diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 7ec46475c6e..29af716ceb0 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -134,13 +134,14 @@ $linkback=''.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print "
\n"; -print $langs->trans("AgendaAutoActionDesc")."
\n"; -print "
\n"; $head=agenda_prepare_head(); dol_fiche_head($head, 'autoactions', $langs->trans("Agenda")); +print $langs->trans("AgendaAutoActionDesc")."
\n"; +print $langs->trans("OnlyActiveElementsAreShown").'
'; +print "
\n"; print '
'; print ''; @@ -179,8 +180,6 @@ print ''; print '
'; print ''; -print '     '; -print ''; print "
"; print "
\n"; @@ -226,12 +225,13 @@ else } print ''."\n"; +print ''; print "
"; dol_htmloutput_mesg($mesg); -$db->close(); - llxFooter(); + +$db->close(); ?> diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php index 1bd0c84ef77..26bd6c8f5ee 100644 --- a/htdocs/admin/agenda_extrafields.php +++ b/htdocs/admin/agenda_extrafields.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2012 Florian Henry * @@ -70,8 +70,6 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print "
\n"; -print "
\n"; - $head=agenda_prepare_head(); dol_fiche_head($head, 'attributes', $langs->trans("Agenda")); diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 52a77de8eae..5d4c787bf37 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -54,8 +54,7 @@ if ($actionsave) $db->begin(); $disableext=GETPOST('AGENDA_DISABLE_EXT','alpha'); - if ($disableext) $disableext=0; else $disableext=1; - $res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_DISABLE_EXT',$disableext,'chaine',0,'',$conf->entity); $i=1; $errorsaved=0; $error=0; @@ -67,7 +66,7 @@ if ($actionsave) $src=trim(GETPOST('agenda_ext_src'.$i,'alpha')); $color=trim(GETPOST('agenda_ext_color'.$i,'alpha')); if ($color=='-1') $color=''; - + if (! empty($src) && ! preg_match('/^(http\s*|ftp\s*):/', $src)) { setEventMessage($langs->trans("ErrorParamMustBeAnUrl"),'errors'); @@ -75,26 +74,26 @@ if ($actionsave) $errorsaved++; break; } - + //print 'color='.$color; - $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_NAME'.$i,$name,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_SRC'.$i,$src,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $i++; } - + // Save nb of agenda if (! $error) { - $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0); + $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity); if (! $res > 0) $error++; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; } - + if (! $error) { $db->commit(); @@ -124,34 +123,57 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print '
'; -print $langs->trans("AgendaExtSitesDesc")."
\n"; -print "
\n"; - $head=agenda_prepare_head(); dol_fiche_head($head, 'extsites', $langs->trans("Agenda")); +print $langs->trans("AgendaExtSitesDesc")."
\n"; +print "
\n"; + print '
'; -$selectedvalue=(GETPOST('AGENDA_DISABLE_AGENDA','alpha'))?GETPOST('AGENDA_DISABLE_EXT','alpha'):$conf->global->AGENDA_DISABLE_EXT; +$selectedvalue=$conf->global->AGENDA_DISABLE_EXT; if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1; -print $langs->trans("ExtSitesEnableThisTool").' '.$form->selectyesno("AGENDA_DISABLE_EXT",$selectedvalue,1).'

