noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 252/323: PLANANC : fix bug when creating firs


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 252/323: PLANANC : fix bug when creating first plan
Date: Wed, 14 Mar 2018 17:39:00 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 87f6fe7cf250475bc4eff2d511af78f8d378c485
Author: Dany De Bontridder <address@hidden>
Date:   Sat Feb 24 13:40:42 2018 +0100

    PLANANC : fix bug when creating first plan
---
 include/anc_pa.inc.php           | 16 ++++++++++------
 include/class/anc_plan.class.php | 17 +++++++++++++++++
 2 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php
index d721e64..a5461e0 100644
--- a/include/anc_pa.inc.php
+++ b/include/anc_pa.inc.php
@@ -52,7 +52,7 @@ if ($sa=="add_pa")
         $ret.=HtmlInput::title_box(_('Nouveau plan'), 'anc_div_add', 'hide');
         $ret.= '<form method="post">';
         $ret.=dossier::hidden();
-        $ret.= $new->form();
+        $ret.= $new->form_new();
         $ret.= HtmlInput::hidden("sa", "pa_write");
         $ret.=HtmlInput::submit("submit", _("Enregistre"));
         $ret.=HtmlInput::button_hide("anc_div_add");
@@ -111,11 +111,12 @@ if ($sa=="pa_delete")
     $delete->delete();
     $sa="anc_menu";
 }
-
-// show the detail
+//--------------------------------------------------------------------------------------------------
+// show the detail of an analytic axis (=plan)
+// 
+//--------------------------------------------------------------------------------------------------
 if ($sa=="pa_detail")
 {
-    
     $pa_id=$http->get("pa_id","number");
     
     $new=new Anc_Plan($cn, $pa_id);
@@ -127,9 +128,11 @@ if ($sa=="pa_detail")
 
     $ret.= $new->form();
     $ret.= $wSa;
+    $ret.="<p>";
     $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.="</p>";
     //---------------------------------------------------------------------
     //  Detail now
     // Use Manage_Table
@@ -145,6 +148,7 @@ if ($sa=="pa_detail")
     $accounting->set_callback("ajax_misc.php");
     $accounting->add_json_param("op", "anc_accounting");
     $accounting->add_json_param("pa_id", $pa_id);
+    $accounting->set_sort_column("po_name");
     ob_start();
     $accounting->display_table(" where pa_id = $1 order by po_name 
",array($pa_id));
     $accounting->create_js_script();
@@ -170,8 +174,8 @@ if ($sa=='anc_menu')
         $url=http_build_query(array("sa"=>"add_pa","ac"=>$ac,
                 "gDossier"=>Dossier::id()));
         echo '<div class="content">';
-        echo '<TABLE>';
-        echo '<TR><TD class="vert_mtitle">';
+        echo '<TABLE class="vert_mtitle">';
+        echo '<TR><TD class="first">';
         echo '<a href="?'.$url.'">'._("Ajout d'un plan comptable").'</a>';
         echo '</TD></TR>';
         echo '</TABLE>';
diff --git a/include/class/anc_plan.class.php b/include/class/anc_plan.class.php
index f7ee135..b55e8a9 100644
--- a/include/class/anc_plan.class.php
+++ b/include/class/anc_plan.class.php
@@ -140,6 +140,23 @@ class Anc_Plan
         $ret.=$wId->input();
         return $ret;
     }
+    /**
+     * @brief add a new plan
+     */
+    function form_new()
+    {
+        $wName=new IText("pa_name");
+        $wDescription=new IText("pa_description");
+        $wDescription->size=80;
+        
+        $ret="<TABLE>";
+        $ret.='<tr>'.td(_('Nom')).'<td>'.$wName->input().'</td>'.'</tr>';
+        
$ret.="<tr>".td(_('Description')).'<td>'.$wDescription->input().'</td>'."</tr>";
+        $ret.="</table>";
+        return $ret;
+
+        
+    }
     function isAppend()
     {
         $count=$this->db->get_value("select count(pa_id) from 
plan_analytique");



reply via email to

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