Fix: "Now" link works when date popup is not used.

New: Add option to hide help in menu.
This commit is contained in:
Laurent Destailleur 2009-08-09 19:25:17 +00:00
parent e5475f0b28
commit 13a3de8d90
9 changed files with 59 additions and 37 deletions

View File

@ -31,6 +31,8 @@ For users:
- New: Enhancement in project module. - New: Enhancement in project module.
- New: Add log tab on emailing module. - New: Add log tab on emailing module.
- New: Minor enhancements in look themes. - New: Minor enhancements in look themes.
- New: Add option to hide help in menu.
- Fix: "Now" link works when date popup is not used.
- Fix: Debug seriously the email notification module. - Fix: Debug seriously the email notification module.
- Fix: Error Call to a member function trans when refusing a supplier order. - Fix: Error Call to a member function trans when refusing a supplier order.
- Fix: Fix payment conditions on commercial proposals. - Fix: Fix payment conditions on commercial proposals.

View File

@ -64,9 +64,6 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["main_popup_calendar"],'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_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_BUGTRACK_LINK", $_POST["main_show_bugtrack_link"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SHOW_WORKBOARD", $_POST["main_show_workboard"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'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); dolibarr_set_const($db, "MAIN_SEARCHFORM_CONTACT", $_POST["MAIN_SEARCHFORM_CONTACT"],'chaine',0,'',$conf->entity);
@ -74,9 +71,12 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update')
dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_PRODUITSERVICE",$_POST["MAIN_SEARCHFORM_PRODUITSERVICE"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SEARCHFORM_ADHERENT",$_POST["MAIN_SEARCHFORM_ADHERENT"],'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity);
$_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer
@ -136,15 +136,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print '</tr>'; print '</tr>';
/*
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print $html->selectyesno('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
// Desactivation javascript et ajax // Desactivation javascript et ajax
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
@ -216,7 +207,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'; print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>';
// Hide need help link on login page // Hide help link on login page
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
print $html->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); print $html->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
@ -256,6 +247,24 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
} }
print '</td></tr>'; print '</td></tr>';
// Hide help link on login page
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp").'</td><td>';
print $html->selectyesno('MAIN_HELP_DISABLELINK',isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
/*
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print $html->selectyesno('main_show_bugtrack_link',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';
*/
print '</table>'; print '</table>';
print '<br><center>'; print '<br><center>';
@ -287,14 +296,6 @@ else
print '<td width="20">&nbsp;</td>'; print '<td width="20">&nbsp;</td>';
print "</tr>"; print "</tr>";
/*
$var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print yn($conf->global->MAIN_SHOW_BUGTRACK_LINK)."</td>";
print '<td width="20">&nbsp;</td>';
print "</tr>";
*/
// Disable javascript/ajax // Disable javascript/ajax
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>'; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
@ -375,6 +376,22 @@ else
print nl2br($conf->global->MAIN_MOTD); print nl2br($conf->global->MAIN_MOTD);
print '</td></tr>'; print '</td></tr>';
// Link to wiki help
$var=!$var;
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).'</td><td>';
print yn($conf->global->MAIN_HELP_DISABLELINK,1);
print '</td></tr>';
/*
// Show bugtrack link
$var=!$var;
print '<tr '.$bc[$var].'"><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
print yn($conf->global->MAIN_BUGTRACK_ENABLELINK)."</td>";
print '<td width="20">&nbsp;</td>';
print "</tr>";
*/
print '</table>'; print '</table>';

View File

@ -2449,19 +2449,19 @@ class Form
} }
else else
{ {
$reset_scripts .= 'this.form.elements[\''.$prefix.'day\'].value=formatDate(new Date(), \'dds\');'; $reset_scripts .= 'this.form.elements[\''.$prefix.'day\'].value=formatDate(new Date(), \'d\'); ';
$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'MM\');'; $reset_scripts .= 'this.form.elements[\''.$prefix.'month\'].value=formatDate(new Date(), \'M\'); ';
$reset_scripts .= 'this.form.elements[\''.$prefix.'year\'].value=formatDate(new Date(), \'YYYY\');'; $reset_scripts .= 'this.form.elements[\''.$prefix.'year\'].value=formatDate(new Date(), \'yyyy\'); ';
} }
// Generate the hour part // Generate the hour part
if ($h) if ($h)
{ {
$reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\');'; $reset_scripts .= 'this.form.elements[\''.$prefix.'hour\'].value=formatDate(new Date(), \'HH\'); ';
} }
// Generate the minute part // Generate the minute part
if ($m) if ($m)
{ {
$reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\');'; $reset_scripts .= 'this.form.elements[\''.$prefix.'min\'].value=formatDate(new Date(), \'mm\'); ';
} }
// If reset_scripts is not empty, print the button with the reset_scripts in OnClick // If reset_scripts is not empty, print the button with the reset_scripts in OnClick
if ($reset_scripts) if ($reset_scripts)

View File

@ -103,7 +103,7 @@ class MenuLeft {
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{ {
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small); $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small);
print '<img title="'.$title.'" src="'.$urllogo.'">'; print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>';
} }
} }

View File

@ -103,7 +103,7 @@ class MenuLeft {
if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) if (! empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small))
{ {
$urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small); $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&amp;file='.urlencode('thumbs/'.$mysoc->logo_small);
print '<img title="'.$title.'" src="'.$urllogo.'">'; print '<center><img title="'.$title.'" src="'.$urllogo.'"></center>';
} }
} }

View File