'; -$var=false; +$var=true; print ""; print ""; -print '"; -print ""; +print '"; +print '"; +print ""; + +// Show external agenda +$var=!$var; +print ""; +print ""; +print '"; print ""; // Nb of agenda -print ""; -print ""; -print ""; -print ""; +$var=!$var; +print ""; +print ""; +print '"; +print ""; print "
'.$langs->trans("Parameter")."".$langs->trans("Value")."'.$langs->trans("Parameter")."'.$langs->trans("Value")."
".$langs->trans("ExtSitesEnableThisTool")."'; +if ($conf->use_javascript_ajax) +{ + print ajax_constantonoff('AGENDA_DISABLE_EXT',array('enabled'=>array(0=>'.hideifnotset')),null,1); +} +else +{ + if($conf->global->AGENDA_DISABLE_EXT == 0) + { + print ''.img_picto($langs->trans("Enabled"),'on').''; + } + else + { + print ''.img_picto($langs->trans("Disabled"),'off').''; + } +} +print "
".$langs->trans("ExtSitesNbOfAgenda").""; -print ''; -print "
".$langs->trans("ExtSitesNbOfAgenda")."'; +print ''; +print "
"; print "
"; @@ -162,7 +184,7 @@ print ""; print "".$langs->trans("Parameter").""; print "".$langs->trans("Name").""; print "".$langs->trans("ExtSiteUrlAgenda")." (".$langs->trans("Example").': http://yoursite/agenda/agenda.ics)'; -print ''.$langs->trans("Color").''; +print ''.$langs->trans("Color").''; print ""; $i=1; @@ -173,19 +195,19 @@ while ($i <= $MAXAGENDA) $name='AGENDA_EXT_NAME'.$key; $src='AGENDA_EXT_SRC'.$key; $color='AGENDA_EXT_COLOR'.$key; - + $var=!$var; print ""; // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name - print ''; + print ''; // URL - print ''; + print ''; // Color (Possible colors are limited by Google) - print ''; - //print $formadmin->select_colors($conf->global->$color, "google_agenda_color".$key, $colorlist); - print $formother->select_color((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, ''); + print ''; + //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); + print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset'); print ''; print ""; $i++; diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 3dfc317509a..64e03fe7f9c 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -75,13 +75,13 @@ $linkback='
'.$langs->trans("BackToM print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); print '
'; -print $langs->trans("AgendaSetupOtherDesc")."
\n"; -print "
\n"; $head=agenda_prepare_head(); dol_fiche_head($head, 'xcal', $langs->trans("Agenda")); +print $langs->trans("AgendaSetupOtherDesc")."
\n"; +print "
\n"; print ''; print ''; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 4b886f2d24f..4451fcd49e1 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -676,7 +676,7 @@ if ($action == 'create') print ''; print ''; print ''; print '';*/ // Message @@ -1124,7 +1124,7 @@ else // Background color print ''; // Message diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index e5c1f2e6a2f..dffb7f37982 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -465,6 +465,7 @@ class FormOther * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void + * @deprecated */ function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') { @@ -479,9 +480,10 @@ class FormOther * @param string $form_name Name of form * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string $morecss Add css style into input field * @return void */ - function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') + function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='', $morecss='') { global $langs; @@ -529,7 +531,7 @@ class FormOther } } ); }); '; - $out.= ''; + $out.= ''; } else // In most cases, this is not used. We used instead function with no specific list of colors { @@ -545,7 +547,7 @@ class FormOther }); '; - $out.= ''; //print ''; foreach ($arrayofcolors as $val) { diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index ba2df7195f8..071034b5fcc 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -643,16 +643,27 @@ function setConstant(url, code, input, entity) { // Enable another element if (type == "disabled") { $.each(data, function(key, value) { - $("#" + value).removeAttr("disabled"); - if ($("#" + value).hasClass("butActionRefused") == true) { - $("#" + value).removeClass("butActionRefused"); - $("#" + value).addClass("butAction"); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).removeAttr("disabled"); + if ($(newvalue).hasClass("butActionRefused") == true) { + $(newvalue).removeClass("butActionRefused"); + $(newvalue).addClass("butAction"); } }); + } else if (type == "enabled") { + $.each(data, function(key, value) { + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).attr("disabled", true); + if ($(newvalue).hasClass("butAction") == true) { + $(newvalue).removeClass("butAction"); + $(newvalue).addClass("butActionRefused"); + } + }); // Show another element } else if (type == "showhide" || type == "show") { $.each(data, function(key, value) { - $("#" + value).show(); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).show(); }); // Set another constant } else if (type == "set") { @@ -687,16 +698,27 @@ function delConstant(url, code, input, entity) { // Disable another element if (type == "disabled") { $.each(data, function(key, value) { - $("#" + value).attr("disabled", true); - if ($("#" + value).hasClass("butAction") == true) { - $("#" + value).removeClass("butAction"); - $("#" + value).addClass("butActionRefused"); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).attr("disabled", true); + if ($(newvalue).hasClass("butAction") == true) { + $(newvalue).removeClass("butAction"); + $(newvalue).addClass("butActionRefused"); } }); + } else if (type == "enabled") { + $.each(data, function(key, value) { + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).removeAttr("disabled"); + if ($(newvalue).hasClass("butActionRefused") == true) { + $(newvalue).removeClass("butActionRefused"); + $(newvalue).addClass("butAction"); + } + }); // Hide another element } else if (type == "showhide" || type == "hide") { $.each(data, function(key, value) { - $("#" + value).hide(); + var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value; + $(newvalue).hide(); }); // Delete another constant } else if (type == "del") { diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 64b1339a944..f22ae595a77 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -353,12 +353,13 @@ function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0) /** * On/off button for constant * - * @param string $code Name of constant - * @param array $input Input element (enable/disable or show/hide another element, set/del another constant) - * @param int $entity Entity to set + * @param string $code Name of constant + * @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid')) + * @param int $entity Entity to set + * @param int $revertonoff Revert on/off * @return void */ -function ajax_constantonoff($code, $input=array(), $entity=false) +function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0) { global $conf, $langs; @@ -399,8 +400,8 @@ function ajax_constantonoff($code, $input=array(), $entity=false) '."\n"; $out.= ''; - $out.= ''.img_picto($langs->trans("Disabled"),'switch_off').''; - $out.= ''.img_picto($langs->trans("Enabled"),'switch_on').''; + $out.= ''.($revertonoff?img_picto($langs->trans("Enabled"),'switch_on'):img_picto($langs->trans("Disabled"),'switch_off')).''; + $out.= ''.($revertonoff?img_picto($langs->trans("Disabled"),'switch_off'):img_picto($langs->trans("Enabled"),'switch_on')).''; $out.="\n"; return $out; diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2f4782dd3bb..04a95bf5980 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -25,7 +25,7 @@ HTMLCharset= Charset des pages HTML générées DBStoringCharset= Charset base pour stockage données DBSortingCharset= Charset base pour tri données WarningModuleNotActive= Module %s non actif -WarningOnlyPermissionOfActivatedModules= Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer les autres modules sur la page Accueil->Configuration->Modules +WarningOnlyPermissionOfActivatedModules= Attention, seules les permissions en rapport avec les modules activés sont affichées ici. Vous pouvez activer d'autres modules sur la page Accueil->Configuration->Modules DolibarrSetup= Installation ou mise à jour de Dolibarr DolibarrUser= Utilisateur Dolibarr InternalUser= Utilisateur interne @@ -1349,7 +1349,7 @@ AccountancyCodeBuy=Code compta achat AgendaSetup= Configuration du module actions et agenda PasswordTogetVCalExport= Clé pour autoriser lien export PastDelayVCalExport=Ne pas exporter les événements de plus de -AGENDA_USE_EVENT_TYPE=Utilisez les type des évenements (administrable dans Configuration->Dictionnary->llx_c_actioncomm) +AGENDA_USE_EVENT_TYPE=Utilisez les types des évenements (administrable dans Configuration -> Dictionnaires -> Liste des types d'évenements de l'agenda) ##### ClickToDial ##### ClickToDialDesc= Ce module permet d'ajouter un petit picto à côté des numéros de téléphones. Un clic sur ce picto provoque l'appel de l'URL définie dans ce paramétrage. Ceci permet de provoquer des appels à un serveur de téléphonie depuis Dolibarr qui peut alors composer le numéro sur un système SIP par exemple. ##### Point Of Sales (CashDesk) #####
'.$langs->trans("MailTopic").'
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($_POST['bgcolor'],'bgcolor','new_mailing',0); + print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0); print '
'.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; @@ -1001,7 +1001,7 @@ else // Background color /*print '
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($object->bgcolor,'bgcolor','edit_mailing',0); + print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '
'.$langs->trans("BackgroundColorByDefault").''; - $htmlother->select_color($object->bgcolor,'bgcolor','edit_mailing',0); + print $htmlother->selectColor($object->bgcolor,'bgcolor','edit_mailing',0); print '