phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r436 - in trunk/coprop: . include include/template
Date: Tue, 2 Oct 2012 19:00:50 +0200 (CEST)

Author: danydb
Date: 2012-10-02 19:00:49 +0200 (Tue, 02 Oct 2012)
New Revision: 436

Modified:
   trunk/coprop/coprop-constant.php
   trunk/coprop/include/ajax_mod_key.php
   trunk/coprop/include/class_install_plugin.php
   trunk/coprop/include/key.inc.php
   trunk/coprop/include/template/coprop_lot_list.php
   trunk/coprop/include/template/key_detail.php
   trunk/coprop/index.php
Log:
Add mechanisme for DB patching

Modified: trunk/coprop/coprop-constant.php
===================================================================
--- trunk/coprop/coprop-constant.php    2012-10-02 16:59:44 UTC (rev 435)
+++ trunk/coprop/coprop-constant.php    2012-10-02 17:00:49 UTC (rev 436)
@@ -17,4 +17,5 @@
 $g_copro_parameter=new Copro_Parameter();
 define ("COPRO_MAX_LOT",19);
 define("MAXROWBUD",15);
+define ('COPROP_VERSION',1);
 ?>
\ No newline at end of file

Modified: trunk/coprop/include/ajax_mod_key.php
===================================================================
--- trunk/coprop/include/ajax_mod_key.php       2012-10-02 16:59:44 UTC (rev 
435)
+++ trunk/coprop/include/ajax_mod_key.php       2012-10-02 17:00:49 UTC (rev 
436)
@@ -68,5 +68,6 @@
 echo HtmlInput::hidden('cr_id',$key_id);
 require_once 'template/key_detail.php';
 echo HtmlInput::submit("mod_key","Modifier",' onclick="return confirm (\'Vous 
confirmez?\')"');
+echo HtmlInput::button('rlist','Retour liste',' 
onclick="$(\'key_list\').show();$(\'keydetail_div\').hide()"');
 echo '</form>';
 ?>

Modified: trunk/coprop/include/class_install_plugin.php
===================================================================
--- trunk/coprop/include/class_install_plugin.php       2012-10-02 16:59:44 UTC 
(rev 435)
+++ trunk/coprop/include/class_install_plugin.php       2012-10-02 17:00:49 UTC 
(rev 436)
@@ -155,10 +155,20 @@
        }
        function create_table()
        {
-         
+
               $file=dirname(__FILE__)."/../sql/create_table.sql";
                $this->cn->execute_script($file);
 
        }
+       function upgrade()
+       {
+               global $cn;
+               $version=$cn->get_value('select max(v_id) from coprop.version');
+               for ($i=$version+1;$i<=COPROP_VERSION;$i++)
+               {
+                       $file=dirname(__FILE__)."/../sql/upgrade$i.sql";
+                       $this->cn->execute_script($file);
+               }
+       }
 
 }

Modified: trunk/coprop/include/key.inc.php
===================================================================
--- trunk/coprop/include/key.inc.php    2012-10-02 16:59:44 UTC (rev 435)
+++ trunk/coprop/include/key.inc.php    2012-10-02 17:00:49 UTC (rev 436)
@@ -107,9 +107,10 @@
 endfor;
 ?>
 </table>
- </div>
-<? 
$js=sprintf("add_key('%s','%s','%s')",$gDossier,$_REQUEST['plugin_code'],$_REQUEST['ac']);
+       <? 
$js=sprintf("add_key('%s','%s','%s')",$gDossier,$_REQUEST['plugin_code'],$_REQUEST['ac']);
  echo HtmlInput::button("add_key","Ajout clef","onclick=\"$js\"");
        ?>
+ </div>
 
+
 <div id="keydetail_div"></div>

Modified: trunk/coprop/include/template/coprop_lot_list.php
===================================================================
--- trunk/coprop/include/template/coprop_lot_list.php   2012-10-02 16:59:44 UTC 
(rev 435)
+++ trunk/coprop/include/template/coprop_lot_list.php   2012-10-02 17:00:49 UTC 
(rev 436)
@@ -28,16 +28,16 @@
  */
 $gDossier=Dossier::id();
 ?>
