New: Can define first day of week

This commit is contained in:
Laurent Destailleur 2009-09-29 17:14:52 +00:00
parent a4543024b7
commit 96b5362c8d
4 changed files with 88 additions and 28 deletions

View File

@ -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")."<br>\n";
print "<br>\n";
if (isset($_GET["action"]) && $_GET["action"] == 'edit')
if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit
{
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -171,7 +172,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
print '<td width="20">&nbsp;</td>';
print '</tr>';
// 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 '</tr>';
}
print '</table><br>';
// First day for weeks
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
print $html->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:''),'MAIN_START_WEEK',0);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
print '</table><br>';
// Themes
@ -275,7 +284,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
print '</form>';
print '<br>';
}
else
else // Show
{
$var=true;
@ -323,7 +332,7 @@ else
print '<td width="20">&nbsp;</td>';
print "</tr>";
// 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 "</tr>";
}
// First day for weeks
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>';
print $langs->trans("Day".(isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'0'));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
print '</table><br>';

View File

@ -354,7 +354,7 @@ print '<br>';
</td>
</tr>
<tr><td><label for="latex_structure_label">
Cl<EFBFBD> de l'<EFBFBD>tiquette</label></td>
Cle etiquette</label></td>
<td><input type="text" name="latex_structure_label" size="30"
value="tab:__TABLE__-structure"
id="latex_structure_label" />
@ -373,7 +373,7 @@ print '<br>';
return false;
else return true;" />
<label for="checkbox_latex_data">
Donn<EFBFBD>es</label>
Donnees</label>
</legend>
<input type="checkbox" name="latex_showcolumns" value="yes"
@ -399,7 +399,7 @@ print '<br>';
</tr>
<tr><td><label for="latex_data_label">
Cl<EFBFBD> de l'<EFBFBD>tiquette</label></td>
Cle de l'etiquette</label></td>
<td><input type="text" name="latex_data_label" size="30"
value="tab:__TABLE__-data"
id="latex_data_label" />
@ -426,14 +426,14 @@ print '<br>';
<table>
<tr><td><label for="export_separator">
Champs termin<EFBFBD>s par</label></td>
Champs termines par</label></td>
<td><input type="text" name="export_separator" size="2"
id="export_separator"
value=";" />
</td>
</tr>
<tr><td><label for="enclosed">
Champs entour<EFBFBD>s par</label></td>
Champs entoures par</label></td>
<td><input type="text" name="enclosed" size="2"
id="enclosed"
value="&quot;" />
@ -441,7 +441,7 @@ print '<br>';
</td>
</tr>
<tr><td><label for="escaped">
Caract<EFBFBD>re sp<EFBFBD>cial</label></td>
Caractere special</label></td>
<td><input type="text" name="escaped" size="2"
id="escaped"
value="\" />
@ -449,7 +449,7 @@ print '<br>';
</tr>
<tr><td><label for="add_character">
Lignes termin<EFBFBD>es par</label></td>
Lignes terminees par</label></td>
<td><input type="text" name="add_character" size="2"
id="add_character"
value="\r\n" />
@ -468,7 +468,7 @@ print '<br>';
id="checkbox_dump_showcsvnames"
/>
<label for="checkbox_dump_showcsvnames">
Afficher les noms de champ en premi<EFBFBD>re ligne</label>
Afficher les noms de champ en premiere ligne</label>
</fieldset>
-->
@ -598,7 +598,7 @@ if (window.parent.frames[1]) {
<?php
$result=$formfile->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 '<br><br>';

View File

@ -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)
{

View File

@ -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 = '<select class="flat" name="'.$htmlname.'">';
if ($useempty)
{
$select_week .= '<option value="-1">&nbsp;</option>';
}
foreach ($week as $key => $val)
{
if ($selected == $key)
{
$select_week .= '<option value="'.$key.'" selected="true">';
}
else
{
$select_week .= '<option value="'.$key.'">';
}
$select_week .= $val;
}
$select_week .= '</select>';
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 .= '</select>';
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='')
{