26require
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
38$langs->loadLangs(array(
"admin",
"other",
"agenda"));
40$action =
GETPOST(
'action',
'aZ09');
41$value =
GETPOST(
'value',
'alpha');
42$modulepart =
GETPOST(
'modulepart',
'aZ09');
44$param =
GETPOST(
'param',
'alpha');
45$cancel =
GETPOST(
'cancel',
'alpha');
46$scandir =
GETPOST(
'scandir',
'alpha');
55include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
57if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
61 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
68if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
71 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
77if ($action ==
'set') {
78 dolibarr_set_const($db,
'AGENDA_USE_EVENT_TYPE_DEFAULT',
GETPOST(
'AGENDA_USE_EVENT_TYPE_DEFAULT'),
'chaine', 0,
'', $conf->entity);
79 dolibarr_set_const($db,
'AGENDA_DEFAULT_FILTER_TYPE',
GETPOST(
'AGENDA_DEFAULT_FILTER_TYPE'),
'chaine', 0,
'', $conf->entity);
80 dolibarr_set_const($db,
'AGENDA_DEFAULT_FILTER_STATUS',
GETPOST(
'AGENDA_DEFAULT_FILTER_STATUS'),
'chaine', 0,
'', $conf->entity);
83 dolibarr_set_const($db,
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT',
GETPOST(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration'),
'chaine', 0,
'', $conf->entity);
84 dolibarr_set_const($db,
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL',
GETPOSTINT(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODELmodel_mail'),
'chaine', 0,
'', $conf->entity);
85 dolibarr_set_const($db,
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES', json_encode(
GETPOST(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES')),
'chaine', 0,
'', $conf->entity);
86} elseif ($action ==
'specimen') {
87 $modele =
GETPOST(
'module',
'alpha');
90 $commande->initAsSpecimen();
91 $specimenthirdparty =
new Societe($db);
92 $specimenthirdparty->initAsSpecimen();
93 $commande->thirdparty = $specimenthirdparty;
98 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
99 foreach ($dirmodels as $reldir) {
100 $file =
dol_buildpath($reldir.
"core/modules/action/doc/pdf_".$modele.
".modules.php", 0);
101 if (file_exists($file)) {
102 $classname =
"pdf_".$modele;
107 if ($classname !==
'') {
110 $module =
new $classname($db, $commande);
111 '@phan-var-force pdf_standard_actions $module';
113 if ($module->write_file($commande, $langs) > 0) {
114 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=action&file=SPECIMEN.pdf");
122 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
124} elseif ($action ==
'setmodel') {
128} elseif ($action ==
'del') {
131 if ($conf->global->ACTION_EVENT_ADDON_PDF ==
"$value") {
135} elseif ($action ==
'setdoc') {
137 if (
dolibarr_set_const($db,
"ACTION_EVENT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
140 $conf->global->ACTION_EVENT_ADDON_PDF = $value;
156$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
157llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-agenda_reminder');
159$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
160print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
167print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="agenda">';
168print
'<input type="hidden" name="token" value="'.newToken().
'">';
169print
'<input type="hidden" name="action" value="set">';
171print
'<table class="noborder allwidth">'.
"\n";
172print
'<tr class="liste_titre">'.
"\n";
173print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
174print
'<td class="center"> </td>'.
"\n";
175print
'<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
179print
'<tr class="oddeven">'.
"\n";
181print $langs->trans(
'AGENDA_REMINDER_BROWSER').
'<br>';
182print
'<span class="opacitymedium">'.$langs->trans(
'AGENDA_REMINDER_BROWSERHelp').
'</span>';
184print
'<td class="center"> </td>'.
"\n";
185print
'<td class="right nowraponall">'.
"\n";
192 print
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
193 print
'</td></tr>'.
"\n";
199 print
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
200 print
'</td></tr>'.
"\n";
219$job->fetch(0,
'ActionComm',
'sendEmailsReminder');
222print
'<tr class="oddeven">'.
"\n";
224print $langs->trans(
'AGENDA_REMINDER_EMAIL', $langs->transnoentities(
"Module2300Name"));
225if (isModEnabled(
'cron')) {
228 if ($job->status == $job::STATUS_ENABLED) {
229 print
'<br><span class="opacitymedium">'.$langs->trans(
"AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
235print
'<td class="center"> </td>'.
"\n";
236print
'<td class="right nowraponall">'.
"\n";
238if (!isModEnabled(
'cron')) {
239 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
242 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
246 if ($job->status != $job::STATUS_ENABLED) {
247 $langs->load(
"cron");
248 print
'<span class="opacitymedium warning">'.$langs->trans(
"JobXMustBeEnabled", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
250 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
253 $langs->load(
"cron");
254 print
'<span class="opacitymedium warning">'.$langs->trans(
"JobNotFound", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
261 print
'<tr class="oddeven">'.
"\n";
263 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES', $langs->transnoentities(
"Module2300Name"));
264 print
'<br><span class="opacitymedium">'.$langs->trans(
"AGENDA_DEFAULT_REMINDER_EVENT_TYPES_NOTE", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
266 print
'<td class="center"> </td>'.
"\n";
267 print
'<td class="right nowraponall">'.
"\n";
268 if (!isModEnabled(
'cron')) {
269 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
271 if (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES')) {
272 $selected =
GETPOST(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES');
274 $selected = json_decode(
getDolGlobalString(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES',
''));
276 print
$formactions->select_type_actions($selected,
"AGENDA_DEFAULT_REMINDER_EVENT_TYPES",
"systemauto", 0, -1, 1, 1);
283 print
'<tr class="oddeven">'.
"\n";
285 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_OFFSET', $langs->transnoentities(
"Module2300Name"));
287 print
'<td class="center"> </td>'.
"\n";
288 print
'<td class="right nowraponall">'.
"\n";
289 if (!isModEnabled(
'cron')) {
290 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
292 print
'<input class="width50" type="number" name="AGENDA_DEFAULT_REMINDER_OFFSET" value="'.(GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_OFFSET') ?
GETPOSTINT(
'AGENDA_DEFAULT_REMINDER_OFFSET') :
getDolGlobalInt(
'AGENDA_DEFAULT_REMINDER_OFFSET', 30)).
'"> ';
293 $selected = (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration') ?
GETPOST(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration') :
getDolGlobalString(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT',
'i'));
294 print $form->selectTypeDuration(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_', $selected, array(
'y',
'm'));
300 print
'<tr class="oddeven">'.
"\n";
302 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL', $langs->transnoentities(
"Module2300Name"));
304 print
'<td class="center"> </td>'.
"\n";
305 print
'<td class="right nowraponall">'.
"\n";
306 if (!isModEnabled(
'cron')) {
307 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
309 $selected = (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODELmodel_mail') ?
GETPOST(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODELmodel_mail') :
getDolGlobalInt(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL', 0));
310 print $form->selectModelMail(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL',
'actioncomm_send', 1, 1, $selected);
313print
'</td></tr>'.
"\n";
319print
'<div class="center">';
320print
'<input type="submit" id="save" name="save" class="button hideifnotset button-save" value="'.$langs->trans(
"Save").
'">';
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
agenda_prepare_head()
Prepare array with list of tabs.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage predefined suppliers products.
Class to manage third parties objects (customers, suppliers, prospects...)
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.