]> git.agnieray.net Git - galette.git/blob - galette/install/steps/db_install.php
35d136a8ade1092630277c9266f35ba55531bc31
[galette.git] / galette / install / steps / db_install.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Galette installation, database initialization/upgrade
7 *
8 * PHP version 5
9 *
10 * Copyright © 2013-2014 The Galette Team
11 *
12 * This file is part of Galette (http://galette.tuxfamily.org).
13 *
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * @category Core
28 * @package Galette
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2013-2014 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
33 * @version SVN: $Id$
34 * @link http://galette.tuxfamily.org
35 * @since Available since 0.8 - 2013-01-12
36 */
37
38 use Galette\Core\Install as GaletteInstall;
39 use Galette\Core\Db as GaletteDb;
40
41 //ok, let's run the scripts!
42 $db_installed = $install->executeScripts($zdb);
43 ?>
44 <h2><?php echo $install->getStepTitle(); ?></h2>
45 <?php
46 if ($db_installed === false) {
47 $msg = _T("Database has not been installed!");
48 if ($install->isUpgrade()) {
49 $msg = _T("Database has not been upgraded!");
50 }
51 echo '<p id="errorbox">' . $msg . '</p>';
52 } else {
53 $msg = _T("Database has been installed :)");
54 if ($install->isUpgrade()) {
55 $msg = _T("Database has been upgraded :)");
56 }
57 echo '<p id="infobox">' . $msg . '</p>';
58 }
59 ?>
60 <ul class="leaders">
61 <?php
62 foreach ($install->getDbInstallReport() as $r) {
63 ?>
64 <li>
65 <span><?php echo $r['message']; ?></span>
66 <span><?php echo $install->getValidationImage($r['res']); ?></span>
67 </li>
68 <?php
69 }
70 ?>
71 </ul>
72
73 <form action="installer.php" method="POST">
74 <p id="btn_box">
75 <?php
76 if (!$db_installed) {
77 ?>
78 <input type="submit" id="retry_btn" value="<?php echo _T("Retry"); ?>"/>
79 <?php
80 }
81 ?>
82
83 <input id="next_btn" type="submit" value="<?php echo _T("Next step"); ?>"<?php if (!$db_installed) { echo ' disabled="disabled"'; } ?>/>
84 <?php
85 if ($db_installed) {
86 ?>
87 <input type="hidden" name="install_dbwrite_ok" value="1"/>
88 <?php
89 }
90
91 if (!$db_installed) {
92 //once DB is installed, that does not make sense to go back
93 ?>
94 <input type="submit" id="btnback" name="stepback_btn" value="<?php echo _T("Back"); ?>"/>
95 <?php
96 }
97 ?>
98 </p>
99 </form>