[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r264 - in trunk/coprop: . include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r264 - in trunk/coprop: . include |
Date: |
Sat, 7 Jan 2012 05:58:40 +0100 (CET) |
Author: danydb
Date: 2012-01-07 05:58:39 +0100 (Sat, 07 Jan 2012)
New Revision: 264
Removed:
trunk/coprop/include/coprop_parameter.php
Modified:
trunk/coprop/coprop-javascript.js
trunk/coprop/include/class_budget.php
trunk/coprop/include/class_install_plugin.php
trunk/coprop/include/copro-parameter.inc.php
trunk/coprop/include/lot.inc.php
trunk/coprop/index.php
Log:
add immeuble, lot, coprop
Modified: trunk/coprop/coprop-javascript.js
===================================================================
--- trunk/coprop/coprop-javascript.js 2012-01-05 22:22:16 UTC (rev 263)
+++ trunk/coprop/coprop-javascript.js 2012-01-07 04:58:39 UTC (rev 264)
@@ -245,4 +245,37 @@
{
alert(e.message);
}
+}
+
+function budget_detail(plugin_code,ac,dossier,bud_id)
+{
+ waiting_box();
+ try
+ {
+ var
queryString="plugin_code="+plugin_code+"&gDossier="+dossier+"&bud_id="+bud_id+'&ac='+ac+"&act=buddisplay";
+ var action=new Ajax.Request ( 'ajax.php',
+ {
+ method:'get',
+ parameters:queryString,
+ onFailure:null,
+ onSuccess:function (response)
+ {
+ try
+ {
+ remove_waiting_box();
+
$('divbuddetail').innerHTML=response.responseText;
+
response.responseText.evalScripts();
+ }
+ catch(e)
+ {
+ alert("Réponse Ajax ="+e.message);
+ }
+ }
+ }
+ );
+ }
+ catch(e)
+ {
+ alert(e.message);
+ }
}
\ No newline at end of file
Modified: trunk/coprop/include/class_budget.php
===================================================================
--- trunk/coprop/include/class_budget.php 2012-01-05 22:22:16 UTC (rev
263)
+++ trunk/coprop/include/class_budget.php 2012-01-07 04:58:39 UTC (rev
264)
@@ -6,7 +6,7 @@
function to_list()
{
global $cn;
-
+
$array=$cn->get_array("select b_id, b_name,
to_char(b_start,'DD.MM.YYYY') as str_start,
to_char(b_end,'DD.MM.YYYY') as str_end,
@@ -14,7 +14,7 @@
from coprop.budget
order by b_name
");
-
+
require_once 'template/budget_list.php';
}
@@ -23,18 +23,18 @@
global $cn;
try
{
-
+
if ( ! isset ($this->b_id)|| trim($this->b_id)=='')
throw new Exception ("Aucun budget demandé");
- $array=$cn->get_array("select
bt_id,bt_amount,f_id,vw_name,quick_code,cr_name,cr_id
+ $array=$cn->get_array("select
bt_id,bt_amount,f_id,vw_name,quick_code,cr_name,cr_id
from coprop.budget_detail
join coprop.clef_repartition using (cr_id)
join vw_fiche_attr using (f_id)
where b_id=$1",array($this->b_id));
$a_input=array();
$fiche_dep=$cn->make_list("select fd_id from fiche_def where
frd_id=2");
- var_dump($fiche_dep);
- $a_key=$cn->make_array(" select cr_id,cr_name from
coprop.clef_repartition order by cr_name");
+
+ $a_key=$cn->make_array(" select cr_id,cr_name from
coprop.clef_repartition order by cr_name");
for ($i=0;$i<count($array);$i++)
{
$card=new ICard('f_id'.$i);
@@ -43,7 +43,7 @@
// name of the field to update with the name of the card
$card->set_attribute('label','w_card_label'.$i);
-
+
// Type of card : deb, cred,
$card->set_attribute('typecard',$fiche_dep);
@@ -71,19 +71,18 @@
$amount=new INum("bt_amount[]");
$amount->value=round($array[$i]['bt_amount'],2);
$hidden=HtmlInput::hidden("bt_id[]",$array[$i]["bt_id"]);
-
+
$ikey=new ISelect("key[]");
$ikey->value=$a_key;
$ikey->selected=$array[$i]['cr_id'];
-
+
$a_input[$i]["amount"]=$amount->input();
$a_input[$i]["hidden"]=$hidden;
$a_input[$i]["card"]=$card->input().$f_card_bt;
$a_input[$i]["card_label"]=$f_card_label;
-
+
$a_input[$i]['key']=$ikey->input();
- var_dump($card);
-
+
}
require_once 'template/bud_detail.php';
}
Modified: trunk/coprop/include/class_install_plugin.php
===================================================================
--- trunk/coprop/include/class_install_plugin.php 2012-01-05 22:22:16 UTC
(rev 263)
+++ trunk/coprop/include/class_install_plugin.php 2012-01-07 04:58:39 UTC
(rev 264)
@@ -66,15 +66,19 @@
$this->cn->exec_sql($sql);
// load default value
$array = array(
- 'categorie_lot' => array(''),
- 'categorie_coprop' => array(''),
- 'poste_appel' => array(''),
- 'journal_appel' => array('0'),
+ 'categorie_lot' => 0,
+ 'categorie_coprop' => 0,
+ 'categorie_immeuble' => 0,
+ 'categorie_appel' => 0,
+ 'poste_appel' => 0,
+ 'journal_appel' => 0,
+ 'id_immeuble'=>9002,
+ 'id_coprop'=>9003
);
foreach ($array as $code => $value)
{
- $this->cn->exec_sql('insert into
coprop.parameter(pr_id,pr_value) values ($1,$2)', array($code, $value[0]));
+ $this->cn->exec_sql('insert into
coprop.parameter(pr_id,pr_value) values ($1,$2)', array($code, $value));
}
}
Modified: trunk/coprop/include/copro-parameter.inc.php
===================================================================
--- trunk/coprop/include/copro-parameter.inc.php 2012-01-05 22:22:16 UTC
(rev 263)
+++ trunk/coprop/include/copro-parameter.inc.php 2012-01-07 04:58:39 UTC
(rev 264)
@@ -37,6 +37,7 @@
$g_copro_parameter->save('categorie_coprop',$_POST['categorie_coprop']);
$g_copro_parameter->save('journal_appel',$_POST['journal_appel']);
$g_copro_parameter->save('categorie_appel',$_POST['categorie_appel']);
+
$g_copro_parameter->save('categorie_immeuble',$_POST['categorie_immeuble']);
}
catch(Exception $e)
{
@@ -65,15 +66,18 @@
$categorie_appel->value=$cn->make_array("select fd_id,fd_label from fiche_def
order by fd_label ");
$categorie_appel->selected=$g_copro_parameter->categorie_appel;
+$categorie_immeuble=new ISelect('categorie_immeuble');
+$categorie_immeuble->value=$cn->make_array("select fd_id,fd_label from
fiche_def order by fd_label ");
+$categorie_immeuble->selected=$g_copro_parameter->categorie_immeuble;
?>
<form method="POST">
<table>
<tr>
<td>
- Catégorie de fiches pour les lots
+ Catégorie de fiches pour les immeubles
</td>
<td>
- <?=$cat_lot->input()?>
+ <?=$categorie_immeuble->input()?>
</td>
</tr>
<tr>
@@ -84,6 +88,14 @@
<?=$cat_coprop->input();?>
</td>
</tr>
+ <tr>
+ <td>
+ Catégorie de fiches pour les lots
+ </td>
+ <td>
+ <?=$cat_lot->input()?>
+ </td>
+ </tr>
<tr>
<td>
Catégorie de fiches pour les appels de fond
Deleted: trunk/coprop/include/coprop_parameter.php
===================================================================
--- trunk/coprop/include/coprop_parameter.php 2012-01-05 22:22:16 UTC (rev
263)
+++ trunk/coprop/include/coprop_parameter.php 2012-01-07 04:58:39 UTC (rev
264)
@@ -1,29 +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
- *
- */
-?>
Modified: trunk/coprop/include/lot.inc.php
===================================================================
--- trunk/coprop/include/lot.inc.php 2012-01-05 22:22:16 UTC (rev 263)
+++ trunk/coprop/include/lot.inc.php 2012-01-07 04:58:39 UTC (rev 264)
@@ -75,41 +75,51 @@
$f_add_button->label=_('Créer une nouvelle fiche');
$f_add_button->set_attribute('ipopup','ipop_newcard');
$f_add_button->set_attribute('jrn',-1);
-$filter=$g_copro_parameter->categorie_lot.",".$g_copro_parameter->categorie_coprop;
+$filter=$g_copro_parameter->categorie_lot.",".$g_copro_parameter->categorie_coprop.",".$g_copro_parameter->categorie_immeuble;
$f_add_button->javascript="
this.filter='$filter';this.jrn=-1;select_card_type(this);";
+
+// liste Immeuble
+
+$sql=" select a.f_id ,
+ (select ad_value from fiche_detail where f_id=a.f_id and ad_id=1) as
building_name,
+ (select ad_value from fiche_detail where f_id=a.f_id and ad_id=23) as
building_qcode
+ from
+ fiche as a
+ where
+ a.fd_id=$1";
+
/*
- * Liste
+ * Liste coprop par immeuble
*/
-$sql=" select distinct
- c_fiche_id,
+$sql=" select f_id,
(select ad_value from fiche_detail where f_id=c_fiche_id and ad_id=1)
as copro_name,
(select ad_value from fiche_detail where f_id=c_fiche_id and ad_id=23)
as copro_qcode
-
+ (select ad_value from fiche_detail where f_id=c_fiche_id and ad_id=10)
as copro_start,
+ (select ad_value from fiche_detail where f_id=c_fiche_id and ad_id=33)
as copro_end
from
- coprop.coproprietaire
+ fiche
+ where
+ fd_id=$1
+ and f_id in ( select f_id from fiche_detail where ad_id=$1 and
ad_value=$2)
";
/**
* @todo ajouter tri
*/
-$a_copro=$cn->get_array($sql);
+$a_copro=$cn->get_array($sql,array($g_copro_parameter->categorie_coprop));
-$sql_lot=$cn->prepare ("lot","select coprop_fk, (select ad_value from
fiche_detail where f_id=l_fiche_id and ad_id=1) as lot_name,
+$sql_lot=$cn->prepare ("lot","select f_id,
+ (select ad_value from fiche_detail where f_id=l_fiche_id and ad_id=1)
as lot_name,
(select ad_value from fiche_detail where f_id=l_fiche_id and ad_id=23)
as lot_qcode,
(select ad_value from fiche_detail where f_id=l_fiche_id and ad_id=9)
as lot_desc
- from coprop.lot where coprop_fk=$1");
+ from fiche where f_id in ( select f_id from fiche_detail where ad_id=$1
and ad_value=$2)
+ and fd_id=$3");
echo $f_add_button->input();
-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 '<div id="divcopropmod"></div>';
+
echo $f_add_button->input();
?>
Modified: trunk/coprop/index.php
===================================================================
--- trunk/coprop/index.php 2012-01-05 22:22:16 UTC (rev 263)
+++ trunk/coprop/index.php 2012-01-07 04:58:39 UTC (rev 264)
@@ -38,7 +38,7 @@
$url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
$array=array (
- array($url.'&sa=lot',_('Lot'),_('Listes des lots et liaison
copro'),1),
+ array($url.'&sa=lot',_('Immeubles,lots et copropriétaires'),_('Listes
des immeubles, copropriétaire et lots '),1),
array($url.'&sa=cle',_('Clef de répartition'),_('Clef de
répartition'),2),
array($url.'&sa=af',_('Appel de fond'),_('Création décompte pour
appel de fond'),3),
array($url.'&sa=bu',_('Budget'),_('budgets'),5),
@@ -70,7 +70,9 @@
if ( $cn->exist_schema('coprop') == false)
{
require_once('include/class_install_plugin.php');
-
+/**
+ * créer fiche immeuble, lot, copropriétaire, ajouter des select dans
catégorie lots pour montrer les copro + immeubles
+ */
$iplugn=new Install_Plugin($cn);
$iplugn->install();
echo_warning(_("L'extension est installée, pourriez-vous en vérifier le
paramètrage ?"));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r264 - in trunk/coprop: . include,
phpcompta-dev <=