diff --git a/calendar/edit_entry.php b/calendar/edit_entry.php index dae4241bee..89b1e53ecb 100755 --- a/calendar/edit_entry.php +++ b/calendar/edit_entry.php @@ -407,9 +407,16 @@ if ($id > 0) { - $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id)); - $p->set_var('action_text_button',lang('Delete')); - $p->set_var('action_confirm_button',"onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\""); + $action_url_button = $phpgw->link('/calendar/delete.php','id='.$id); + $action_text_button = lang('Delete'); + $action_confirm_button = "onClick=\"return confirm('".lang("Are you sure\\nyou want to \\ndelete this entry?\\n\\nThis will delete\\nthis entry for all users.")."')\""; + $var = Array( + 'action_url_button' => $action_url_button, + 'action_text_button' => $action_text_button, + 'action_confirm_button' => $action_confirm_button, + 'action_extra_field' => '' + ); + $p->set_var($var); $p->parse('delete_button','form_button'); $p->pparse('out','edit_entry_end'); } diff --git a/calendar/edit_entry_handler.php b/calendar/edit_entry_handler.php index 4f8bd2eaae..2c64279cb4 100755 --- a/calendar/edit_entry_handler.php +++ b/calendar/edit_entry_handler.php @@ -271,18 +271,20 @@ $phpgw->calendar->event = $event; $var = Array( - 'action_url_button' => $phpgw->link('/calendar/edit_entry_handler.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday), - 'action_text_button' => lang('Ignore Conflict'), - 'action_confirm_button' => '' + 'action_url_button' => $phpgw->link('/calendar/edit_entry_handler.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday), + 'action_text_button' => lang('Ignore Conflict'), + 'action_confirm_button' => '', + 'action_extra_field => '' ); $p->set_var($var); $p->parse('resubmit_button','form_button'); $var = Array( - 'action_url_button' => $phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday), - 'action_text_button' => lang('Re-Edit Event'), - 'action_confirm_button' => '' + 'action_url_button' => $phpgw->link('/calendar/edit_entry.php','readsess='.$event->id.'&year='.$event->start->year.'&month='.$event->start->month.'&day='.$event->start->mday), + 'action_text_button' => lang('Re-Edit Event'), + 'action_confirm_button' => '', + 'action_extra_field' => '' ); $p->set_var($var); diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index 38dc39d1ad..d8390ec463 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -82,13 +82,11 @@ class calendar extends calendar_ } $this->template_dir = $phpgw->common->get_tpl_dir('calendar'); - $this->phpgwapi_template_dir = $phpgw->common->get_image_path('phpgwapi'); + $this->phpgwapi_template_dir = PHPGW_IMAGES_DIR; $this->image_dir = $phpgw->common->get_image_path('calendar'); $this->today = $this->localdates(time()); $this->open('',intval($this->owner)); -// $this->end_repeat_day = $this->today['raw']; -// $this->read_repeated_events($this->owner); $this->set_filter(); $this->tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); @@ -1538,14 +1536,13 @@ class calendar extends calendar_ } } - $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); + $p = CreateObject('phpgwapi.Template',$this->template_dir); $p->set_unknowns('keep'); $templates = Array( 'view_begin' => 'view.tpl', 'list' => 'list.tpl', - 'view_end' => 'view.tpl', - 'form_button' => 'form_button_script.tpl' + 'view_end' => 'view.tpl' ); $p->set_file($templates); @@ -1570,7 +1567,9 @@ class calendar extends calendar_ if ($event->category) { - $cat = $phpgw->categories->return_single($event->category); + $cats = CreateObject('phpgwapi.categories'); + $cats->categories($this->owner,'calendar'); + $cat = $cats->return_single($event->category); $var = Array( 'field' => lang('Category'), 'data' => $cat[0]['name'] @@ -1780,25 +1779,41 @@ class calendar extends calendar_ 'form_button' => 'form_button_script.tpl' ); $p->set_file($templates); - - $p->set_var('action_url_button',$phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.ACCEPTED)); - $p->set_var('action_text_button',' '.lang('Accept').' '); - $p->set_var('action_confirm_button',''); + + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.ACCEPTED), + 'action_text_button' => ' '.lang('Accept').' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); $str .= ''.$p->finish($p->parse('out','form_button')).''."\n"; - $p->set_var('action_url_button',$phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.REJECTED)); - $p->set_var('action_text_button',' '.lang('Reject').' '); - $p->set_var('action_confirm_button',''); + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.REJECTED), + 'action_text_button' => ' '.lang('Reject').' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); $str .= ''.$p->finish($p->parse('out','form_button')).''."\n"; - $p->set_var('action_url_button',$phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.TENTATIVE)); - $p->set_var('action_text_button',' '.lang('Tentative').' '); - $p->set_var('action_confirm_button',''); + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.TENTATIVE), + 'action_text_button' => ' '.lang('Tentative').' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); $str .= ''.$p->finish($p->parse('out','form_button')).''."\n"; - $p->set_var('action_url_button',$phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.NO_RESPONSE)); - $p->set_var('action_text_button',' '.lang('No Response').' '); - $p->set_var('action_confirm_button',''); + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/action.php','id='.$this->event->id.'&action='.NO_RESPONSE), + 'action_text_button' => ' '.lang('No Response').' ', + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); $str .= ''.$p->finish($p->parse('out','form_button')).''."\n"; $str .= ''; diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index d14b68da05..40c609cc10 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -628,6 +628,7 @@ class calendar_ extends calendar__ . 'mdatetime='.$today.', ' . 'edatetime='.$enddate.', ' . 'priority='.$event->priority.', ' + . 'category='.$event->category.', ' . "cal_type='".$type."', " . 'is_public='.$event->public.', ' . "title='".addslashes($event->title)."', " diff --git a/calendar/inc/header.inc.php b/calendar/inc/header.inc.php index 6035ebd274..1828a3c5c6 100644 --- a/calendar/inc/header.inc.php +++ b/calendar/inc/header.inc.php @@ -16,7 +16,7 @@ if (floor(phpversion()) == 4) { global $date, $year, $month, $day, $thisyear, $thismonth, $thisday, $filter, $keywords; - global $matrixtype, $participants, $owner, $phpgw, $grants, $rights, $SCRIPT_FILENAME; + global $matrixtype, $participants, $owner, $phpgw, $grants, $rights, $SCRIPT_FILENAME, $remainder; } $cols = 8; @@ -24,133 +24,7 @@ { $cols++; } + + include(PHPGW_APP_TPL.'/header.inc.php'); + flush(); ?> - - - - - - - - - -calendar->check_perms(PHPGW_ACL_PRIVATE) == True) - { - $remainder -= 30; -?> - - - - 0) - { -?> - - - - - - - - -
-   - - - <?php echo lang('Today'); ?> - - - - <?php echo lang('This week'); ?> - - - - <?php echo lang('This month'); ?> - - - - <?php echo lang('This year'); ?> - - - - <?php echo lang('Daily Matrix View'); ?> - -
- : - - - - - - - - - - - - -'; - } - } ?> - - -
- : - - - - - - - - - - - - - - - -
- - - - - - - - - - - > - -
- diff --git a/calendar/inc/hook_calendar_email.inc.php b/calendar/inc/hook_calendar_email.inc.php index 0e2805821c..8ec035b8f5 100755 --- a/calendar/inc/hook_calendar_email.inc.php +++ b/calendar/inc/hook_calendar_email.inc.php @@ -40,8 +40,7 @@ reset($event->participants); - $tz_offset = ((60 * 60) * intval($phpgw_info['user']['preferences']['common']['tz_offset'])); - $freetime = $phpgw->calendar->localdates(mktime(0,0,0,$event->start->month,$event->start->mday,$event->start->year) - $tz_offset); + $freetime = $phpgw->calendar->localdates(mktime(0,0,0,$event->start->month,$event->start->mday,$event->start->year) - $phpgw->calendar->tz_offset); echo $phpgw->calendar->timematrix($freetime,$phpgw->calendar->splittime('000000',False),0,$event->participants); echo ''; diff --git a/calendar/matrixselect.php b/calendar/matrixselect.php index c2c898f77c..f21c86842d 100755 --- a/calendar/matrixselect.php +++ b/calendar/matrixselect.php @@ -132,10 +132,11 @@ $p->parse('output','list',True); $var = Array( - 'submit_button' => lang('Submit'), - 'action_url_button' => '', - 'action_text_button' => lang('Cancel'), - 'action_confirm_button' => 'onClick="history.back(-1)"' + 'submit_button' => lang('Submit'), + 'action_url_button' => '', + 'action_text_button' => lang('Cancel'), + 'action_confirm_button' => 'onClick="history.back(-1)"', + 'action_extra_field' => '' ); $p->set_var($var); diff --git a/calendar/month.php b/calendar/month.php index 9cebf020bf..d73fa52cf2 100755 --- a/calendar/month.php +++ b/calendar/month.php @@ -25,6 +25,7 @@ 'noappfooter' => True, 'nofooter' => True ); + $friendly = intval($friendly); } else { @@ -51,7 +52,7 @@ $m = mktime(0,0,0,$thismonth,1,$thisyear); - if ($friendly == 0) + if (intval($friendly) == 0) { $printer = ''; $param = 'year='.$thisyear.'&month='.$thismonth.'&friendly=1&filter='.$filter.'&owner='.$owner; diff --git a/calendar/search.php b/calendar/search.php index d8692bab66..fa09680b09 100755 --- a/calendar/search.php +++ b/calendar/search.php @@ -51,16 +51,16 @@ $words = split(' ',$keywords); for ($i=0;$icalendar->filter,'private')) { - $sql .= "AND calendar_entry.cal_access='private' "; + $sql .= "AND phpgw_cal.is_public=0 "; } - $sql .= 'ORDER BY calendar_entry.cal_datetime ASC, calendar_entry.cal_edatetime ASC, calendar_entry.cal_priority ASC'; + $sql .= 'ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC'; $events = $phpgw->calendar->get_event_ids(True,$sql); @@ -125,7 +125,7 @@ arsort($ids); for(reset($ids);$key=key($ids);next($ids)) { - $p->set_var('url_result',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/view.php','id='.$key.'&owner='.$owner)); + $p->set_var('url_result',$phpgw->link('/calendar/view.php','id='.$key.'&owner='.$owner)); $p->set_var('result_desc',$info[$key]); $p->parse('output','search_list',True); } diff --git a/calendar/templates/default/form_button_dropdown.tpl b/calendar/templates/default/form_button_dropdown.tpl new file mode 100755 index 0000000000..12377f3191 --- /dev/null +++ b/calendar/templates/default/form_button_dropdown.tpl @@ -0,0 +1,9 @@ + + +
+ {title}: + {hidden_vars} + +
+ diff --git a/calendar/templates/default/form_button_script.tpl b/calendar/templates/default/form_button_script.tpl index 8bcb0ea363..ca566e0a7d 100755 --- a/calendar/templates/default/form_button_script.tpl +++ b/calendar/templates/default/form_button_script.tpl @@ -1,6 +1,6 @@
- + {action_extra_field}
diff --git a/calendar/templates/default/head.tpl b/calendar/templates/default/head.tpl new file mode 100755 index 0000000000..bb9cc2d59c --- /dev/null +++ b/calendar/templates/default/head.tpl @@ -0,0 +1,6 @@ + + + + {header_column} +
+ diff --git a/calendar/templates/default/head_col.tpl b/calendar/templates/default/head_col.tpl new file mode 100755 index 0000000000..7e562e4a89 --- /dev/null +++ b/calendar/templates/default/head_col.tpl @@ -0,0 +1,2 @@ + +{str} diff --git a/calendar/templates/default/header.inc.php b/calendar/templates/default/header.inc.php new file mode 100755 index 0000000000..60c59c1962 --- /dev/null +++ b/calendar/templates/default/header.inc.php @@ -0,0 +1,173 @@ +set_var('str',$str); + $tpl->parse('header_column','head_col',True); + } + + function add_image_ahref($link,$image,$alt) + { + return ''.$alt.''; + } + + $tpl = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $tpl->set_unknowns('remove'); + $templates = Array( + 'head' => 'head.tpl', + 'head_col' => 'head_col.tpl', + 'form_button_dropdown' => 'form_button_dropdown.tpl', + 'form_button_script' => 'form_button_script.tpl' + ); + $tpl->set_file($templates); + $tpl->set_block('form_button_script','form_button'); + $tpl->set_var('cols',$cols); + + $str = '  '; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/day.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'today.gif',lang('Today')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/week.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'week.gif',lang('This week')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/month.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'month.gif',lang('This month')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/year.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'year.gif',lang('This Year')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/matrixselect.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).''; + add_col($str,$tpl); + + $base_url = '/calendar/'.basename($SCRIPT_FILENAME); + $remainder = 65; + if($phpgw->calendar->check_perms(PHPGW_ACL_PRIVATE) == True) + { + $remainder -= 30; + $hidden_vars = ''."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($matrixtype) && $matrixtype) + { + $hidden_vars .= ' '."\n"; + } + if(isset($participants) && $participants) + { + for ($i=0;$i'."\n"; + } + } + $form_options = ''."\n"; + $form_options .= ' '."\n"; + + $var = Array( + 'form_width' => '30', + 'form_link' => $phpgw->link($base_url,'owner='.$owner), + 'form_name' => 'filter', + 'title' => lang('Filter'), + 'hidden_vars' => $hidden_vars, + 'form_options' => $form_options, + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->parse('header_column','form_button_dropdown',True); + } + + if(count($grants) > 0) + { + $hidden_vars = ' '."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($id) && $id != 0) + { + $hidden_vars .= ' '."\n"; + } + $form_options = ''; + while(list($grantor,$temp_rights) = each($grants)) + { + $form_options .= ' '."\n"; + } + reset($grants); + + $var = Array( + 'form_width' => $remainder, + 'form_link' => $phpgw->link($base_url), + 'form_name' => 'owner', + 'title' => lang('User'), + 'hidden_vars' => $hidden_vars, + 'form_options' => $form_options, + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->parse('header_column','form_button_dropdown',True); + } + + $hidden_vars = ' '."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($filter) && $filter) + { + $hidden_vars .= ' '."\n"; + } + $extra_field = $hidden_vars.' '; + + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/search.php','owner='.$owner), + 'action_text_button' => lang('Search'), + 'action_confirm_button' => '', + 'action_extra_field' => $extra_field + ); + $tpl->set_var($var); + $button = $tpl->fp('out','form_button'); + $tpl->set_var('str',''.$button.''); + $tpl->parse('header_column','head_col',True); + + echo $tpl->fp('out','head'); + unset($tpl); +?> diff --git a/calendar/templates/default/index.tpl b/calendar/templates/default/index.tpl index bf14986f4e..61746cbf4c 100755 --- a/calendar/templates/default/index.tpl +++ b/calendar/templates/default/index.tpl @@ -2,10 +2,12 @@ {printer_friendly} diff --git a/calendar/templates/idsociety/form_button_dropdown.tpl b/calendar/templates/idsociety/form_button_dropdown.tpl new file mode 100755 index 0000000000..12377f3191 --- /dev/null +++ b/calendar/templates/idsociety/form_button_dropdown.tpl @@ -0,0 +1,9 @@ + + diff --git a/calendar/templates/idsociety/form_button_script.tpl b/calendar/templates/idsociety/form_button_script.tpl index 8bcb0ea363..ca566e0a7d 100755 --- a/calendar/templates/idsociety/form_button_script.tpl +++ b/calendar/templates/idsociety/form_button_script.tpl @@ -1,6 +1,6 @@ - + {action_extra_field} diff --git a/calendar/templates/idsociety/head.tpl b/calendar/templates/idsociety/head.tpl new file mode 100755 index 0000000000..bb9cc2d59c --- /dev/null +++ b/calendar/templates/idsociety/head.tpl @@ -0,0 +1,6 @@ + +
+
+ {title}: + {hidden_vars} + +
+
+ + {header_column} +
+ diff --git a/calendar/templates/idsociety/head_col.tpl b/calendar/templates/idsociety/head_col.tpl new file mode 100755 index 0000000000..7e562e4a89 --- /dev/null +++ b/calendar/templates/idsociety/head_col.tpl @@ -0,0 +1,2 @@ + +{str} diff --git a/calendar/templates/idsociety/header.inc.php b/calendar/templates/idsociety/header.inc.php new file mode 100755 index 0000000000..60c59c1962 --- /dev/null +++ b/calendar/templates/idsociety/header.inc.php @@ -0,0 +1,173 @@ +set_var('str',$str); + $tpl->parse('header_column','head_col',True); + } + + function add_image_ahref($link,$image,$alt) + { + return ''.$alt.''; + } + + $tpl = CreateObject('phpgwapi.Template',$phpgw->common->get_tpl_dir('calendar')); + $tpl->set_unknowns('remove'); + $templates = Array( + 'head' => 'head.tpl', + 'head_col' => 'head_col.tpl', + 'form_button_dropdown' => 'form_button_dropdown.tpl', + 'form_button_script' => 'form_button_script.tpl' + ); + $tpl->set_file($templates); + $tpl->set_block('form_button_script','form_button'); + $tpl->set_var('cols',$cols); + + $str = '  '; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/day.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'today.gif',lang('Today')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/week.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'week.gif',lang('This week')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/month.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'month.gif',lang('This month')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/year.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'year.gif',lang('This Year')).''; + add_col($str,$tpl); + + $link = $phpgw->link('/calendar/matrixselect.php','day='.$phpgw->calendar->today['day'].'&month='.$phpgw->calendar->today['month'].'&year='.$phpgw->calendar->today['year'].'&owner='.$owner); + $str = ' '.add_image_ahref($link,'view.gif',lang('Daily Matrix View')).''; + add_col($str,$tpl); + + $base_url = '/calendar/'.basename($SCRIPT_FILENAME); + $remainder = 65; + if($phpgw->calendar->check_perms(PHPGW_ACL_PRIVATE) == True) + { + $remainder -= 30; + $hidden_vars = ''."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($matrixtype) && $matrixtype) + { + $hidden_vars .= ' '."\n"; + } + if(isset($participants) && $participants) + { + for ($i=0;$i'."\n"; + } + } + $form_options = ''."\n"; + $form_options .= ' '."\n"; + + $var = Array( + 'form_width' => '30', + 'form_link' => $phpgw->link($base_url,'owner='.$owner), + 'form_name' => 'filter', + 'title' => lang('Filter'), + 'hidden_vars' => $hidden_vars, + 'form_options' => $form_options, + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->parse('header_column','form_button_dropdown',True); + } + + if(count($grants) > 0) + { + $hidden_vars = ' '."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($id) && $id != 0) + { + $hidden_vars .= ' '."\n"; + } + $form_options = ''; + while(list($grantor,$temp_rights) = each($grants)) + { + $form_options .= ' '."\n"; + } + reset($grants); + + $var = Array( + 'form_width' => $remainder, + 'form_link' => $phpgw->link($base_url), + 'form_name' => 'owner', + 'title' => lang('User'), + 'hidden_vars' => $hidden_vars, + 'form_options' => $form_options, + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->parse('header_column','form_button_dropdown',True); + } + + $hidden_vars = ' '."\n"; + if(isset($date) && $date) + { + $hidden_vars .= ' '."\n"; + } + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; + if(isset($keywords) && $keywords) + { + $hidden_vars .= ' '."\n"; + } + if(isset($filter) && $filter) + { + $hidden_vars .= ' '."\n"; + } + $extra_field = $hidden_vars.' '; + + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/search.php','owner='.$owner), + 'action_text_button' => lang('Search'), + 'action_confirm_button' => '', + 'action_extra_field' => $extra_field + ); + $tpl->set_var($var); + $button = $tpl->fp('out','form_button'); + $tpl->set_var('str',''.$button.''); + $tpl->parse('header_column','head_col',True); + + echo $tpl->fp('out','head'); + unset($tpl); +?> diff --git a/calendar/templates/idsociety/index.tpl b/calendar/templates/idsociety/index.tpl index bf14986f4e..61746cbf4c 100755 --- a/calendar/templates/idsociety/index.tpl +++ b/calendar/templates/idsociety/index.tpl @@ -2,10 +2,12 @@ {printer_friendly} diff --git a/calendar/view.php b/calendar/view.php index 8e10af8a8a..127e680116 100755 --- a/calendar/view.php +++ b/calendar/view.php @@ -14,12 +14,10 @@ /* $Id$ */ -// $phpgw_flags = array( -// 'currentapp' => 'calendar', -// 'enable_nextmatchs_class' => True -// ); -// $phpgw_info['flags'] = $phpgw_flags; - $phpgw_info['flags']['currentapp'] = 'calendar'; + $phpgw_flags = array( + 'currentapp' => 'calendar', + ); + $phpgw_info['flags'] = $phpgw_flags; include('../header.inc.php'); @@ -57,17 +55,25 @@ if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_EDIT) == True)) { - $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/edit_entry.php','id='.$id.'&owner='.$owner)); - $p->set_var('action_text_button',' '.lang('Edit').' '); - $p->set_var('action_confirm_button',''); + $var = Array( + 'action_url_button' => $phpgw->link('/calendar/edit_entry.php','id='.$id.'&owner='.$owner), + 'action_text_button' => lang('Edit'), + 'action_confirm_button' => '', + 'action_extra_field' => '' + ); + $p->set_var($var); echo $p->finish($p->parse('out','form_button')); } if (($event->owner == $owner) && ($phpgw->calendar->check_perms(PHPGW_ACL_DELETE) == True)) { - $p->set_var('action_url_button',$phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id.'&owner='.$owner)); - $p->set_var('action_text_button',lang('Delete')); - $p->set_var('action_confirm_button',"onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\""); + $var = Array( + 'action_url_button' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/delete.php','id='.$id.'&owner='.$owner), + 'action_text_button' => lang('Delete'), + 'action_confirm_button' => "onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\"", + 'action_extra_field' => '' + ); + $p->set_var($var); echo $p->finish($p->parse('out','form_button')); }