phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] calendar inc/class.uiholiday.inc.php inc/class....


From: Sigurd Nes
Subject: [Phpgroupware-cvs] calendar inc/class.uiholiday.inc.php inc/class....
Date: Mon, 11 Dec 2006 10:07:35 +0000

CVSROOT:        /sources/phpgroupware
Module name:    calendar
Changes by:     Sigurd Nes <sigurdne>   06/12/11 10:07:35

Modified files:
        inc            : class.uiholiday.inc.php 
                         class.uiicalendar.inc.php 
        templates/base : header.inc.php holiday.tpl 

Log message:
        notices, links

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.uiholiday.inc.php?cvsroot=phpgroupware&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/calendar/inc/class.uiicalendar.inc.php?cvsroot=phpgroupware&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/calendar/templates/base/header.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/calendar/templates/base/holiday.tpl?cvsroot=phpgroupware&r1=1.1&r2=1.2

Patches:
Index: inc/class.uiholiday.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/class.uiholiday.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- inc/class.uiholiday.inc.php 6 Dec 2006 17:58:01 -0000       1.11
+++ inc/class.uiholiday.inc.php 11 Dec 2006 10:07:35 -0000      1.12
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.uiholiday.inc.php,v 1.11 2006/12/06 17:58:01 sigurdne Exp 
$ */
+       /* $Id: class.uiholiday.inc.php,v 1.12 2006/12/11 10:07:35 sigurdne Exp 
$ */
 
        class uiholiday
        {
@@ -22,6 +22,7 @@
                var $template_dir;
                var $holidays;
                var $cat_id;
+               var $locale;
 
                var $public_functions = array(
                        'admin' => True,
@@ -62,9 +63,9 @@
                //      
$p->set_block('locales','submit_column','submit_column');
 
                        $var = Array(
-                               'th_bg'         => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
-                               'left_next_matchs'      => 
$GLOBALS['phpgw']->nextmatchs->left('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
-                               'right_next_matchs'     => 
$GLOBALS['phpgw']->nextmatchs->right('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
+                       //      'th_bg'         => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
+                               'left_next_matchs'      => 
$GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$this->bo->total,array('menuaction'=>'calendar.uiholiday.admin')),
+                               'right_next_matchs'     => 
$GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$this->bo->total,array('menuaction'=>'calendar.uiholiday.admin')),
                                'center'                        => '<td 
align="center">'.lang('Countries').'</td>',
                                'sort_name'             => 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'locale',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Country')),
                                'header_edit'   => lang('Edit'),
@@ -88,9 +89,11 @@
                        else
                        {
                                $p->set_var('submit_extra',' width="5%"');
+                               $cnt =0;
                                while (list(,$value) = each($locales))
                                {
-                                       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
+//                                     $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
+                                       $tr_color = $cnt % 2 ? 'row_on' : 
'row_off';
                                        if (! $value)  $value  = '&nbsp;';
 
                                        $var = Array(
@@ -103,6 +106,7 @@
                                        );
                                        $p->set_var($var);
                                        $p->parse('rows','row',True);
+                                       $cnt++;
                                }
                        }
 
@@ -155,13 +159,13 @@
 
                        $var = Array(
                                'th_bg'                 => 
$GLOBALS['phpgw_info']['theme']['th_bg'],
-                               'left_next_matchs'      => 
$GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$this->bo->total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
-                               'right_next_matchs'     => 
$GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$this->bo->total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
+                               'left_next_matchs'      => 
$GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$this->bo->total,array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)),
+                               'right_next_matchs'     => 
$GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$this->bo->total,array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)),
                                'center'                                        
=> '<td align="right">'.lang('Holidays').' ('.$this->bo->locales[0].')</td><td 
align="left">'.$year_form.'</td>',
-                               'sort_name'                             => 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'name',$this->bo->order,'/index.php',lang('Holiday'),'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
+                               'sort_name'                             => 
$GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'name',$this->bo->order,'/index.php',lang('Holiday'),array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)),
                                'header_edit'                   => lang('Edit'),
                                'header_delete'         => lang('Delete'),
-                               'header_rule'        => 
'<td>'.$GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'month_num,mday',$this->bo->order,'/index.php',lang('Rule'),'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year).'</td>',
+                               'header_rule'        => 
'<td>'.$GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'month_num,mday',$this->bo->order,'/index.php',lang('Rule'),array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)).'</td>',
                                'header_extra'       => lang('Copy'),
                                'extra_width'        => 'width="5%"'
                        );
