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 importing card
25  */
27 $g_dir_importbank =dirname(__FILE__);
28 /*
29  * load javascript
30  */
31 require_once $g_dir_importbank.'/include/class_import_bank.php';
32 require_once NOALYSS_INCLUDE.'/lib/class_html_table.php';
33 require_once $g_dir_importbank.'/bank_constant.php';
34 
35 global $version_plugin;
36 $version_plugin=SVNINFO;
37 Extension::check_version(6910);
38 global $cn;
39 echo '<div style="float:right"><a class="mtitle" style="font-size:140%" href="http://wiki.noalyss.eu/doku.php?id=importation_de_banque" target="_blank">Aide</a>'.
40 '<span style="font-size:0.8em;color:red;display:inline">vers:SVNINFO</span>'.
41 '</div>';
42 $cn=Dossier::connect();
43 
44 ob_start();
45 require_once('bank_js.js');
46 $j=ob_get_contents();
47 ob_end_clean();
48 echo create_script($j);
49 
50 /*
51  * Menu
52  */
53 global $cn;
54 
55 $url='?'.dossier::get().'&plugin_code='.$_REQUEST['plugin_code']."&ac=".$_REQUEST['ac'];
56 
57 $array=array (
58  array($url.'&sa=import',_('Importation'),_('Importation de nouveaux fichiers'),1),
59  array($url.'&sa=purge',_('Liste Import '),_('Historique des imports effectués'),5)
60  );
61 
62 $sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:1;
63 switch($sa)
64  {
65  case 'import':
66  $default=1;
67  break;
68  case 'reconc':
69  $default=2;
70  break;
71  case 'transfer':
72  $default=3;
73  break;
74  case 'purge':
75  $default=5;
76  break;
77  default:
78  $default=0;
79  }
80 echo ShowItem($array,'H','mtitle','mtitle',$default,' style="width:80%;margin-left:10%"');
81 if ($cn->exist_schema('importbank') == false)
82  {
83  require_once('include/class_install_plugin.php');
84 
85  $iplugn=new Install_Plugin($cn);
86  $iplugn->install();
87 
88  }
89  if ( $cn->get_value("select count(*) from importbank.version") == 0 ) {
90  $cn->execute_script($g_dir_importbank."/sql/upgrade1.sql");
91  }
92 
93 /*
94  *Menu : import bank, reconciliation operation, purge temporary table
95  */
96 if ( ! isset($_REQUEST['sa']))
97  {
98  require_once($g_dir_importbank.'/include/import_bank.php');
99  exit();
100  }
101 /*
102  * Import file
103  */
104 if ( $_REQUEST['sa']=='import')
105  {
106  require_once($g_dir_importbank.'/include/import_bank.php');
107  exit();
108  }
109 
110 if($_REQUEST['sa'] == 'reconc')
111  {
112  Import_Bank::reconciliation();
113  }
114 
115 
116 if($_REQUEST['sa'] == 'purge')
117  {
118  echo '<div class="content" style="width:80%;margin-left:10%">';
119  $action_form=HtmlInput::default_value_request("form_action", "");
120  $action_form2=HtmlInput::default_value_request("form_action2", "");
121  if (isset($_REQUEST['delete']))
122  {
124  }
125  if ($action_form == 'delete_record' || $action_form2 == 'delete_record')
126  {
128  }
129  if ($action_form == "transfer_record" || $action_form2 == "transfer_record")
130  {
132  }
133  //////////////////////////////////////////////////
134  // Group action
135  //////////////////////////////////////////////////
136  if ($action_form == "selected_record" || $action_form2 == "selected_record")
137  {
139  }
140  /////////////////////////////////////////////////
141  // Reconcile auto
142  ////////////////////////////////////////////////
143  if ($action_form == "reconcile_auto" || $action_form2 == "reconcile_auto")
144  {
145  $id=HtmlInput::default_value_request("id", 0);
146  if ( $id == 0 || isNumber($id)==0) {
147  throw new Exception(_("Donnée invalide"));
148  }
150  }
151  /*
152  * Show all the import
153  */
154  if ( ! isset($_REQUEST['sb']))
155  {
157  exit();
158  }
159  if ($_REQUEST['sb'] == 'list')
160  {
161  // Perform other info
163  exit();
164  }
165 
166  }
static transfer_record($p_array)
import row marked to transfer and from the specific import to the database
static delete($p_array)
Delete all the selected import.
global $version_plugin
Definition: index.php:22
$_REQUEST['sa']
Definition: index.php:68
static list_record($p_id)
Show detail of a imported file $p_id is import.id.
$cn
Definition: index.php:42
$sa
Definition: index.php:67
static selected_action()
Do the same operation for all the selected records , the parameters are found in $_REQUEST.
global $g_dir_importbank
Definition: index.php:26
static delete_record($p_array)
delete the record marked as deleted
static show_import()
show the different import
static reconcile_auto($p_id, $all=true)
Try to find the concerned operation, fill the table suggest_bank.
$j
Definition: index.php:36
$array
Definition: index.php:42
$url
Definition: index.php:40