noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 17/46: Task #0001595: CA - liste d'opérations


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 17/46: Task #0001595: CA - liste d'opérations - pas de choix de l'execice.
Date: Tue, 13 Jul 2021 05:01:53 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 1eb960760007b24b0c95c625050c583776300bba
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jun 12 11:07:54 2021 +0200

    Task #0001595: CA - liste d'opérations - pas de choix de l'execice.
---
 html/ajax_misc.php        |  2 +-
 html/js/noalyss_script.js | 12 ++++++++++--
 include/anc_od.inc.php    | 13 +++++++++++--
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 3e5d09b..b764655 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -376,7 +376,7 @@ switch ($op)
         $field=$http->get("field");
         $type=$http->get("type");
         $exercice=$http->get("exercice","number");
-        $last=$http->get("last","number");
+        $last=$http->get("last","string",0);
         
         // if last == 1 then show first and last periode of the 
         // exercice
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index 1a8cfc2..912fa10 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -3670,8 +3670,16 @@ function updatePeriode(p_dossier, p_exercice, 
p_periode_from, p_periode_to, p_la
 {
     waiting_box();
     var exercice = $(p_exercice).value;
-    new Ajax.Updater(p_periode_from, "ajax_misc.php", {method: "get", 
parameters: {op: "periode_change", "gDossier": p_dossier, "exercice": exercice, 
field: p_periode_from, "type": "from", "last": p_last}});
-    new Ajax.Updater(p_periode_to, "ajax_misc.php", {method: "get", 
parameters: {op: "periode_change", "gDossier": p_dossier, "exercice": exercice, 
field: p_periode_to, "type": "to", "last": p_last}});
+    new Ajax.Updater(p_periode_from, "ajax_misc.php", 
+        {   method: "get",
+            parameters: {op: "periode_change", "gDossier": p_dossier, 
"exercice": exercice,
+                field: p_periode_from, "type": "from", "last": p_last}});
+    if ( p_periode_to && p_last ) {
+        new Ajax.Updater(p_periode_to, "ajax_misc.php", 
+        {   method: "get", 
+            parameters: {op: "periode_change", "gDossier": p_dossier, 
"exercice": exercice, 
+                field: p_periode_to, "type": "to", "last": p_last}});
+    }
     remove_waiting_box();
 }
 /**
diff --git a/include/anc_od.inc.php b/include/anc_od.inc.php
index fc7ca55..a636d6c 100644
--- a/include/anc_od.inc.php
+++ b/include/anc_od.inc.php
@@ -31,6 +31,7 @@ require_once NOALYSS_INCLUDE.'/lib/iselect.class.php';
 require_once  NOALYSS_INCLUDE.'/class/anc_operation.class.php';
 require_once  NOALYSS_INCLUDE.'/class/anc_plan.class.php';
 require_once  NOALYSS_INCLUDE.'/class/anc_group_operation.class.php';
+require_once  NOALYSS_INCLUDE.'/class/exercice.class.php';
 
 global $g_user;
 $http=new HttpInput();
@@ -100,7 +101,14 @@ if ( isset($_GET['see']))
 
     echo dossier::hidden();
     $hid=new IHidden();
-
+    $exercice=$http->request("exercice","number",0);
+    if ($exercice == 0 ){
+        $exercice=$g_user->get_exercice();
+    }
+    $ex=new Exercice($cn);
+    
$js=sprintf("updatePeriode(%d,'%s','%s')",Dossier::id(),'exercice','p_periode');
+    $wex=$ex->select('exercice',$exercice,' onchange="'.$js.'"');
+    echo $wex->input();
     $hid->name="ac";
     $hid->value=$http->request("ac");
     echo $hid->input();
@@ -114,7 +122,8 @@ if ( isset($_GET['see']))
 // filter on the current year
     $filter_year=" where p_exercice='".$g_user->get_exercice()."'";
 
-    $periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') 
from parm_periode $filter_year order by  p_start,p_end",1);
+    $periode_start=$cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY') 
from parm_periode 
+           where p_exercice=$1 order by  p_start,p_end",1,[$exercice]);
     $g_user=new User($cn);
     $current=$http->get("p_periode","number",$g_user->get_periode());
     $w->value=$periode_start;



reply via email to

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