29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
46$langs->loadLangs(array(
'admin',
'other',
'agenda'));
48$action =
GETPOST(
'action',
'aZ09');
49$cancel =
GETPOST(
'cancel',
'alpha');
51$search_event =
GETPOST(
'search_event',
'alpha');
55$sql =
"SELECT a.rowid, a.code, a.label, a.elementtype, a.rang as position";
56$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_action_trigger as a";
57$sql .=
" ORDER BY a.rang ASC";
58$resql = $db->query($sql);
60 $num = $db->num_rows($resql);
63 $obj = $db->fetch_object($resql);
64 $triggers[$i][
'rowid'] = $obj->rowid;
65 $triggers[$i][
'code'] = $obj->code;
66 $triggers[$i][
'element'] = $obj->elementtype;
67 $triggers[$i][
'label'] = ($langs->trans(
"Notify_".$obj->code) !=
"Notify_".$obj->code ? $langs->trans(
"Notify_".$obj->code) : $obj->label);
68 $triggers[$i][
'position'] = $obj->position;
86if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
91if (
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha')) {
95if ($action ==
"save" && empty($cancel)) {
100 foreach ($triggers as $trigger) {
101 $keyparam =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
102 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $keyparam)) {
127$title = $langs->trans(
"AgendaSetup");
128$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
130llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-agenda');
132$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
133print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
135print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
136print
'<input type="hidden" name="token" value="'.newToken().
'">';
137print
'<input type="hidden" name="action" value="save">';
140$param .=
'&search_event='.urlencode($search_event);
146print
'<span class="opacitymedium">'.$langs->trans(
"AgendaAutoActionDesc").
" ".$langs->trans(
"OnlyActiveElementsAreShown",
'modules.php').
'</span><br>';
149print
'<div class="div-table-responsive">';
150print
'<table class="noborder centpercent">';
151print
'<tr class="liste_titre">';
152print
'<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).
'"></td>';
153print
'<td class="liste_titre"></td>';
155print
'<td class="liste_titre maxwidthsearch">';
156$searchpicto = $form->showFilterButtons();
162print
'<tr class="liste_titre">';
163print
'<th class="liste_titre" colspan="2">'.$langs->trans(
"ActionsEvents").
'</th>';
164print
'<th class="liste_titre"><a href="'.$_SERVER[
"PHP_SELF"].
'?action=selectall'.($param ? $param :
'').
'">'.$langs->trans(
"All").
'</a>/<a href="'.$_SERVER[
"PHP_SELF"].
'?action=selectnone'.($param ? $param :
'').
'">'.$langs->trans(
"None").
'</a></th>';
167if (!empty($triggers)) {
168 foreach ($triggers as $trigger) {
169 $module = $trigger[
'element'];
170 if ($module ==
'order_supplier' || $module ==
'invoice_supplier') {
171 $module =
'fournisseur';
173 if ($module ==
'shipping') {
174 $module =
'expedition';
176 if ($module ==
'member') {
177 $module =
'adherent';
179 if ($module ==
'project') {
182 if ($module ==
'proposal_supplier') {
183 $module =
'supplier_proposal';
185 if ($module ==
'contact') {
188 if ($module ==
'facturerec') {
193 $tmparray = explode(
'@', $module);
194 if (!empty($tmparray[1])) {
195 $module = $tmparray[1];
199 if (isModEnabled($module)) {
201 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_BILLED' && !
getDolGlobalString(
'FICHINTER_CLASSIFY_BILLED')) {
204 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_UNBILLED' && !
getDolGlobalString(
'FICHINTER_CLASSIFY_BILLED')) {
207 if ($trigger[
'code'] ==
'ACTION_CREATE') {
212 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $trigger[
'code'])) {
213 print
'<!-- '.$trigger[
'position'].
' -->';
214 print
'<tr class="oddeven">';
215 print
'<td>'.$trigger[
'code'].
'</td>';
216 print
'<td>'.$trigger[
'label'].
'</td>';
217 print
'<td class="right" width="40">';
218 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
220 print
'<input class="oddeven" type="checkbox" name="'.$key.
'" value="1"'.((($action ==
'selectall' || $value) && $action !=
"selectnone") ?
' checked' :
'').
'>';
221 print
'</td></tr>'.
"\n";
231print $form->buttonsSaveCancel(
"Save",
'');
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).
agenda_prepare_head()
Prepare array with list of tabs.
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.
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.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
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.