51function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode =
'', $usergroupid =
'', $excludetype =
'', $resourceid = 0)
53 global $conf, $user, $langs, $db, $hookmanager;
54 global $begin_h, $end_h, $begin_d, $end_d;
57 $langs->load(
"companies");
59 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
64 print
'<input type="hidden" name="token" value="'.newToken().
'">';
65 print
'<input type="hidden" name="year" value="'.((int) $year).
'">';
66 print
'<input type="hidden" name="month" value="'.((int) $month).
'">';
67 print
'<input type="hidden" name="day" value="'.((int) $day).
'">';
68 if ($massaction !=
'predelete' && $massaction !=
'preaffecttag') {
69 print
'<input type="hidden" name="action" value="'.$action.
'">';
71 print
'<input type="hidden" name="search_showbirthday" value="'.((int) $showbirthday).
'">';
73 print
'<div class="divsearchfield">';
76 if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) {
77 $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
79 print
img_picto($langs->trans(
"ActionType"),
'square',
'class="pictofixedwidth inline-block" style="color: #ddd;"');
80 print
$formactions->select_type_actions($actioncode,
"search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0,
'maxwidth500 widthcentpercentminusx');
85 print
'<div class="divsearchfield">';
86 print
img_picto($langs->trans(
"ActionsToDoBy"),
'user',
'class="pictofixedwidth inline-block"');
87 print $form->select_dolusers($filtert,
'search_filtert', 1,
'', !$canedit,
'',
'', 0, 0, 0,
'', 0,
'',
'minwidth150 maxwidth500 widthcentpercentminusxx');
91 print
'<div class="divsearchfield">';
92 print
img_picto($langs->trans(
"ToUserOfGroup"),
'object_group',
'class="pictofixedwidth inline-block"');
93 print $form->select_dolgroups($usergroupid,
'usergroup', 1,
'', !$canedit,
'',
'',
'0',
false,
'minwidth100 maxwidth500 widthcentpercentminusxx');
96 if (isModEnabled(
'resource')) {
97 include_once DOL_DOCUMENT_ROOT.
'/resource/class/html.formresource.class.php';
101 print
'<div class="divsearchfield">';
102 print
img_picto($langs->trans(
"Resource"),
'object_resource',
'class="pictofixedwidth inline-block"');
103 print $formresource->select_resource_list($resourceid,
"search_resourceid",
'', 1, 0, 0,
null,
'', 2, 0,
'maxwidth500');
108 if (isModEnabled(
'societe') && $user->hasRight(
'societe',
'lire')) {
109 print
'<div class="divsearchfield">';
110 print
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth inline-block"');
111 print $form->select_company($socid,
'search_socid',
'',
' ', 0, 0,
null, 0,
'minwidth100 maxwidth500');
115 if (isModEnabled(
'projet') && !empty($user->rights->projet->lire)) {
116 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
119 print
'<div class="divsearchfield">';
120 print
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth inline-block"');
121 print $formproject->select_projects($socid ? $socid : -1, $pid,
'search_projectid', 0, 0, 1, 0, 0, 0, 0,
'', 1, 0,
'maxwidth500');
125 if ($canedit && !preg_match(
'/list/', $_SERVER[
"PHP_SELF"])) {
127 print
'<div class="divsearchfield">';
128 print
img_picto($langs->trans(
"Status"),
'setup',
'class="pictofixedwidth inline-block"');
129 $formactions->form_select_status_action(
'formaction', $status, 1,
'search_status', 1, 2,
'minwidth100');
134 $parameters = array(
'canedit'=>$canedit,
'pid'=>$pid,
'socid'=>$socid);
136 $reshook = $hookmanager->executeHooks(
'searchAgendaFrom', $parameters, $object, $action);
138 print
'<div class="clearboth"></div>';
150 global $langs, $conf, $user, $db, $socid;
154 include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
155 include_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
157 $sql =
"SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent";
158 $sql .=
", c.code, c.libelle as type_label";
159 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
160 $sql .=
", s.code_client, s.code_compta, s.client";
161 $sql .=
", s.logo, s.email, s.entity";
162 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
163 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
164 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
165 if (empty($user->rights->societe->client->voir) && !$socid) {
166 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
168 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
169 $sql .=
" AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now).
"'))";
170 if (empty($user->rights->societe->client->voir) && !$socid) {
171 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
174 $sql .=
" AND s.rowid = ".((int) $socid);
176 $sql .=
" ORDER BY a.datep DESC, a.id DESC";
177 $sql .= $db->plimit($max, 0);
179 $resql = $db->query($sql);
181 $num = $db->num_rows($resql);
183 print
'<div class="div-table-responsive-no-min">';
184 print
'<table class="noborder centpercent">';
185 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastActionsToDo", $max).
'</th>';
186 print
'<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&status=todo">'.$langs->trans(
"FullList").
'</a></th>';
192 $customerstatic =
new Client($db);
195 $obj = $db->fetch_object($resql);
198 print
'<tr class="oddeven">';
200 $staticaction->type_code = $obj->code;
201 $staticaction->label = ($obj->label ? $obj->label : $obj->type_label);
202 $staticaction->id = $obj->id;
203 print
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
208 if ($obj->socid > 0) {
209 $customerstatic->id = $obj->socid;
210 $customerstatic->name = $obj->name;
212 $customerstatic->code_client = $obj->code_client;
213 $customerstatic->code_compta = $obj->code_compta;
214 $customerstatic->client = $obj->client;
215 $customerstatic->logo = $obj->logo;
216 $customerstatic->email = $obj->email;
217 $customerstatic->entity = $obj->entity;
218 print $customerstatic->getNomUrl(1,
'', 40);
222 $datep = $db->jdate($obj->dp);
223 $datep2 = $db->jdate($obj->dp2);
226 print
'<td width="100" class="right tddate">'.dol_print_date($datep,
'day').
' ';
228 if ($obj->percent == 0 && $datep && $datep < time()) {
231 if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) {
234 if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) {
237 if ($obj->percent > 0 && $obj->percent < 100 && !$datep2 && $datep && $datep < time()) {
246 print
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
252 print
"</table></div><br>";
269 global $langs, $conf, $user, $db, $socid;
273 $sql =
"SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label";
274 $sql .=
", c.code, c.libelle";
275 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
276 $sql .=
", s.code_client, s.code_compta, s.client";
277 $sql .=
", s.logo, s.email, s.entity";
278 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
279 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action ";
280 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
281 if (empty($user->rights->societe->client->voir) && !$socid) {
282 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
284 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
285 $sql .=
" AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now).
"'))";
286 if (empty($user->rights->societe->client->voir) && !$socid) {
287 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
290 $sql .=
" AND s.rowid = ".((int) $socid);
292 $sql .=
" ORDER BY a.datep2 DESC";
293 $sql .= $db->plimit($max, 0);
295 $resql = $db->query($sql);
297 $num = $db->num_rows($resql);
299 print
'<div class="div-table-responsive-no-min">';
300 print
'<table class="noborder centpercent">';
301 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastDoneTasks", $max).
'</th>';
302 print
'<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&status=done">'.$langs->trans(
"FullList").
'</a></th>';
308 $customerstatic =
new Societe($db);
311 $obj = $db->fetch_object($resql);
314 print
'<tr class="oddeven">';
316 $staticaction->type_code = $obj->code;
317 $staticaction->label = $obj->label;
318 $staticaction->id = $obj->id;
319 print
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
324 if ($obj->socid > 0) {
325 $customerstatic->id = $obj->socid;
326 $customerstatic->name = $obj->name;
328 $customerstatic->code_client = $obj->code_client;
329 $customerstatic->code_compta = $obj->code_compta;
330 $customerstatic->client = $obj->client;
331 $customerstatic->logo = $obj->logo;
332 $customerstatic->email = $obj->email;
333 $customerstatic->entity = $obj->entity;
334 print $customerstatic->getNomUrl(1,
'', 30);
339 print
'<td width="100" class="right tddate">'.dol_print_date($db->jdate($obj->da2),
'day');
343 print
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
350 print
"</table></div><br>";
366 global $langs, $conf, $user, $db;
369 $extrafields->fetch_name_optionals_label(
'actioncomm');
374 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_other.php";
375 $head[$h][1] = $langs->trans(
"Miscellaneous");
376 $head[$h][2] =
'other';
379 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda.php";
380 $head[$h][1] = $langs->trans(
"AutoActions");
381 $head[$h][2] =
'autoactions';
384 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_reminder.php";
385 $head[$h][1] = $langs->trans(
"Reminders");
386 $head[$h][2] =
'reminders';
389 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_xcal.php";
390 $head[$h][1] = $langs->trans(
"ExportCal");
391 $head[$h][2] =
'xcal';
394 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extsites.php";
395 $head[$h][1] = $langs->trans(
"ExtSites");
396 $head[$h][2] =
'extsites';
401 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extrafields.php";
402 $head[$h][1] = $langs->trans(
"ExtraFields");
403 $nbExtrafields = $extrafields->attributes[
'actioncomm'][
'count'];
404 if ($nbExtrafields > 0) {
405 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
407 $head[$h][2] =
'attributes';
424 global $db, $langs, $conf, $user;
429 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/card.php?id='.$object->id;
430 $head[$h][1] = $langs->trans(
"CardAction");
431 $head[$h][2] =
'card';
435 if (isModEnabled(
'resource')) {
436 include_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
439 $head[$h][0] = DOL_URL_ROOT.
'/resource/element_resource.php?element=action&element_id='.$object->id;
440 $listofresourcelinked = $resource->getElementResources($object->element, $object->id);
441 $nbResources = (is_array($listofresourcelinked) ?count($listofresourcelinked) : 0);
442 $head[$h][1] = $langs->trans(
"Resources");
443 if ($nbResources > 0) {
444 $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' :
'');
446 $head[$h][2] =
'resources';
451 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
452 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
453 $upload_dir = $conf->agenda->dir_output.
"/".$object->id;
454 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
455 $nbLinks =
Link::count($db, $object->element, $object->id);
456 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/document.php?id='.$object->id;
457 $head[$h][1] = $langs->trans(
"Documents");
458 if (($nbFiles + $nbLinks) > 0) {
459 $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' :
'');
461 $head[$h][2] =
'documents';
464 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/info.php?id='.$object->id;
465 $head[$h][1] = $langs->trans(
'Info');
466 $head[$h][2] =
'info';
485 global $langs, $conf, $user;
490 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list'.($param ?
'&'.$param :
'');
491 $head[$h][1] = $langs->trans(
"ViewList");
492 $head[$h][2] =
'cardlist';
495 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month'.($param ?
'&'.$param :
'');
496 $head[$h][1] = $langs->trans(
"ViewCal");
497 $head[$h][2] =
'cardmonth';
500 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week'.($param ?
'&'.$param :
'');
501 $head[$h][1] = $langs->trans(
"ViewWeek");
502 $head[$h][2] =
'cardweek';
505 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day'.($param ?
'&'.$param :
'');
506 $head[$h][1] = $langs->trans(
"ViewDay");
507 $head[$h][2] =
'cardday';
511 if (!empty($conf->global->AGENDA_SHOW_PERTYPE)) {
512 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/pertype.php'.($param ?
'?'.$param :
'');
513 $head[$h][1] = $langs->trans(
"ViewPerType");
514 $head[$h][2] =
'cardpertype';
519 $newparam = preg_replace(
'/&?search_filtert=\d+/',
'', $newparam);
520 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/peruser.php'.($newparam ?
'?'.$newparam :
'');
521 $head[$h][1] = $langs->trans(
"ViewPerUser");
522 $head[$h][2] =
'cardperuser';
show_array_actions_to_do($max=5)
Show actions to do array.
show_array_last_actions_done($max=5)
Show last actions array.
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0)
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
agenda_prepare_head()
Prepare array with list of tabs.
actions_prepare_head($object)
Prepare array with list of tabs.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
Class to manage agenda events (actions)
Class to manage customers or prospects.
static count($dbs, $objecttype, $objectid)
Return nb of links.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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)
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).