diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 1014d40de50..3f976efc784 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -53,6 +53,9 @@ $type = 'action'; * Actions */ +$error = 0; +$errors = array(); + include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; $reg = array(); @@ -109,7 +112,36 @@ if ($action == 'set') { } else { setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } -} elseif ($action == 'specimen') { // For orders + +} elseif ($action == 'setcolors') { + $event_color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('event_past_color', 'alphanohtml')); + $res = dolibarr_set_const($db, 'AGENDA_EVENT_PAST_COLOR', $event_color, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + $errors[] = $db->lasterror(); + } + + $event_color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('event_progress_color', 'alphanohtml')); + $res = dolibarr_set_const($db, 'AGENDA_EVENT_PROGRESS_COLOR', $event_color, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + $errors[] = $db->lasterror(); + } + + $event_color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('event_future_color', 'alphanohtml')); + $res = dolibarr_set_const($db, 'AGENDA_EVENT_FUTURE_COLOR', $event_color, 'chaine', 0, '', $conf->entity); + if (!$res > 0) { + $error++; + $errors[] = $db->lasterror(); + } + + if ($error) { + setEventMessages('', $errors, 'errors'); + } else { + setEventMessage($langs->trans('SetupSaved')); + } +} +elseif ($action == 'specimen') { // For orders $modele = GETPOST('module', 'alpha'); $commande = new CommandeFournisseur($db); @@ -192,9 +224,10 @@ print dol_get_fiche_head($head, 'other', $langs->trans("Agenda"), -1, 'action'); /* - * Documents models for supplier orders + * Miscellaneous */ +print load_fiche_titre($langs->trans('Miscellaneous'), '', ''); // Define array def of models $def = array(); @@ -394,7 +427,54 @@ print ''."\n"; print ''; -print dol_get_fiche_end(); +print $form->buttonsSaveCancel("Save", ''); + +print ''; + + +/* + * User interface (colors) + */ + +print load_fiche_titre($langs->trans('UserInterface'), '', ''); + +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +$formother = new FormOther($db); + +print '
'; print "