phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4879 - in phpcompta/trunk: html html/js include include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4879 - in phpcompta/trunk: html html/js include include/template
Date: Mon, 11 Jun 2012 22:50:44 +0200 (CEST)

Author: danydb
Date: 2012-06-11 22:50:43 +0200 (Mon, 11 Jun 2012)
New Revision: 4879

Added:
   phpcompta/trunk/include/template/document_mod_change.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/include/class_document_type.php
   phpcompta/trunk/include/template/list_category_document.php
Log:
Add #610 Modifier type de document

Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2012-06-09 22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/html/ajax_misc.php  2012-06-11 20:50:43 UTC (rev 4879)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  *   This file is part of PhpCompta.
  *
@@ -128,7 +127,7 @@
 </data>
 EOF;
                break;
-       /* remove a cat of document */
+       /* rem a cat of document */
        case 'rem_cat_doc':
                require_once('class_document_type.php');
                // if user can not return error message
@@ -171,6 +170,9 @@
 EOF;
                return;
                break;
+        case 'mod_cat_doc':
+         require_once 'template/document_mod_change.php';
+         break;
        case 'dsp_tva':
                $cn = new Database($gDossier);
                $Res = $cn->exec_sql("select * from tva_rate order by tva_rate 
desc");

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2012-06-09 22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/html/js/scripts.js  2012-06-11 20:50:43 UTC (rev 4879)
@@ -405,6 +405,33 @@
                  "ajax_misc.php" , {method:'get', 
parameters:queryString,onFailure:ajax_misc_failure,onSuccess:success_cat_doc_remove}
                  );
 }
+/**
+ address@hidden change a document_modele
+ */
+function cat_doc_change(p_dt_id,p_dossier)
+{
+    var queryString="gDossier="+p_dossier+"&op=mod_cat_doc"+"&dt_id="+p_dt_id;
+    var nTop=calcy(posY);
+    var nLeft="200px";
+    var str_style="top:"+nTop+"px;left:"+nLeft+";width:50em;height:auto";
+
+    removeDiv('change_doc_div');
+    waiting_box();
+    var action = new Ajax.Request(
+                                 "ajax_misc.php" , 
+                                 {
+                                     method:'get', parameters:queryString,
+                                     onFailure:ajax_misc_failure,
+                                     onSuccess:function(req){
+                                         remove_waiting_box();
+                                         
add_div({id:'change_doc_div',style:str_style,cssclass:'inner_box',drag:"1"});
+                                         
$('change_doc_div').innerHTML=req.responseText;
+
+                                     }
+                                 }
+                                 );
+}
+
 function success_cat_doc_remove(req)
 {
     try
@@ -1179,6 +1206,10 @@
        return str_style;
 
 }
+/**
+ address@hidden compute Y even if the windows has scrolled down or up
+ address@hidden the correct Y position
+ */
 function calcy(p_sy)
 {
        var sy=p_sy;

Modified: phpcompta/trunk/include/class_document_type.php
===================================================================
--- phpcompta/trunk/include/class_document_type.php     2012-06-09 22:12:42 UTC 
(rev 4878)
+++ phpcompta/trunk/include/class_document_type.php     2012-06-11 20:50:43 UTC 
(rev 4879)
@@ -64,13 +64,21 @@
             $tmp['dt_prefix']=$r[$i]['dt_prefix'];
 
             $bt=new IButton('X'.$r[$i]['dt_id']);
+            $bt->label=_('Modifier');
+            
$bt->javascript="cat_doc_change('".$r[$i]['dt_id']."','".Dossier::id()."');";
+
+            $tmp['js_mod']=$bt->input();
+            $tmp['dt_id']=$r[$i]['dt_id'];
+
+            $bt=new IButton('X'.$r[$i]['dt_id']);
             $bt->label=_('Effacer');
             $bt->javascript="if (confirm('"._('Vous confirmez')."')==true) {";
             
$bt->javascript.="cat_doc_remove('".$r[$i]['dt_id']."','".Dossier::id()."');";
             $bt->javascript.='}';
+ 
+            $tmp['js_remove']=$bt->input();
 
-            $tmp['js_remove']=$bt->input();
-            $tmp['dt_id']=$r[$i]['dt_id'];
+
             $array[$i]=$tmp;
         }
         return $array;

Added: phpcompta/trunk/include/template/document_mod_change.php
===================================================================
--- phpcompta/trunk/include/template/document_mod_change.php                    
        (rev 0)
+++ phpcompta/trunk/include/template/document_mod_change.php    2012-06-11 
20:50:43 UTC (rev 4879)
@@ -0,0 +1,53 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright Author Dany De Bontridder address@hidden
+
+/* !\file
+ * \brief this file respond to an ajax request to modify a type of document
+ */
+require_once 'class_document_type.php';
+echo HtmlInput::title_box(_('Type de document'),'change_doc_div');
+?>
+<form method="GET" id="cat_doc_f" 
onsubmit="cat_doc_change_record('cat_doc_f');">
+<table>
+<tr>
+  <td> <?=_('Nom')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+<tr>
+  <td><?=_('Préfixe')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+<tr>
+  <td><?=_('Prochain numéro')?>
+  </td>
+  <td>
+  </td>
+</tr>
+
+</table>
+
+  <? echo HtmlInput::submit("save",_('Sauver'));?>
+</form>
\ No newline at end of file

Modified: phpcompta/trunk/include/template/list_category_document.php
===================================================================
--- phpcompta/trunk/include/template/list_category_document.php 2012-06-09 
22:12:42 UTC (rev 4878)
+++ phpcompta/trunk/include/template/list_category_document.php 2012-06-11 
20:50:43 UTC (rev 4879)
@@ -15,8 +15,13 @@
 <?=h($row['dt_prefix']);?>
 </td>
 <td>
+<?=$row['js_mod'];?>
+</td>
+<td>
 <?=$row['js_remove'];?>
 </td>
+
+
 </tr>
 <?
 endfor;



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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