]>
git.agnieray.net Git - galette.git/blob - galette/install/steps/db_select_version.php
3a8a05bc4ad3cf7fb789c0e852de308d4b090f13
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
6 * Galette installation, database upgrade previous version selection step
10 * Copyright © 2013-2014 The Galette Team
12 * This file is part of Galette (http://galette.tuxfamily.org).
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.
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.
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/>.
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 * @link http://galette.tuxfamily.org
34 * @since Available since 0.8 - 2013-07-21
37 use Galette\Core\Install
as GaletteInstall
;
38 use Galette\Core\Db
as GaletteDb
;
40 $versions = $install->getScripts();
41 $current = $install->getCurrentVersion($zdb);
42 $raw_current = $zdb->getDbVersion(true);
45 <h2
><?php
echo _T("Previous version selection"); ?
></h2
>
46 <p
><?php
echo _T("Select your previous Galette version below, and then click next."); ?
></p
>
47 <form action
="installer.php" method
="post">
49 if (count($versions) == 0) {
51 <p id
="errorbox"><?php
echo _T("No update script found!"); ?
></p
>
53 if ($raw_current === GALETTE_DB_VERSION
) {
55 <p id
="warningbox"><?php
echo _T("It seems you already use latest Galette version!"); ?
></p
>
60 <input type
="submit" name
="abort_btn" value
="<?php echo _T("Cancel
"); ?>"/>
61 <button type
="submit" id
="btnback" name
="stepback_btn" formnovalidate
><i
class="fas fa-backward"></i
> <?php
echo _T("Back"); ?
></button
>
66 if ($current !== false) {
67 if ($current < 0.70) {
69 <p id
="warningbox"><?php
echo _T("Previous version is older than 0.7. <strong>Make sure you select the right version</strong>."); ?
></p
>
73 <p id
="successbox"><?php
echo _T("Your previous version should be selected and <strong>displayed in bold</strong>."); ?
></p
>
78 if ($raw_current === GALETTE_DB_VERSION
) {
80 <p id
="warningbox"><?php
echo _T("It seems you already use latest Galette version!<br/>Are you sure you want to upgrade?"); ?
></p
>
84 <fieldset
class="cssform">
85 <legend
class="ui-state-active ui-corner-top"><?php
echo _T("Your current Galette version is..."); ?
></legend
>
90 foreach ($versions as $version) {
99 <label
for="upgrade-<?php echo $version; ?>">
101 if ($last === '0.00') {
104 number_format($version, 2),
105 _T("older than %version")
107 } elseif ($last != number_format($version - 0.01, 2)) {
108 echo _T("comprised between") . " " .
109 $last . " " . _T("and") . " " . number_format($version - 0.01, 2);
111 echo " " . number_format($version - 0.01, 2);
118 <input type
="radio" name
="previous_version" value
="<?php echo $version; ?>" id
="upgrade-<?php echo $version; ?>"<?php
if ($is_current) { echo ' checked="checked"'; }; ?
> required
/>
124 $is_current = $current == $version;
134 <button type
="submit"><?php
echo _T("Next step"); ?
> <i
class="fas fa-forward"></i
></button
>
135 <button type
="submit" id
="btnback" name
="stepback_btn" formnovalidate
><i
class="fas fa-backward"></i
> <?php
echo _T("Back"); ?
></button
>