noalyss Version-9
upgrade-template.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * PhpCompta 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 PhpCompta; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19// Copyright (2018) Author Dany De Bontridder <dany@alchimerys.be>
20
21if (!defined('ALLOWED'))
22 die('Appel direct ne sont pas permis');
23if (!defined('ALLOWED_ADMIN'))
24{
25 die(_('Non autorisé'));
26}
28
31/*
32 * If xml is null , it means it was not possible to get the file , could be
33 * a network problem or a misconfiguration
34 */
35if ( $xml == NULL) {
36 echo '<h2 class="error">';
37 printf (_("Désolé , impossible de se connecter au serveur %s"),
38 NOALYSS_PACKAGE_REPOSITORY);
39 echo '</h2>';
40 return;
41
42}
43
44
45$a_template=$xml->xpath('//database_template/dbtemplate');
47echo "<table>";
48echo tr(
49 th(_("Nom")).th(_("Description")).th(_("Mise à jour"))
50);
51for ($i=0; $i<$nb_template; $i++)
52{
53 echo '<tr>';
54 echo td($a_template[$i]->name);
55 echo td($a_template[$i]->description);
56 echo td($a_template[$i]->date_update);
57 echo '<td id="template'.trim($a_template[$i]->code).'" >';
58 $js=sprintf("onclick=\"install_template('%s')\"", trim($a_template[$i]->code));
59 echo HtmlInput::button("installTemplate", "Installation modèle", $js);
60 echo '</td>';
61 echo '</tr>';
62}
63echo "</table>";
64?>
65<script>
66 function install_template(p_code)
67 {
68 var task_id = "<?= uniqid() ?>";
69 progress_bar_start(task_id);
70 new Ajax.Updater("installTemplate" + p_code, "ajax_misc.php", {
71 method:"POST",
72 parameters:{op:"installTemplate", gDossier:0, code:p_code,task_id:task_id}
73 }
74 );
75 }
76</script>
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
$from_poste name
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
connect to NOALYSS_PACKAGE and fetch the file web.xml , it displays content of this file ,...
if( $xml==NULL) $a_template
$nb_template
$package_repository