phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r213 - in trunk/coprop: . include include/template


From: phpcompta-dev
Subject: [Phpcompta-dev] r213 - in trunk/coprop: . include include/template
Date: Tue, 20 Dec 2011 23:13:11 +0100 (CET)

Author: danydb
Date: 2011-12-20 23:13:09 +0100 (Tue, 20 Dec 2011)
New Revision: 213

Added:
   trunk/coprop/include/class_copro_lot.php
   trunk/coprop/include/template/coprop_lot_add.php
   trunk/coprop/include/template/coprop_lot_list.php
Removed:
   trunk/coprop/include/template/list_copro_lot.php
Modified:
   trunk/coprop/ajax.php
   trunk/coprop/coprop-javascript.js
   trunk/coprop/include/lot.inc.php
Log:

Copro

Modified: trunk/coprop/ajax.php
===================================================================
--- trunk/coprop/ajax.php       2011-12-18 20:27:11 UTC (rev 212)
+++ trunk/coprop/ajax.php       2011-12-20 22:13:09 UTC (rev 213)
@@ -7,9 +7,10 @@
 $html='';$extra='';$ctl='';
 ob_start();
 switch($act) {
-case 'dsp_decl':
+       // ajout un lien copro + lot
+case 'addcopro':
   /* the hide button */
-  require_once('include/ajax_dsp.php');
+  require_once('include/ajax_add_copro_lot.php');
   break;
 default:
 

Modified: trunk/coprop/coprop-javascript.js
===================================================================
--- trunk/coprop/coprop-javascript.js   2011-12-18 20:27:11 UTC (rev 212)
+++ trunk/coprop/coprop-javascript.js   2011-12-20 22:13:09 UTC (rev 213)
@@ -23,13 +23,27 @@
 {
        try
        {
-               alert('Modifier un copropriétaire et ses lots');
+               $('listcoprolot').hide();
+               $('ajoutcopro').show();
        }
        catch(e)
        {
                alert(e.message);
        }
 }
+function copro_show_list()
+{
+       try
+       {
+               $('listcoprolot').show();
+               $('ajoutcopro').hide();
+       }
+       catch(e)
+       {
+               alert(e.message);
+       }
+
+}
 /**
  * Ajout clef + tantième lot associés
  */

Added: trunk/coprop/include/class_copro_lot.php
===================================================================
--- trunk/coprop/include/class_copro_lot.php                            (rev 0)
+++ trunk/coprop/include/class_copro_lot.php    2011-12-20 22:13:09 UTC (rev 
213)
@@ -0,0 +1,36 @@
+<?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
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief gère la liaison entre lots et copropriétaire
+ *
+ */
+class Copro_List
+{
+       function insert($p_array)
+       {
+               
+       }
+}
+?>

Modified: trunk/coprop/include/lot.inc.php
===================================================================
--- trunk/coprop/include/lot.inc.php    2011-12-18 20:27:11 UTC (rev 212)
+++ trunk/coprop/include/lot.inc.php    2011-12-20 22:13:09 UTC (rev 213)
@@ -27,6 +27,19 @@
  *
  */
 global $cn,$g_copro_parameter;
+if ( isset($_POST['copro_new']))
+{
+       var_dump($_POST);
+       $cp=new Copro_List();
+       try
+       {
+               $cp->insert($_POST);
+       }
+       catch(Exception $e)
+       {
+               echo $e->getTraceAsString();
+       }
+}
 //require_once 'include/class_coprop-lot_coprop.php';
 /* Add button */
 $f_add_button=new IButton('add_card');
@@ -56,11 +69,14 @@
        (select ad_value from fiche_detail where f_id=jcl_lot and ad_id=23) as 
lot_qcode from coprop.jnt_coprop_lot where jcl_id=$1");
 
 echo $f_add_button->input();
-require_once 'template/list_copro_lot.php';
+echo '<div class="content" id="listcoprolot">';
+require_once 'template/coprop_lot_list.php';
+echo '</div>';
+
+echo '<div class="content" id="ajoutcopro" style="display:none">';
+require_once('template/coprop_lot_add.php');
+
+echo '</div>';
 echo $f_add_button->input();
-/**
- * @todo
- * Bouton pour ajouter une fiche de lot ou copro (comme dans menu ach/ven...)
- */
 
 ?>

Added: trunk/coprop/include/template/coprop_lot_add.php
===================================================================
--- trunk/coprop/include/template/coprop_lot_add.php                            
(rev 0)
+++ trunk/coprop/include/template/coprop_lot_add.php    2011-12-20 22:13:09 UTC 
(rev 213)
@@ -0,0 +1,127 @@
+<?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
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief ajout lien entre copro et lot
+ *
+ */
+  $copro=new ICard();
+  $copro->label="Copropriétaire : ".HtmlInput::infobulle(0) ;
+  $copro->name="w_copro";
+  $copro->tabindex=1;
+  $copro->value="";
+  $copro->table=0;
+
+ // name of the field to update with the name of the card
+  $copro->set_attribute('label','w_copro_label');
+  // Type of card : deb, cred,
+  $copro->set_attribute('typecard',$g_copro_parameter->categorie_coprop);
+
+  $copro->extra=$g_copro_parameter->categorie_coprop;
+
+// Add the callback function to filter the card on the jrn
+  $copro->set_callback('filter_card');
+  $copro->set_attribute('ipopup','ipopcard');
+// when value selected in the autcomplete
+  $copro->set_function('fill_data');
+
+// when the data change
+  $copro->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
+            $copro->name);
+  $copro->set_dblclick("fill_ipopcard(this);");
+
+  $copro_label=new ISpan();
+  $copro_label->table=0;
+  $f_copro=$copro_label->input("w_copro_label","");
+
+// Search button for card
+  $f_copro_bt=$copro->search();
+
+
+echo '<form method="post" onsubmit="return confirm(\'Vous validez ?\')">';
+echo h2("Affectation de lot à un copropriétaire",'class="info"');
+echo "Copropriétaire ".$copro->input();
+echo $f_copro_bt;
+echo $f_copro;
+echo HtmlInput::hidden('p_jrn',$g_copro_parameter->journal_appel);
+echo HtmlInput::hidden('ledger_type','ODS');
+?>
+<table>
+       <tr>
+               <th>Lot</th>
+               <th>Pourcentage</th>
+       </tr>
+<?
+for ($i=0;$i<20;$i++):
+       $lot=new ICard();
+  $lot->label="Lot : ".HtmlInput::infobulle(0) ;
+  $lot->name="w_lot".$i;
+  $lot->tabindex=1;
+  $lot->value="";
+  $lot->table=0;
+
+ // name of the field to update with the name of the card
+  $lot->set_attribute('label','w_lot_label'.$i);
+  // Type of card : deb, cred,
+  $lot->set_attribute('typecard',$g_copro_parameter->categorie_lot);
+
+  $lot->extra=$g_copro_parameter->categorie_lot;
+
+// Add the callback function to filter the card on the jrn
+  $lot->set_callback('filter_card');
+  $lot->set_attribute('ipopup','ipopcard');
+// when value selected in the autcomplete
+  $lot->set_function('fill_data');
+
+// when the data change
+  $lot->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
+            $lot->name);
+  $lot->set_dblclick("fill_ipopcard(this);");
+
+  $lot_label=new ISpan();
+  $lot_label->table=0;
+  $f_lot=$lot_label->input("w_lot_label".$i,"");
+
+// Search button for card
+  $f_lot_bt=$lot->search();
+  $num=new INum("lot_per".$i);
+?>
+<tr>
+       <td>
+       <?=$f_lot_bt?>
+       <?=$lot->input()?>
+       </td>
+       <td>
+               <?=$num->input()?>
+       </td>
+       <td>
+
+               <?=$f_lot?>
+       </td>
+</tr>
+<? endfor;?>
+</table>
+<? echo HtmlInput::submit('copro_new','Sauver');?>
+<? echo HtmlInput::button("add_link","Retour à la liste sans sauver 
","onclick=\"copro_show_list()\"");?>
+</form>

