From fa6d037ed4d2cc5c61a822fee2b14b8aa0588620 Mon Sep 17 00:00:00 2001 From: skeeter Date: Thu, 20 Sep 2001 21:29:16 +0000 Subject: [PATCH] Moved things around on the header to include a drop down filter for the categories searching. Also a fix for a repeating event problem and interval/frequency. --- calendar/inc/class.bocalendar.inc.php | 4 +- calendar/inc/class.socalendar.inc.php | 6 +- calendar/inc/class.socalendar__.inc.php | 4 +- calendar/inc/class.uicalendar.inc.php | 7 +- calendar/templates/default/head.tpl | 5 +- calendar/templates/default/header.inc.php | 77 +++++++++++++++++---- calendar/templates/idsociety/header.inc.php | 74 ++++++++++++++++---- calendar/templates/justweb/header.inc.php | 76 ++++++++++++++++---- calendar/templates/verdilak/header.inc.php | 76 ++++++++++++++++---- 9 files changed, 260 insertions(+), 69 deletions(-) diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index 555c5fd12f..278a804e29 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -156,8 +156,8 @@ $this->printer_friendly = ($GLOBALS['friendly'] == 1?True:False); - if(isset($GLOBALS['filter'])) { $this->filter = $GLOBALS['filter']; } - if(isset($GLOBALS['cat_id'])) { $this->cat_id = $GLOBALS['cat_id']; } + if(isset($GLOBALS['HTTP_POST_VARS']['filter'])) { $this->filter = $GLOBALS['HTTP_POST_VARS']['filter']; } + if(isset($GLOBALS['HTTP_POST_VARS']['cat_id'])) { $this->cat_id = $GLOBALS['HTTP_POST_VARS']['cat_id']; } if(!isset($this->filter)) { diff --git a/calendar/inc/class.socalendar.inc.php b/calendar/inc/class.socalendar.inc.php index bbb672dbdd..0fae881cf7 100755 --- a/calendar/inc/class.socalendar.inc.php +++ b/calendar/inc/class.socalendar.inc.php @@ -55,7 +55,7 @@ { $extra = ''; $extra .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':''); - $extra .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':''); + $extra .= ($this->cat_id?"AND phpgw_cal.category like '%".$this->cat_id."%' ":''); return $this->cal->list_events($startYear,$startMonth,$startDay,$endYear,$endMonth,$endDay,$extra,$this->datetime->tz_offset); } @@ -77,7 +77,7 @@ $sql .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':''); - $sql .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':''); + $sql .= ($this->cat_id?"AND phpgw_cal.category like '%".$this->cat_id."%' ":''); $sql .= 'ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC'; @@ -104,7 +104,7 @@ } $sql .= (strpos($this->filter,'private')?'AND phpgw_cal.is_public=0 ':''); - $sql .= ($this->cat_id?'AND phpgw_cal.category = '.$this->cat_id.' ':''); + $sql .= ($this->cat_id?"AND phpgw_cal.category like '%".$this->cat_id."%' ":''); $sql .= 'ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC'; return $this->get_event_ids(False,$sql); } diff --git a/calendar/inc/class.socalendar__.inc.php b/calendar/inc/class.socalendar__.inc.php index c9578e97f9..8e77c74af9 100755 --- a/calendar/inc/class.socalendar__.inc.php +++ b/calendar/inc/class.socalendar__.inc.php @@ -133,9 +133,9 @@ class socalendar__ $this->add_attribute('public',$class); } - function set_common_recur($year=0,$month=0,$day=0,$interval) + function set_common_recur($year=0,$month=0,$day=0,$interval=0) { - $this->add_attribute('recur_interval',intval(interval)); + $this->add_attribute('recur_interval',intval($interval)); $this->set_date('recur_enddate',$year,$month,$day,0,0,0); $this->add_attribute('recur_data',0); } diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 0fc85e3f39..ce3a5b7a84 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -484,7 +484,10 @@ echo '
'; - $cal_id = $vcal_id?$vcal_id:$GLOBALS['HTTP_GET_VARS']['cal_id']; + $cal_id = ($vcal_id?$vcal_id:''); + $cal_id = (isset($GLOBALS['HTTP_POST_VARS']['cal_id'])?$GLOBALS['HTTP_POST_VARS']['cal_id']:$cal_id); + $cal_id = (isset($GLOBALS['HTTP_GET_VARS']['cal_id'])?$GLOBALS['HTTP_GET_VARS']['cal_id']:$cal_id); + $date = $cal_date?$cal_date:0; $date = $date?$date:intval($GLOBALS['HTTP_GET_VARS']['date']); @@ -1420,7 +1423,7 @@ { $cols++; } - + $tpl = CreateObject('phpgwapi.Template',$this->template_dir); $tpl->set_unknowns('remove'); diff --git a/calendar/templates/default/head.tpl b/calendar/templates/default/head.tpl index 7135c6bc79..d483005ad2 100755 --- a/calendar/templates/default/head.tpl +++ b/calendar/templates/default/head.tpl @@ -1,10 +1,13 @@ +{row} + + {header_column}
- + {str} diff --git a/calendar/templates/default/header.inc.php b/calendar/templates/default/header.inc.php index 5aa1ae9d39..5a4eac962f 100755 --- a/calendar/templates/default/header.inc.php +++ b/calendar/templates/default/header.inc.php @@ -32,12 +32,23 @@ ); $tpl->set_file($templates); $tpl->set_block('head_tpl','head','head'); + $tpl->set_block('head_tpl','head_table','head_table'); $tpl->set_block('head_tpl','head_col','head_col'); $tpl->set_block('form_button_script','form_button'); - $tpl->set_var('cols',$cols); + + if(floor(phpversion()) >= 4) + { + $tpl->set_var('cols',8); + } + else + { + $tpl->set_var('cols',7); + } $today = date('Ymd',time()); + $col_width = 12; + add_col($tpl,'  '); add_col($tpl,' '.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).''); @@ -51,22 +62,63 @@ if(floor(phpversion()) >= 4) { add_col($tpl,' '.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).''); + $col_width += 2; } add_col($tpl,' '.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).''); - $remainder = 63; + add_col($tpl,'  '); + + $tpl->parse('row','head_table',True); + + $tpl->set_var('header_column',''); + $tpl->set_var('cols',$cols); + + $remainder = 72; + + $hidden_vars = ''."\n"; + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants']) + { + for ($i=0;$i'."\n"; + } + } + if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")
\n"; } + + $var = Array( + 'form_width' => '28', + 'form_link' => $this->page($referrer), + 'form_name' => 'cat_id', + 'title' => lang('Category'), + 'hidden_vars' => $hidden_vars, + 'form_options' => ''.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'), + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->set_var('str',$tpl->fp('out','form_button_dropdown')); + $tpl->parse('header_column','head_col',True); + if($this->bo->check_perms(PHPGW_ACL_PRIVATE)) { $remainder -= 28; $hidden_vars = ''."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) { - $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -103,13 +155,6 @@ if(count($this->bo->grants) > 0) { $hidden_vars = ' '."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) - { - $hidden_vars .= ' '."\n"; - } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -133,7 +178,8 @@ while(list($key,$grant) = each($drop_down)) { $form_options .= ' '."\n"; - } reset($this->bo->grants); + } + reset($this->bo->grants); $var = Array( 'form_width' => $remainder, @@ -173,4 +219,5 @@ $button = $tpl->fp('out','form_button'); $tpl->set_var('str',''.$button.''); $tpl->parse('header_column','head_col',True); + $tpl->parse('row','head_table',True); ?> diff --git a/calendar/templates/idsociety/header.inc.php b/calendar/templates/idsociety/header.inc.php index 6c673445b2..5a4eac962f 100755 --- a/calendar/templates/idsociety/header.inc.php +++ b/calendar/templates/idsociety/header.inc.php @@ -32,12 +32,23 @@ ); $tpl->set_file($templates); $tpl->set_block('head_tpl','head','head'); + $tpl->set_block('head_tpl','head_table','head_table'); $tpl->set_block('head_tpl','head_col','head_col'); $tpl->set_block('form_button_script','form_button'); - $tpl->set_var('cols',$cols); + + if(floor(phpversion()) >= 4) + { + $tpl->set_var('cols',8); + } + else + { + $tpl->set_var('cols',7); + } $today = date('Ymd',time()); + $col_width = 12; + add_col($tpl,'  '); add_col($tpl,' '.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).''); @@ -51,22 +62,63 @@ if(floor(phpversion()) >= 4) { add_col($tpl,' '.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).''); + $col_width += 2; } add_col($tpl,' '.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).''); - $remainder = 63; + add_col($tpl,'  '); + + $tpl->parse('row','head_table',True); + + $tpl->set_var('header_column',''); + $tpl->set_var('cols',$cols); + + $remainder = 72; + + $hidden_vars = ''."\n"; + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants']) + { + for ($i=0;$i'."\n"; + } + } + if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")
\n"; } + + $var = Array( + 'form_width' => '28', + 'form_link' => $this->page($referrer), + 'form_name' => 'cat_id', + 'title' => lang('Category'), + 'hidden_vars' => $hidden_vars, + 'form_options' => ''.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'), + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->set_var('str',$tpl->fp('out','form_button_dropdown')); + $tpl->parse('header_column','head_col',True); + if($this->bo->check_perms(PHPGW_ACL_PRIVATE)) { $remainder -= 28; $hidden_vars = ''."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) { - $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -103,13 +155,6 @@ if(count($this->bo->grants) > 0) { $hidden_vars = ' '."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) - { - $hidden_vars .= ' '."\n"; - } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -174,4 +219,5 @@ $button = $tpl->fp('out','form_button'); $tpl->set_var('str',''.$button.''); $tpl->parse('header_column','head_col',True); + $tpl->parse('row','head_table',True); ?> diff --git a/calendar/templates/justweb/header.inc.php b/calendar/templates/justweb/header.inc.php index d74fe6c426..5a4eac962f 100755 --- a/calendar/templates/justweb/header.inc.php +++ b/calendar/templates/justweb/header.inc.php @@ -32,12 +32,23 @@ ); $tpl->set_file($templates); $tpl->set_block('head_tpl','head','head'); + $tpl->set_block('head_tpl','head_table','head_table'); $tpl->set_block('head_tpl','head_col','head_col'); $tpl->set_block('form_button_script','form_button'); - $tpl->set_var('cols',$cols); + + if(floor(phpversion()) >= 4) + { + $tpl->set_var('cols',8); + } + else + { + $tpl->set_var('cols',7); + } $today = date('Ymd',time()); + $col_width = 12; + add_col($tpl,'  '); add_col($tpl,' '.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).''); @@ -51,22 +62,63 @@ if(floor(phpversion()) >= 4) { add_col($tpl,' '.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).''); + $col_width += 2; } add_col($tpl,' '.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).''); - $remainder = 63; + add_col($tpl,'  '); + + $tpl->parse('row','head_table',True); + + $tpl->set_var('header_column',''); + $tpl->set_var('cols',$cols); + + $remainder = 72; + + $hidden_vars = ''."\n"; + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants']) + { + for ($i=0;$i'."\n"; + } + } + if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")
\n"; } + + $var = Array( + 'form_width' => '28', + 'form_link' => $this->page($referrer), + 'form_name' => 'cat_id', + 'title' => lang('Category'), + 'hidden_vars' => $hidden_vars, + 'form_options' => ''.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'), + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->set_var('str',$tpl->fp('out','form_button_dropdown')); + $tpl->parse('header_column','head_col',True); + if($this->bo->check_perms(PHPGW_ACL_PRIVATE)) { $remainder -= 28; $hidden_vars = ''."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) { - $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -103,13 +155,6 @@ if(count($this->bo->grants) > 0) { $hidden_vars = ' '."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) - { - $hidden_vars .= ' '."\n"; - } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -134,7 +179,7 @@ { $form_options .= ' '."\n"; } - reset($this->bo->grants); + reset($this->bo->grants); $var = Array( 'form_width' => $remainder, @@ -174,4 +219,5 @@ $button = $tpl->fp('out','form_button'); $tpl->set_var('str',''.$button.''); $tpl->parse('header_column','head_col',True); + $tpl->parse('row','head_table',True); ?> diff --git a/calendar/templates/verdilak/header.inc.php b/calendar/templates/verdilak/header.inc.php index d74fe6c426..5a4eac962f 100755 --- a/calendar/templates/verdilak/header.inc.php +++ b/calendar/templates/verdilak/header.inc.php @@ -32,12 +32,23 @@ ); $tpl->set_file($templates); $tpl->set_block('head_tpl','head','head'); + $tpl->set_block('head_tpl','head_table','head_table'); $tpl->set_block('head_tpl','head_col','head_col'); $tpl->set_block('form_button_script','form_button'); - $tpl->set_var('cols',$cols); + + if(floor(phpversion()) >= 4) + { + $tpl->set_var('cols',8); + } + else + { + $tpl->set_var('cols',7); + } $today = date('Ymd',time()); + $col_width = 12; + add_col($tpl,'  '); add_col($tpl,' '.add_image_ahref($this->page('day','&date='.$today),'today.gif',lang('Today')).''); @@ -51,22 +62,63 @@ if(floor(phpversion()) >= 4) { add_col($tpl,' '.add_image_ahref($this->page('planner','&date='.$today),'planner.gif',lang('Planner')).''); + $col_width += 2; } add_col($tpl,' '.add_image_ahref($this->page('matrixselect'),'view.gif',lang('Daily Matrix View')).''); - $remainder = 63; + add_col($tpl,'  '); + + $tpl->parse('row','head_table',True); + + $tpl->set_var('header_column',''); + $tpl->set_var('cols',$cols); + + $remainder = 72; + + $hidden_vars = ''."\n"; + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['matrixtype']) && $GLOBALS['HTTP_POST_VARS']['matrixtype']) + { + $hidden_vars .= ' '."\n"; + } + if(isset($GLOBALS['HTTP_POST_VARS']['participants']) && $GLOBALS['HTTP_POST_VARS']['participants']) + { + for ($i=0;$i'."\n"; + } + } + if($this->debug) { echo 'Cat ID = ('.$this->bo->cat_id.")
\n"; } + + $var = Array( + 'form_width' => '28', + 'form_link' => $this->page($referrer), + 'form_name' => 'cat_id', + 'title' => lang('Category'), + 'hidden_vars' => $hidden_vars, + 'form_options' => ''.$this->cat->formated_list('select','all',$this->bo->cat_id,'True'), + 'button_value' => lang('Go!') + ); + $tpl->set_var($var); + $tpl->set_var('str',$tpl->fp('out','form_button_dropdown')); + $tpl->parse('header_column','head_col',True); + if($this->bo->check_perms(PHPGW_ACL_PRIVATE)) { $remainder -= 28; $hidden_vars = ''."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) + if(isset($GLOBALS['HTTP_GET_VARS']['cal_id']) && $GLOBALS['HTTP_GET_VARS']['cal_id'] != 0) { - $hidden_vars .= ' '."\n"; + $hidden_vars .= ' '."\n"; } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -103,13 +155,6 @@ if(count($this->bo->grants) > 0) { $hidden_vars = ' '."\n"; - if(isset($GLOBALS['HTTP_GET_VARS']['date']) && $GLOBALS['HTTP_GET_VARS']['date']) - { - $hidden_vars .= ' '."\n"; - } - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; - $hidden_vars .= ' '."\n"; if(isset($GLOBALS['HTTP_POST_VARS']['keywords']) && $GLOBALS['HTTP_POST_VARS']['keywords']) { $hidden_vars .= ' '."\n"; @@ -134,7 +179,7 @@ { $form_options .= ' '."\n"; } - reset($this->bo->grants); + reset($this->bo->grants); $var = Array( 'form_width' => $remainder, @@ -174,4 +219,5 @@ $button = $tpl->fp('out','form_button'); $tpl->set_var('str',''.$button.''); $tpl->parse('header_column','head_col',True); + $tpl->parse('row','head_table',True); ?>