@@ -178,7 +182,8 @@
                                $maxmatchs = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
                                for($i=$this->bo->start; $i < count($holidays) 
&& $i < $this->bo->start+$maxmatchs; $i++)
                                {
-                                       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
+                               //      $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_class($tr_color);
+                                       $tr_color = $i % 2 ? 'row_on' : 
'row_off';
                                        if (!$holidays[$i]['name'])
                                        {
                                                $holidays[$i]['name'] = 
'&nbsp;';
@@ -261,20 +266,20 @@
                        $var = Array(
                                'title_holiday'=> ($this->bo->id ? lang('Edit') 
: lang('Add')).' '.lang('Holiday'),
                                'message'               => $message,
-                               'actionurl'        => 
$GLOBALS['phpgw']->link($this->base_url,'menuaction=calendar.boholiday.add&year='.$this->bo->year),
+                               'actionurl'        => 
$GLOBALS['phpgw']->link($this->base_url,array('menuaction'=>'calendar.boholiday.add','year'=>$this->bo->year)),
                                'hidden_vars'   => '<input type="hidden" 
name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n"
                                                         . '<input 
type="hidden" name="holiday[locales]" value="'.$this->bo->locales[0].'">'."\n"
                        );
                        $t->set_var($var);
 
 // Locale
-                       $this->display_item($t,lang('Country'),'<input 
name="holiday[locale]" size="3" maxlength="2" value="'.$holiday[locale].'">');
+                       $this->display_item($t,lang('Country'),'<input 
name="holiday[locale]" size="3" maxlength="2" 
value="'.(isset($holiday['locale'])?$holiday['locale']:'').'">');
 
 // Title/Name
-                       $this->display_item($t,lang('title'),'<input 
name="holiday[name]" size="60" maxlength="50" value="'.$holiday['name'].'">');
+                       $this->display_item($t,lang('title'),'<input 
name="holiday[name]" size="60" maxlength="50" 
value="'.(isset($holiday['name'])?$holiday['name']:'').'">');
 
 // Date
-                       
$this->display_item($t,lang('Date'),$GLOBALS['phpgw']->common->dateformatorder($this->sb->getYears('holiday[year]',$holiday['occurence']>1900?$holiday['occurence']:0),$this->sb->getMonthText('holiday[month_num]',$holiday['month']),$this->sb->getDays('holiday[mday]',$holiday['day'])).
+                       
$this->display_item($t,lang('Date'),$GLOBALS['phpgw']->common->dateformatorder($this->sb->getYears('holiday[year]',isset($holiday['occurence'])
 && 
$holiday['occurence']>1900?$holiday['occurence']:0),$this->sb->getMonthText('holiday[month_num]',(isset($holiday['month'])?$holiday['month']:'')),$this->sb->getDays('holiday[mday]',(isset($holiday['day'])?$holiday['day']:''))).
                                '&nbsp;'.lang('Set a Year only for one-time / 
non-regular holidays.'));
 
 // Occurence
@@ -290,7 +295,7 @@
                        $out = '';
                        while(list($key,$value) = each($occur))
                        {
-                               $out .= '<option 
value="'.$key.'"'.($holiday['occurence']==$key?' 
selected':'').'>'.$value.'</option>'."\n";
+                               $out .= '<option 
value="'.$key.'"'.(isset($holiday['occurence']) && 
$holiday['occurence']==$key?' selected':'').'>'.$value.'</option>'."\n";
                        }
                        $occurence_html = '<select 
name="holiday[occurence]">'."\n".$out.'</select>'."\n";
 
@@ -306,12 +311,12 @@
                        $out = '';
                        for($i=0;$i<7;$i++)
                        {
-                               $out .= '<option 
value="'.$i.'"'.($holiday['dow']==$i?' 
selected':'').'>'.$dow[$i].'</option>'."\n";
+                               $out .= '<option 
value="'.$i.'"'.(isset($holiday['dow']) && $holiday['dow']==$i?' 
selected':'').'>'.$dow[$i].'</option>'."\n";
                        }
                        $dow_html = '<select 
name="holiday[dow]">'."\n".$out.'</select>'."\n";
                        
$this->display_item($t,lang('Occurence'),$occurence_html.'&nbsp;'.$dow_html.
                                '&nbsp;'.lang('You can either set a Year or a 
Occurence, not both !!!'));
-                       $this->display_item($t,lang('Observance Rule'),'<input 
type="checkbox" name="holiday[observance_rule]" 
value="True"'.($holiday['observance_rule']?' checked':'').'>'.
+                       $this->display_item($t,lang('Observance Rule'),'<input 
type="checkbox" name="holiday[observance_rule]" 
value="True"'.(isset($holiday['observance_rule']) && 
$holiday['observance_rule']?' checked':'').'>'.
                                '&nbsp;'.lang('If checked holidays falling on a 
weekend, are taken on the monday after.'));
 
                        $t->set_var('lang_add',lang('Save'));

Index: inc/class.uiicalendar.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/inc/class.uiicalendar.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- inc/class.uiicalendar.inc.php       6 Dec 2006 15:12:46 -0000       1.12
+++ inc/class.uiicalendar.inc.php       11 Dec 2006 10:07:35 -0000      1.13
@@ -12,7 +12,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-       /* $Id: class.uiicalendar.inc.php,v 1.12 2006/12/06 15:12:46 sigurdne 
Exp $ */
+       /* $Id: class.uiicalendar.inc.php,v 1.13 2006/12/11 10:07:35 sigurdne 
Exp $ */
 
        class uiicalendar
        {
@@ -178,7 +178,7 @@
                                
mkdir($GLOBALS['phpgw_info']['server']['temp_dir'],0700);
                        }
 
-                       echo '<body bgcolor="' . 
$GLOBALS['phpgw_info']['theme']['bg_color'] . '">';
+                       echo '<body bgcolor="' . 
(isset($GLOBALS['phpgw_info']['theme']['bg_color'])?$GLOBALS['phpgw_info']['theme']['bg_color']:'')
 . '">';
 
                        $action = strtoupper(get_var('action', Array('GET')));
                        if ($action == 'GETFILE')
@@ -195,11 +195,11 @@
                        $var = Array(
                                'vcal_header'   => '<p>',
                                'ical_lang'             => lang('(i/v)Cal'),
-                               'action_url'    => 
$GLOBALS['phpgw']->link('/index.php','menuaction=calendar.boicalendar.import'),
+                               'action_url'    => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction'=>'calendar.boicalendar.import')),
                                'lang_access'   => lang('Access'),
                                'lang_groups'   => lang('Which groups'),
-                               'access_option'=> $access_option,
-                               'group_option'  => $group_option,
+                               'access_option'=> 
(isset($access_option)?$access_option:''),
+                               'group_option'  => 
(isset($group_option)?$group_option:''),
                                'load_vcal'     => lang('Load [iv]Cal')
                        );
                        $this->template->set_var($var);

Index: templates/base/header.inc.php
===================================================================
RCS file: /sources/phpgroupware/calendar/templates/base/header.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- templates/base/header.inc.php       9 Dec 2006 07:50:15 -0000       1.2
+++ templates/base/header.inc.php       11 Dec 2006 10:07:35 -0000      1.3
@@ -9,7 +9,7 @@
   *  option) any later version.                                              *
   \**************************************************************************/
 
-  /* $Id: header.inc.php,v 1.2 2006/12/09 07:50:15 sigurdne Exp $ */
+  /* $Id: header.inc.php,v 1.3 2006/12/11 10:07:35 sigurdne Exp $ */
 
        function add_col(&$tpl,$str)
        {
@@ -51,17 +51,17 @@
 
        add_col($tpl,'  <td width="2%">&nbsp;</td>');
 
-       add_col($tpl,'  <td 
width="2%">'.add_image_ahref($this->page('day','&date='.$today),'today',lang('Today')).'</td>');
+       add_col($tpl,'  <td 
width="2%">'.add_image_ahref($this->page('day',array('date'=>$today)),'today',lang('Today')).'</td>');
 
-       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('week','&date='.$today),'week',lang('This
 week')).'</td>');
+       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('week',array('date'=>$today)),'week',lang('This
 week')).'</td>');
 
-       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('month','&date='.$today),'month',lang('This
 month')).'</td>');
+       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('month',array('date'=>$today)),'month',lang('This
 month')).'</td>');
 
-       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('year','&date='.$today),'year',lang('This
 Year')).'</td>');
+       add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('year',array('date'=>$today)),'year',lang('This
 Year')).'</td>');
 
        if(floor(phpversion()) >= 4)
        {
-               add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('planner','&date='.$today),'planner',lang('Planner')).'</td>');
+               add_col($tpl,'  <td width="2%" 
align="left">'.add_image_ahref($this->page('planner',array('date'=>$today)),'planner',lang('Planner')).'</td>');
                $col_width += 2;
        }
 

Index: templates/base/holiday.tpl
===================================================================
RCS file: /sources/phpgroupware/calendar/templates/base/holiday.tpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- templates/base/holiday.tpl  28 Jul 2006 03:30:43 -0000      1.1
+++ templates/base/holiday.tpl  11 Dec 2006 10:07:35 -0000      1.2
@@ -1,4 +1,4 @@
-<!-- $Id: holiday.tpl,v 1.1 2006/07/28 03:30:43 skwashd Exp $ -->
+<!-- $Id: holiday.tpl,v 1.2 2006/12/11 10:07:35 sigurdne Exp $ -->
 <!-- BEGIN form -->
 <center>
 {message}<br />
@@ -27,7 +27,7 @@
 </center>
 <!-- END form -->
 <!-- BEGIN list -->
- <tr bgcolor="{tr_color}">
+ <tr class="{tr_color}">
   <td valign="top" width="35%"><b>{field}:</b></td>
   <td valign="top" width="65%">{data}</td>
  </tr>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]