noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 63/219: Analytic : change the name and descri


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 63/219: Analytic : change the name and description in Ajax, improve esthetic
Date: Mon, 18 Dec 2017 13:22:39 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 8246933e92b391bccf040fab23e12de6876f4650
Author: Dany De Bontridder <address@hidden>
Date:   Tue Sep 26 23:12:54 2017 +0200

    Analytic : change the name and description in Ajax, improve esthetic
---
 html/ajax_misc.php                 |  4 +++-
 html/js/infobulle.js               |  2 +-
 include/ajax/ajax_anc_plan.php     |  2 ++
 include/anc_pa.inc.php             | 12 ++++--------
 include/class/anc_plan.class.php   | 29 ++++++++++++++++++++++-------
 include/lib/message_javascript.php |  2 +-
 include/template/anc_key_input.php |  2 +-
 7 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 1f8bf74..82749d1 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -183,7 +183,9 @@ $path = array(
     /* display the lettering , callebd from acc_ledger : dsp_letter*/
     "dl"=>"ajax_display_letter",
     // Add , delete update anc accounting
-    "anc_accounting"=>"ajax_anc_accounting"
+    "anc_accounting"=>"ajax_anc_accounting",
+    // Update name and description
+    "anc_updatedescription"=>"ajax_anc_plan"
 )    ;
 
 if (array_key_exists($op, $path)) {
diff --git a/html/js/infobulle.js b/html/js/infobulle.js
index e87b19b..41750dd 100644
--- a/html/js/infobulle.js
+++ b/html/js/infobulle.js
@@ -31,7 +31,7 @@ function showBulle(p_ctl){
     var d=document.getElementById('bulle');
     d.innerHTML=content[p_ctl];
     d.style.top=posY+offsetY+"px";
-    d.style.left=posX+offsetX+"px";
+    d.style.left=posX+offsetX-10+"px";
     d.style.visibility="visible";
 }
 function getPosition(e)
diff --git a/include/ajax/ajax_anc_plan.php b/include/ajax/ajax_anc_plan.php
index 8e78c19..dca03dd 100644
--- a/include/ajax/ajax_anc_plan.php
+++ b/include/ajax/ajax_anc_plan.php
@@ -25,6 +25,8 @@ if (!defined('ALLOWED'))
 
 require_once NOALYSS_INCLUDE . "/lib/inplace_edit.class.php";
 
+if ( $g_user->check_module("PLANANC ") ) die("forbidden");
+
 $input = $http->request("input");
 $action = $http->request("ieaction", "string", "display");
 $pa_id=$http->post("id","numeric");
diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php
index dda0426..1822757 100644
--- a/include/anc_pa.inc.php
+++ b/include/anc_pa.inc.php
@@ -30,6 +30,7 @@ if (!defined('ALLOWED'))
 require_once NOALYSS_INCLUDE.'/class/anc_plan.class.php';
 require_once NOALYSS_INCLUDE.'/class/anc_account_table.class.php';
 require_once NOALYSS_INCLUDE.'/database/poste_analytique_sql.class.php';
+require_once NOALYSS_INCLUDE.'/lib/inplace_edit.class.php';
 
 $ret="";
 $str_dossier=Dossier::get();
@@ -117,23 +118,18 @@ if ($sa=="pa_detail")
     
     $pa_id=$http->get("pa_id","numeric");
     
-    $new=new Anc_Plan($cn, $_GET['pa_id']);
+    $new=new Anc_Plan($cn, $pa_id);
     $wSa=HtmlInput::hidden("sa", "pa_update");
 
     $new->get();
 
     $ret.= '<div class="content">';
-    $ret.= '<form method="post">';
-    $ret.=dossier::hidden();
 
     $ret.= $new->form();
     $ret.= $wSa;
-    $ret.=HtmlInput::submit("submit", _("Enregistre"));
-    $ret.=HtmlInput::button_anchor(_('Efface'), '', 'remove_analytic_plan',
+    $ret.=HtmlInput::button_anchor(_('Efface ce plan'), '', 
'remove_analytic_plan',
                     'onclick="return 
confirm_box(\'remove_analytic_plan\',\'Effacer ?\',function () 
{window.location=\'do.php?ac='.$_REQUEST['ac'].'&pa_id='.$_GET['pa_id'].'&sa=pa_delete&'.$str_dossier.'\';})"',
                     'smallbutton');
-    $ret.= '</form>';
-
     //---------------------------------------------------------------------
     //  Detail now
     // Use Manage_Table
@@ -207,7 +203,7 @@ if ($sa=='anc_menu')
             echo '<TD>'.
             '<a href="?'.$url.'">'.
             h($line['name']);
-
+            echo "&nbsp;";
             echo h($line['description'])."</a>";
             echo "</td>";
             echo "</TR>\n";
diff --git a/include/class/anc_plan.class.php b/include/class/anc_plan.class.php
index f5ff21a..f7ee135 100644
--- a/include/class/anc_plan.class.php
+++ b/include/class/anc_plan.class.php
@@ -111,16 +111,31 @@ class Anc_Plan
     }
     function form()
     {
+        $dossier_id=Dossier::id();
+        $wName=new IText('pa_name',$this->name,"pa_name");
+        $iName=new Inplace_Edit($wName);
+        $iName->set_callback("ajax_misc.php");
+        $iName->add_json_param("gDossier",$dossier_id);
+        $iName->add_json_param("action","anc_updatedescription");
+        $iName->add_json_param("op","anc_updatedescription");
+        $iName->add_json_param("id",$this->id);
+
+
+        $wDescription=new 
IText('pa_description',$this->description,"pa_description");
+        $wDescription->size=50;
+        if ( $this->description == "") $wDescription->value=_("Aucune 
description");
+        $iDescription=new Inplace_Edit($wDescription);
+        $iDescription->add_json_param("gDossier",$dossier_id);
+        $iDescription->add_json_param("op","anc_updatedescription");
+        $iDescription->add_json_param("action","anc_updatedescription");
+        $iDescription->set_callback("ajax_misc.php");
+        $iDescription->add_json_param("id",$this->id);
+        
 
-        $wName=new IText('pa_name',$this->name);
-
-        $wName->table=1;
-        $wDescription=new IText('pa_description',$this->description);
-        $wDescription->table=1;
         $wId=new IHidden("pa_id",$this->id);
         $ret="<TABLE>";
-        $ret.='<tr>'.td(_('Nom')).$wName->input().'</tr>';
-        $ret.="<tr>".td(_('Description')).$wDescription->input()."</tr>";
+        $ret.='<tr>'.td(_('Nom')).'<td>'.$iName->input().'</td>'.'</tr>';
+        
$ret.="<tr>".td(_('Description')).'<td>'.$iDescription->input().'</td>'."</tr>";
         $ret.="</table>";
         $ret.=$wId->input();
         return $ret;
diff --git a/include/lib/message_javascript.php 
b/include/lib/message_javascript.php
index 35919e2..560cf06 100644
--- a/include/lib/message_javascript.php
+++ b/include/lib/message_javascript.php
@@ -69,7 +69,7 @@ content[37]="<?php echo _("Les dates sont en format 
DD.MM.YYYY")?>";
 content[38]="<?php echo _("La numérotation est propre à chaque journal. 
Laissez à 0 pour ne pas changer le numéro")?>";
 content[39]="<?php echo _("Le préfixe des pièces doit être différent pour 
chaque journal, on peut aussi utiliser l'année")?>";
 content[40]="<?php echo _("Laissez à 0 pour ne pas changer le numéro")?>";
-content[41]="<?php echo _("Mettez le pourcentage à zéro pour effacer la 
ligne")?>";
+content[41]="<?php echo _("Mettez le pourcentage <br> à zéro pour effacer la 
ligne")?>";
 content[42]="<?php echo _("Selectionnez le plan qui vous intéresse avant de 
cliquer sur Recherche")?>";
 
 </script>
\ No newline at end of file
diff --git a/include/template/anc_key_input.php 
b/include/template/anc_key_input.php
index b1f71cb..87dfe95 100644
--- a/include/template/anc_key_input.php
+++ b/include/template/anc_key_input.php
@@ -62,8 +62,8 @@
                 endfor;
                 ?>
                     <th style="text-align: right">
-                    <?php echo _('Pourcentage'); ?>
                     <?php echo HtmlInput::infobulle(41); ?>
+                    <?php echo _('Pourcentage'); ?>
                 </th>
             </tr>
             <?php



reply via email to

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