Added: trunk/coprop/include/template/coprop_lot_list.php
===================================================================
--- trunk/coprop/include/template/coprop_lot_list.php                           
(rev 0)
+++ trunk/coprop/include/template/coprop_lot_list.php   2011-12-20 22:13:09 UTC 
(rev 213)
@@ -0,0 +1,67 @@
+<?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
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief show list between lot et copropriétaire
+ *
+ */
+$gDossier=Dossier::id();
+?>
+<table class="result">
+       <tr>
+               <th> Nom copropriétaire </th>
+               <th>
+                       Lot(s)
+               </th>
+       </tr>
+<?
+for ($i=0;$i<count($a_copro);$i++):
+       
$col_copro=HtmlInput::anchor($a_copro[$i]['copro_name'],"","mod_coprop($gDossier,'".$a_copro[$i]['jcl_copro']."','".$_REQUEST['plugin_code']."'");
+?>
+       <tr>
+               <td><?=col_copro?></td>
+       </tr>
+       <td>
+               <?
+                       $rlot=$cn->execute('lot',$a_copro[$i]['jcl_id']);
+                       $max=Database::num_row($rlot);
+                       $sp="";
+                       for ($e=0;$e<$max;$e++):
+                               $row=Database::fetch_array($rlot,$e);
+                               
$js_lot=HtmlInput::card_detail($row['lot_qcode'],$row['lot_name']);
+                               echo $js_lot.$sp;
+                               $sp=" , ";
+                       endfor;
+               ?>
+
+       </td>
+</tr>
+<?
+endfor;
+?>
+
+</table>
+<?
+echo HtmlInput::button("add_link","Ajout Copropriétaire / lot 
","onclick=\"add_coprop()\"");
+?>
\ No newline at end of file

