noalyss  Version-9
upgrade.inc.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS isfree 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 isdistributed 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 // Copyright (2014) Author Dany De Bontridder <dany@alchimerys.be>
20 /**
21  * @file
22  * @brief Upgrade all the database : the central repository , the templates and
23  * the folder
24  * @param $rep db connection to central repository
25  */
26 if (!defined('ALLOWED')) die('Appel direct ne sont pas permis');
27 if ( ! defined ('ALLOWED_ADMIN')) { die (_('Non autorisé'));}
28 
30 
31 $menu=array(
32  ["?action=upgrade&sb=database", _("Base de données"), _("Met à jour toutes les dossiers et modèles"), 'database'],
33  ["?action=upgrade&sb=application", _("Application"), _("Installe la dernière version de Noalyss"), 'application'],
34  ["?action=upgrade&sb=plugin", _("Extension"), _("Installe ou met à jour les extensions"), "plugin"],
35  ["?action=upgrade&sb=template", _("Modèle"), _("Installe des modèles"), "template"]
36 );
37 $sb=$http->request("sb", "string", "application");
38 echo '<div class="">';
39 echo ShowItem($menu, "H", "nav-item", "nav-link", $sb,"nav nav-pills nav-level2");
40 echo '</div>';
41 
42 $sc=$http->get("sc", "string", "none");
43 
44 //-----------------------------------------------------------------------------
45 // Upgrade Databases (Folder, Template , Account )
46 //-----------------------------------------------------------------------------
47 if ($sb=="database")
48 {
49  ?>
50 <p>
51 
52 <?php
53 echo _("Mettez vos bases de données à jour pour qu'elles correspondent à cette version de Noalyss");
54 ?>
55 </p>
56  <form method="get" id="frm_upg_all" onsubmit="return confirm_box('frm_upg_all', '<?php echo _('Confirmez') ?>')">
57  <input type="hidden" name="sb" value="database">
58  <input type="hidden" name="sc" value="upg_all">
59  <input type="hidden" name="action" value="upgrade">
60  <input type="submit" class="button" name="submit_upg_all" id="submit_upg_all" value="<?php echo _('Tout mettre à jour') ?>">
61  </form>
62 
63  <?php
64  if ($sc==="upg_all"&&(!defined('MULTI')||(defined('MULTI')&&MULTI==1)))
65  {
66  echo '<div class="content">';
67 
69 
70  echo '</div>';
71  return;
72  }
73 }
74 // Import the file with the package
75 //------------------------------------------------------------------------------
76 // Upgrade Main application, show all the info from the NOALYSS_PACKAGE site
77 //------------------------------------------------------------------------------
78 if ($sb=="application")
79 {
80  require NOALYSS_INCLUDE."/upgrade-core.php";
81 }
82 //------------------------------------------------------------------------------
83 // Install or Upgrade Extension, show all the info from the NOALYSS_PACKAGE site
84 //------------------------------------------------------------------------------
85 if ($sb=="plugin")
86 {
87  require NOALYSS_INCLUDE."/upgrade-plugin.php";
88 
89 }
90 //-------------------------------------------------------------------------------------------------------------------------------
91 // Install template
92 //-------------------------------------------------------------------------------------------------------------------------------
93 if ( $sb == 'template')
94 {
95  require NOALYSS_INCLUDE."/upgrade-template.php";
96 
97 }
98 
99 ?>
$menu
$menu
Definition: upgrade.inc.php:31
HttpInput
manage the http input (get , post, request) and extract from an array
Definition: http_input.class.php:37
p
p($p_string)
Definition: ac_common.php:39
ShowItem
ShowItem($p_array, $p_dir='V', $class="nav-item", $class_ref="nav-link", $default="", $p_extra="nav nav-pills nav-fill")
store the string which print the content of p_array in a table used to display the menu
Definition: ac_common.php:528
$http
if(! defined('ALLOWED_ADMIN')) $http
Definition: upgrade.inc.php:29
Dossier\upgrade
static upgrade()
Upgrade check if the folder ACCOUNT_REPOSITORY needs to be upgrade thanks the variable DBVERSIONREPO ...
Definition: dossier.class.php:338
name
$from_poste name
Definition: balance.inc.php:159
$sb
$sb
Definition: upgrade.inc.php:37
type
$input_from type
Definition: balance.inc.php:65
$sc
$sc
Definition: upgrade.inc.php:42
value
$q value
Definition: ajax_add_concerned_card.php:59