noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 08/13: Calendar : zoom and list mode, fix hei


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 08/13: Calendar : zoom and list mode, fix height
Date: Sun, 07 Jun 2015 17:57:26 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit b7c30b14081e0789ac7cfff4ed6e2f57b327c50e
Author: Dany De Bontridder <address@hidden>
Date:   Fri Jun 5 21:48:17 2015 +0200

    Calendar : zoom and list mode, fix height
---
 html/ajax_misc.php             |    4 ++--
 html/js/scripts.js             |    9 +++++++--
 include/ajax_calendar_zoom.php |    3 ++-
 include/calendar.inc.php       |    2 +-
 include/class_calendar.php     |   21 +++++++++++----------
 include/template/dashboard.php |    2 +-
 6 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index c5fad7a..2ceda15 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -156,9 +156,9 @@ EOF;
                /* others report */
                $cal = new Calendar();
                $cal->set_periode($per);
-
+                $notitle=HtmlInput::default_value_get("notitle", 0);
                $html = "";
-               $html = $cal->display($_GET['t']);
+               $html = $cal->display($_GET['t'],$notitle);
                $html = escape_xml($html);
                header('Content-type: text/xml; charset=UTF-8');
                echo <<<EOF
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 6d72394..952f2a1 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -343,9 +343,14 @@ function getNodeText(xmlNode)
  */
 function change_month(obj)
 {
-    var queryString = "gDossier=" + obj.gDossier + "&op=cal" + "&per=" + 
obj.value + "&t=" + obj.type_display;
     var action = new Ajax.Request(
-            "ajax_misc.php", {method: 'get', parameters: queryString, 
onFailure: ajax_misc_failure, onSuccess: success_misc}
+            "ajax_misc.php", 
+            {
+                method: 'get', 
+                parameters: { gDossier : obj.gDossier , op:'cal' ,"per"  : 
obj.value , t: obj.type_display, notitle:obj.notitle},
+                onFailure: ajax_misc_failure, 
+                onSuccess: success_misc
+            }
     );
 
 }
diff --git a/include/ajax_calendar_zoom.php b/include/ajax_calendar_zoom.php
index 7c35b56..dc03a0d 100644
--- a/include/ajax_calendar_zoom.php
+++ b/include/ajax_calendar_zoom.php
@@ -23,11 +23,12 @@ ob_start();
 if ( $notitle== 0 ) echo HtmlInput::title_box(_("Calendrier"), 
"calendar_zoom_div");
 $cal=new Calendar();
 $in=HtmlInput::default_value_get('in',"");
+$notitle=HtmlInput::default_value_get('notitle',"0");
 if ( $in == "") {
     $in=$cal->get_preference();
 }
 $cal->set_periode($in);
-echo $cal->zoom($distype);
+echo $cal->zoom($distype,$notitle);
 $response=  ob_get_clean();
 
 $html=escape_xml($response);
diff --git a/include/calendar.inc.php b/include/calendar.inc.php
index fb2f7be..c1a409a 100644
--- a/include/calendar.inc.php
+++ b/include/calendar.inc.php
@@ -15,5 +15,5 @@ $cal->default_periode=(isset 
($_GET['in']))?$_GET['in']:$g_user->get_periode();
 ?>
 <div id="calendar_zoom_div">
     
-<?php echo $cal->display('long',true); ?>
+<?php echo $cal->display('long',1); ?>
 </div>
\ No newline at end of file
diff --git a/include/class_calendar.php b/include/class_calendar.php
index 9df931f..8519d34 100644
--- a/include/class_calendar.php
+++ b/include/class_calendar.php
@@ -150,7 +150,7 @@ class Calendar
      * 
      *\return HTML String
      */
-    function display($p_type,$p_notitle=false)
+    function display($p_type,$p_notitle)
     {
         global $g_user;
         if  ($p_type != 'long' && $p_type != 'short') {
@@ -167,6 +167,8 @@ class Calendar
         /* weekday */
         
$week=array(_('Dimanche'),_('Lundi'),_('Mardi'),_('Mercredi'),_('Jeudi'),_('Vendredi'),_('Samedi'));
 
+        $notitle=$p_notitle;
+        
         $this->fill_from_action($cell,$p_type);
         $this->fill_from_todo($cell,$p_type);
         $wMonth=new ISelect('per');
@@ -176,10 +178,10 @@ class Calendar
         $wMonth->javascript="onchange=change_month(this)";
         $wMonth->set_attribute('gDossier',dossier::id());
         $wMonth->set_attribute('type_display',$p_type);
+        $wMonth->set_attribute('notitle',$notitle);
         $month_year=$wMonth->input().$wMonth->get_js_attr();
         ob_start();
         $zoom=($p_type=='short')?0:1;
-        $notitle=($p_notitle)?1:0;
         
         require_once('template/calendar.php');
 
@@ -243,7 +245,7 @@ class Calendar
     /**
      * @brief zoom the calendar
      */
-    function zoom_calendar()
+    function zoom_calendar($notitle)
     {
         global $g_user;
         $exercice_user=$g_user->get_exercice();
@@ -263,8 +265,8 @@ class Calendar
         $cn=new Database(dossier::id());
         $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");
         $wMonth->selected=$this->default_periode;
-        
$wMonth->javascript=sprintf("onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s'})",
-            dossier::id(),'per_div','calendar_zoom_div','cal');
+        
$wMonth->javascript=sprintf("onchange=calendar_zoom({gDossier:%d,invalue:'%s',outvalue:'%s',distype:'%s',notitle:%d})",
+            dossier::id(),'per_div','calendar_zoom_div','cal',$notitle);
         $wMonth->set_attribute('gDossier',dossier::id());
         $month_year=$wMonth->input().$wMonth->get_js_attr();
         ob_start();
@@ -287,7 +289,7 @@ class Calendar
      * Display the next events for 30 days 
      * todo list + action to remind
      */
-    function zoom_list()
+    function zoom_list($notitle)
     {
         global $g_user;
         $cn=new Database(dossier::id());
@@ -307,7 +309,6 @@ class Calendar
               order by ag_remind_date,ag_hour
         ";
         $a_event=$cn->get_array($sql,array($profile));
-        $notitle=HtmlInput::default_value_get('notitle', 0);
         ob_start();
         require_once 'template/calendar-list.php';
         $ret=ob_get_clean();
@@ -316,15 +317,15 @@ class Calendar
         
     }
     
-    function zoom($p_type)
+    function zoom($p_type,$p_notitle)
     {
         switch ($p_type)
         {
             case 'cal':
-                return $this->zoom_calendar();
+                return $this->zoom_calendar($p_notitle);
                 break;
             case 'list':
-                return $this->zoom_list();
+                return $this->zoom_list($p_notitle);
                 break;
         }
     }
diff --git a/include/template/dashboard.php b/include/template/dashboard.php
index 3b05b09..96c4016 100644
--- a/include/template/dashboard.php
+++ b/include/template/dashboard.php
@@ -4,7 +4,7 @@
 ?><!-- left div -->
 <div id="calendar_box_div" class="box">
 <?php echo 
HtmlInput::title_box(_('Calendrier'),'cal_div','zoom',"onclick=\"calendar_zoom($obj)\"");?>
-<?php echo $cal->display('short'); ?>
+<?php echo $cal->display('short',0); ?>
 </div>
 
 <div id="todo_listg_div" class="box"> <?php echo 
HtmlInput::title_box(_('Pense-Bête'),"todo_listg_div",'zoom'," 
onclick=\"zoom_todo()\"")?>



reply via email to

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