Deleted: trunk/coprop/include/template/list_copro_lot.php
===================================================================
--- trunk/coprop/include/template/list_copro_lot.php    2011-12-18 20:27:11 UTC 
(rev 212)
+++ trunk/coprop/include/template/list_copro_lot.php    2011-12-20 22:13:09 UTC 
(rev 213)
@@ -1,67 +0,0 @@
-<?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
- */
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/**
- * @file
- * @brief show list between lot et copropriétaire
- *
- */
-$gDossier=Dossier::id();
-?>
-<table class="result">
-       <tr>
-               <th> Nom copropriétaire </th>
-               <th>
-                       Lot(s)
-               </th>
-       </tr>
-<?
-for ($i=0;$i<count($a_copro);$i++):
-       
$col_copro=HtmlInput::anchor($a_copro[$i]['copro_name'],"","mod_coprop($gDossier,'".$a_copro[$i]['jcl_copro']."','".$_REQUEST['plugin_code']."'");
-?>
-       <tr>
-               <td><?=col_copro?></td>
-       </tr>
-       <td>
-               <?
-                       $rlot=$cn->execute('lot',$a_copro[$i]['jcl_id']);
-                       $max=Database::num_row($rlot);
-                       $sp="";
-                       for ($e=0;$e<$max;$e++):
-                               $row=Database::fetch_array($rlot,$e);
-                               
$js_lot=HtmlInput::card_detail($row['lot_qcode'],$row['lot_name']);
-                               echo $js_lot.$sp;
-                               $sp=" , ";
-                       endfor;
-               ?>
-
-       </td>
-</tr>
-<?
-endfor;
-?>
-
-</table>
-<?
-echo HtmlInput::button("add_link","Ajout Copropriétaire / lot 
","onclick=\"add_coprop('$gDossier')\"");
-?>
\ No newline at end of file




reply via email to

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