From 96b5362c8dcbed6e4e52d2ffaee513545037aa24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Sep 2009 17:14:52 +0000 Subject: [PATCH] New: Can define first day of week --- htdocs/admin/ihm.php | 31 ++++++++++--- htdocs/admin/tools/dolibarr_export.php | 18 ++++---- htdocs/admin/tools/export.php | 4 +- htdocs/html.form.class.php | 63 ++++++++++++++++++++++---- 4 files changed, 88 insertions(+), 28 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index d01f76cb7ae..3398b0d757a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -19,7 +19,7 @@ /** * \file htdocs/admin/ihm.php - * \brief Page de configuration de l'interface homme machine + * \brief Page to setup GUI display options * \version $Id$ */ @@ -63,7 +63,8 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_CONFIRM_AJAX", $_POST["main_confirm_ajax"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["main_popup_calendar"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity); - + dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity); @@ -101,7 +102,7 @@ print $langs->trans("DisplayDesc")."
\n"; print "
\n"; -if (isset($_GET["action"]) && $_GET["action"] == 'edit') +if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit { print '
'; print ''; @@ -171,7 +172,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ' '; print ''; - // Activate previeuw tab on element card + // Activate preview tab on element card if (function_exists("imagick_readimage")) { $var=!$var; @@ -182,7 +183,15 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print ''; } - print '
'; + // First day for weeks + $var=!$var; + print ''.$langs->trans("WeekStartOnDay").''; + print $html->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:''),'MAIN_START_WEEK',0); + print ''; + print ' '; + print ''; + + print '
'; // Themes @@ -275,7 +284,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') print '
'; print '
'; } -else +else // Show { $var=true; @@ -323,7 +332,7 @@ else print ' '; print ""; - // Activate previeuw tab on element card + // Activate preview tab on element card if (function_exists("imagick_readimage")) { $var=!$var; @@ -333,6 +342,14 @@ else print ""; } + // First day for weeks + $var=!$var; + print ''.$langs->trans("WeekStartOnDay").''; + print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'0')); + print ''; + print ' '; + print ''; + print '
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 31ed4887476..f434c025c48 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -354,7 +354,7 @@ print '
'; + Cle etiquette @@ -373,7 +373,7 @@ print '
'; return false; else return true;" /> + Donnees '; + Cle de l'etiquette @@ -426,14 +426,14 @@ print '
'; + Champs termines par + Champs entoures par + Caractere special + Lignes terminees par
@@ -441,7 +441,7 @@ print '
';
@@ -449,7 +449,7 @@ print '
';
@@ -468,7 +468,7 @@ print '
'; id="checkbox_dump_showcsvnames" /> + Afficher les noms de champ en premiere ligne --> @@ -598,7 +598,7 @@ if (window.parent.frames[1]) { show_documents('systemtools','',DOL_DATA_ROOT.'/admin/temp',$_SERVER['PHP_SELF'],0,1,'','',0,0,48,0,'',$langs->trans("Files")); +$result=$formfile->show_documents('systemtools','',DOL_DATA_ROOT.'/admin/temp',$_SERVER['PHP_SELF'],0,1,'','',0,0,54,0,'',$langs->trans("PreviousDumpFiles")); //if ($result) print '

'; diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 363eeb48732..50ae88c03db 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -18,7 +18,7 @@ /** * \file htdocs/admin/tools/export.php - * \brief Page export de la base + * \brief Page to export a database into a dump file * \version $Id$ */ @@ -223,7 +223,7 @@ if ($what) } } -$result=$formfile->show_documents('systemtools','',$conf->admin->dir_temp,$_SERVER['PHP_SELF'],0,1,'',array(),0,0,48,0,'',$langs->trans("Files")); +$result=$formfile->show_documents('systemtools','',$conf->admin->dir_temp,$_SERVER['PHP_SELF'],0,1,'',array(),0,0,54,0,'',$langs->trans("PreviousDumpFiles")); if ($result == 0) { diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index dc1dfac80ef..a2048703a62 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -2703,10 +2703,51 @@ class Form } /** - * \brief Retourne la liste des mois - * \param selected Id mois pre-selectionne - * \param htmlname Nom de la zone select - * \param useempty Affiche valeur vide dans liste + * \brief Return HTML combo list of week + * \param selected Preselected value + * \param htmlname Nom de la zone select + * \param useempty Affiche valeur vide dans liste + * TODO Move into html.formother + */ + function select_dayofweek($selected='',$htmlname='weekid',$useempty=0) + { + global $langs; + + $week = array( 0=>$langs->trans("Day0"), + 1=>$langs->trans("Day1"), + 2=>$langs->trans("Day2"), + 3=>$langs->trans("Day3"), + 4=>$langs->trans("Day4"), + 5=>$langs->trans("Day5"), + 6=>$langs->trans("Day6")); + + $select_week = ''; + return $select_week; + } + + /** + * \brief Return HTML combo list of month + * \param selected Preselected value + * \param htmlname Nom de la zone select + * \param useempty Affiche valeur vide dans liste + * TODO Move into html.formother */ function select_month($selected='',$htmlname='monthid',$useempty=0) { @@ -2732,13 +2773,15 @@ class Form $select_month .= ''; return $select_month; } + /** - * \brief Retourne la liste des annees - * \param selected Annee pre-selectionne - * \param htmlname Nom de la zone select - * \param useempty Affiche valeur vide dans liste - * \param $min_year Valeur minimum de l'annee dans la liste (par defaut annee courante -10) - * \param $max_year Valeur maximum de l'annee dans la liste (par defaut annee courante + 5) + * \brief Return HTML combo list of years + * \param selected Preselected value + * \param htmlname Name of HTML select object + * \param useempty Affiche valeur vide dans liste + * \param $min_year Valeur minimum de l'annee dans la liste (par defaut annee courante -10) + * \param $max_year Valeur maximum de l'annee dans la liste (par defaut annee courante + 5) + * TODO Move into html.formother */ function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year='', $max_year='') {