-<h1>Lots affectés</h1>
+<h1 class="title">Lots affectés</h1>
 <? for ( $i=0;$i<count($a_immeuble);$i++):?>
-<h2>Immeuble : 
<?=HtmlInput::card_detail($a_immeuble[$i]['quick_code'],$a_immeuble[$i]['vw_name'],'
 style="display:inline;text-decoration:underline"')?></h2>
+<h2 class="title">Immeuble : 
<?=HtmlInput::card_detail($a_immeuble[$i]['quick_code'],$a_immeuble[$i]['vw_name'],'
 style="display:inline;text-decoration:underline"')?></h2>
 
 <?
 $ret_coprop=$cn->execute("coprop",array($a_immeuble[$i]['f_id']));
 $max_coprop=Database::num_row($ret_coprop);
 if ($max_coprop==0)
 {
-    echo "Pas de copropriétaires pour cet immeuble";
+    echo '<p class="notice">Pas de copropriétaires pour cet immeuble</p>';
     continue;
 }
 ?>
@@ -53,7 +53,7 @@
    $max_lot=Database::num_row($ret_lot);
     if ($max_lot==0)
     {
-        echo "Pas de lot pour ce copropriétaires ";
+        echo '<p class="notice">Pas de lot pour ce copropriétaires </p>';
         continue;
     }
     ?>
@@ -69,7 +69,7 @@
 
 <? endfor; ?>
 
-<h1>Lot sans immeuble ou sans copropriétaires</h1>
+<h1 class="title">Lot sans immeuble ou sans copropriétaires</h1>
 <ul>
 <? for($e=0;$e<count($a_undef_lot);$e++):?>
       <li><?=HtmlInput::card_detail($a_undef_lot[$e]['lot_qcode'],'',' 
style="display:inline;text-decoration:underline"')." 
".h($a_undef_lot[$e]['lot_name']." ".$a_undef_lot[$e]['lot_desc'])?></li>

Modified: trunk/coprop/include/template/key_detail.php
===================================================================
--- trunk/coprop/include/template/key_detail.php        2012-10-02 16:59:44 UTC 
(rev 435)
+++ trunk/coprop/include/template/key_detail.php        2012-10-02 17:00:49 UTC 
(rev 436)
@@ -28,9 +28,10 @@
  */
 ?>
 <div class="content" style="margin-left: 20px">
+       <?=HtmlInput::button('rlist','Retour liste',' 
onclick="$(\'key_list\').show();$(\'keydetail_div\').hide()"')?>
 <h1><?=$str_message?></h1>
-<?=HtmlInput::button('rlist','Retour liste',' 
onclick="$(\'key_list\').show();$(\'keydetail_div\').hide()"')?>
 
+
 <h2> Caractéristique</h2>
 <table>
        <tr>
@@ -131,4 +132,5 @@
 ?>
 
 </p>
+
 </div>
\ No newline at end of file

Modified: trunk/coprop/index.php
===================================================================
--- trunk/coprop/index.php      2012-10-02 16:59:44 UTC (rev 435)
+++ trunk/coprop/index.php      2012-10-02 17:00:49 UTC (rev 436)
@@ -85,7 +85,15 @@
        // Affiche paramètre
     $def=4;
   }
-require_once('coprop-constant.php');
+  require_once('coprop-constant.php');
+  $version=$cn->get_value('select max(v_id) from coprop.version');
+ if ( $version < COPROP_VERSION)
+ {
+          require_once('include/class_install_plugin.php');
+         $iplugin=new Install_Plugin($cn);
+         $iplugin->upgrade();
+ }
+
 // show menu
 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" 
href="http://wiki.phpcompta.eu/doku.php?id=plugin:copropriété"; 
target="_blank">Aide</a>'.
 '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.



---
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]