New: Include Dolibarr version in suggested dump filename.

This commit is contained in:
Laurent Destailleur 2009-07-28 17:19:46 +00:00
parent e48d440630
commit ee999273ba
3 changed files with 9 additions and 3 deletions

View File

@ -27,6 +27,8 @@ For users:
- New: Added estimated value for stocks.
- New: Added module Gravatar to found photo of users or members
from their email on gravatar.com.
- New: Include Dolibarr version in suggested dump filename.
- New: Enhancement in project module.
- Fix: Error Call to a member function trans when refusing a supplier order.
- Fix: Fix payment conditions on commercial proposals.
- Fix: Nb of orders to process was wrong.

View File

@ -516,7 +516,7 @@ print '<br>';
<?php echo $langs->trans("FileNameToGenerate"); ?></label> :
<input type="text" name="filename_template" size="60" id="filename_template"
value="<?php
$file='mysqldump_'.$dolibarr_main_db_name.'_'.strftime("%Y%m%d%H%M").'.sql';
$file='mysqldump_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.sql';
echo $file;
?>" />

View File

@ -63,11 +63,13 @@ function dol_now($mode='tzserver')
return $ret;
}
/**
* \brief Clean a string to use it as a file name.
* \param str String to clean
* \param newstr String to replace bad chars by
* \return string String cleaned (a-zA-Z_)
* \seealso dol_string_nospecial, dol_string_unaccent
*/
function dol_sanitizeFileName($str,$newstr='_')
{
@ -75,9 +77,10 @@ function dol_sanitizeFileName($str,$newstr='_')
}
/**
* \brief Clean a string from all accent characters
* \brief Clean a string from all accent characters to be used as ref, login or by dol_sanitizeFileName.
* \param str String to clean
* \return string Cleaned string
* \seealso dol_sanitizeFilename, dol_string_nospecial
*/
function dol_string_unaccent($str)
{
@ -120,10 +123,11 @@ function dol_string_unaccent($str)
}
/**
* \brief Clean a string from all punctuation characters
* \brief Clean a string from all punctuation characters to use it as a ref or login.
* \param str String to clean
* \param newstr String to replace bad chars by
* \return string Cleaned string
* \seealso dol_sanitizeFilename, dol_string_unaccent
*/
function dol_string_nospecial($str,$newstr='_')
{