Introduce warning to remind to do a backup before migration.

Required because we discovered, during beta, serious bugs into some
databases system loosing data.
This commit is contained in:
Laurent Destailleur 2015-01-25 22:29:36 +01:00
parent 8fb6ade27a
commit 57c84089fe
5 changed files with 19 additions and 12 deletions

View File

@ -488,13 +488,15 @@ function dolEscapeXML($string)
*
* @param string $stringtoescape String to escape
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
* @param string $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
*/
function dol_escape_js($stringtoescape, $mode=0)
function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
{
// escape quotes and backslashes, newlines, etc.
$substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n');
$substitjs=array("'"=>"\\'","\r"=>'\\r');
//$substitjs['</']='<\/'; // We removed this. Should be useless.
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
else if ($mode == 1) $substitjs["'"]="\\'";
else if ($mode == 2) { $substitjs['"']='\\"'; }

View File

@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
$this->family = "hr";
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Gestion des adhérents d'une association";
$this->description = "Management of members of a foundation or association";
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0;
@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules
$r++;
$this->rights[$r][0] = 75;
$this->rights[$r][1] = 'Setup types and attributes of members';
$this->rights[$r][1] = 'Setup types of membership';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'configurer';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
@ -349,7 +349,7 @@ else
{
$choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
$choice .= '<center><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div></center>';
$choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div></div>';
// <img src="../theme/eldy/img/tick.png" alt="Ok"> ';
$foundrecommandedchoice=1; // To show only once
}
@ -449,12 +449,12 @@ else
{
$choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE);
$choice .= '<center><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
$choice .= '<div class="center"><div class="ok">'.$langs->trans("InstallChoiceSuggested").'</div>';
if ($count < count($migarray)) // There is other choices after
{
print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
}
$choice .= '</center>';
$choice .= '</div>';
}
$choice .= '</td>';
@ -462,7 +462,7 @@ else
if ($allowupgrade)
{
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade
$choice .= '<a class="button" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
$choice .= '<a class="button runupgrade" href="upgrade.php?action=upgrade'.($count<count($migrationscript)?'_'.$versionto:'').'&amp;selectlang='.$setuplang.'&amp;versionfrom='.$versionfrom.'&amp;versionto='.$versionto.'">'.$langs->trans("Start").'</a>';
}
else
{
@ -531,6 +531,10 @@ $("div#AShowChoices a").click(function() {
});
$(".runupgrade").click(function() {
return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
});
</script>';
pFooter(true); // Never display next button

View File

@ -568,7 +568,7 @@ Permission67=Export interventions
Permission71=Read members
Permission72=Create/modify members
Permission74=Delete members
Permission75=Setup types and attributes for members
Permission75=Setup types of membership
Permission76=Export datas
Permission78=Read subscriptions
Permission79=Create/modify subscriptions
@ -591,8 +591,8 @@ Permission106=Export sendings
Permission109=Delete sendings
Permission111=Read financial accounts
Permission112=Create/modify/delete and compare transactions
Permission113=Setup financiel accounts (create, manage categories)
Permission114=Consolidate transactions
Permission113=Setup financial accounts (create, manage categories)
Permission114=Reconciliate transactions
Permission115=Export transactions and account statements
Permission116=Transfers between accounts
Permission117=Manage cheques dispatching

View File

@ -155,6 +155,7 @@ MigrationFinished=Migration finished
LastStepDesc=<strong>Last step</strong>: Define here login and password you plan to use to connect to software. Do not loose this as it is the account to administer all others.
ActivateModule=Activate module %s
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode)
WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process...
#########
# upgrade