NEW Can set default value of event type when creating an event (if type
of event option is used).
This commit is contained in:
parent
3f506552e3
commit
60c6510fc1
@ -74,8 +74,9 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', GETPOST('AGENDA_DEFAULT_FILTER_TYPE'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
@ -127,6 +128,17 @@ else
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>'."\n";
|
||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
|
||||
print '<td align="center"> </td>'."\n";
|
||||
print '<td align="right" class="nowrap">'."\n";
|
||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", '', 0, 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
// AGENDA_DEFAULT_FILTER_TYPE
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>'."\n";
|
||||
|
||||
@ -647,7 +647,8 @@ if ($action == 'create')
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
{
|
||||
print '<tr><td width="30%"><span class="fieldrequired">'.$langs->trans("Type").'</span></b></td><td>';
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):$object->type_code, "actioncode","systemauto");
|
||||
$default=(empty($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT)?'':$conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT);
|
||||
$formactions->select_type_actions(GETPOST("actioncode")?GETPOST("actioncode"):($object->type_code?$object->type_code:$default), "actioncode","systemauto");
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -1546,6 +1546,7 @@ AgendaSetup=Events and agenda module setup
|
||||
PasswordTogetVCalExport=Key to authorize export link
|
||||
PastDelayVCalExport=Do not export event older than
|
||||
AGENDA_USE_EVENT_TYPE=Use events types (managed into menu Setup -> Dictionary -> Type of agenda events)
|
||||
AGENDA_USE_EVENT_TYPE_DEFAULT=Set automatically this default value for type of event into event create form
|
||||
AGENDA_DEFAULT_FILTER_TYPE=Set automatically this type of event into search filter of agenda view
|
||||
AGENDA_DEFAULT_FILTER_STATUS=Set automatically this status for events into search filter of agenda view
|
||||
AGENDA_DEFAULT_VIEW=Which tab do you want to open by default when selecting menu Agenda
|
||||
|
||||
Loading…
Reference in New Issue
Block a user