noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 19/323: Task #1516 : Module période : add ic


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 19/323: Task #1516 : Module période : add icon for closing / opening
Date: Wed, 14 Mar 2018 17:38:10 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 39c12647ee1805670e80f99e981788446e627c65
Author: Dany De Bontridder <address@hidden>
Date:   Sun Jan 7 11:04:37 2018 +0100

    Task #1516 : Module période : add icon for closing / opening
---
 include/class/periode.class.php              |  8 +++-----
 include/class/periode_ledger_table.class.php | 11 ++++++-----
 include/constant.php                         |  2 ++
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/class/periode.class.php b/include/class/periode.class.php
index 63ad8da..982aa90 100644
--- a/include/class/periode.class.php
+++ b/include/class/periode.class.php
@@ -614,15 +614,13 @@ class Periode
         echo "<td>";
         if ($obj->getp("p_closed")=='f')
         {
-            $javascript=sprintf("%s.close_periode('%d')", $p_js, $obj->p_id);
-            echo HtmlInput::anchor_action(_("Fermeture"), $javascript, NULL,
-                    "line");
+            $javascript=sprintf('%s.close_periode(\'%d\')', $p_js, $obj->p_id);
+            echo HtmlInput::image_click(ICONON, $javascript, _('Fermé'));
         }
         else
         {
             $javascript=sprintf("%s.open_periode('%d')", $p_js, $obj->p_id);
-            echo HtmlInput::anchor_action(_("Réouverture"), $javascript, NULL,
-                    "line");
+            echo HtmlInput::image_click(ICONOFF, $javascript, _('Ouvert'));
         }
         echo "</td>";
         echo "</tr>";
diff --git a/include/class/periode_ledger_table.class.php 
b/include/class/periode_ledger_table.class.php
index d4c4da5..71b633f 100644
--- a/include/class/periode_ledger_table.class.php
+++ b/include/class/periode_ledger_table.class.php
@@ -140,20 +140,21 @@ class Periode_Ledger_Table
         echo td(format_date($pa_row["p_end"], "YYYY-MM-DD", "DD.MM.YYYY"));
         echo td($pa_row["p_exercice"]);
         $status=($pa_row['p_closed']=='t')?_("Fermée"):_("Ouvert");
-
+        echo "<td>";
+        if ($pa_row["status"] == "OP") { echo _("Ouvert"); }
+        if ($pa_row["status"] == "CL") { echo _("Fermé"); }
+        echo "</td>";
         /// Can close if open
         echo "<td>";
         if ($pa_row['status']=='OP')
         {
             $javascript=sprintf("%s.close_periode('%d')", $p_js, 
$pa_row['id']);
-            echo HtmlInput::anchor_action(_("Fermeture"), $javascript, NULL,
-                    "line");
+            echo HtmlInput::image_click(ICONON, $javascript, _('Fermé'));
         }
         elseif ($pa_row['status']=='CL')
         {
             $javascript=sprintf("%s.open_periode('%d')", $p_js, $pa_row['id']);
-            echo HtmlInput::anchor_action(_("Réouverture"), $javascript, NULL,
-                    "line");
+            echo HtmlInput::image_click(ICONOFF, $javascript, _('Ouvert'));
         }
         echo "</td>";
         echo "</tr>";
diff --git a/include/constant.php b/include/constant.php
index 84588e2..3e44862 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -309,3 +309,5 @@ define ('EMAIL_LIMIT',1002);
 define ('EXC_PARAM_VALUE',1005);
 define ('EXC_PARAM_TYPE',1006);
 define ('EXC_DUPLICATE',1200);
+define ('ICONON','icon-on.png');
+define ('ICONOFF','icon-off.png');
\ No newline at end of file



reply via email to

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