Create Event - Add fields

This commit is contained in:
atm-lena 2020-08-25 12:40:29 +02:00
parent c2e98c7c90
commit 25840c2b3d
2 changed files with 47 additions and 1 deletions

View File

@ -64,6 +64,10 @@ $apmin = GETPOST('apmin');
$p2hour = GETPOST('p2hour');
$p2min = GETPOST('p2min');
$offsetvalue = GETPOST('offsetvalue');
$offsetunit = GETPOST('offsetunittype_duration');
$typeremind = GETPOST('typeremind');
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year"));
@ -1106,7 +1110,28 @@ if ($action == 'create')
print '</table>';
dol_fiche_end();
print '<br><hr><br>';
print '<table class="border centpercent">';
//Reminder
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("Reminder").'</td><td colspan="3">';
print '<input type="number" name="offsetvalue" value="10" size="5">';
print '</td></tr>';
//Reminder Type
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("ReminderType").'</td><td colspan="3">';
print $form->select_type_duration('offsetunit');
print '</td></tr>';
//Notification
print '<tr><td class="titlefieldcreate nowrap">'.$langs->trans("TypeRemind").'</td><td colspan="3">';
print $form->selectarray('typeremind', array('mail'=>$langs->trans('EMail'), 'push'=>$langs->trans('OSNotif')));
print '</td></tr>';
print '</table>';
dol_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Add").'">';

View File

@ -5673,6 +5673,27 @@ class Form
return $retstring;
}
public function select_type_duration($prefix){
global $langs;
$retstring = '';
$TDurationTypes = array('year'=>$langs->trans('Years'), 'month'=>$langs->trans('Month'), 'week'=>$langs->trans('Weeks'), 'day'=>$langs->trans('Days'), 'minute'=>$langs->trans('Minutes'));
$retstring .= '<select class="flat" id="select_'.$prefix.'type_duration" name="'.$prefix.'type_duration">';
foreach($TDurationTypes as $key=>$typeduration){
$retstring .= '<option value="'.$key.'"';
$retstring .= ">".$typeduration."</option>";
}
$retstring .= "</select>";
print $retstring;
return;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Function to show a form to select a duration on a page