68 $showextcals = array(),
73 $search_categ_cus = 0,
74 $search_import_key =
''
76 global $user, $langs,
$db, $hookmanager;
79 $langs->load(
"companies");
81 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
85 print
'<input type="hidden" name="token" value="'.newToken().
'">';
86 print
'<input type="hidden" name="year" value="'.((int) $year).
'">';
87 print
'<input type="hidden" name="month" value="'.((int) $month).
'">';
88 print
'<input type="hidden" name="day" value="'.((int) $day).
'">';
89 if ($massaction !=
'predelete' && $massaction !=
'preaffecttag') {
90 print
'<input type="hidden" name="action" value="'.$action.
'">';
92 print
'<input type="hidden" name="search_showbirthday" value="'.((int) $showbirthday).
'">';
94 print
'<div class="divsearchfield">';
100 print
img_picto($langs->trans(
"ActionType"),
'square',
'class="pictofixedwidth inline-block" style="color: #ddd;"');
101 print $formactions->select_type_actions($actioncode,
"search_actioncode", $excludetype, (
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? -1 : 1), 0, $multiselect, 0,
'minwidth150 maxwidth200 widthcentpercentminusx', 1);
106 print
'<div class="divsearchfield">';
107 print
img_picto($langs->trans(
"ActionsToDoBy"),
'user',
'class="pictofixedwidth inline-block"');
108 print $form->select_dolusers($filtert,
'search_filtert', 1,
null, (
int) !$canedit,
'',
'',
'0', 0, 0,
'', 2,
'',
'minwidth100 maxwidth250 widthcentpercentminusx');
112 print
'<div class="divsearchfield">';
113 print
img_picto($langs->trans(
"ToUserOfGroup"),
'object_group',
'class="pictofixedwidth inline-block"');
114 print $form->select_dolgroups($usergroupid,
'usergroup', 1,
'', (
int) !$canedit,
'', array(),
'0',
false,
'minwidth100 maxwidth250 widthcentpercentminusx');
118 include_once DOL_DOCUMENT_ROOT.
'/resource/class/html.formresource.class.php';
122 print
'<div class="divsearchfield">';
123 print
img_picto($langs->trans(
"Resource"),
'object_resource',
'class="pictofixedwidth inline-block"');
124 print $formresource->select_resource_list($resourceid,
"search_resourceid",
'', 1, 0, 0, [],
'', 2, 0,
'minwidth100 maxwidth250 widthcentpercentminusx');
129 if (
isModEnabled(
'societe') && $user->hasRight(
'societe',
'lire')) {
130 print
'<div class="divsearchfield">';
131 print
img_picto($langs->trans(
"ThirdParty"),
'company',
'class="pictofixedwidth inline-block"');
132 print $form->select_company($socid,
'search_socid',
'',
' ', 0, 0, array(), 0,
'minwidth100 maxwidth250 widthcentpercentminusx');
136 if (
isModEnabled(
'project') && $user->hasRight(
'projet',
'lire')) {
137 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
140 print
'<div class="divsearchfield">';
141 print
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth inline-block"');
142 print $formproject->select_projects($socid ? $socid : -1, (
string) $pid,
'search_projectid', 0, 0, 1, 0, 0, 0, 0,
'', 1, 0,
'minwidth100 maxwidth250 widthcentpercentminusx');
146 if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
147 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
148 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
150 $langs->load(
'categories');
152 print
'<div class="divsearchfield">';
153 print
img_picto($langs->trans(
'Categories'),
'category',
'class="pictofixedwidth"');
154 print $formother->select_categories(
'actioncomm', $search_categ_cus,
'search_categ_cus', 1, $langs->trans(
'Categories'),
'minwidth100 maxwidth250 widthcentpercentminusx');
158 if ($canedit && !preg_match(
'/list/', $_SERVER[
"PHP_SELF"])) {
160 print
'<div class="divsearchfield">';
161 print
img_picto($langs->trans(
"Status"),
'status',
'class="pictofixedwidth inline-block"');
162 $formactions->form_select_status_action(
'formaction', $status, 1,
'search_status', 1, 2,
'minwidth100');
167 $parameters = array(
'canedit' => $canedit,
'pid' => $pid,
'socid' => $socid);
169 $reshook = $hookmanager->executeHooks(
'searchAgendaFrom', $parameters,
$object, $action);
171 print
'<div class="clearboth"></div>';
183 global $langs,
$conf, $user,
$db, $socid;
187 include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
188 include_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
190 $sql =
"SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent";
191 $sql .=
", c.code, c.libelle as type_label";
192 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
193 $sql .=
", s.code_client, s.code_compta, s.client";
194 $sql .=
", s.logo, s.email, s.entity";
195 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
196 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
197 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
198 if (!$user->hasRight(
'societe',
'client',
'voir')) {
199 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
201 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
202 $sql .=
" AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now).
"'))";
203 if (!$user->hasRight(
'societe',
'client',
'voir')) {
204 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
207 $sql .=
" AND s.rowid = ".((int) $socid);
209 $sql .=
" ORDER BY a.datep DESC, a.id DESC";
210 $sql .=
$db->plimit($max, 0);
212 $resql =
$db->query($sql);
214 $num =
$db->num_rows($resql);
216 print
'<div class="div-table-responsive-no-min">';
217 print
'<table class="noborder centpercent">';
218 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastActionsToDo", $max).
'</th>';
219 print
'<th colspan="2" class="right"><a class="commonlink" href="'.dolBuildUrl(DOL_URL_ROOT.
'/comm/action/list.php', [
'mode' =>
'show_list',
'status' =>
'todo']).
'">'.$langs->trans(
"FullList").
'</a></th>';
228 $obj =
$db->fetch_object($resql);
231 print
'<tr class="oddeven">';
233 $staticaction->type_code = $obj->code;
234 $staticaction->label = ($obj->label ? $obj->label : $obj->type_label);
235 $staticaction->id = $obj->id;
236 print
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
241 if ($obj->socid > 0) {
242 $customerstatic->id = $obj->socid;
243 $customerstatic->name = $obj->name;
245 $customerstatic->code_client = $obj->code_client;
246 $customerstatic->code_compta = $obj->code_compta;
247 $customerstatic->code_compta_client = $obj->code_compta;
248 $customerstatic->client = $obj->client;
249 $customerstatic->logo = $obj->logo;
250 $customerstatic->email = $obj->email;
251 $customerstatic->entity = $obj->entity;
252 print $customerstatic->getNomUrl(1,
'', 40);
256 $datep =
$db->jdate($obj->dp);
257 $datep2 =
$db->jdate($obj->dp2);
260 print
'<td width="100" class="right tddate">'.dol_print_date($datep,
'day').
' ';
262 if ($obj->percent == 0 && $datep && $datep < time()) {
265 if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) {
268 if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) {
271 if ($obj->percent > 0 && $obj->percent < 100 && !$datep2 && $datep && $datep < time()) {
280 print
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
286 print
"</table></div><br>";
303 global $langs,
$conf, $user,
$db, $socid;
307 $sql =
"SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label";
308 $sql .=
", c.code, c.libelle";
309 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
310 $sql .=
", s.code_client, s.code_compta, s.client";
311 $sql .=
", s.logo, s.email, s.entity";
312 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
313 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action ";
314 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
315 if (!$user->hasRight(
'societe',
'client',
'voir')) {
316 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
318 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
319 $sql .=
" AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now).
"'))";
320 if (!$user->hasRight(
'societe',
'client',
'voir')) {
321 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
324 $sql .=
" AND s.rowid = ".((int) $socid);
326 $sql .=
" ORDER BY a.datep2 DESC";
327 $sql .=
$db->plimit($max, 0);
329 $resql =
$db->query($sql);
331 $num =
$db->num_rows($resql);
333 print
'<div class="div-table-responsive-no-min">';
334 print
'<table class="noborder centpercent">';
335 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastDoneTasks", $max).
'</th>';
336 print
'<th colspan="2" class="right"><a class="commonlink" href="'.dolBuildUrl(DOL_URL_ROOT.
'/comm/action/list.php', [
'mode'=>
'show_list',
'status' =>
'done']).
'">'.$langs->trans(
"FullList").
'</a></th>';
345 $obj =
$db->fetch_object($resql);
348 print
'<tr class="oddeven">';
350 $staticaction->type_code = $obj->code;
351 $staticaction->label = $obj->label;
352 $staticaction->id = $obj->id;
353 print
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
358 if ($obj->socid > 0) {
359 $customerstatic->id = $obj->socid;
360 $customerstatic->name = $obj->name;
362 $customerstatic->code_client = $obj->code_client;
363 $customerstatic->code_compta = $obj->code_compta;
364 $customerstatic->code_compta_client = $obj->code_compta;
365 $customerstatic->client = $obj->client;
366 $customerstatic->logo = $obj->logo;
367 $customerstatic->email = $obj->email;
368 $customerstatic->entity = $obj->entity;
369 print $customerstatic->getNomUrl(1,
'', 30);
374 print
'<td width="100" class="right tddate">'.dol_print_date(
$db->jdate($obj->da2),
'day');
378 print
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
385 print
"</table></div><br>";
401 global $langs,
$conf, $user, $extrafields;
403 $extrafields->fetch_name_optionals_label(
'actioncomm');
408 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda_other.php");
409 $head[$h][1] = $langs->trans(
"Miscellaneous");
410 $head[$h][2] =
'other';
413 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda.php");
414 $head[$h][1] = $langs->trans(
"AutoActions");
415 $head[$h][2] =
'autoactions';
418 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda_reminder.php");
419 $head[$h][1] = $langs->trans(
"Reminders");
420 $head[$h][2] =
'reminders';
423 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda_xcal.php");
424 $head[$h][1] = $langs->trans(
"ExportCal");
425 $head[$h][2] =
'xcal';
428 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda_extsites.php");
429 $head[$h][1] = $langs->trans(
"ExtSites");
430 $head[$h][2] =
'extsites';
435 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
"/admin/agenda_extrafields.php");
436 $head[$h][1] = $langs->trans(
"ExtraFields");
437 $nbExtrafields = $extrafields->attributes[
'actioncomm'][
'count'];
438 if ($nbExtrafields > 0) {
439 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
441 $head[$h][2] =
'attributes';
463 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/card.php', [
'id'=>
$object->id]);
464 $head[$h][1] = $langs->trans(
"CardAction");
465 $head[$h][2] =
'card';
470 include_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
473 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/resource/element_resource.php', [
'element' =>
'action',
'element_id'=>
$object->id]);
474 $listofresourcelinked = $resource->getElementResources(
$object->element,
$object->id);
475 $nbResources = (is_array($listofresourcelinked) ? count($listofresourcelinked) : 0);
476 $head[$h][1] = $langs->trans(
"Resources");
477 if ($nbResources > 0) {
478 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' :
'');
480 $head[$h][2] =
'resources';
485 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
486 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
487 $upload_dir =
$conf->agenda->dir_output.
"/".
$object->id;
488 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
490 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/document.php', [
'id' =>
$object->id]);
491 $head[$h][1] = $langs->trans(
"Documents");
492 if (($nbFiles + $nbLinks) > 0) {
493 $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ?
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' :
'');
495 $head[$h][2] =
'documents';
498 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/info.php', [
'id' =>
$object->id]);
499 $head[$h][1] = $langs->trans(
'Info');
500 $head[$h][2] =
'info';
519 global $langs,
$conf, $user;
524 parse_str($param, $query);
526 $query = array_merge($query, [
'mode' =>
'show_list']);
527 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/list.php', $query);
528 $head[$h][1] = $langs->trans(
"ViewList");
529 $head[$h][2] =
'cardlist';
532 $query[
'mode'] =
'show_month';
533 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/index.php', $query);
534 $head[$h][1] = $langs->trans(
"ViewCal");
535 $head[$h][2] =
'cardmonth';
538 $query[
'mode'] =
'show_week';
539 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/index.php', $query);
540 $head[$h][1] = $langs->trans(
"ViewWeek");
541 $head[$h][2] =
'cardweek';
544 $query[
'mode'] =
'show_day';
545 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/index.php', $query);
546 $head[$h][1] = $langs->trans(
"ViewDay");
547 $head[$h][2] =
'cardday';
550 unset($query[
'mode']);
552 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/pertype.php', $query);
553 $head[$h][1] = $langs->trans(
"ViewPerType");
554 $head[$h][2] =
'cardpertype';
559 $newparam = preg_replace(
'/&?search_filtert=\d+/',
'', $newparam);
561 parse_str($newparam, $query);
563 $head[$h][0] =
dolBuildUrl(DOL_URL_ROOT.
'/comm/action/peruser.php', $query);
564 $head[$h][1] = $langs->trans(
"ViewPerUser");
565 $head[$h][2] =
'cardperuser';
if(! $sortfield) if(! $sortorder) $object
show_array_actions_to_do($max=5)
Show actions to do array.
print_actions_filter( $form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filtered, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid=0, $excludetype='', $resourceid=0, $search_categ_cus=0, $search_import_key='')
Show filter form in agenda view.
show_array_last_actions_done($max=5)
Show last actions array.
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.
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($utf8_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.
dol_now($mode='gmt')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php