Plugins  LAST
 All Data Structures Files Functions Variables Pages
index.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 
23 /*!\file
24  * \brief main file for tva
25  */
26 
27 /*
28  * load javascript
29  */
30 
31 require_once NOALYSS_INCLUDE.'/class/class_acc_ledger.php';
32 global $version_plugin;
33 $version_plugin=SVNINFO;
34 Extension::check_version(6913);
35 ob_start();
36 require_once('coprop-javascript.js');
37 $j=ob_get_contents();
38 ob_end_clean();
39 echo create_script($j);
40 
41 $url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code'].'&ac='.$_REQUEST['ac'];
42 $array=array (
43  array($url.'&sa=lot',_('Immeubles,lots et copropriétaires'),_('Listes des immeubles, copropriétaire et lots '),1),
44  array($url.'&sa=cle',_('Clef de répartition'),_('Clef de répartition'),2),
45  array($url.'&sa=af',_('Appel de fond'),_('Création décompte pour appel de fond'),3),
46  array($url.'&sa=bu',_('Budget'),_('budgets'),5),
47  array($url.'&sa=hs',_('Historique'),_('Historique des appels'),6),
48  array($url.'&sa=pa',_('Paramètre'),_('Configuration et paramètre'),4)
49  );
50 
51 $sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:0;
52 $def=0;
53 switch($sa)
54  {
55  case 'lot':
56  $def=1;
57  break;
58  case 'cle':
59  $def=2;
60  break;
61  case 'af':
62  $def=3;
63  break;
64  case 'pa':
65  $def=4;
66  break;
67  case 'bu':
68  $def=5;
69  break;
70  case 'hs':
71  $def=6;
72  break;
73  }
74 
75 $cn=Dossier::connect();
76 if ( $cn->exist_schema('coprop') == false)
77  {
78  require_once('include/class_install_plugin.php');
79 /**
80  * créer fiche immeuble, lot, copropriétaire, ajouter des select dans catégorie lots pour montrer les copro + immeubles
81  */
82  $iplugn=new Install_Plugin($cn);
83  $iplugn->install();
84  echo_warning(_("L'extension est installée, pourriez-vous en vérifier le paramètrage ?"));
85  // Affiche paramètre
86  $def=4;
87  }
88  require_once('coprop-constant.php');
89  $version=$cn->get_value('select max(v_id) from coprop.version');
90  if ( $version < COPROP_VERSION)
91  {
92  require_once('include/class_install_plugin.php');
93  $iplugin=new Install_Plugin($cn);
94  $iplugin->upgrade();
95  }
96 
97 // show menu
98 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=plugin:copropriété" target="_blank">Aide</a>'.
99 '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
100 '</div>';
101 echo '<div class="topmenu">';
102 echo ShowItem($array,'H','mtitle','mtitle',$def,' style="width:98%" class="mtitle"');
103 echo '</div>';
104 
105 // include the right file
106 /*
107  * Lot
108  */
109 if ($def==1)
110  {
111  require_once('include/lot.inc.php');
112  exit();
113  }
114 
115 /*
116  * Paramètre
117  */
118 if ($def==4)
119  {
120  require_once('include/copro-parameter.inc.php');
121  exit();
122  }
123 /*
124  * Clef
125  */
126 if ($def==2)
127  {
128  require_once('include/key.inc.php');
129  exit();
130  }
131 /*
132  * Appel de fond
133  */
134 if ($def==3)
135  {
136  require_once('include/appel_fond.inc.php');
137  exit();
138  }
139 if ($def==5)
140  {
141  require_once('include/budget.inc.php');
142  exit();
143  }
144 if ($def==6)
145  {
146  require_once('include/historic.inc.php');
147  exit();
148  }
149 
150 ?>
global $version_plugin
Definition: index.php:22
$_REQUEST['sa']
Definition: index.php:68
const COPROP_VERSION
$cn
Definition: index.php:42
$sa
Definition: index.php:67
$version
Definition: index.php:89
$def
Definition: index.php:69
$j
Definition: index.php:36
$array
Definition: index.php:42
$url
Definition: index.php:40