@ -239,7 +239,8 @@ UMask=UMask parameter for new files on Unix/Linux/BSD file system.
UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone).<br>Ce paramètre ne sert pas sous un serveur Windows. UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).<br>It must be the octal value (for example, 0666 means read and write for everyone).<br>Ce paramètre ne sert pas sous un serveur Windows.
SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation
UseACacheDelay = Delay for caching export response in seconds (0 or empty for no cache) UseACacheDelay = Delay for caching export response in seconds (0 or empty for no cache)
DisableLinkToHelpCenter=Hide link "Need help or support" on login page DisableLinkToHelpCenter=Hide link "<b>Need help or support</b>" on login page
DisableLinkToHelp=Hide link "<b>%s Online help</b>" on left menu
AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on documents because too long, you must add yourself carriage returns in the textarea. AddCRIfTooLong=There is no automatic wrapping, so if line is out of page on documents because too long, you must add yourself carriage returns in the textarea.
ModuleDisabled=Module disabled ModuleDisabled=Module disabled
ModuleDisabledSoNoEvent=Module disabled so event never created ModuleDisabledSoNoEvent=Module disabled so event never created

View File

@ -239,7 +239,8 @@ UMask = Paramètre UMask des nouveaux fichiers sous Unix/Linux/BSD.
UMaskExplanation = Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'upload par exemple).<br>Ce doit être la valeur octal (par exemple 0666 signifie lecture/ecriture pour tous).<br>Ce paramètre n'a aucun effet sur un serveur Windows. UMaskExplanation = Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'upload par exemple).<br>Ce doit être la valeur octal (par exemple 0666 signifie lecture/ecriture pour tous).<br>Ce paramètre n'a aucun effet sur un serveur Windows.
SeeWikiForAllTeam = Voir le wiki pour le détail de tous les acteurs et leur organisation SeeWikiForAllTeam = Voir le wiki pour le détail de tous les acteurs et leur organisation
UseACacheDelay = Delay de mise en cache de l'export en secondes (0 ou vide pour aucun cache) UseACacheDelay = Delay de mise en cache de l'export en secondes (0 ou vide pour aucun cache)
DisableLinkToHelpCenter=Cacher le lien "Besoin d'un support ou aide" sur la page de login DisableLinkToHelpCenter=Cacher le lien "<b>Besoin d'un support ou aide</b>" sur la page de login
DisableLinkToHelp=Cacher le lien "<b>%s Aide en ligne</b>" du menu gauche
AddCRIfTooLong=Il n'y a pas de coupures de lignes automatiques, aussi si votre texte est trop long sur les documents, il vous faut ajouter par vous-meme des retours chariots dans la zone de saisie du texte. AddCRIfTooLong=Il n'y a pas de coupures de lignes automatiques, aussi si votre texte est trop long sur les documents, il vous faut ajouter par vous-meme des retours chariots dans la zone de saisie du texte.
ModuleDisabled=Module désactivé ModuleDisabled=Module désactivé
ModuleDisabledSoNoEvent=Module désactivé donc évênement jamais créé ModuleDisabledSoNoEvent=Module désactivé donc évênement jamais créé

View File

@ -447,6 +447,7 @@ function formatDate(date,format)
//alert('substr='+substr); //alert('substr='+substr);
if (substr == 'yyyy') { result=result+year; } if (substr == 'yyyy') { result=result+year; }
else if (substr == 'yy') { result=result+year.substring(2,4); } else if (substr == 'yy') { result=result+year.substring(2,4); }
else if (substr == 'M') { result=result+month; }
else if (substr == 'MM') { result=result+(month<1||month>9?"":"0")+month; } else if (substr == 'MM') { result=result+(month<1||month>9?"":"0")+month; }
else if (substr == 'd') { result=result+day; } else if (substr == 'd') { result=result+day; }
else if (substr == 'dd') { result=result+(day<1||day>9?"":"0")+day; } else if (substr == 'dd') { result=result+(day<1||day>9?"":"0")+day; }

View File

@ -756,14 +756,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
// Other external js // Other external js
require_once DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php';
$mini='';$ext=''; $mini='';$ext='.js';
if (! empty($conf->global->MAIN_OPTIMIZE_SPEED)) { $mini='_mini'; $ext=''; } // mini='_mini', ext='.gz' if (! empty($conf->global->MAIN_OPTIMIZE_SPEED)) { $mini='_mini'; $ext='.jgz'; } // mini='_mini', ext='.gz'
// This one is required for all Ajax features // This one is required for all Ajax features
if (! defined('DISABLE_PROTOTYPE')) if (! defined('DISABLE_PROTOTYPE'))
{ {
print '<!-- Includes for Prototype (Used by Scriptaculous and PWC) -->'."\n"; print '<!-- Includes for Prototype (Used by Scriptaculous and PWC) -->'."\n";
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/scriptaculous/lib/prototype'.$mini.'.js'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/scriptaculous/lib/prototype'.$mini.$ext.'"></script>'."\n";
} }
// This one is required for boxes // This one is required for boxes
if (! defined('DISABLE_SCRIPTACULOUS')) if (! defined('DISABLE_SCRIPTACULOUS'))
@ -779,7 +779,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{ {
print '<!-- Includes for PWC (Used for confirm popup) -->'."\n"; print '<!-- Includes for PWC (Used for confirm popup) -->'."\n";
// PWC js // PWC js
print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/pwc/window'.$mini.'.js'.$ext.'"></script>'."\n"; print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/pwc/window'.$mini.$ext.'"></script>'."\n";
} }
} }
@ -1005,7 +1005,7 @@ function left_menu($menu_array, $helppagename='', $moresearchform='')
} }
// Link to Dolibarr wiki pages // Link to Dolibarr wiki pages
if ($helppagename && empty($conf->global->MAIN_DISABLE_HELP_LINKS)) if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK))
{ {
$langs->load("help"); $langs->load("help");