29 require
'../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
38 $langs->loadLangs(array(
'admin',
'other',
'agenda'));
40 $action =
GETPOST(
'action',
'aZ09');
41 $cancel =
GETPOST(
'cancel',
'alpha');
43 $search_event =
GETPOST(
'search_event',
'alpha');
47 $sql =
"SELECT a.rowid, a.code, a.label, a.elementtype, a.rang as position";
48 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_action_trigger as a";
49 $sql .=
" ORDER BY a.rang ASC";
52 $num = $db->num_rows(
$resql);
55 $obj = $db->fetch_object(
$resql);
56 $triggers[$i][
'rowid'] = $obj->rowid;
57 $triggers[$i][
'code'] = $obj->code;
58 $triggers[$i][
'element'] = $obj->elementtype;
59 $triggers[$i][
'label'] = ($langs->trans(
"Notify_".$obj->code) !=
"Notify_".$obj->code ? $langs->trans(
"Notify_".$obj->code) : $obj->label);
60 $triggers[$i][
'position'] = $obj->position;
77 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')) {
86 if ($action ==
"save" && empty($cancel)) {
91 foreach ($triggers as $trigger) {
92 $keyparam =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
93 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $keyparam)) {
118 $help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
122 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
123 print
load_fiche_titre($langs->trans(
"AgendaSetup"), $linkback,
'title_setup');
125 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
126 print
'<input type="hidden" name="token" value="'.newToken().
'">';
127 print
'<input type="hidden" name="action" value="save">';
130 $param .=
'&search_event='.urlencode($search_event);
134 print
dol_get_fiche_head($head,
'autoactions', $langs->trans(
"Agenda"), -1,
'action');
136 print
'<span class="opacitymedium">'.$langs->trans(
"AgendaAutoActionDesc").
" ".$langs->trans(
"OnlyActiveElementsAreShown",
'modules.php').
'</span><br>';
139 print
'<div class="div-table-responsive">';
140 print
'<table class="noborder centpercent">';
141 print
'<tr class="liste_titre">';
142 print
'<td class="liste_titre"><input type="text" name="search_event" value="'.dol_escape_htmltag($search_event).
'"></td>';
143 print
'<td class="liste_titre"></td>';
145 print
'<td class="liste_titre maxwidthsearch">';
146 $searchpicto =
$form->showFilterButtons();
152 print
'<tr class="liste_titre">';
153 print
'<th class="liste_titre" colspan="2">'.$langs->trans(
"ActionsEvents").
'</th>';
154 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>';
157 if (!empty($triggers)) {
158 foreach ($triggers as $trigger) {
159 $module = $trigger[
'element'];
160 if ($module ==
'order_supplier' || $module ==
'invoice_supplier') {
161 $module =
'fournisseur';
163 if ($module ==
'shipping') {
164 $module =
'expedition_bon';
166 if ($module ==
'member') {
167 $module =
'adherent';
169 if ($module ==
'project') {
172 if ($module ==
'proposal_supplier') {
173 $module =
'supplier_proposal';
175 if ($module ==
'contact') {
178 if ($module ==
'facturerec') {
183 $tmparray = explode(
'@', $module);
184 if (!empty($tmparray[1])) {
185 $module = $tmparray[1];
191 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
194 if ($trigger[
'code'] ==
'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) {
198 if ($search_event ===
'' || preg_match(
'/'.preg_quote($search_event,
'/').
'/i', $trigger[
'code'])) {
199 print
'<!-- '.$trigger[
'position'].
' -->';
200 print
'<tr class="oddeven">';
201 print
'<td>'.$trigger[
'code'].
'</td>';
202 print
'<td>'.$trigger[
'label'].
'</td>';
203 print
'<td class="right" width="40">';
204 $key =
'MAIN_AGENDA_ACTIONAUTO_'.$trigger[
'code'];
205 $value = $conf->global->$key;
206 print
'<input class="oddeven" type="checkbox" name="'.$key.
'" value="1"'.((($action ==
'selectall' || $value) && $action !=
"selectnone") ?
' checked' :
'').
'>';
207 print
'</td></tr>'.
"\n";
217 print
$form->buttonsSaveCancel(
"Save",
'');
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)) $help_url
View.
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()
Empty header.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.