Skip to content
Snippets Groups Projects
Commit 57c84089 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Introduce warning to remind to do a backup before migration.

Required because we discovered, during beta, serious bugs into some
databases system loosing data.
parent 8fb6ade2
Branches
Tags
No related merge requests found
...@@ -488,13 +488,15 @@ function dolEscapeXML($string) ...@@ -488,13 +488,15 @@ function dolEscapeXML($string)
* *
* @param string $stringtoescape String to escape * @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 $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. * @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. // escape quotes and backslashes, newlines, etc.
$substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n'); $substitjs=array("'"=>"\\'","\r"=>'\\r');
//$substitjs['</']='<\/'; // We removed this. Should be useless. //$substitjs['</']='<\/'; // We removed this. Should be useless.
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; } if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
else if ($mode == 1) $substitjs["'"]="\\'"; else if ($mode == 1) $substitjs["'"]="\\'";
else if ($mode == 2) { $substitjs['"']='\\"'; } else if ($mode == 2) { $substitjs['"']='\\"'; }
......
...@@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules ...@@ -50,7 +50,7 @@ class modAdherent extends DolibarrModules
$this->family = "hr"; $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) // 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->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->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->special = 0; $this->special = 0;
...@@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules ...@@ -137,7 +137,7 @@ class modAdherent extends DolibarrModules
$r++; $r++;
$this->rights[$r][0] = 75; $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][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'configurer'; $this->rights[$r][4] = 'configurer';
......
<?php <?php
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* 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 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2013-2014 Juanjo Menent <jmenent@2byte.es>
...@@ -349,7 +349,7 @@ else ...@@ -349,7 +349,7 @@ else
{ {
$choice .= '<br>'; $choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); //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"> '; // <img src="../theme/eldy/img/tick.png" alt="Ok"> ';
$foundrecommandedchoice=1; // To show only once $foundrecommandedchoice=1; // To show only once
} }
...@@ -449,12 +449,12 @@ else ...@@ -449,12 +449,12 @@ else
{ {
$choice .= '<br>'; $choice .= '<br>';
//print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); //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 if ($count < count($migarray)) // There is other choices after
{ {
print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION); print $langs->trans("MigrateIsDoneStepByStep",DOL_VERSION);
} }
$choice .= '</center>'; $choice .= '</div>';
} }
$choice .= '</td>'; $choice .= '</td>';
...@@ -462,7 +462,7 @@ else ...@@ -462,7 +462,7 @@ else
if ($allowupgrade) if ($allowupgrade)
{ {
// If it's not last updagre script, action = upgrade_tmp, if last action = upgrade // 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 else
{ {
...@@ -531,6 +531,10 @@ $("div#AShowChoices a").click(function() { ...@@ -531,6 +531,10 @@ $("div#AShowChoices a").click(function() {
}); });
$(".runupgrade").click(function() {
return confirm("'.dol_escape_js($langs->transnoentitiesnoconv("WarningUpgrade"), 0, 1).'");
});
</script>'; </script>';
pFooter(true); // Never display next button pFooter(true); // Never display next button
......
...@@ -568,7 +568,7 @@ Permission67=Export interventions ...@@ -568,7 +568,7 @@ Permission67=Export interventions
Permission71=Read members Permission71=Read members
Permission72=Create/modify members Permission72=Create/modify members
Permission74=Delete members Permission74=Delete members
Permission75=Setup types and attributes for members Permission75=Setup types of membership
Permission76=Export datas Permission76=Export datas
Permission78=Read subscriptions Permission78=Read subscriptions
Permission79=Create/modify subscriptions Permission79=Create/modify subscriptions
...@@ -591,8 +591,8 @@ Permission106=Export sendings ...@@ -591,8 +591,8 @@ Permission106=Export sendings
Permission109=Delete sendings Permission109=Delete sendings
Permission111=Read financial accounts Permission111=Read financial accounts
Permission112=Create/modify/delete and compare transactions Permission112=Create/modify/delete and compare transactions
Permission113=Setup financiel accounts (create, manage categories) Permission113=Setup financial accounts (create, manage categories)
Permission114=Consolidate transactions Permission114=Reconciliate transactions
Permission115=Export transactions and account statements Permission115=Export transactions and account statements
Permission116=Transfers between accounts Permission116=Transfers between accounts
Permission117=Manage cheques dispatching Permission117=Manage cheques dispatching
......
...@@ -155,6 +155,7 @@ MigrationFinished=Migration finished ...@@ -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. 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 ActivateModule=Activate module %s
ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode) 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 # upgrade
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment