noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] branch master updated: Tache #0001875: Demand


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] branch master updated: Tache #0001875: Demande amélioration calendrier Code cleaning
Date: Sat, 16 Jan 2021 06:58:26 -0500

This is an automated email from the git hooks/post-receive script.

sparkyx pushed a commit to branch master
in repository noalyss.

The following commit(s) were added to refs/heads/master by this push:
     new a7b8d81  Tache #0001875: Demande amélioration calendrier Code cleaning
a7b8d81 is described below

commit a7b8d812509654ee125ef6e7c8af6384407e2b90
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jan 16 12:58:08 2021 +0100

    Tache #0001875: Demande amélioration calendrier
    Code cleaning
---
 html/ajax.php               |  1 +
 html/ajax_misc.php          |  2 ++
 html/do.php                 |  4 +---
 include/lib/idate.class.php | 13 +++++--------
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/html/ajax.php b/html/ajax.php
index 4219a4c..76bb6a2 100644
--- a/html/ajax.php
+++ b/html/ajax.php
@@ -28,6 +28,7 @@ $cn=Dossier::connect();
 $g_parameter=new Noalyss_Parameter_Folder($cn);
 $g_user=new User($cn);
 $g_user->check(true);
+IDate::set_firstDate($g_user->get_first_week_day());
 set_language();
 /* if a code has been asked */
 if (isset($_REQUEST['plugin_code']) )
diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index a1dfd69..f0cd815 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -94,6 +94,8 @@ else
     $g_user->check(true);
 }
 
+IDate::set_firstDate($g_user->get_first_week_day());
+
 // For progress bar, for saving time , we check and answer directly
 if ($op == "progressBar") {
     $task_id=$http->request("task_id");
diff --git a/html/do.php b/html/do.php
index 47f180f..2b67723 100644
--- a/html/do.php
+++ b/html/do.php
@@ -56,9 +56,7 @@ $cn = Dossier::connect();
 global $g_user, $cn,$g_parameter,$http;
 $g_user = new User($cn);
 $http=new HttpInput();
-if ( ! defined("FIRST_WEEK_DAY")) {
-    define ("FIRST_WEEK_DAY",$g_user->get_first_week_day());
-}
+IDate::set_firstDate($g_user->get_first_week_day());
 /*
  * check that the database is not empty
  */
diff --git a/include/lib/idate.class.php b/include/lib/idate.class.php
index 805041b..8eab4fd 100644
--- a/include/lib/idate.class.php
+++ b/include/lib/idate.class.php
@@ -37,7 +37,7 @@ class IDate extends HtmlInput
     var $placeholder;
     var $title;
     var $autofocus;
-    var $firstDate; //<! first day in the calendar : 0 for sunday
+    static $firstDate=0; //<! first day in the calendar : 0 for sunday
 
     function __construct($name='', $value='', $p_id="")
     {
@@ -47,7 +47,6 @@ class IDate extends HtmlInput
         $this->extra="";
         $this->style=' class="input_text" ';
         $this->autofocus=false;
-        $this->firstDate=(defined("FIRST_WEEK_DAY"))?FIRST_WEEK_DAY:0;
     }
     /**
      * @return string
@@ -108,20 +107,18 @@ class IDate extends HtmlInput
      */
     public function get_firstDate()
     {
-        return $this->firstDate;
-        return $this;
+        return self::$firstDate;
     }
 
     /**
      * @param mixed $firstDate
      */
-    public function set_firstDate($firstDate)
+    static function set_firstDate($firstDate)
     {
         if (isNumber($firstDate)==0){
             throw new Exception("IDATE1: invalide data");
         }
-        $this->firstDate = $firstDate;
-        return $this;
+        self::$firstDate= $firstDate;
     }
 
 
@@ -165,7 +162,7 @@ class IDate extends HtmlInput
             </script>'
                 ,$this->id,
                 $this->id,
-                $this->firstDate);
+                self::$firstDate);
         return $r;
     }
 



reply via email to

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