24 require
'../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/cron/class/cronjob.class.php';
34 $langs->loadLangs(array(
"admin",
"other",
"agenda"));
36 $action =
GETPOST(
'action',
'aZ09');
37 $value =
GETPOST(
'value',
'alpha');
38 $param =
GETPOST(
'param',
'alpha');
39 $cancel =
GETPOST(
'cancel',
'alpha');
40 $scandir =
GETPOST(
'scandir',
'alpha');
48 include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
50 if (preg_match(
'/set_([a-z0-9_\-]+)/i', $action, $reg))
56 Header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
63 if (preg_match(
'/del_([a-z0-9_\-]+)/i', $action, $reg))
68 Header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
76 dolibarr_set_const($db,
'AGENDA_USE_EVENT_TYPE_DEFAULT',
GETPOST(
'AGENDA_USE_EVENT_TYPE_DEFAULT'),
'chaine', 0,
'', $conf->entity);
77 dolibarr_set_const($db,
'AGENDA_DEFAULT_FILTER_TYPE',
GETPOST(
'AGENDA_DEFAULT_FILTER_TYPE'),
'chaine', 0,
'', $conf->entity);
78 dolibarr_set_const($db,
'AGENDA_DEFAULT_FILTER_STATUS',
GETPOST(
'AGENDA_DEFAULT_FILTER_STATUS'),
'chaine', 0,
'', $conf->entity);
80 } elseif ($action ==
'specimen')
82 $modele =
GETPOST(
'module',
'alpha');
85 $commande->initAsSpecimen();
86 $commande->thirdparty = $specimenthirdparty;
89 $file =
''; $classname =
''; $filefound = 0;
90 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
91 foreach ($dirmodels as $reldir)
93 $file =
dol_buildpath($reldir.
"core/modules/action/doc/pdf_".$modele.
".modules.php", 0);
94 if (file_exists($file))
97 $classname =
"pdf_".$modele;
106 $module =
new $classname($db, $commande);
108 if ($module->write_file($commande, $langs) > 0)
110 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=action&file=SPECIMEN.pdf");
118 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
123 elseif ($action ==
'setmodel')
127 } elseif ($action ==
'del')
132 if ($conf->global->ACTION_EVENT_ADDON_PDF ==
"$value")
dolibarr_del_const($db,
'ACTION_EVENT_ADDON_PDF', $conf->entity);
137 elseif ($action ==
'setdoc')
139 if (
dolibarr_set_const($db,
"ACTION_EVENT_ADDON_PDF", $value,
'chaine', 0,
'', $conf->entity))
143 $conf->global->ACTION_EVENT_ADDON_PDF = $value;
160 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
163 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
172 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" name="agenda">';
173 print '<input type="hidden" name="token" value="'.newToken().
'">';
174 print '<input type="hidden" name="action" value="set">';
176 print '<table class="noborder allwidth">'.
"\n";
177 print '<tr class="liste_titre">'.
"\n";
178 print '<td>'.$langs->trans(
"Parameters").
'</td>'.
"\n";
179 print '<td class="center"> </td>'.
"\n";
180 print '<td class="right">'.$langs->trans(
"Value").
'</td>'.
"\n";
184 print '<tr class="oddeven">'.
"\n";
185 print '<td>'.$langs->trans(
'AGENDA_REMINDER_BROWSER').
'</td>'.
"\n";
186 print '<td class="center"> </td>'.
"\n";
187 print '<td class="right">'.
"\n";
189 if (empty($conf->global->AGENDA_REMINDER_BROWSER)) {
191 $langs->load(
"errors");
192 print img_warning($langs->trans(
"WarningAvailableOnlyForHTTPSServers"),
'',
'valignmiddle size15x').
' ';
194 print '<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
195 print '</td></tr>'.
"\n";
198 $langs->load(
"errors");
199 print img_warning($langs->trans(
"WarningAvailableOnlyForHTTPSServers"),
'',
'valignmiddle size15x').
' ';
201 print '<a class="valignmiddle" href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_BROWSER&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
202 print '</td></tr>'.
"\n";
204 print '<tr class="oddeven">'.
"\n";
205 print '<td>'.$langs->trans(
'AGENDA_REMINDER_BROWSER_SOUND').
'</td>'.
"\n";
206 print '<td class="center"> </td>'.
"\n";
207 print '<td class="right">'.
"\n";
209 if (empty($conf->global->AGENDA_REMINDER_BROWSER_SOUND)) {
210 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_BROWSER_SOUND&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
212 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_BROWSER_SOUND&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
215 print '</td></tr>'.
"\n";
219 $job->fetch(0,
'ActionComm',
'sendEmailsReminder');
222 print '<tr class="oddeven">'.
"\n";
223 print '<td>'.$langs->trans(
'AGENDA_REMINDER_EMAIL', $langs->transnoentities(
"Module2300Name"));
224 if (!empty($conf->cron->enabled)) {
225 if (!empty($conf->global->AGENDA_REMINDER_EMAIL)) {
227 if ($job->status == $job::STATUS_ENABLED) {
228 print '<br><span class="opacitymedium">'.$langs->trans(
"AGENDA_REMINDER_EMAIL_NOTE", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
234 print '<td class="center"> </td>'.
"\n";
235 print '<td class="right">'.
"\n";
237 if (empty($conf->cron->enabled)) {
238 print '<span class="opacitymedium">'.$langs->trans(
"WarningModuleNotActive", $langs->transnoentitiesnoconv(
"Module2300Name")).
'</span>';
240 if (empty($conf->global->AGENDA_REMINDER_EMAIL)) {
241 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?action=set_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Disabled'),
'switch_off').
'</a>';
245 if ($job->status != $job::STATUS_ENABLED) {
246 print '<span class="opacitymedium warning">'.$langs->trans(
"JobXMustBeEnabled", $langs->transnoentitiesnoconv(
"sendEmailsReminder")).
'</span>';
248 print '<a href="'.$_SERVER[
'PHP_SELF'].
'?action=del_AGENDA_REMINDER_EMAIL&token='.
newToken().
'">'.
img_picto($langs->trans(
'Enabled'),
'switch_on').
'</a>';
253 print '</td></tr>'.
"\n";
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
delDocumentModel($name, $type)
Delete document model used by doc generator.
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.
agenda_prepare_head()
Prepare array with list of tabs.
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).
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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 Calling this function terminate execution ...
Class to manage predefined suppliers products.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
isHTTPS()
Return if we are using a HTTPS connexion Check HTTPS (no way to be modified by user but may be empty ...
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.