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(7, 0);
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);
92 while ($obj = $this->
db->fetch_object(
$resql)) {
94 if (preg_match(
'/^TASK_/', $obj->code)) {
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 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
210 'mainmenu'=>
'agenda',
211 'url'=>
'/comm/action/index.php',
214 'perms'=>
'$user->rights->agenda->myactions->read || $user->rights->resource->read',
215 'enabled'=>
'$conf->agenda->enabled || $conf->resource->enabled',
221 $this->menu[$r] = array(
225 'prefix' =>
img_picto(
'', $this->picto,
'class="paddingright pictofixedwidth"'),
226 'mainmenu'=>
'agenda',
227 'url'=>
'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda',
230 'perms'=>
'$user->rights->agenda->myactions->read',
231 'enabled'=>
'$conf->agenda->enabled',
236 $this->menu[$r] = array(
239 'titre'=>
'NewAction',
240 'mainmenu'=>
'agenda',
241 'url'=>
'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
242 'langs'=>
'commercial',
244 'perms'=>
'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))',
245 'enabled'=>
'$conf->agenda->enabled',
251 $this->menu[$r] = array(
255 'mainmenu'=>
'agenda',
256 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda',
259 'perms'=>
'$user->rights->agenda->myactions->read',
260 'enabled'=>
'$conf->agenda->enabled',
265 $this->menu[$r] = array(
268 'titre'=>
'MenuToDoMyActions',
269 'mainmenu'=>
'agenda',
270 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
273 'perms'=>
'$user->rights->agenda->myactions->read',
274 'enabled'=>
'$conf->agenda->enabled',
279 $this->menu[$r] = array(
282 'titre'=>
'MenuDoneMyActions',
283 'mainmenu'=>
'agenda',
284 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
287 'perms'=>
'$user->rights->agenda->myactions->read',
288 'enabled'=>
'$conf->agenda->enabled',
293 $this->menu[$r] = array(
296 'titre'=>
'MenuToDoActions',
297 'mainmenu'=>
'agenda',
298 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
301 'perms'=>
'$user->rights->agenda->allactions->read',
302 'enabled'=>
'$user->rights->agenda->allactions->read',
307 $this->menu[$r] = array(
310 'titre'=>
'MenuDoneActions',
311 'mainmenu'=>
'agenda',
312 'url'=>
'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
315 'perms'=>
'$user->rights->agenda->allactions->read',
316 'enabled'=>
'$user->rights->agenda->allactions->read',
323 $this->menu[$r] = array(
327 'mainmenu'=>
'agenda',
328 'url'=>
'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda',
331 'perms'=>
'$user->rights->agenda->myactions->read',
332 'enabled'=>
'$conf->agenda->enabled',
337 $this->menu[$r] = array(
340 'titre'=>
'MenuToDoMyActions',
341 'mainmenu'=>
'agenda',
342 'url'=>
'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine',
345 'perms'=>
'$user->rights->agenda->myactions->read',
346 'enabled'=>
'$conf->agenda->enabled',
351 $this->menu[$r] = array(
354 'titre'=>
'MenuDoneMyActions',
355 'mainmenu'=>
'agenda',
356 'url'=>
'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine',
359 'perms'=>
'$user->rights->agenda->myactions->read',
360 'enabled'=>
'$conf->agenda->enabled',
365 $this->menu[$r] = array(
368 'titre'=>
'MenuToDoActions',
369 'mainmenu'=>
'agenda',
370 'url'=>
'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1',
373 'perms'=>
'$user->rights->agenda->allactions->read',
374 'enabled'=>
'$user->rights->agenda->allactions->read',
379 $this->menu[$r] = array(
382 'titre'=>
'MenuDoneActions',
383 'mainmenu'=>
'agenda',
384 'url'=>
'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1',
387 'perms'=>
'$user->rights->agenda->allactions->read',
388 'enabled'=>
'$user->rights->agenda->allactions->read',
394 $this->menu[$r] = array(
397 'titre'=>
'Reportings',
398 'mainmenu'=>
'agenda',
399 'url'=>
'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda',
402 'perms'=>
'$user->rights->agenda->allactions->read',
403 'enabled'=>
'$conf->agenda->enabled',
409 $this->menu[$r] = array(
412 'titre' =>
'Categories',
413 'mainmenu' =>
'agenda',
414 'url'=>
'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10',
417 'perms' =>
'$user->rights->agenda->allactions->read',
418 'enabled' =>
'$conf->categorie->enabled',
430 $this->export_code[$r] = $this->rights_class.
'_'.$r;
431 $this->export_label[$r] =
"ExportDataset_event1";
432 $this->export_permission[$r] = array(array(
"agenda",
"export"));
433 $this->export_fields_array[$r] = array(
'ac.id'=>
"IdAgenda",
'ac.ref_ext'=>
"ExternalRef",
'ac.datec'=>
"DateCreation",
'ac.datep'=>
"DateActionBegin",
434 'ac.datep2'=>
"DateActionEnd",
'ac.label'=>
"Title",
'ac.note'=>
"Note",
'ac.percent'=>
"Percent",
'ac.durationp'=>
"Duration",
435 'cac.libelle'=>
"ActionType",
436 's.rowid'=>
"IdCompany",
's.nom'=>
'CompanyName',
's.address'=>
'Address',
's.zip'=>
'Zip',
's.town'=>
'Town',
437 'co.code'=>
'CountryCode',
's.phone'=>
'Phone',
's.siren'=>
'ProfId1',
's.siret'=>
'ProfId2',
's.ape'=>
'ProfId3',
's.idprof4'=>
'ProfId4',
's.idprof5'=>
'ProfId5',
's.idprof6'=>
'ProfId6',
438 's.code_compta'=>
'CustomerAccountancyCode',
's.code_compta_fournisseur'=>
'SupplierAccountancyCode',
's.tva_intra'=>
'VATIntra',
439 'p.ref' =>
'ProjectRef',
441 $this->export_TypeFields_array[$r] = array(
'ac.ref_ext'=>
"Text",
'ac.datec'=>
"Date",
'ac.datep'=>
"Date",
442 'ac.datep2'=>
"Date",
'ac.label'=>
"Text",
'ac.note'=>
"Text",
'ac.percent'=>
"Numeric",
443 'ac.durationp'=>
"Duree",
444 'cac.libelle'=>
"List:c_actioncomm:libelle:libelle",
445 's.nom'=>
'Text',
's.address'=>
'Text',
's.zip'=>
'Text',
's.town'=>
'Text',
446 'co.code'=>
'Text',
's.phone'=>
'Text',
's.siren'=>
'Text',
's.siret'=>
'Text',
's.ape'=>
'Text',
's.idprof4'=>
'Text',
's.idprof5'=>
'Text',
's.idprof6'=>
'Text',
447 's.code_compta'=>
'Text',
's.code_compta_fournisseur'=>
'Text',
's.tva_intra'=>
'Text',
450 $this->export_entities_array[$r] = array(
'ac.id'=>
"action",
'ac.ref_ext'=>
"action",
'ac.datec'=>
"action",
'ac.datep'=>
"action",
451 'ac.datep2'=>
"action",
'ac.label'=>
"action",
'ac.note'=>
"action",
'ac.percent'=>
"action",
'ac.durationp'=>
"action",
452 'cac.libelle'=>
"action",
453 's.rowid'=>
"company",
's.nom'=>
'company',
's.address'=>
'company',
's.zip'=>
'company',
's.town'=>
'company',
454 'co.code'=>
'company',
's.phone'=>
'company',
's.siren'=>
'company',
's.siret'=>
'company',
's.ape'=>
'company',
's.idprof4'=>
'company',
's.idprof5'=>
'company',
's.idprof6'=>
'company',
455 's.code_compta'=>
'company',
's.code_compta_fournisseur'=>
'company',
's.tva_intra'=>
'company',
456 'p.ref' =>
'project',
459 $keyforselect =
'actioncomm'; $keyforelement =
'action'; $keyforaliasextra =
'extra';
460 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
462 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
463 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'actioncomm as ac';
464 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'actioncomm_extrafields as extra ON ac.id = extra.fk_object';
465 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_actioncomm as cac on ac.fk_action = cac.id';
466 if (!empty($user) && empty($user->rights->agenda->allactions->read)) {
467 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'actioncomm_resources acr on ac.id = acr.fk_actioncomm';
469 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'socpeople as sp on ac.fk_contact = sp.rowid';
470 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe as s on ac.fk_soc = s.rowid';
471 if (!empty($user) && empty($user->rights->societe->client->voir)) {
472 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
474 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_country as co on s.fk_pays = co.rowid';
475 $this->export_sql_end[$r] .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"projet as p ON p.rowid = ac.fk_project";
476 $this->export_sql_end[$r] .=
' WHERE ac.entity IN ('.getEntity(
'agenda').
')';
477 if (empty($user->rights->societe->client->voir)) {
478 $this->export_sql_end[$r] .=
' AND (sc.fk_user = '.(empty($user) ? 0 : $user->id).
' OR ac.fk_soc IS NULL)';
480 if (empty($user->rights->agenda->allactions->read)) {
481 $this->export_sql_end[$r] .=
' AND acr.fk_element = '.(empty($user) ? 0 : $user->id);
483 $this->export_sql_order[$r] =
' ORDER BY ac.datep';
Class to describe and enable/disable module Agenda.
__construct($db)
Constructor.
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.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.