34 private static $nb_day=array(31,28,31,30,31,30,31,31,30,31,30,31);
50 $this->current_date=getdate();
51 $this->month=$this->current_date[
'mon'];
52 $this->day=self::$nb_day[$this->month-1];
53 $this->year=$this->current_date[
'year'];
54 $this->action_div=array();
55 $this->action=array();
58 if ( $this->year % 4 == 0 && $this->month=2)
73 $sql=
"select ag_id,to_char(ag_remind_date,'DD')::integer as ag_timestamp_day,ag_title,ag_hour,
74 coalesce(name,'interne') as str_name
76 " from action_gestion ".
77 " left join vw_fiche_name on (f_id=f_id_dest) ".
79 " to_char(ag_remind_date,'MM')::integer=$1 ".
80 " and to_char(ag_remind_date,'YYYY')::integer=$2 ".
81 " and ag_dest in (select p_granted from user_sec_action_profile where p_id =$3)
82 and ag_state IN (2, 3)
98 if ( $p_style ==
"short")
100 foreach ($this->action as
$day=>$aAction)
103 $p_array[
$day]=
'<span class="smallbutton" onclick="display_task(\'tsk'.$day.
'\');
">'." [
".count($aAction)." ]
".'</span>';
105 $this->action_div[$day]='<div id="tsk
'.$day.'" class="inner_box
" style="width:200;
display:none
">';
106 $this->action_div[$day].=HtmlInput::title_box($day."/
".$this->month."/
".$this->year, "tsk
".$day, "hide
");
107 $this->action_div[$day].="<ol>
";
108 for ($i=0;$i<count($aAction);$i++)
110 $this->action_div[$day].='<li>'.HtmlInput::detail_action($aAction[$i],
111 $this->hour[$day][$i]." ".
112 $this->str_name[$day][$i]." ".
113 $this->title[$day][$i]).'</li>';
115 $this->action_div[$day].='</ol>';
116 $this->action_div[$day].=' <p style="text-
align: center
">';
117 $this->action_div[$day].=HtmlInput::button_hide('tsk'.$day);
118 $this->action_div[$day].='</p>';
119 $this->action_div[$day].='</div>';
122 else if ( $p_style == "long")
124 foreach ($this->action as $day=>$aAction)
126 $p_array[$day].="<ol>
";
127 for ($i=0;$i<count($aAction);$i++)
129 $p_array[$day].='<li>'.$this->hour[$day][$i]." ".hb($this->str_name[$day][$i]).'→'.HtmlInput::detail_action($aAction[$i], $this->hour[$day][$i]." ".$this->title[$day][$i]).'</li>';
131 $p_array[$day].='</ol>';
140 function fill_from_todo(&$p_array,$p_style)
142 $cn=Dossier::connect();
143 if ($p_style=="
short")
145 $sql="select count(*) as
nb,to_char(tl_date,'DD')::integer as tl_date_day ".
148 " to_char(tl_date,'MM')::integer=$1 ".
149 " and to_char(tl_date,'YYYY')::integer=$2 ".
150 " and use_login=$3 group by to_char(tl_date,'DD')::integer ";
151 $array=
$cn->get_array(
$sql,array($this->month,$this->year,$_SESSION[SESSION_KEY.'g_user']));
155 $p_array[
$ind].=
"<span style=\"display:block\" class=\"todo\">".h(
$array[
$i][
'nb']).
" "._(
'Notes').
'</span>';
157 }
else if ($p_style==
"long")
159 $sql=
"select to_char(tl_date,'DD')::integer as tl_date_day,tl_title ".
162 " to_char(tl_date,'MM')::integer=$1 ".
163 " and to_char(tl_date,'YYYY')::integer=$2 ".
164 " and use_login=$3 ";
165 $array=
$cn->get_array(
$sql,array($this->month,$this->year,$_SESSION[SESSION_KEY.
'g_user']));
170 $p_array[
$ind].=
"<span style=\"display:block\" class=\"todo\">".h(
$array[
$i][
'tl_title']).
'</span>';
184 throw new Exception(
"Calendar::display, unknow type");
186 $exercice_user=
$g_user->get_exercice();
195 $week=array(_(
'Dimanche'),_(
'Lundi'),_(
'Mardi'),_(
'Mercredi'),_(
'Jeudi'),_(
'Vendredi'),_(
'Samedi'));
203 $wMonth->value=
$cn->make_array(
"select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = '$exercice_user' order by p_start");
205 $wMonth->javascript=
"onchange=change_month(this)";
207 $wMonth->set_attribute(
'type_display',
$p_type);
208 $wMonth->set_attribute(
'notitle',
$notitle);
209 $month_year=$wMonth->input().$wMonth->get_js_attr();
213 require_once NOALYSS_TEMPLATE.
'/calendar.php';
215 if (count($this->action_div) > 0)
217 foreach ($this->action_div as
$day)
222 $ret=ob_get_contents();
232 $array=
$cn->get_array(
"select to_char(p_start,'MM') as month, to_char(p_start,'YYYY') as year ".
234 $this->month=(int)
$array[0][
'month'];
235 $this->year=(int)
$array[0][
'year'];
236 $this->day=self::$nb_day[$this->month-1];
237 if ( $this->year % 4 == 0 && $this->month==2)
249 $today=date(
'd.m.Y');
251 select p_id from parm_periode
253 p_start <= to_date($1,'DD.MM.YYYY')
255 p_end >= to_date($1,'DD.MM.YYYY')",
278 $exercice_user=
$g_user->get_exercice();
287 $week=array(_(
'Dimanche'),_(
'Lundi'),_(
'Mardi'),_(
'Mercredi'),_(
'Jeudi'),_(
'Vendredi'),_(
'Samedi'));
291 $wMonth=
new ISelect(
'per_div');
293 $wMonth->value=
$cn->make_array(
"select p_id,to_char(p_start,'MM/YYYY') from parm_periode where p_exercice = $1 order by p_start"
294 ,0,array($exercice_user));
296 $wMonth->javascript=sprintf(
"onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s',notitle:%d})",
299 $month_year=$wMonth->input().$wMonth->get_js_attr();
302 require_once NOALYSS_TEMPLATE.
'/calendar.php';
304 if (count($this->action_div) > 0)
306 foreach ($this->action_div as
$day)
311 $ret=ob_get_contents();
328 select ag_id,ag_remind_date,to_char(ag_remind_date,'DD.MM.YY') as str_date,ag_title,ag_hour,
329 coalesce(name,'interne') as str_name,
330 case when ag_remind_date < now() then 'R'
331 when ag_remind_date = now() then 'N'
334 coalesce (ag_remind_date::date,current_date) - current_date as delta_days
336 left join vw_fiche_name on (f_id=f_id_dest)
338 ag_dest in (select p_granted from user_sec_action_profile where p_id =$1)
339 and ag_state IN (2, 3)
340 and ag_remind_date is not null
341 order by ag_remind_date,ag_hour
345 require_once NOALYSS_TEMPLATE.
'/calendar-list.php';
nb($p_number)
format the number for the CSV export
global $g_user
if no group available , then stop
return false Description text align
for( $i=0; $i< $nb_row; $i++)
for($i=0;$i<=6;$i++) $ind
zoom_calendar($notitle)
zoom the calendar
get_preference()
get the periode from the preference of the current user change the value of default_periode to today
set_periode($p_per)
set the periode to the parameter, change the value of $this->default_periode there is no check on the...
display($p_type, $p_notitle)
display a calendar after a call to Calendar::fill
fill_from_action(&$p_array, $p_style)
fill the array given as parameter with the data from action_gestion
fill_from_todo(&$p_array, $p_style)
fill the array given as parameter with the data from todo
zoom($p_type, $p_notitle)
set_month_year()
set correctly the month and the year with the default_periode
zoom_list($notitle)
Display the next events for 30 days todo list + action to remind.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...