source: companies/celepar/calendar/inc/class.uiholiday.inc.php @ 763

Revision 763, 19.4 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
1<?php
2  /**************************************************************************\
3  * eGroupWare - Calendar                                                    *
4  * http://www.egroupware.org                                                *
5  * Based on Webcalendar by Craig Knudsen <cknudsen@radix.net>               *
6  *          http://www.radix.net/~cknudsen                                  *
7  * Modified by Mark Peters <skeeter@phpgroupware.org>                       *
8  * --------------------------------------------                             *
9  *  This program is free software; you can redistribute it and/or modify it *
10  *  under the terms of the GNU General Public License as published by the   *
11  *  Free Software Foundation; either version 2 of the License, or (at your  *
12  *  option) any later version.                                              *
13  \**************************************************************************/
14
15
16        class uiholiday
17        {
18                var $debug = False;
19                var $base_url;
20                var $bo;
21                var $template_dir;
22                var $holidays;
23                var $cat_id;
24
25                var $public_functions = array(
26                        'admin' => True,
27                        'edit_locale' => True,
28                        'edit_holiday' => True,
29                        'copy_holiday' => True,
30                        'delete_holiday' => True,
31                        'delete_locale' => True,
32                        'submit'        => True
33                );
34
35                function uiholiday()
36                {
37                        $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs');
38
39                        $this->bo = CreateObject('calendar.boholiday');
40                        $this->bo->check_admin();
41                        $this->base_url = $this->bo->base_url;
42                        $this->template_dir = $GLOBALS['phpgw']->common->get_tpl_dir('calendar');
43                        $this->sb = CreateObject('phpgwapi.sbox');
44
45                        $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Holiday Management');
46                }
47
48                function admin()
49                {
50                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
51                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
52                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
53                        $GLOBALS['phpgw']->common->phpgw_header();
54
55                        $p = &$GLOBALS['phpgw']->template;
56                        $p->set_file(Array('locales'=>'locales.tpl'));
57                        $p->set_block('locales','list','list');
58                        $p->set_block('locales','row','row');
59                        $p->set_block('locales','row_empty','row_empty');
60                        $p->set_block('locales','submit_column','submit_column');
61
62                        $var = Array(
63                                'th_bg'         => $GLOBALS['phpgw_info']['theme']['th_bg'],
64                                'left_next_matchs'      => $GLOBALS['phpgw']->nextmatchs->left('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
65                                'right_next_matchs'     => $GLOBALS['phpgw']->nextmatchs->right('/index.php?menuaction=calendar.uiholiday.admin',$this->bo->start,$this->bo->total),
66                                'center'                        => '<td align="center">'.lang('Countries').'</td>',
67                                'sort_name'             => $GLOBALS['phpgw']->nextmatchs->show_sort_order($this->bo->sort,'locale',$this->bo->order,'/calendar/'.basename($SCRIPT_FILENAME),lang('Country')),
68                                'header_edit'   => lang('Edit'),
69                                'header_delete' => lang('Delete'),
70                                'header_extra'  => lang('Submit to Repository'),
71                                'extra_width'  => 'width="45%"',
72                                'rule'         => '',
73                                'header_rule'  => '',
74                                'back_button'   => ''
75                        );
76
77                        $p->set_var($var);
78
79                        $locales = $this->bo->get_locale_list($this->bo->sort, $this->bo->order, $this->bo->query, $this->bo->total);
80                        @reset($locales);
81                        if (!$locales)
82                        {
83                                $p->set_var('message',lang('no matches found'));
84                                $p->parse('rows','row_empty',True);
85                        }
86                        else
87                        {
88                                $p->set_var('submit_extra',' width="5%"');
89                                while (list(,$value) = each($locales))
90                                {
91                                        $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
92                                        if (! $value)  $value  = '&nbsp;';
93
94                                        $var = Array(
95                                                'tr_color'              => $tr_color,
96                                                'group_name'    => $value,
97                                                'edit_link'             => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$value)) . '"> '.lang('Edit').' </a>',
98                                                'delete_link'   => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.delete_locale','locale'=>$value)).'"> '.lang('Delete').' </a>',
99                                                'extra_link'    => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.submit','locale'=>$value)).'"> '.lang('Submit').' </a>'.
100                                                        ' &nbsp; &nbsp; <a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.submit','locale'=>$value,'download'=>1)).'"> '.lang('Download').' </a>'
101                                        );
102                                        $p->set_var($var);
103                                        $p->parse('rows','row',True);
104                                }
105                        }
106
107                        $var = Array(
108                                'new_action'            => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_holiday','id'=>0)),
109                                'lang_add'                      => lang('add'),
110                                'search_action' => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
111                                'lang_search'           => lang('search')
112                        );
113
114                        $p->set_var($var);
115                        $p->pparse('out','list');
116                }
117
118                function edit_locale($locale='')
119                {
120                        if ($locale === '')
121                        {
122                                $locale = $this->bo->locale;
123                        }
124                        if ($locale)
125                        {
126                                $this->bo->locales = array($locale);
127                                $this->bo->total = $this->bo->so->holiday_total($locale,$this->bo->query);
128                        }
129                        if(!$this->bo->total && !isset($this->bo->query))
130                        {
131                                $link_params = Array(
132                                        'menuaction'    => 'calendar.uiholiday.admin'
133                                );
134                                $GLOBALS['phpgw']->redirect_link($this->base_url,$link_params);
135                        }
136                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
137                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
138                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
139                        $GLOBALS['phpgw']->common->phpgw_header();
140                        $p = CreateObject('phpgwapi.Template',$this->template_dir);
141                        $p->set_file(Array('locale'=>'locales.tpl'));
142                        $p->set_block('locale','list','list');
143                        $p->set_block('locale','row','row');
144                        $p->set_block('locale','row_empty','row_empty');
145                        $p->set_block('locale','back_button_form','back_button_form');
146
147                        if (!is_object($GLOBALS['phpgw']->html))
148                        {
149                                $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html');
150                        }
151                        $html = &$GLOBALS['phpgw']->html;
152                        $year_form = str_replace('<option value=""></option>','',$html->form($html->sbox_submit($this->sb->getYears('year',$this->bo->year),true),array(),
153                                $this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0])));
154                        unset($html);
155
156                        $holidays = $this->bo->get_holiday_list();
157                        $total = count($holidays);
158
159                        $var = Array(
160                                'th_bg'                         => $GLOBALS['phpgw_info']['theme']['th_bg'],
161                                'left_next_matchs'      => $GLOBALS['phpgw']->nextmatchs->left('/index.php',$this->bo->start,$total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
162                                'right_next_matchs'     => $GLOBALS['phpgw']->nextmatchs->right('/index.php',$this->bo->start,$total,'&menuaction=calendar.uiholiday.edit_locale&locale='.$this->bo->locales[0].'&year='.$this->bo->year),
163                                'center'                        => '<td align="right">'.lang('Holidays').' ('.$this->bo->locales[0].')</td><td align="left">'.$year_form.'</td>',
164                                '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),
165                                'header_edit'           => lang('Edit'),
166                                'header_delete'         => lang('Delete'),
167                                '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>',
168                                'header_extra'          => lang('Copy'),
169                                'extra_width'           => 'width="5%"'
170                        );
171
172                        $p->set_var($var);
173
174                        if (!count($holidays))
175                        {
176                                $p->set_var('message',lang('no matches found'));
177                                $p->parse('rows','row_empty',True);
178                        }
179                        else
180                        {
181                                $maxmatchs = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
182                                $end = min($total,$this->bo->start+$maxmatchs);
183                                $p->set_var('rows',lang('showing %1 - %2 of %3',1+$this->bo->start,$end,$total));
184                                for($i=$this->bo->start; $i < $end; $i++)
185                                {
186                                        $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
187                                        if (!$holidays[$i]['name'])
188                                        {
189                                                $holidays[$i]['name'] = '&nbsp;';
190                                        }
191                                       
192                                        $var = Array(
193                                                'tr_color'              => $tr_color,
194                                                'header_delete'=> lang('Delete'),
195                                                'group_name'    => $holidays[$i]['name'],
196                                                'rule'                  => '<td>'.$this->bo->rule_string($holidays[$i]).'</td>',
197                                                'edit_link'             => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_holiday','locale'=>$this->bo->locales[0],'id'=>$holidays[$i]['index'],'year'=>$this->bo->year)).'"> '.lang('Edit').' </a>',
198                                                'extra_link'    => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.copy_holiday','locale'=>$this->bo->locales[0],'id'=>$holidays[$i]['index'],'year'=>$this->bo->year)).'"> '.lang('Copy').' </a>',
199                                                'delete_link'   => '<a href="'.$GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.delete_holiday','locale'=>$this->bo->locales[0],'id'=>$holidays[$i]['index'],'year'=>$this->bo->year)).'"> '.lang('Delete').' </a>'
200                                        );
201
202                                        $p->set_var($var);
203                                        $p->parse('rows','row',True);
204                                }
205                        }
206
207                        $var = Array(
208                                'new_action'    => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_holiday','locale'=>$this->bo->locales[0],'id'=>0,'year'=>$this->bo->year)),
209                                'lang_add'              => lang('add'),
210                                'back_action'   => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
211                                'lang_back'             => lang('Back'),
212                                'search_action'=> $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)),
213                                'lang_search'   => lang('search')
214                        );
215                        $p->set_var($var);
216                        $p->parse('back_button','back_button_form',False);
217                        $p->pparse('out','list');
218                }
219
220                function copy_holiday()
221                {
222                        if(@$this->bo->id)
223                        {
224                                $holiday = $this->bo->read_entry($this->bo->id);
225                        }
226                        $this->bo->id = 0;
227
228                        if (!$holiday['occurence'] || $holiday['occurence'] >= 1900)
229                        {
230                                $holiday['occurence'] = date('Y');
231                        }
232                        $this->edit_holiday('',$holiday);
233                }
234
235                function edit_holiday($error='',$holiday='')
236                {
237                        if(@$this->bo->id && !$holiday)
238                        {
239                                $holiday = $this->bo->read_entry($this->bo->id);
240                        }
241                        if ($this->locale)
242                        {
243                                $holiday['locale'] = $this->locale;
244                        }
245                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
246                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
247                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
248                        $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.($this->bo->id ? lang('Edit') : lang('Add')).' '.lang('Holiday');
249                        $GLOBALS['phpgw']->common->phpgw_header();
250
251                        $t = &$GLOBALS['phpgw']->template;
252                        $t->set_file(Array('holiday'=>'holiday.tpl','form_button'=>'form_button_script.tpl'));
253                        $t->set_block('holiday','form','form');
254                        $t->set_block('holiday','list','list');
255
256                        if (@count($error))
257                        {
258                                $message = $GLOBALS['phpgw']->common->error_list($error);
259                        }
260                        else
261                        {
262                                $message = '';
263                        }
264       
265                        $var = Array(
266                                'title_holiday' => ($this->bo->id ? lang('Edit') : lang('Add')).' '.lang('Holiday'),
267                                'message'       => $message,
268                                'actionurl'     => $GLOBALS['phpgw']->link($this->base_url,'menuaction=calendar.boholiday.add&year='.$this->bo->year),
269                                'hidden_vars'   => '<input type="hidden" name="holiday[hol_id]" value="'.$this->bo->id.'">'."\n"
270                                        . '<input type="hidden" name="holiday[locales]" value="'.$this->bo->locales[0].'">'."\n"
271                        );
272                        $t->set_var($var);
273
274// Locale
275                        $this->display_item($t,lang('Country'),$this->sb->form_select($holiday['locale'],'holiday[locale]'));
276
277// Title/Name
278                        $this->display_item($t,lang('title'),'<input name="holiday[name]" size="60" maxlength="50" value="'.$holiday['name'].'">');
279
280// Date
281                        $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'])).
282                                '&nbsp;'.lang('Set a Year only for one-time / non-regular holidays.'));
283
284// Occurence
285                        $occur = Array(
286                                0       => '',
287                                1       => '1.',
288                                2       => '2.',
289                                3       => '3.',
290                                4       => '4.',
291                                5       => '5.',
292                                99      => lang('Last')
293                        );
294                        $out = '';
295                        while(list($key,$value) = each($occur))
296                        {
297                                $out .= '<option value="'.$key.'"'.($holiday['occurence']==$key?' selected':'').'>'.$value.'</option>'."\n";
298                        }
299                        $occurence_html = '<select name="holiday[occurence]">'."\n".$out.'</select>'."\n";
300
301                        $dow = Array(
302                                0       => lang('Sun'),
303                                1       => lang('Mon'),
304                                2       => lang('Tue'),
305                                3       => lang('Wed'),
306                                4       => lang('Thu'),
307                                5       => lang('Fri'),
308                                6       => lang('Sat')
309                        );
310                        $out = '';
311                        for($i=0;$i<7;$i++)
312                        {
313                                $out .= '<option value="'.$i.'"'.($holiday['dow']==$i?' selected':'').'>'.$dow[$i].'</option>'."\n";
314                        }
315                        $dow_html = '<select name="holiday[dow]">'."\n".$out.'</select>'."\n";
316                        $this->display_item($t,lang('Occurence'),$occurence_html.'&nbsp;'.$dow_html.
317                                '&nbsp;'.lang('You can either set a Year or a Occurence, not both !!!'));
318                        $this->display_item($t,lang('Observance Rule'),'<input type="checkbox" name="holiday[observance_rule]" value="True"'.($holiday['observance_rule']?' checked':'').'>'.
319                                '&nbsp;'.lang('If checked holidays falling on a weekend, are taken on the monday after.'));
320
321                        $t->set_var('lang_add',lang('Save'));
322                        $t->set_var('lang_reset',lang('Reset'));
323
324                        if(@$this->bo->locales[0])
325                        {
326                                $link_params = Array(
327                                        'menuaction'    => 'calendar.uiholiday.edit_locale',
328                                        'year'                  => $this->bo->year,
329                                        'locale'                => $this->bo->locales[0]
330                                );
331                        }
332                        else
333                        {
334                                $link_params = Array(
335                                        'menuaction'    => 'calendar.uiholiday.admin'
336                                );
337                        }
338                       
339                        $t->set_var(Array(
340                                'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,$link_params),
341                                'action_text_button'    => lang('Cancel'),
342                                'action_confirm_button' => '',
343                                'action_extra_field'    => ''
344                        ));
345                        $t->parse('cancel_button','form_button');
346                       
347                        if ($this->bo->id)
348                        {
349                                $link_params = Array(
350                                        'menuaction'    => 'calendar.uiholiday.delete_holiday',
351                                        'year'                  => $this->bo->year,
352                                        'locale'                => $this->bo->locales[0],
353                                        'id'                    => $this->bo->id
354                                );
355                                $t->set_var(Array(
356                                        'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,$link_params),
357                                        'action_text_button'    => lang('Delete'),
358                                        'action_confirm_button' => '',
359                                        'action_extra_field'    => ''
360                                ));
361                                $t->parse('delete_button','form_button');
362                        }
363                        else
364                        {
365                                $t->set_var('delete_button','&nbsp;');
366                        }
367                        $t->pparse('out','form');
368                }
369
370
371                function delete_locale()
372                {
373                        if(!$this->bo->total)
374                        {
375                                $this->admin();
376                        }
377
378                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
379                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
380                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
381                        $GLOBALS['phpgw']->common->phpgw_header();
382
383                        $p = CreateObject('phpgwapi.Template',$this->template_dir);
384                        $p->set_file(Array('form'=>'delete_common.tpl','form_button'=>'form_button_script.tpl'));
385               
386                        $p->set_var('messages',lang('Are you sure want to delete this Country?')."<br>".$this->bo->locales[0]);
387
388                        $var = Array(
389                                'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.admin')),
390                                'action_text_button'    => lang('No'),
391                                'action_confirm_button' => '',
392                                'action_extra_field'    => ''
393                        );
394                        $p->set_var($var);
395                        $p->parse('no','form_button');
396
397                        $var = Array(
398                                'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.boholiday.delete_locale','locale'=>$this->bo->locales[0])),
399                                'action_text_button'    => lang('Yes'),
400                                'action_confirm_button' => '',
401                                'action_extra_field'    => ''
402                        );
403                        $p->set_var($var);
404                        $p->parse('yes','form_button');
405
406                        $p->pparse('out','form');
407                }
408
409                function delete_holiday()
410                {
411                        $holiday = $this->bo->read_entry($this->bo->id);
412
413                        if(!$holiday)
414                        {
415                                $this->edit_locale();
416                        }
417                       
418                        unset($GLOBALS['phpgw_info']['flags']['noheader']);
419                        unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
420                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
421                        $GLOBALS['phpgw']->common->phpgw_header();
422
423                        $p = CreateObject('phpgwapi.Template',$this->template_dir);
424                        $p->set_file(Array('form'=>'delete_common.tpl','form_button'=>'form_button_script.tpl'));
425               
426                        $p->set_var('messages',lang('Are you sure want to delete this holiday?')."<br>".$holiday['name'].' ('.$this->bo->locales[0].') '.$this->bo->rule_string($holiday));
427
428                        $var = Array(
429                                'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.uiholiday.edit_locale','locale'=>$this->bo->locales[0],'year'=>$this->bo->year)),
430                                'action_text_button'    => lang('No'),
431                                'action_confirm_button' => '',
432                                'action_extra_field'    => ''
433                        );
434                        $p->set_var($var);
435                        $p->parse('no','form_button');
436
437                        $var = Array(
438                                'action_url_button'     => $GLOBALS['phpgw']->link($this->base_url,Array('menuaction'=>'calendar.boholiday.delete_holiday','locale'=>$this->bo->locales[0],'id'=>$this->bo->id,'year'=>$this->bo->year)),
439                                'action_text_button'    => lang('Yes'),
440                                'action_confirm_button' => '',
441                                'action_extra_field'    => ''
442                        );
443                        $p->set_var($var);
444                        $p->parse('yes','form_button');
445
446                        $p->pparse('out','form');
447                }
448
449                function submit()
450                {
451                        if(!@$this->bo->locales[0])
452                        {
453                                $this->admin();
454                        }
455                        $this->bo->year = 0;    // for a complete list with all years
456                        $holidays = $this->bo->get_holiday_list();
457
458                        if (isset($_GET['download']))
459                        {
460                                $locale = $this->bo->locales[0];
461                                $browser = CreateObject('phpgwapi.browser');
462                                $browser->content_header("holidays.$locale.csv",'text/text');
463                                unset($browser);
464
465                                while (list(,$holiday) = @each($holidays))
466                                {
467                                        echo "$locale\t$holiday[name]\t$holiday[day]\t$holiday[month]\t$holiday[occurence]\t$holiday[dow]\t$holiday[observance_rule]\n";
468                                }
469                                $GLOBALS['phpgw']->common->phpgw_exit();
470                        }
471                        elseif($this->debug)
472                        {
473                                $action = $GLOBALS['phpgw']->link('/calendar/phpgroupware.org/accept_holiday.php');
474                        }
475                        else
476                        {
477                                $action = 'http://www.egroupware.org/cal/accept_holiday.php';
478                        }
479                        $GLOBALS['phpgw_info']['flags']['noappheader']  = True;
480                        $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
481                        $GLOBALS['phpgw_info']['flags']['nofooter'] = True;
482                        $GLOBALS['phpgw']->common->phpgw_header();
483
484                        echo '<body onLoad="document.submitform.submit()">'."\n";
485                        echo '<form action="'.$action.'" method="post" name="submitform">'."\n";
486
487                        $c_holidays = count($holidays);
488                        echo '<input type="hidden" name="locale" value="'.$this->bo->locales[0].'">'."\n";
489                        for($i=0;$i<$c_holidays;$i++)
490                        {
491                                echo '<input type="hidden" name="name[]" value="'.htmlspecialchars($holidays[$i]['name']).'">'."\n"
492                                        . '<input type="hidden" name="day[]" value="'.$holidays[$i]['day'].'">'."\n"
493                                        . '<input type="hidden" name="month[]" value="'.$holidays[$i]['month'].'">'."\n"
494                                        . '<input type="hidden" name="occurence[]" value="'.$holidays[$i]['occurence'].'">'."\n"
495                                        . '<input type="hidden" name="dow[]" value="'.$holidays[$i]['dow'].'">'."\n"
496                                        . '<input type="hidden" name="observance[]" value="'.$holidays[$i]['observance_rule'].'">'."\n";
497                        }
498                        echo "</form>\n</body>\n</head>";
499                }
500
501                /* private functions */
502                function display_item(&$p,$field,$data)
503                {
504                        $var = Array(
505                                'tr_color' => $GLOBALS['phpgw']->nextmatchs->alternate_row_color(),
506                                'field' => $field,
507                                'data'  => $data
508                        );
509                        $p->set_var($var);
510                        $p->parse('rows','list',True);
511                }
512        }
513?>
Note: See TracBrowser for help on using the repository browser.