27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
35 $langs->loadLangs(array(
'admin',
'other',
'agenda'));
37 $action =
GETPOST(
'action',
'aZ09');
38 $cancel =
GETPOST(
'cancel',
'alpha');
40 $search_event =
GETPOST(
'search_event',
'alpha');
44 $sql =
"SELECT a.rowid, a.code, a.label, a.elementtype, a.rang as position";
45 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_action_trigger as a";
46 $sql .=
" ORDER BY a.rang ASC";
50 $num = $db->num_rows(
$resql);
54 $obj = $db->fetch_object(
$resql);
55 $triggers[$i][
'rowid'] = $obj->rowid;
56 $triggers[$i][
'code'] = $obj->code;
57 $triggers[$i][
'element'] = $obj->elementtype;
58 $triggers[$i][
'label'] = ($langs->trans(
"Notify_".$obj->code) !=
"Notify_".$obj->code ? $langs->trans(
"Notify_".$obj->code) : $obj->label);
59 $triggers[$i][
'position'] = $obj->position;
76 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha'))
82 if (
GETPOST(
'button_search_x',
'alpha') ||
GETPOST(
'button_search.x',
'alpha') ||
GETPOST(
'button_search',
'alpha'))
87 if ($action ==
"save" && empty($cancel))
93 foreach ($triggers as $trigger)
95 $keyparam =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
97 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $keyparam))
100 if (!($res > 0)) $error++;
120 $wikihelp =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
123 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
126 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
127 print '<input type="hidden" name="token" value="'.newToken().
'">';
128 print '<input type="hidden" name="action" value="save">';
131 $param .=
'&search_event='.urlencode($search_event);
137 print '<span class="opacitymedium">'.$langs->trans(
"AgendaAutoActionDesc").
" ".$langs->trans(
"OnlyActiveElementsAreShown",
'modules.php').
'</span><br>';
140 print '<div class="div-table-responsive">';
141 print '<table class="noborder centpercent">';
142 print '<tr class="liste_titre">';
143 print '<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).
'"></td>';
144 print '<td class="liste_titre"></td>';
146 print '<td class="liste_titre maxwidthsearch">';
147 $searchpicto = $form->showFilterButtons();
153 print '<tr class="liste_titre">';
154 print '<th class="liste_titre" colspan="2">'.$langs->trans(
"ActionsEvents").
'</th>';
155 print '<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>';
158 if (!empty($triggers))
160 foreach ($triggers as $trigger)
162 $module = $trigger[
'element'];
163 if ($module ==
'order_supplier' || $module ==
'invoice_supplier') $module =
'fournisseur';
164 if ($module ==
'shipping') $module =
'expedition_bon';
165 if ($module ==
'member') $module =
'adherent';
166 if ($module ==
'project') $module =
'projet';
167 if ($module ==
'proposal_supplier') $module =
'supplier_proposal';
168 if ($module ==
'contact') $module =
'societe';
171 $tmparray = explode(
'@', $module);
172 if (!empty($tmparray[1])) {
173 $module = $tmparray[1];
177 if (!empty($conf->$module->enabled))
180 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED))
continue;
181 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED))
continue;
183 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $trigger[
'code']))
185 print '<tr class="oddeven">';
186 print '<td>'.$trigger[
'code'].
'</td>';
187 print '<td>'.$trigger[
'label'].
'</td>';
188 print '<td class="right" width="40">';
189 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
190 $value = $conf->global->$key;
191 print '<input class="oddeven" type="checkbox" name="'.$key.
'" value="1"'.((($action ==
'selectall' || $value) && $action !=
"selectnone") ?
' checked' :
'').
'>';
192 print '</td></tr>'.
"\n";
202 print '<div class="center">';
203 print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
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.
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 ...
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.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.