projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed 'bad password' info screen to be usable also in non-js mode.
[fa-stable.git]
/
admin
/
inst_upgrade.php
diff --git
a/admin/inst_upgrade.php
b/admin/inst_upgrade.php
index 9166a59240c8f45fd1c71cb394abf204cd62eb77..20a056557e80d07fc16c263376f77b612ca7898a 100644
(file)
--- a/
admin/inst_upgrade.php
+++ b/
admin/inst_upgrade.php
@@
-9,7
+9,7
@@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security =
20
;
+$page_security =
'SA_SOFTWAREUPGRADE'
;
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
$path_to_root="..";
include_once($path_to_root . "/includes/session.inc");
@@
-96,7
+96,8
@@
function upgrade_step($index, $conn)
$force = get_post('force_'.$index);
if ($force || get_post('install_'.$index))
{
$force = get_post('force_'.$index);
if ($force || get_post('install_'.$index))
{
- if (!$inst->installed($pref) || $force)
+ $state = $inst->installed($pref);
+ if (!$state || $force)
{
if (!$inst->pre_check($pref)) return false;
{
if (!$inst->pre_check($pref)) return false;
@@
-104,7
+105,11
@@
function upgrade_step($index, $conn)
$ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);
$ret &= $inst->install($pref, $force);
$ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);
$ret &= $inst->install($pref, $force);
- }
+ } else
+ if ($state!==true) {
+ display_error(_("Upgrade cannot be done because database has been already partially upgraded. Please downgrade database to clean previous version or try forced upgrade."));
+ $ret = false;
+ }
}
return $ret;
}
}
return $ret;
}
@@
-168,6
+173,7
@@
$th = array(_("Version"), _("Description"), _("Sql file"), _("Install"),
table_header($th);
$k = 0; //row colour counter
table_header($th);
$k = 0; //row colour counter
+$partial = 0;
foreach($installers as $i => $inst)
{
alt_table_row_color($k);
foreach($installers as $i => $inst)
{
alt_table_row_color($k);
@@
-178,14
+184,27
@@
foreach($installers as $i => $inst)
// this is checked only for first (site admin) company,
// but in fact we should always upgrade all data sets after
// source upgrade.
// this is checked only for first (site admin) company,
// but in fact we should always upgrade all data sets after
// source upgrade.
- if ($inst->installed(TB_PREF))
+ $check = $inst->installed(TB_PREF);
+ if ($check === true)
label_cell(_("Installed"));
label_cell(_("Installed"));
- else
- check_cells(null,'install_'.$i, 0);
+ else
+ if (!$check)
+ check_cells(null,'install_'.$i, 0);
+ else {
+ label_cell("<span class=redfg>"
+ . sprintf(_("Partially installed (%s)"), $check) . "</span>");
+ $partial++;
+ }
+
check_cells(null,'force_'.$i, 0);
end_row();
}
end_table(1);
check_cells(null,'force_'.$i, 0);
end_row();
}
end_table(1);
+if ($partial!=0) {
+ display_note(_("Database upgrades marked as partially installed cannot be installed automatically.
+You have to clean database manually to enable them, or try to perform forced upgrade."));
+ br();
+}
submit_center('Upgrade', _('Upgrade system'), true, _('Save database and perform upgrade'), 'process');
end_form();
submit_center('Upgrade', _('Upgrade system'), true, _('Save database and perform upgrade'), 'process');
end_form();