diff --git a/html/js/scripts.js b/html/js/scripts.js index a2695d0f2..0109baa3d 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -1753,4 +1753,16 @@ function filter_table(phrase, _id, colnr,start_row) { table.rows[r].style.display = 'none'; } } +} +function display_task(p_id) +{ + new Draggable(p_id,{starteffect:function() + { + new Effect.Highlight(obj.id,{scroll:window,queue:'end'}); + }} + ); + $(p_id).style.top=posY; + $(p_id).style.left=posX; + $(p_id).style.display='block'; + } \ No newline at end of file diff --git a/include/class_calendar.php b/include/class_calendar.php index 47574a656..a254a492b 100644 --- a/include/class_calendar.php +++ b/include/class_calendar.php @@ -35,6 +35,10 @@ class Calendar $this->month=$this->current_date['mon']; $this->day=self::$nb_day[$this->month-1]; $this->year=$this->current_date['year']; + $this->action_div=array(); + $this->action=array(); + $this->title=array(); + if ( $this->year % 4 == 0 && $this->month=2) $this->day=29; } @@ -48,22 +52,40 @@ class Calendar $profile=$g_user->get_profile(); $cn=new Database(dossier::id()); - $sql="select count(*) as nb,to_char(ag_remind_date,'DD')::integer as ag_timestamp_day ". + $sql="select ag_id,to_char(ag_remind_date,'DD')::integer as ag_timestamp_day,ag_title + ". " from action_gestion ". " where ". " to_char(ag_remind_date,'MM')::integer=$1 ". " and to_char(ag_remind_date,'YYYY')::integer=$2 ". " and ag_dest in (select p_granted from user_sec_action_profile where p_id =$3) and ag_state IN (2, 3) - group by to_char(ag_remind_date,'DD')::integer"; + "; $array=$cn->get_array($sql,array($this->month,$this->year,$profile)); for ($i=0;$i".$array[$i]['nb']." "._("Tâches suivies").''; + + $this->action[$ind][]=$array[$i]['ag_id']; + $this->title[$ind][]=$array[$i]['ag_title']; } + /* + * Fill foreach day + */ + foreach ($this->action as $day=>$aAction) + { + if ($p_array[$day]=="") $p_array[$day]=''." ".count($aAction)." "._("Tâches").''; + $this->action_div[$day]=''; + } } /*!\brief fill the array given as parameter with the data from todo *\param $p_array array of the date of the month @@ -113,7 +135,15 @@ class Calendar $month_year=$wMonth->input().$wMonth->get_js_attr(); ob_start(); require_once('template/calendar.php'); - $ret=ob_get_contents(); + + if (count($this->action_div) > 0) + { + foreach ($this->action_div as $day) + { + echo $day; + } + } + $ret=ob_get_contents(); ob_end_clean(); return $ret; } @@ -133,7 +163,7 @@ class Calendar } /** *@brief get the periode from the preference of the current user - * change the value of default_periode + * change the value of default_periode to today *@return $this->default_periode */ function get_preference() @@ -152,7 +182,7 @@ class Calendar { $p_id=$g_user->get_periode(); } - $this->default_periode=$p_id; + $this->default_periode=$p_id; return $p_id; } /**