27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
47$langs->loadLangs(array(
"admin",
"other",
"agenda"));
49$action =
GETPOST(
'action',
'aZ09');
50$value =
GETPOST(
'value',
'alpha');
51$modulepart =
GETPOST(
'modulepart',
'aZ09');
53$param =
GETPOST(
'param',
'alpha');
54$cancel =
GETPOST(
'cancel',
'alpha');
55$scandir =
GETPOST(
'scandir',
'alpha');
64include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
66if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg)) {
70 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
77if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg)) {
80 header(
"Location: ".$_SERVER[
"PHP_SELF"]);
86if ($action ==
'set') {
92 dolibarr_set_const($db,
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT',
GETPOST(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration'),
'chaine', 0,
'',
$conf->entity);
94 dolibarr_set_const($db,
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES', json_encode(
GETPOST(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES')),
'chaine', 0,
'',
$conf->entity);
95} elseif ($action ==
'specimen') {
96 $modele =
GETPOST(
'module',
'alpha');
99 $commande->initAsSpecimen();
100 $specimenthirdparty =
new Societe($db);
101 $specimenthirdparty->initAsSpecimen();
102 $commande->thirdparty = $specimenthirdparty;
107 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
108 foreach ($dirmodels as $reldir) {
109 $file =
dol_buildpath($reldir.
"core/modules/action/doc/pdf_".$modele.
".modules.php", 0);
110 if (file_exists($file)) {
111 $classname =
"pdf_".$modele;
116 if ($classname !==
'') {
119 $module =
new $classname($db, $commande);
120 '@phan-var-force pdf_standard_actions $module';
123 if ($module->write_file($commande, $langs) > 0) {
124 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=action&file=SPECIMEN.pdf");
132 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
134} elseif ($action ==
'setmodel') {
138} elseif ($action ==
'del') {
141 if (
$conf->global->ACTION_EVENT_ADDON_PDF ==
"$value") {
145} elseif ($action ==
'setdoc') {
150 $conf->global->ACTION_EVENT_ADDON_PDF = $value;
166$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
167llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-agenda_reminder');
169$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
170print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
177print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" name="agenda">';
178print
'<input type="hidden" name="token" value="'.newToken().
'">';
179print
'<input type="hidden" name="action" value="set">';
181print
'<table class="noborder allwidth">'.
"\n";
182print
'<tr class="liste_titre">'.
"\n";
183print
'<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
184print
'<td class="center"> </td>'.
"\n";
185print
'<td class="right"></td>'.
"\n";
189print
'<tr class="oddeven">'.
"\n";
191print $langs->trans(
'AGENDA_REMINDER_BROWSER').
'<br>';
192print
'<span class="opacitymedium">'.$langs->trans(
'AGENDA_REMINDER_BROWSERHelp').
'</span>';
194print
'<td class="center"> </td>'.
"\n";
195print
'<td class="right nowraponall">'.
"\n";
202 print
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
203 print
'</td></tr>'.
"\n";
209 print
'<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
210 print
'</td></tr>'.
"\n";
229$job->fetch(0,
'ActionComm',
'sendEmailsReminder');
232print
'<tr class="oddeven">'.
"\n";
234print $langs->trans(
'AGENDA_REMINDER_EMAIL', $langs->transnoentities(
"Module2300Name"));
235if (isModEnabled(
'cron')) {
238 if ($job->status == $job::STATUS_ENABLED) {
239 print
'<br><span class="opacitymedium">'.$langs->trans(
"AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
245print
'<td class="center"> </td>'.
"\n";
246print
'<td class="right nowraponall">'.
"\n";
248if (!isModEnabled(
'cron')) {
249 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
252 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
256 if ($job->status != $job::STATUS_ENABLED) {
257 $langs->load(
"cron");
258 print
'<span class="opacitymedium warning">'.$langs->trans(
"JobXMustBeEnabled", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
260 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
263 $langs->load(
"cron");
264 print
'<span class="opacitymedium warning">'.$langs->trans(
"JobNotFound", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
271 print
'<tr class="oddeven">'.
"\n";
273 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES', $langs->transnoentities(
"Module2300Name"));
274 print
'<br><span class="opacitymedium">'.$langs->trans(
"AGENDA_DEFAULT_REMINDER_EVENT_TYPES_NOTE", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
276 print
'<td class="center"> </td>'.
"\n";
277 print
'<td class="right nowraponall">'.
"\n";
278 if (!isModEnabled(
'cron')) {
279 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
281 if (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES')) {
282 $selected =
GETPOST(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES');
284 $selected = json_decode(
getDolGlobalString(
'AGENDA_DEFAULT_REMINDER_EVENT_TYPES',
''));
286 print
$formactions->select_type_actions($selected,
"AGENDA_DEFAULT_REMINDER_EVENT_TYPES",
"systemauto", 0, -1, 1, 1);
293 print
'<tr class="oddeven">'.
"\n";
295 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_OFFSET', $langs->transnoentities(
"Module2300Name"));
297 print
'<td class="center"> </td>'.
"\n";
298 print
'<td class="right nowraponall">'.
"\n";
299 if (!isModEnabled(
'cron')) {
300 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
302 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)).
'"> ';
303 $selected = (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration') ?
GETPOST(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_type_duration') :
getDolGlobalString(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT',
'i'));
304 print $form->selectTypeDuration(
'AGENDA_DEFAULT_REMINDER_OFFSET_UNIT_', $selected, array(
'y',
'm'));
310 print
'<tr class="oddeven">'.
"\n";
312 print $langs->trans(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL', $langs->transnoentities(
"Module2300Name"));
314 print
'<td class="center"> </td>'.
"\n";
315 print
'<td class="right nowraponall">'.
"\n";
316 if (!isModEnabled(
'cron')) {
317 print
'<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
319 $selected = (GETPOSTISSET(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODELmodel_mail') ?
GETPOST(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODELmodel_mail') :
getDolGlobalInt(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL', 0));
320 print $form->selectModelMail(
'AGENDA_DEFAULT_REMINDER_EMAIL_MODEL',
'actioncomm_send', 1, 1, $selected);
323print
'</td></tr>'.
"\n";
329print
'<div class="center">';
330print
'<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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.