mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 03:12:35 +01:00
Merge pull request #14568 from atm-lena/NEW_AgendaEvent_Remind
Agenda Remind (Part 1)
This commit is contained in:
@@ -5669,6 +5669,38 @@ class Form
|
||||
return $retstring;
|
||||
}
|
||||
|
||||
/**
|
||||
* select_type_duration
|
||||
*
|
||||
* @param string $prefix Prefix
|
||||
* @param string $modelType Model type
|
||||
* @return string HTML select string
|
||||
*/
|
||||
public function select_type_duration($prefix, $selected = 'minute')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$retstring = '';
|
||||
|
||||
$TDurationTypes = array('year'=>$langs->trans('Years'), 'month'=>$langs->trans('Month'), 'week'=>$langs->trans('Weeks'), 'day'=>$langs->trans('Days'), 'hour'=>$langs->trans('Hours'), '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.'"';
|
||||
if($key == $selected)
|
||||
{
|
||||
$retstring .= " selected";
|
||||
}
|
||||
$retstring .= ">".$typeduration."</option>";
|
||||
}
|
||||
|
||||
$retstring .= "</select>";
|
||||
|
||||
return $retstring;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Function to show a form to select a duration on a page
|
||||
@@ -7941,4 +7973,41 @@ class Form
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* select_model_mail
|
||||
*
|
||||
* @param string $prefix Prefix
|
||||
* @param string $modelType Model type
|
||||
* @return string HTML select string
|
||||
*/
|
||||
public function select_model_mail($prefix, $modelType = '') {
|
||||
|
||||
global $langs, $db, $user;
|
||||
|
||||
$retstring = '';
|
||||
|
||||
$TModels = array();
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$result = $formmail->fetchAllEMailTemplate($modelType, $user, $langs);
|
||||
|
||||
if ($result > 0) {
|
||||
foreach ($formmail->lines_model as $model){
|
||||
$TModels[$model->id] = $model->label;
|
||||
}
|
||||
}
|
||||
|
||||
$retstring .= '<select class="flat" id="select_'.$prefix.'model_mail" name="'.$prefix.'model_mail">';
|
||||
|
||||
foreach ($TModels as $id_model=>$label_model){
|
||||
$retstring .= '<option value="'.$id_model.'"';
|
||||
$retstring .= ">".$label_model."</option>";
|
||||
}
|
||||
|
||||
$retstring .= "</select>";
|
||||
|
||||
return $retstring;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user