33 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
53 $this->family =
"projects";
54 $this->module_position =
'15';
56 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
57 $this->
description =
"Follow events or rendez-vous. Record manual events into Agendas or let application record automatic events for log tracking.";
59 $this->version =
'dolibarr';
61 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
62 $this->picto =
'action';
65 $this->dirs = array(
"/agenda/temp");
68 $this->config_page_url = array(
"agenda_other.php");
71 $this->hidden =
false;
72 $this->depends = array();
73 $this->requiredby = array();
74 $this->conflictwith = array();
75 $this->langfiles = array(
"companies");
76 $this->phpmin = array(5, 4);
79 $this->module_parts = array();
87 $this->
const = array();
89 $sqlreadactions =
"SELECT code, label, description FROM ".MAIN_DB_PREFIX.
"c_action_trigger ORDER by rang";
90 $resql = $this->
db->query($sqlreadactions);
93 while ($obj = $this->
db->fetch_object(
$resql))
96 if (preg_match(
'/^TASK_/', $obj->code))
continue;
98 $this->
const[] = array(
'MAIN_AGENDA_ACTIONAUTO_'.$obj->code,
"chaine",
"1",
'', 0,
'current');
106 $this->tabs = array();
110 $this->boxes = array(0=>array(
'file'=>
'box_actions.php',
'enabledbydefaulton'=>
'Home'));
115 $this->cronjobs = array(
116 0=>array(
'label'=>
'SendEmailsReminders',
'jobtype'=>
'method',
'class'=>
'comm/action/class/actioncomm.class.php',
'objectname'=>
'ActionComm',
'method'=>
'sendEmailsReminder',
'parameters'=>
'',
'comment'=>
'SendEMailsReminder',
'frequency'=>5,
'unitfrequency'=>60,
'priority'=>10,
'status'=>1,
'test'=>
'$conf->agenda->enabled',
'datestart'=>$datestart),
121 $this->rights = array();
122 $this->rights_class =
'agenda';
133 $this->rights[$r][0] = 2401;
134 $this->rights[$r][1] =
'Read actions/tasks linked to his account';
135 $this->rights[$r][2] =
'r';
136 $this->rights[$r][3] = 0;
137 $this->rights[$r][4] =
'myactions';
138 $this->rights[$r][5] =
'read';
141 $this->rights[$r][0] = 2402;
142 $this->rights[$r][1] =
'Create/modify actions/tasks linked to his account';
143 $this->rights[$r][2] =
'w';
144 $this->rights[$r][3] = 0;
145 $this->rights[$r][4] =
'myactions';
146 $this->rights[$r][5] =
'create';
149 $this->rights[$r][0] = 2403;
150 $this->rights[$r][1] =
'Delete actions/tasks linked to his account';
151 $this->rights[$r][2] =
'w';
152 $this->rights[$r][3] = 0;
153 $this->rights[$r][4] =
'myactions';
154 $this->rights[$r][5] =
'delete';
157 $this->rights[$r][0] = 2411;
158 $this->rights[$r][1] =
'Read actions/tasks of others';
159 $this->rights[$r][2] =
'r';
160 $this->rights[$r][3] = 0;
161 $this->rights[$r][4] =
'allactions';
162 $this->rights[$r][5] =
'read';
165 $this->rights[$r][0] = 2412;
166 $this->rights[$r][1] =
'Create/modify actions/tasks of others';
167 $this->rights[$r][2] =
'w';
168 $this->rights[$r][3] = 0;
169 $this->rights[$r][4] =
'allactions';
170 $this->rights[$r][5] =
'create';
173 $this->rights[$r][0] = 2413;
174 $this->rights[$r][1] =
'Delete actions/tasks of others';
175 $this->rights[$r][2] =
'w';
176 $this->rights[$r][3] = 0;
177 $this->rights[$r][4] =
'allactions';
178 $this->rights[$r][5] =
'delete';
181 $this->rights[$r][0] = 2414;
182 $this->rights[$r][1] =
'Export actions/tasks of others';
183 $this->rights[$r][2] =
'w';
184 $this->rights[$r][3] = 0;
185 $this->rights[$r][4] =
'export';
188 $this->menu = array();
205 $this->menu[$r] = array(
208 'titre'=>
'TMenuAgenda',
209 'mainmenu'=>
'agenda',
210 'url'=>
'/comm/action/index.php',
213 'perms'=>
'$user->rights->agenda->myactions->read',
214 'enabled'=>
'$conf->agenda->enabled',
220 $this->menu[$r] = array(
224 'mainmenu'=>
'agenda',
225 'url'=>
'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
228 'perms'=>
'$user->rights->agenda->myactions->read',
229 'enabled'=>
'$conf->agenda->enabled',
234 $this->menu[$r] = array(
237 'titre'=>
'NewAction',
238 'mainmenu'=>
'agenda',
239 'url'=>
'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
240 'langs'=>
'commercial',
242 'perms'=>
'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
243 'enabled'=>
'$conf->agenda->enabled',
249 $this->menu[$r] = array(
253 'mainmenu'=>
'agenda',
254 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda',
257 'perms'=>
'$user->rights->agenda->myactions->read',
258 'enabled'=>
'$conf->agenda->enabled',
263 $this->menu[$r] = array(
266 'titre'=>
'MenuToDoMyActions',
267 'mainmenu'=>
'agenda',
268 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
271 'perms'=>
'$user->rights->agenda->myactions->read',
272 'enabled'=>
'$conf->agenda->enabled',
277 $this->menu[$r] = array(
280 'titre'=>
'MenuDoneMyActions',
281 'mainmenu'=>
'agenda',
282 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
285 'perms'=>
'$user->rights->agenda->myactions->read',
286 'enabled'=>
'$conf->agenda->enabled',
291 $this->menu[$r] = array(
294 'titre'=>
'MenuToDoActions',
295 'mainmenu'=>
'agenda',
296 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
299 'perms'=>
'$user->rights->agenda->allactions->read',
300 'enabled'=>
'$user->rights->agenda->allactions->read',
305 $this->menu[$r] = array(
308 'titre'=>
'MenuDoneActions',
309 'mainmenu'=>
'agenda',
310 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
313 'perms'=>
'$user->rights->agenda->allactions->read',
314 'enabled'=>
'$user->rights->agenda->allactions->read',
321 $this->menu[$r] = array(
325 'mainmenu'=>
'agenda',
326 'url'=>
'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda',
329 'perms'=>
'$user->rights->agenda->myactions->read',
330 'enabled'=>
'$conf->agenda->enabled',
335 $this->menu[$r] = array(
338 'titre'=>
'MenuToDoMyActions',
339 'mainmenu'=>
'agenda',
340 'url'=>
'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
343 'perms'=>
'$user->rights->agenda->myactions->read',
344 'enabled'=>
'$conf->agenda->enabled',
349 $this->menu[$r] = array(
352 'titre'=>
'MenuDoneMyActions',
353 'mainmenu'=>
'agenda',
354 'url'=>
'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
357 'perms'=>
'$user->rights->agenda->myactions->read',
358 'enabled'=>
'$conf->agenda->enabled',
363 $this->menu[$r] = array(
366 'titre'=>
'MenuToDoActions',
367 'mainmenu'=>
'agenda',
368 'url'=>
'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
371 'perms'=>
'$user->rights->agenda->allactions->read',
372 'enabled'=>
'$user->rights->agenda->allactions->read',
377 $this->menu[$r] = array(
380 'titre'=>
'MenuDoneActions',
381 'mainmenu'=>
'agenda',
382 'url'=>
'/comm/action/list.php?action=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
385 'perms'=>
'$user->rights->agenda->allactions->read',
386 'enabled'=>
'$user->rights->agenda->allactions->read',
392 $this->menu[$r] = array(
395 'titre'=>
'Reportings',
396 'mainmenu'=>
'agenda',
397 'url'=>
'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda',
400 'perms'=>
'$user->rights->agenda->allactions->read',
401 'enabled'=>
'$conf->agenda->enabled',
407 $this->menu[$r] = array(
410 'titre' =>
'Categories',
411 'mainmenu' =>
'agenda',
412 'url'=>
'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10',
415 'perms' =>
'$user->rights->agenda->allactions->read',
416 'enabled' =>
'$conf->categorie->enabled&&$conf->categorie->enabled',
428 $this->export_code[$r] = $this->rights_class.
'_'.$r;
429 $this->export_label[$r] =
"ExportDataset_event1";
430 $this->export_permission[$r] = array(array(
"agenda",
"export"));
431 $this->export_fields_array[$r] = array(
'ac.id'=>
"IdAgenda",
'ac.ref_ext'=>
"ExternalRef",
'ac.datec'=>
"DateCreation",
'ac.datep'=>
"DateActionBegin",
432 'ac.datep2'=>
"DateActionEnd",
'ac.label'=>
"Title",
'ac.note'=>
"Note",
'ac.percent'=>
"Percent",
'ac.durationp'=>
"Duration",
433 'cac.libelle'=>
"ActionType",
434 's.rowid'=>
"IdCompany",
's.nom'=>
'CompanyName',
's.address'=>
'Address',
's.zip'=>
'Zip',
's.town'=>
'Town',
435 'co.code'=>
'CountryCode',
's.phone'=>
'Phone',
's.siren'=>
'ProfId1',
's.siret'=>
'ProfId2',
's.ape'=>
'ProfId3',
's.idprof4'=>
'ProfId4',
's.idprof5'=>
'ProfId5',
's.idprof6'=>
'ProfId6',
436 's.code_compta'=>
'CustomerAccountancyCode',
's.code_compta_fournisseur'=>
'SupplierAccountancyCode',
's.tva_intra'=>
'VATIntra',
437 'p.ref' =>
'ProjectRef',
439 $this->export_TypeFields_array[$r] = array(
'ac.ref_ext'=>
"Text",
'ac.datec'=>
"Date",
'ac.datep'=>
"Date",
440 'ac.datep2'=>
"Date",
'ac.label'=>
"Text",
'ac.note'=>
"Text",
'ac.percent'=>
"Numeric",
441 'ac.durationp'=>
"Duree",
442 'cac.libelle'=>
"List:c_actioncomm:libelle:libelle",
443 's.nom'=>
'Text',
's.address'=>
'Text',
's.zip'=>
'Text',
's.town'=>
'Text',
444 'co.code'=>
'Text',
's.phone'=>
'Text',
's.siren'=>
'Text',
's.siret'=>
'Text',
's.ape'=>
'Text',
's.idprof4'=>
'Text',
's.idprof5'=>
'Text',
's.idprof6'=>
'Text',
445 's.code_compta'=>
'Text',
's.code_compta_fournisseur'=>
'Text',
's.tva_intra'=>
'Text',
448 $this->export_entities_array[$r] = array(
'ac.id'=>
"action",
'ac.ref_ext'=>
"action",
'ac.datec'=>
"action",
'ac.datep'=>
"action",
449 'ac.datep2'=>
"action",
'ac.label'=>
"action",
'ac.note'=>
"action",
'ac.percent'=>
"action",
'ac.durationp'=>
"action",
450 'cac.libelle'=>
"action",
451 's.rowid'=>
"company",
's.nom'=>
'company',
's.address'=>
'company',
's.zip'=>
'company',
's.town'=>
'company',
452 'co.code'=>
'company',
's.phone'=>
'company',
's.siren'=>
'company',
's.siret'=>
'company',
's.ape'=>
'company',
's.idprof4'=>
'company',
's.idprof5'=>
'company',
's.idprof6'=>
'company',
453 's.code_compta'=>
'company',
's.code_compta_fournisseur'=>
'company',
's.tva_intra'=>
'company',
454 'p.ref' =>
'project',
457 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
458 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'actioncomm as ac';
459 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_actioncomm as cac on ac.fk_action = cac.id';
460 if (!empty($user) && empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'actioncomm_resources acr on ac.id = acr.fk_actioncomm';
461 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'socpeople as sp on ac.fk_contact = sp.rowid';
462 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe as s on ac.fk_soc = s.rowid';
463 if (!empty($user) && empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
464 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_country as co on s.fk_pays = co.rowid';
465 $this->export_sql_end[$r] .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = ac.fk_project";
466 $this->export_sql_end[$r] .=
' WHERE ac.entity IN ('.getEntity(
'agenda').
')';
467 if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=
' AND (sc.fk_user = '.(empty($user) ? 0 : $user->id).
' OR ac.fk_soc IS NULL)';
468 if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=
' AND acr.fk_element = '.(empty($user) ? 0 : $user->id);
469 $this->export_sql_order[$r] =
' ORDER BY ac.datep';
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
dol_now($mode= 'auto')
Return date for now.
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.
Class to describe and enable/disable module Agenda.
__construct($db)
Constructor.
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...