noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 46/119: Follow-up : tag enable when create do


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 46/119: Follow-up : tag enable when create doc
Date: Mon, 26 Oct 2020 18:27:16 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit dbea6cee68fdbe438031ee5ebf0992e64fc0ace6
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sun Oct 4 15:02:34 2020 +0200

    Follow-up : tag enable when create doc
---
 include/action.common.inc.php                 |  6 ++++--
 include/action.inc.php                        |  2 +-
 include/class/follow_up.class.php             |  7 ++++---
 include/template/action_button.php            | 30 ++++++++++++++++++++++-----
 include/template/follow_up_detail_display.php |  5 ++---
 5 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/include/action.common.inc.php b/include/action.common.inc.php
index 976fcbe..33904ec 100644
--- a/include/action.common.inc.php
+++ b/include/action.common.inc.php
@@ -284,12 +284,13 @@ if ($sub_action == "save_action_st2")
        $act->fromArray($_POST);
     try {
        $act->d_id = 0;
+        $act->ag_id=$http->request("ag_id","number");
        $act->md_id = (isset($_POST['gen_doc'])) ? $_POST['gen_doc'] : 0;
 
         $act->verify();
         
        // insert into action_gestion
-       echo $act->save();
+       echo $act->update();
        $url = "?$base&sa=detail&ag_id=" . $act->ag_id . '&' . dossier::get();
        echo '<p><a class="mtitle" href="' . $url . '">' . hb(_('Evènement 
Sauvée').'  : ' . $act->ag_ref) . '</a></p>';
 
@@ -312,8 +313,9 @@ if ($sub_action == "add_action")
 {
        $act = new Follow_Up($cn);
        $act->fromArray($_POST);
-       $act->ag_id = 0;
+       $act->dt_id = $http->request("action_type","number");
        $act->d_id = 0;
+       $act->save();
        echo '<div class="content">';
        // Add hidden tag
        echo '<form method="post" action="do.php" name="form_add" id="form_add" 
enctype="multipart/form-data" >';
diff --git a/include/action.inc.php b/include/action.inc.php
index 9f61297..70406bb 100644
--- a/include/action.inc.php
+++ b/include/action.inc.php
@@ -57,7 +57,7 @@ $ag_id=$http->request("ag_id","string","0");
 
 $ac=$http->request("ac");
 $base=HtmlInput::request_to_string(array('ac','gDossier'),"");
-
+echo '<div class="content">';
 require_once NOALYSS_INCLUDE.'/action.common.inc.php';
 echo "</div>";
 
diff --git a/include/class/follow_up.class.php 
b/include/class/follow_up.class.php
index 3aa0b6d..e38f4a7 100644
--- a/include/class/follow_up.class.php
+++ b/include/class/follow_up.class.php
@@ -165,7 +165,6 @@ class Follow_Up
         {
             $upd=false;
             $readonly=false;
-            $this->ag_ref=_("Nouveau");
         }
         elseif ($p_view=='READ')
         {
@@ -390,7 +389,7 @@ class Follow_Up
         $h_agrefid=new IHidden();
         $iag_ref=new IText("ag_ref");
         $iag_ref->value=$this->ag_ref;
-        $iag_ref->readOnly=($p_view=="NEW"||$p_view=='READ')?true:false;
+        $iag_ref->readOnly=false;
         $str_ag_ref=$iag_ref->input();
         // Preparing the return string
         $r="";
@@ -871,7 +870,9 @@ class Follow_Up
         $doc->Upload($this->ag_id);
 
         /* save action details */
-        for ($i=0; $i<$_POST['nb_item']; $i++)
+        $http=new HttpInput();
+        $nb_item=$http->post("nb_item","number",0);        
+        for ($i=0; $i< $nb_item ; $i++)
         {
             $act=new Follow_Up_Detail($this->db);
             $act->from_array($_POST, $i);
diff --git a/include/template/action_button.php 
b/include/template/action_button.php
index 0d72879..04a621d 100644
--- a/include/template/action_button.php
+++ b/include/template/action_button.php
@@ -26,19 +26,39 @@
  * @brief show button in the list of actions
  *
  */
+$http=new HttpInput();
 ?>
 <div class="content" style="display:inline" >
        <div style="display:inline">
+            <input id="bt_search" type="button" class="smallbutton" 
onclick="$('search_action').style.display='block'" value="<?php echo 
_('Recherche') ?>">
+            <input id="bt_add" type="button" class="smallbutton" 
onclick="$('b_add_action').style.display='block';document.getElementById('action_type').focus()"
 value="<?php echo _('Ajout') ?>">
+            <div id="b_add_action" style="display:none" class="inner_box">
+                <?php echo HtmlInput::title_box(_("Ajout d'une action"), 
"b_add_action","hide");?>
                <form  method="get" style="display:inline" action="do.php">
                        <?php echo dossier::hidden();
+                        $a_typeAction=new ISelect("action_type");
+                        $a_typeAction->rowsize=10;
+                        $a_typeAction->value=$cn->make_array("select 
dt_id,dt_value from document_type order by 2");
+                        echo _("Type action ");
+                        echo $a_typeAction->input();
                        ?>
-                       <input type="submit" class="smallbutton" 
name="submit_query" value="<?php echo  _("Ajout Action")?>">
-                       <input type="hidden" name="ac" value="<?php echo  
$_REQUEST['ac']?>">
+                        
+                       <input type="hidden" name="ac" value="<?php echo  
$http->request('ac')?>">
                        <input type="hidden" name="sa" value="add_action">
                        <?php echo  $supl_hidden?>
-                       <input id="bt_search" type="button" class="smallbutton" 
onclick="$('search_action').style.display='block'" value="<?php echo  
_('Recherche')?>">
-
+                    <ul class="aligned-block">
+                        <li>
+                            
+                       <input type="submit" class="smallbutton" 
name="submit_query" value="<?php echo  _("Ajout Action")?>">
+                        </li>
+                        <li>
+                            <?php echo 
HtmlInput::button_hide("b_add_action");?>
+                        </li>
+                    </ul>
 
+                        
 
                </form>
-       </div>
\ No newline at end of file
+            </div>
+       </div>
+</div>    
\ No newline at end of file
diff --git a/include/template/follow_up_detail_display.php 
b/include/template/follow_up_detail_display.php
index 2732290..0ce27e9 100644
--- a/include/template/follow_up_detail_display.php
+++ b/include/template/follow_up_detail_display.php
@@ -31,8 +31,7 @@ $tot_vat=0;
 $text=new IText();
 $num=new INum();
 $itva=new ITva_Popup();
-$readonly=$p_view;
-
+$readonly=($p_view == "READ")?true:false;
 // default menu for invoice
 $menu=new Default_Menu();
 ?>
@@ -59,7 +58,7 @@ $menu=new Default_Menu();
             $icard->noadd="no";
             $icard->extra='all';
             $icard->name="e_march".$i;
-            
$tmp_ad=(isset($p_follow_up->aAction_detail[$i]))?$p_follow_up->aAction_detail[$i]:$readonly;
+            
$tmp_ad=(isset($p_follow_up->aAction_detail[$i]))?$p_follow_up->aAction_detail[$i]:false;
             $icard->readOnly=$readonly;
             $icard->value='';
             $aCard[$i]=0;



reply via email to

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