'._("Votre base de données n'est pas à jour").' ';
$a=_("cliquez ici pour appliquer le patch");
- $base = dirname($_SERVER['REQUEST_URI']);
- if ($base == '/') { $base = ''; }
- $base .= '/admin-noalyss.php';
+ $base =NOALYSS_URL.'/admin-noalyss.php';
echo ''.$a.'
';
}
if ( $User->Admin() == 1)
{
- if (SITE_UPDATE !="") {
- $update=@file_get_contents(SITE_UPDATE);
+ if (SITE_UPDATE !="") {
+ $update=@file_get_contents(SITE_UPDATE);
if ($update > $version_noalyss ) {
- echo '
';
- echo '
';
- printf ( "Mise à jour disponible de NOALYSS version actuelle : %s votre version %s ",$update,$version_noalyss);
- echo '
";
+ echo _('Base de données')." ".$name;
+ if ($rep->exist_database($name)>0)
+ {
+ $db=new Database($db_row['mod_id'], 'mod');
+ $db->apply_patch($db_row['mod_name']);
+ $db->clean_orphan_lob();
+ }
+ else
+ {
+ echo_warning(_("Modèle inexistant")." $name");
+ }
+ }
+ }
+
}
diff --git a/include/class/extension.class.php b/include/class/extension.class.php
index 781318938..86e29a814 100644
--- a/include/class/extension.class.php
+++ b/include/class/extension.class.php
@@ -1,4 +1,5 @@
me_code)=="") throw new Exception('Le code ne peut pas être vide');
- if (trim($this->me_menu)=="") throw new Exception('Le nom ne peut pas être vide');
- if (trim($this->me_file)=="") throw new Exception('Chemin incorrect');
- if (file_exists(NOALYSS_PLUGIN.'/'.$this->me_file) == false)
- throw new Exception ('Extension non trouvée, le chemin est-il correct?');
+ if (trim($this->me_code)=="")
+ throw new Exception('Le code ne peut pas être vide');
+ if (trim($this->me_menu)=="")
+ throw new Exception('Le nom ne peut pas être vide');
+ if (trim($this->me_file)=="")
+ throw new Exception('Chemin incorrect');
+ if (file_exists(NOALYSS_PLUGIN.'/'.$this->me_file)==false)
+ throw new Exception('Extension non trouvée, le chemin est-il correct?');
}
- /*!@brief search a extension, the what is the column (extends_code */
+
+ /* !@brief search a extension, the what is the column (extends_code */
+
function search($p_what)
{
- $this->me_code=strtoupper($p_what);
- if ( $this->load() == -1) return null;
- return 1;
+ $this->me_code=strtoupper($p_what);
+ if ($this->load()==-1)
+ return null;
+ return 1;
}
- /*!\brief return 1 if the user given in parameter can access this extension
+
+ /* !\brief return 1 if the user given in parameter can access this extension
* otherwise returns 0
- *\param $p_login the user login
- *\return 1 has access, 0 has no access
+ * \param $p_login the user login
+ * \return 1 has access, 0 has no access
*/
+
function can_request($p_login)
{
- $cnt=$this->cn->get_value("select count(*) from menu_ref
- join profile_menu using (me_code)
- join profile_user using (p_id)
- where
- me_code=$1
- and user_name=$2",
- array($this->me_code,$p_login));
- if ( $cnt > 0) return 1;
- return 0;
+ $cnt=$this->cn->get_value("select count(*) from menu_ref
+ join profile_menu using (me_code)
+ join profile_user using (p_id)
+ where
+ me_code=$1
+ and user_name=$2", array($this->me_code, $p_login));
+ if ($cnt>0)
+ return 1;
+ return 0;
}
- /*!@brief make an array of the available plugin for the current user
+
+ /* !@brief make an array of the available plugin for the current user
* @return an array
- *@see ISelect
+ * @see ISelect
*/
+
static function make_array($cn)
{
$sql="select DISTINCT me_code as value, me_menu as label from ".
- " menu_ref join profile_menu using (me_code)
+ " menu_ref join profile_menu using (me_code)
join profile_user using (p_id) where ".
- " user_name=$1 and me_type='PL' ORDER BY ME_MENU";
- $a=$cn->get_array($sql,array($_SESSION['g_user']));
+ " user_name=$1 and me_type='PL' ORDER BY ME_MENU";
+ $a=$cn->get_array($sql, array($_SESSION['g_user']));
return $a;
}
+
static function check_version($i)
{
global $version_noalyss;
- if ( ! isset ($version_noalyss) || $version_noalyss < $i )
+ if (!isset($version_noalyss)||$version_noalyss<$i)
{
alert(_('Cette extension ne fonctionne pas sur cette version de NOALYSS'.
- ' Veuillez mettre votre programme a jour. Version minimum ').$i);
+ ' Veuillez mettre votre programme a jour. Version minimum ').$i);
return;
}
Extension::check_plugin_version();
}
+
/**
* insert into the table profile_menu for the given profile id and depending
* of the module $p_module
@@ -112,28 +126,31 @@ class Extension extends Menu_Ref_sql
// Module for the plugin
$p_module=$this->depend;
//profile exists ?
- $profile=new Profile_sql($cn,$p_id);
- if ( $profile->p_id != $p_id) {
- throw new Exception(_('Profil inexistant'),10);
+ $profile=new Profile_sql($cn, $p_id);
+ if ($profile->p_id!=$p_id)
+ {
+ throw new Exception(_('Profil inexistant'), 10);
}
// Menu exists
- $module=new Menu_Ref($cn,$p_module);
- if ($module->me_code==null) {
- throw new Exception(_('Module inexistant'),20);
+ $module=new Menu_Ref($cn, $p_module);
+ if ($module->me_code==null)
+ {
+ throw new Exception(_('Module inexistant'), 20);
}
// Dependency
$dep_id=$cn->get_array('select pm_id from profile_menu
where
p_id=$1
- and me_code = $2 ',array($p_id,$p_module));
+ and me_code = $2 ', array($p_id, $p_module));
// throw an exception if there is no dependency
- if (empty($dep_id)) {
- throw new Exception(_('Pas de menu ').$p_module,30);
+ if (empty($dep_id))
+ {
+ throw new Exception(_('Pas de menu ').$p_module, 30);
}
$nb_dep=count($dep_id);
-
+
// insert at the right location
- for ($i=0;$i<$nb_dep;$i++)
+ for ($i=0; $i<$nb_dep; $i++)
{
$profil_menu=new Profile_Menu($cn);
$profil_menu->me_code=$this->me_code;
@@ -144,178 +161,203 @@ class Extension extends Menu_Ref_sql
$profil_menu->pm_default=0;
$profil_menu->p_order=$this->order;
- $cnt=$profil_menu->count(' where pm_id_dep=$3 and p_id=$1 and me_code = $2',array($p_id,$this->me_code,$dep_id[$i]['pm_id']));
- if ( $cnt==0) {
+ $cnt=$profil_menu->count(' where pm_id_dep=$3 and p_id=$1 and me_code = $2',
+ array($p_id, $this->me_code, $dep_id[$i]['pm_id']));
+ if ($cnt==0)
+ {
$profil_menu->insert();
}
}
-
-
}
+
function remove_from_profile_menu($p_id)
{
global $cn;
-
- $cn->exec_sql('delete from profile_menu where (me_code = $1 or me_code in (select me_code from menu_ref where me_file=$2)) and p_id=$3',array($this->me_code,$this->me_file,$p_id));
-
+
+ $cn->exec_sql('delete from profile_menu where (me_code = $1 or me_code in (select me_code from menu_ref where me_file=$2)) and p_id=$3',
+ array($this->me_code, $this->me_file, $p_id));
}
+
/**
* Insert a plugin into the given profile, by default always insert into EXT
*
* @param type $p_id profile.p_id
* @throws Exception if duplicate or error db
*/
- function insert_plugin()
- {
- try
- {
- $this->cn->start();
- $this->verify();
- // check if duplicate
- $this->me_code = strtoupper($this->me_code);
- $count = $this->cn->get_value("select count(*) from menu_ref where me_code=$1", array($this->me_code));
- if ($count != 0)
- throw new Exception("Doublon");
- $this->me_type = 'PL';
- $this->insert();
- $this->cn->commit();
- }
- catch (Exception $exc)
- {
- echo alert($exc->getMessage());
- }
- }
- function update_plugin()
- {
- try
- {
- $this->cn->start();
- $this->verify();
- $this->me_type = 'PL';
- $this->update();
- $this->cn->commit();
- }
- catch (Exception $exc)
- {
- echo alert($exc->getMessage());
- }
- }
- function remove_plugin()
- {
- try
- {
- $this->cn->start();
- $this->delete();
- $this->cn->commit();
- }
- catch (Exception $exc)
- {
- echo alert($exc->getMessage());
- }
- }
- /**
- *remove all the schema from the plugins
- * @param Database $p_cn
- */
- static function clean(Database $p_cn)
- {
- $a_ext=array("tva_belge","amortissement","impdol","coprop","importbank");
- for($i=0;$iexist_schema($a_ext[$i])) {
- $p_cn->exec_sql("drop schema ".$a_ext[$i]." cascade");
- }
- }
- }
- static function check_plugin_version()
+ function insert_plugin()
+ {
+ try
{
- global $g_user,$version_plugin;
- if ($g_user->Admin() == 1)
- {
- if (SITE_UPDATE_PLUGIN != "")
- {
- $update = @file_get_contents(SITE_UPDATE_PLUGIN);
- if ($update > $version_plugin)
- {
- echo '
';
- echo '
';
- echo "Mise à jour disponible des plugins pour NOALYSS, version actuelle : $update votre version $version_plugin";
- echo '
";
+
+ break;
+ case 'en_US.utf8':
+ break;
+ case 'nl_NL.utf8':
+ break;
+ }
+ }
+
+ /**
+ * return a SimpleXMLElement of the plugin thanks its code, it returns NULL if no plugin is found
+ * @param string $p_code code of the plugin
+ * @return SimpleXMLElement or NULL if not found
+ */
+ function find_plugin($p_code)
+ {
+ $a_plugin=$this->content->xpath('//plugins/plugin');
+ $nb_plugin=count($a_plugin);
+ for ($i=0; $i<$nb_plugin; $i++)
+ {
+ if (trim($a_plugin[$i]->code)==$p_code)
+ {
+ return $a_plugin[$i];
+ }
+ }
+ return NULL;
+ }
+
+
+ /**
+ * return a SimpleXMLElement of the db template thanks its code, it returns NULL if no template is found
+ * @param string $p_code code of the template
+ * @return SimpleXMLElement or NULL if not found
+ */
+ function find_template($p_code)
+ {
+ $a_template=$this->content->xpath('//database_template/dbtemplate');
+ $nb_template=count($a_template);
+ for ($i=0; $i<$nb_template; $i++)
+ {
+ if (trim($a_template[$i]->code)==$p_code)
+ {
+ return $a_template[$i];
+ }
+ }
+ return NULL;
+ }
+
+ function make_object($p_type, $p_id)
+ {
+ switch ($p_type)
+ {
+ case "core":
+ // Create an object to download & install the core
+ $obj=new Package_Core("Noalyss", "Core", $this->content->core->path);
+ return $obj;
+ break;
+ case 'template':
+ // create an object to download & install the template
+ $db=$this->find_template($p_id);
+ if ($db == NULL ) {
+ throw new Exception(_("Modèle non trouvé"),1002);
+ }
+ $obj=new Package_Template($db->name,$db->description,$db->path);
+ return $obj;
+ case 'plugin':
+ // create an object to download & install a plugin
+ $plugin = $this->find_plugin($p_id);
+ if ($plugin==NULL)
+ {
+ throw new Exception(_("Extension non trouvée"), 1001);
+ }
+ $obj=new Package_Plugin($plugin->name,$plugin->description,$plugin->path);
+ return $obj;
+ break;
+ case 'contrib':
+ //create an object to download & install a contrib
+ default:
+ break;
+ }
+ }
+ /**
+ * Read xml file from the package
+ * @param string $p_file
+ * @return SimpleXMLElement
+ */
+ public function read_package_xml($p_file)
+ {
+ $dom=new DomDocument('1.0');
+ $dom->load($p_file);
+ $xml=simplexml_import_dom($dom);
+ return $xml;
+ }
+
+}
diff --git a/include/class/package_template.class.php b/include/class/package_template.class.php
new file mode 100644
index 000000000..caa5666d4
--- /dev/null
+++ b/include/class/package_template.class.php
@@ -0,0 +1,77 @@
+
+
+
+/**
+ * @file
+ * @brief
+ */
+require_once NOALYSS_INCLUDE."/class/package_noalyss.class.php";
+
+/**
+ * @brief
+ *
+ */
+class Package_Template extends Package_Noalyss
+{
+
+ public function can_install()
+ {
+ return TRUE;
+ }
+
+ /**
+ * Install the template
+ */
+ public function install()
+ {
+ // make temp dir
+ $tmp=NOALYSS_HOME."/tmp/";
+ $tmpdir=$tmp."db-".microtime(TRUE);
+ mkdir($tmpdir);
+
+ // unzip Archive file
+ $db=new ZipArchive;
+ $db->open($tmp."/".$this->get_file());
+ $db->extractTo($tmpdir);
+
+
+ // create database
+ $cn=new Database();
+ $seq=$cn->get_value("select nextval('s_modid')");
+
+ $sql=sprintf(" create database %smod%d encoding='utf8'", domaine, $seq);
+ $cn->exec_sql($sql);
+
+ $newdb=new Database($seq, 'mod');
+
+ // Execute SQL Script
+ $newdb->execute_script($tmpdir.'/schema.sql');
+ $newdb->execute_script($tmpdir.'/data.sql');
+ $newdb->execute_script($tmpdir.'/constraint.sql');
+
+ // Register into account_repository, we add the seq number for avoiding duplicate
+ $description = sprintf(_("Installé le %s"),date("d-m-Y h:i:s"));
+ $cn->exec_sql(" insert into modeledef (mod_id,mod_name,mod_desc) values ($1,$2,$3)",
+ [$seq,$seq."-".$this->get_name(),$this->get_description()." ".$description]);
+ }
+
+}
diff --git a/include/class/periode.class.php b/include/class/periode.class.php
index 8e4a64c08..4ff4dfc9d 100644
--- a/include/class/periode.class.php
+++ b/include/class/periode.class.php
@@ -218,7 +218,7 @@ class Periode
* @param date $p_date_end
* @param int $p_exercice
* @return int p_id of the new periode
- * @exception Exception 10 Invalide date or exercice
+ * @exception Exception 10 Invalide date or exercice, 20 overlapping periode
*/
function insert($p_date_start, $p_date_end, $p_exercice)
{
@@ -248,7 +248,7 @@ class Periode
",[$p_date_end]);
if ( $overlap_start > 0 || $overlap_end > 0)
{
- throw new Exception (_("Période chevauchant une autre"));
+ throw new Exception (_("Période chevauchant une autre"),20);
}
$p_id=$this->cn->get_next_seq('s_periode');
$sql=" insert into parm_periode(p_id,p_start,p_end,p_closed,p_exercice)
@@ -264,15 +264,14 @@ class Periode
$Res=$this->cn->exec_sql("insert into jrn_periode (jrn_def_id,p_id,status) ".
"select jrn_def_id,$p_id,'OP' from jrn_def");
$this->cn->commit();
+ return $p_id;
}
catch (Exception $e)
{
record_log($e->getTraceAsString());
$this->cn->rollback();
throw $e;
- return 1;
}
- return 0;
}
/* !\brief load data from database
@@ -478,10 +477,7 @@ class Periode
$date_start=sprintf('01.%02d.%d', $month, $year);
$date_end=$this->cn->get_value("select to_char(to_date($1,'DD.MM.YYYY')+interval '1 month'-interval '1 day','DD.MM.YYYY')",
array($date_start));
- if ($this->insert($date_start, $date_end, $p_exercice)!=0)
- {
- throw new Exception('Erreur insertion période');
- }
+ $this->insert($date_start, $date_end, $p_exercice);
}
$month++;
if ($month == 13 )
diff --git a/include/constant.php b/include/constant.php
index 31b88012f..afa6e050f 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -103,7 +103,9 @@ if ( !defined("SITE_UPDATE"))
define ("SITE_UPDATE",'http://www.noalyss.eu/last_version.txt');
if ( !defined("SITE_UPDATE_PLUGIN"))
define ("SITE_UPDATE_PLUGIN",'http://www.noalyss.eu/plugin_last_version.txt');
-
+if ( !defined ("NOALYSS_PACKAGE_REPOSITORY")) {
+ define ("NOALYSS_PACKAGE_REPOSITORY","https://package.noalyss.eu/");
+}
// If you don't want that the system information is accessible
if ( ! defined ("SYSINFO_DISPLAY")) {
define ("SYSINFO_DISPLAY",TRUE);
@@ -311,3 +313,13 @@ define ('EXC_PARAM_TYPE',1006);
define ('EXC_DUPLICATE',1200);
define ("UNPINDG","");
define ("PINDG","");
+
+// Url of NOALYSS (http://...)
+//
+if ( ! defined ("NOALYSS_URL")) {
+ $base=$_SERVER['REQUEST_SCHEME'].'://'.
+ $_SERVER['HTTP_HOST'].
+ ":".$_SERVER['SERVER_PORT'].
+ dirname($_SERVER['PHP_SELF']);
+ define ("NOALYSS_URL",$base);
+}
\ No newline at end of file
diff --git a/include/dossier.inc.php b/include/dossier.inc.php
index 4b0865185..25d865934 100644
--- a/include/dossier.inc.php
+++ b/include/dossier.inc.php
@@ -45,7 +45,7 @@ if ( isset ($_POST['upd']) && isNumber($dossier_id) == 1 && $dossier_id != -1)
$dos->set_parameter("max_email", $max_email);
$dos->save();
}
-echo '
';
+echo '
';
/*
* check and add an new folder
*/
diff --git a/include/lib/user_menu.php b/include/lib/user_menu.php
index b37d630c4..b3dc5fa2c 100644
--- a/include/lib/user_menu.php
+++ b/include/lib/user_menu.php
@@ -118,7 +118,7 @@ function MenuAdmin()
array("admin-noalyss.php?action=dossier_mgt",_("Dossiers"),_('Gestion des dossiers'),1),
array("admin-noalyss.php?action=modele_mgt",_("Modèles"),_('Gestion des modèles'),2),
array("admin-noalyss.php?action=restore",_("Restaure"),_("Restaure une base de données"),3),
- array("admin-noalyss.php?action=upgrade",_("Mise à jour"),_("Mise à jour du système et des bases de données"),5),
+ array("admin-noalyss.php?action=upgrade",_("Installation"),_("Installation Mise à jour du système et des bases de données"),5),
array("admin-noalyss.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
array("admin-noalyss.php?action=info",_("Information système"),('Information à propos de votre installation'),6),
array("login.php",_("Accueil"),"",7),
@@ -145,7 +145,7 @@ function MenuAdmin()
);
}
- $menu=ShowItem($item,'H',"mtitle","mtitle",$def,' style="width:80%;margin-left:10%" ');
+ $menu=ShowItem($item,'H',"mtitle","mtitle",$def);
return $menu;
}
diff --git a/include/modele.inc.php b/include/modele.inc.php
index aa8002a04..5998b636b 100644
--- a/include/modele.inc.php
+++ b/include/modele.inc.php
@@ -254,7 +254,7 @@ $Res = $cn->exec_sql("select mod_id,mod_name,mod_desc from
modeledef $sql_order");
$count = Database::num_row($Res);
-echo '
';
+echo '
';
echo "
"._('Modèles')."
";
if ($sa == 'list')
{
diff --git a/include/restore.inc.php b/include/restore.inc.php
index 941cfc180..2dd3e0489 100644
--- a/include/restore.inc.php
+++ b/include/restore.inc.php
@@ -72,7 +72,7 @@ if ( isset ($_REQUEST['sa'] ))
// Restore a folder (dossier)
if ( $_REQUEST['t']=='d')
{
- echo '
';
+ echo '
';
$cn=new Database();
$id=$cn->get_next_seq('dossier_id');
diff --git a/include/upgrade-core.php b/include/upgrade-core.php
new file mode 100644
index 000000000..529bf86ed
--- /dev/null
+++ b/include/upgrade-core.php
@@ -0,0 +1,65 @@
+
+
+if (!defined('ALLOWED')) die('Appel direct ne sont pas permis');
+if ( ! defined ('ALLOWED_ADMIN')) { die (_('Non autorisé'));}
+
+
+require_once NOALYSS_INCLUDE.'/class/package_repository.class.php';
+/**
+ * @file
+ * @brief
+ */
+printf (_(" La version de votre installaiton est %s "),NOALYSS_VERSION);
+
+$core=new Package_Repository();
+$xml=$core->getContent();
+printf(h1(_("Version %s du %s")),$xml->core->version,$xml->core->date);
+echo '
';
+ return;
+}
+
+$js="onclick='UpgradeCore()'";
+
+echo HtmlInput::button("upgrade",_("Mise à jour de votre système"),$js);
+?>
+
+
+
+
\ No newline at end of file
diff --git a/include/upgrade-plugin.php b/include/upgrade-plugin.php
new file mode 100644
index 000000000..a1d78cd88
--- /dev/null
+++ b/include/upgrade-plugin.php
@@ -0,0 +1,133 @@
+
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+if (!defined('ALLOWED_ADMIN'))
+{
+ die(_('Non autorisé'));
+}
+
+
+require_once NOALYSS_INCLUDE.'/class/package_repository.class.php';
+require_once NOALYSS_INCLUDE.'/class/extension.class.php';
+
+/**
+ * @file
+ * @brief Install new plugin
+ */
+$package_repository=new Package_Repository();
+$xml=$package_repository->getContent();
+
+$a_plugin=$xml->xpath('//plugins/plugin');
+$nb_plugin=count($a_plugin);
+?>
+
+
+
+
+ = _("Nom") ?>
+
+
+ = _("Description") ?>
+
+
+ = _("Auteur") ?>
+
+
+ = _("Code") ?>
+
+
+ Installé ou mettre à jour ???
+
+
+
+
+
+
+ = $a_plugin[$i]->name; ?>
+
+
+ = $a_plugin[$i]->description; ?>
+
+
+ = $a_plugin[$i]->author; ?>
+
+
+ = $a_plugin[$i]->code; ?>
+ version [= $a_plugin[$i]->version; ?>]
+
+
+
+ root)."/plugin.xml"))
+ {
+ // plugin is installed take the version and compare with remote one
+ $xml_plugin=$package_repository->read_package_xml(NOALYSS_PLUGIN."/".trim($a_plugin[$i]->root)."/plugin.xml");
+ if (count($xml_plugin->plugin)>1)
+ {
+ echo _("MultiModule");
+ }
+ // Compute js to install or upgrade
+ $js=sprintf("onclick=\"upgradePlugin('%s')\"", trim($a_plugin[$i]->code));
+ // Check if new version is available
+ if (floatval(trim($xml_plugin->plugin->version))version)))
+ {
+ printf (_("Nouvelle version disponible %s , votre version %s"),
+ floatval(trim($a_plugin[$i]->version)),
+ trim($xml_plugin->plugin->version));
+ echo HtmlInput::button("upgrade", _("Mise à jour"), $js);
+ }
+ else
+ {
+ echo _("Dernière version installée");
+ }
+ }
+ else
+ {
+ // It is not installed , propose to install it
+ echo _("Non installée");
+ echo HtmlInput::button("upgrade", _("Installation"), $js);
+ }
+ ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/include/upgrade-template.php b/include/upgrade-template.php
new file mode 100644
index 000000000..93732055a
--- /dev/null
+++ b/include/upgrade-template.php
@@ -0,0 +1,66 @@
+
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+if (!defined('ALLOWED_ADMIN'))
+{
+ die(_('Non autorisé'));
+}
+require_once NOALYSS_INCLUDE.'/class/package_repository.class.php';
+require_once NOALYSS_INCLUDE.'/class/extension.class.php';
+
+
+$package_repository=new Package_Repository();
+$xml=$package_repository->getContent();
+
+
+$a_template=$xml->xpath('//database_template/dbtemplate');
+$nb_template=count($a_template);
+echo "
";
+?>
+
\ No newline at end of file
diff --git a/include/upgrade.inc.php b/include/upgrade.inc.php
index 8c73434d5..ce2a28d7d 100644
--- a/include/upgrade.inc.php
+++ b/include/upgrade.inc.php
@@ -1,5 +1,4 @@
-
-if (!defined('ALLOWED'))
- die('Appel direct ne sont pas permis');
-require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
/**
* @file
* @brief Upgrade all the database : the central repository , the templates and
* the folder
* @param $rep db connection to central repository
*/
-?>
+if (!defined('ALLOWED')) die('Appel direct ne sont pas permis');
+if ( ! defined ('ALLOWED_ADMIN')) { die (_('Non autorisé'));}
-get("sb", "string","none");
-if ($sb === "upg_all" && (!defined('MULTI')||(defined('MULTI')&&MULTI==1)))
+
+$menu=array(
+ ["?action=upgrade&sb=database", _("Base de données"), _("Met à jour toutes les dossiers et modèles"), 'database'],
+ ["?action=upgrade&sb=application", _("Application"), _("Installe la dernière version de Noalyss"), 'application'],
+ ["?action=upgrade&sb=plugin", _("Extension"), _("Installe ou met à jour les extensions"), "plugin"],
+ ["?action=upgrade&sb=template", _("Modèle"), _("Installe des modèles"), "template"]
+);
+$sb=$http->request("sb", "string", "application");
+echo '
";
+ }
+ echo "";
+
+ echo h1("Create new database");
+$template=$package_repository->make_object("template", "mod1");
+$template->download();
+$template->install();
+echo h2( $template->get_name()." est installé");
\ No newline at end of file