noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 228/323: Document_Modele CFGDOC warning if th


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 228/323: Document_Modele CFGDOC warning if there is no template
Date: Wed, 14 Mar 2018 17:38:55 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 2fb07b839cb579d12e826297d65957f2dcebdd74
Author: Dany De Bontridder <address@hidden>
Date:   Tue Feb 20 21:08:32 2018 +0100

    Document_Modele CFGDOC warning if there is no template
---
 include/class/document_modele.class.php |  7 +++++--
 include/document_modele.inc.php         | 17 +++++++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/include/class/document_modele.class.php 
b/include/class/document_modele.class.php
index ad3fc9f..7c29a83 100644
--- a/include/class/document_modele.class.php
+++ b/include/class/document_modele.class.php
@@ -100,8 +100,11 @@ class Document_modele
          $a->name="sa";
          $a->value="rm_template";
          $r.=$a->input();
-         $r.=HtmlInput::submit("rm_template","Effacer la sélection");
-       }
+         $r.=HtmlInput::submit("rm_template",_("Effacer la sélection"));
+       } else {
+            echo h2(_("Aucun document"));
+            echo _("Il n'y a aucun document, cliquez sur Ajouter pour en 
ajouter un");
+        }
        $b=new IButton('show');
        $b->label="Ajout d'un document";
        $b->javascript="$('add_modele').style.display='block';new 
Draggable('add_modele',{starteffect:function(){
diff --git a/include/document_modele.inc.php b/include/document_modele.inc.php
index 1613d34..8e0ec87 100644
--- a/include/document_modele.inc.php
+++ b/include/document_modele.inc.php
@@ -24,6 +24,10 @@
 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
 require_once NOALYSS_INCLUDE.'/class/document_modele.class.php';
 $sub_action=(isset ($_REQUEST['sa']))?$_REQUEST['sa']:"";
+
+$http=new HttpInput();
+
+$sub_action=$http->request("sa","string","");
 echo js_include('modele_document.js');
 echo '<div class="content">';
 // show the form for adding a template
@@ -37,11 +41,11 @@ if ( $sub_action=='add_document')
 {
     require_once NOALYSS_INCLUDE.'/class/document_modele.class.php';
     $doc=new Document_modele($cn);
-    $doc->md_name=$_POST['md_name'];
+    $doc->md_name=$http->post('md_name');
     $doc->md_id=-1; // because it is a new model
-    $doc->md_type=$_POST['md_type'];
-    $doc->start=$_POST['start_seq'];
-    $doc->md_affect=$_POST['md_affect'];
+    $doc->md_type=$http->post('md_type',"number");
+    $doc->start=$http->post('start_seq',"number");
+    $doc->md_affect=$http->post('md_affect');
     $doc->Save();
 }
 //-----------------------------------------------------
@@ -69,7 +73,8 @@ if ( $sub_action=='rm_template')
 if ( $sub_action == 'mod_template')
   {
     require_once NOALYSS_INCLUDE.'/class/document_modele.class.php';
-    $doc=new Document_modele($cn,$_POST['id']);
+    $id=$http->post("id","number");
+    $doc=new Document_modele($cn,$id);
     $doc->update($_POST);
   }
 //-----------------------------------------------------
@@ -77,7 +82,7 @@ if ( $sub_action == 'mod_template')
 //-----------------------------------------------------
 echo $doc->myList();
 echo '<div id="add_modele" class="inner_box" style="display:none">';
-echo HtmlInput::title_box("Ajout d'un modèle", "add_modele", "hide");
+echo HtmlInput::title_box(_("Ajout d'un modèle"), "add_modele", "hide");
 echo $doc->form('');
 echo '</div>';
 



reply via email to

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