50 function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode =
'', $usergroupid =
'', $excludetype =
'', $resourceid = 0)
52 global $conf, $user, $langs, $db, $hookmanager;
53 global $begin_h, $end_h, $begin_d, $end_d;
56 $langs->load(
"companies");
58 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
63 print '<input type="hidden" name="token" value="'.newToken().
'">';
64 print '<input type="hidden" name="year" value="'.$year.
'">';
65 print '<input type="hidden" name="month" value="'.$month.
'">';
66 print '<input type="hidden" name="day" value="'.$day.
'">';
67 if ($massaction !=
'predelete') {
68 print '<input type="hidden" name="action" value="'.$action.
'">';
70 print '<input type="hidden" name="search_showbirthday" value="'.$showbirthday.
'">';
74 print '<div class="divsearchfield">';
76 print '<span class="fas fa-square inline-block fawidth30" style=" color: #ddd;"></span>';
77 print '<span class="hideonsmartphone">'.$langs->trans(
"Type").
'</span>';
79 if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE))
81 $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
83 print $formactions->select_type_actions($actioncode,
"search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0,
'maxwidth500');
87 print '<div class="divsearchfield">';
89 print '<span class="hideonsmartphone">'.$langs->trans(
"ActionsToDoBy").
'</span>';
90 print $form->select_dolusers($filtert,
'search_filtert', 1,
'', !$canedit,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth500 widthcentpercentminusxx');
92 print '<div class="divsearchfield">';
93 print img_picto(
'',
'object_group',
'class="fawidth30 inline-block"');
94 print '<span class="hideonsmartphone">'.$langs->trans(
"ToUserOfGroup").
'</span>';
95 print $form->select_dolgroups($usergroupid,
'usergroup', 1,
'', !$canedit,
'',
'',
'0',
false,
'maxwidth500');
98 if ($conf->resource->enabled)
100 include_once DOL_DOCUMENT_ROOT.
'/resource/class/html.formresource.class.php';
104 print '<div class="divsearchfield">';
105 print img_picto(
'',
'object_resource',
'class="fawidth30 inline-block"');
106 print '<span class="hideonsmartphone">'.$langs->trans(
"Resource").
'</span>';
107 print $formresource->select_resource_list($resourceid,
"search_resourceid",
'', 1, 0, 0, null,
'', 2, 0,
'maxwidth500');
112 if (!empty($conf->societe->enabled) && $user->rights->societe->lire)
114 print '<div class="divsearchfield">';
116 print '<span class="hideonsmartphone">'.$langs->trans(
"ThirdParty").
'</span>';
117 print $form->select_company($socid,
'search_socid',
'',
' ', 0, 0, null, 0,
'minwidth100 maxwidth500');
121 if (!empty($conf->projet->enabled) && $user->rights->projet->lire)
123 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
126 print '<div class="divsearchfield">';
128 print '<span class="hideonsmartphone">'.$langs->trans(
"Project").
'</span>';
129 print $formproject->select_projects($socid ? $socid : -1, $pid,
'search_projectid', 0, 0, 1, 0, 0, 0, 0,
'', 1, 0,
'maxwidth500');
133 if ($canedit && !preg_match(
'/list/',
$_SERVER[
"PHP_SELF"]))
136 print '<div class="divsearchfield">';
138 print '<span class="hideonsmartphone">'.$langs->trans(
"Status").
'</span>';
139 $formactions->form_select_status_action(
'formaction', $status, 1,
'search_status', 1, 2,
'minwidth100');
144 $parameters = array(
'canedit'=>$canedit,
'pid'=>$pid,
'socid'=>$socid);
146 $reshook = $hookmanager->executeHooks(
'searchAgendaFrom', $parameters, $object, $action);
148 print '<div style="clear:both"></div>';
160 global $langs, $conf, $user, $db, $socid;
164 include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
165 include_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
167 $sql =
"SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent";
168 $sql .=
", c.code, c.libelle as type_label";
169 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
170 $sql .=
", s.code_client, s.code_compta, s.client";
171 $sql .=
", s.logo, s.email, s.entity";
172 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
173 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
174 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
175 if (!$user->rights->societe->client->voir && !$socid) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
176 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
177 $sql .=
" AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now).
"'))";
178 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
179 if ($socid) $sql .=
" AND s.rowid = ".$socid;
180 $sql .=
" ORDER BY a.datep DESC, a.id DESC";
181 $sql .= $db->plimit($max, 0);
183 $resql = $db->query($sql);
186 $num = $db->num_rows(
$resql);
188 print '<div class="div-table-responsive-no-min">';
189 print '<table class="noborder centpercent">';
190 print '<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastActionsToDo", $max).
'</th>';
191 print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.
'/comm/action/list.php?action=show_list&status=todo">'.$langs->trans(
"FullList").
'</a></th>';
197 $customerstatic =
new Client($db);
201 $obj = $db->fetch_object(
$resql);
204 print '<tr class="oddeven">';
206 $staticaction->type_code = $obj->code;
207 $staticaction->label = ($obj->label ? $obj->label : $obj->type_label);
208 $staticaction->id = $obj->id;
209 print '<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
216 $customerstatic->id = $obj->socid;
217 $customerstatic->name = $obj->name;
219 $customerstatic->code_client = $obj->code_client;
220 $customerstatic->code_compta = $obj->code_compta;
221 $customerstatic->client = $obj->client;
222 $customerstatic->logo = $obj->logo;
223 $customerstatic->email = $obj->email;
224 $customerstatic->entity = $obj->entity;
225 print $customerstatic->getNomUrl(1,
'', 40);
229 $datep = $db->jdate($obj->dp);
230 $datep2 = $db->jdate($obj->dp2);
233 print '<td width="100" class="right tddate">'.dol_print_date($datep,
'day').
' ';
235 if ($obj->percent == 0 && $datep && $datep < time()) $late = 1;
236 if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) $late = 1;
237 if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) $late = 1;
238 if ($obj->percent > 0 && $obj->percent < 100 && !$datep2 && $datep && $datep < time()) $late = 1;
243 print
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
249 print "</table></div><br>";
266 global $langs, $conf, $user, $db, $socid;
270 $sql =
"SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label";
271 $sql .=
", c.code, c.libelle";
272 $sql .=
", s.rowid as socid, s.nom as name, s.name_alias";
273 $sql .=
", s.code_client, s.code_compta, s.client";
274 $sql .=
", s.logo, s.email, s.entity";
275 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
276 $sql .=
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action ";
277 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
278 if (!$user->rights->societe->client->voir && !$socid) $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
279 $sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
280 $sql .=
" AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now).
"'))";
281 if (!$user->rights->societe->client->voir && !$socid) $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
282 if ($socid) $sql .=
" AND s.rowid = ".$socid;
283 $sql .=
" ORDER BY a.datep2 DESC";
284 $sql .= $db->plimit($max, 0);
286 $resql = $db->query($sql);
289 $num = $db->num_rows(
$resql);
291 print '<div class="div-table-responsive-no-min">';
292 print '<table class="noborder centpercent">';
293 print '<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastDoneTasks", $max).
'</th>';
294 print '<th colspan="2" class="right"><a class="commonlink" href="'.DOL_URL_ROOT.
'/comm/action/list.php?action=show_list&status=done">'.$langs->trans(
"FullList").
'</a></th>';
300 $customerstatic =
new Societe($db);
304 $obj = $db->fetch_object(
$resql);
307 print '<tr class="oddeven">';
309 $staticaction->type_code = $obj->code;
310 $staticaction->libelle = $obj->label;
311 $staticaction->id = $obj->id;
312 print '<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
319 $customerstatic->id = $obj->socid;
320 $customerstatic->name = $obj->name;
322 $customerstatic->code_client = $obj->code_client;
323 $customerstatic->code_compta = $obj->code_compta;
324 $customerstatic->client = $obj->client;
325 $customerstatic->logo = $obj->logo;
326 $customerstatic->email = $obj->email;
327 $customerstatic->entity = $obj->entity;
328 print $customerstatic->getNomUrl(1,
'', 30);
333 print '<td width="100" class="right tddate">'.dol_print_date($db->jdate($obj->da2),
'day');
337 print '<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
344 print "</table></div><br>";
360 global $langs, $conf, $user;
364 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_other.php";
365 $head[$h][1] = $langs->trans(
"Miscellaneous");
366 $head[$h][2] =
'other';
369 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda.php";
370 $head[$h][1] = $langs->trans(
"AutoActions");
371 $head[$h][2] =
'autoactions';
374 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_reminder.php";
375 $head[$h][1] = $langs->trans(
"Reminders");
376 $head[$h][2] =
'reminders';
379 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_xcal.php";
380 $head[$h][1] = $langs->trans(
"ExportCal");
381 $head[$h][2] =
'xcal';
384 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extsites.php";
385 $head[$h][1] = $langs->trans(
"ExtSites");
386 $head[$h][2] =
'extsites';
391 $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extrafields.php";
392 $head[$h][1] = $langs->trans(
"ExtraFields");
393 $head[$h][2] =
'attributes';
410 global $db, $langs, $conf, $user;
415 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/card.php?id='.$object->id;
416 $head[$h][1] = $langs->trans(
"CardAction");
417 $head[$h][2] =
'card';
421 if ($conf->resource->enabled)
423 include_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
424 $resource =
new DolResource($db);
426 $head[$h][0] = DOL_URL_ROOT.
'/resource/element_resource.php?element=action&element_id='.$object->id;
427 $listofresourcelinked = $resource->getElementResources($object->element, $object->id);
428 $nbResources = (is_array($listofresourcelinked) ?count($listofresourcelinked) : 0);
429 $head[$h][1] = $langs->trans(
"Resources");
430 if ($nbResources > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' :
'');
431 $head[$h][2] =
'resources';
436 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
437 require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
438 $upload_dir = $conf->agenda->dir_output.
"/".$object->id;
439 $nbFiles = count(
dol_dir_list($upload_dir,
'files', 0,
'',
'(\.meta|_preview.*\.png)$'));
440 $nbLinks =
Link::count($db, $object->element, $object->id);
441 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/document.php?id='.$object->id;
442 $head[$h][1] = $langs->trans(
"Documents");
443 if (($nbFiles + $nbLinks) > 0) $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ?
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' :
'');
444 $head[$h][2] =
'documents';
447 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/info.php?id='.$object->id;
448 $head[$h][1] = $langs->trans(
'Info');
449 $head[$h][2] =
'info';
468 global $langs, $conf, $user;
473 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/list.php?action=show_list'.($param ?
'&'.$param :
'');
474 $head[$h][1] = $langs->trans(
"ViewList");
475 $head[$h][2] =
'cardlist';
478 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?action=show_month'.($param ?
'&'.$param :
'');
479 $head[$h][1] = $langs->trans(
"ViewCal");
480 $head[$h][2] =
'cardmonth';
483 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?action=show_week'.($param ?
'&'.$param :
'');
484 $head[$h][1] = $langs->trans(
"ViewWeek");
485 $head[$h][2] =
'cardweek';
488 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?action=show_day'.($param ?
'&'.$param :
'');
489 $head[$h][1] = $langs->trans(
"ViewDay");
490 $head[$h][2] =
'cardday';
494 if (!empty($conf->global->AGENDA_SHOW_PERTYPE))
496 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/pertype.php'.($param ?
'?'.$param :
'');
497 $head[$h][1] = $langs->trans(
"ViewPerType");
498 $head[$h][2] =
'cardpertype';
503 $newparam = preg_replace(
'/&?search_filtert=\d+/',
'', $newparam);
504 $head[$h][0] = DOL_URL_ROOT.
'/comm/action/peruser.php'.($newparam ?
'?'.$newparam :
'');
505 $head[$h][1] = $langs->trans(
"ViewPerUser");
506 $head[$h][2] =
'cardperuser';
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)
agenda_prepare_head()
Prepare array with list of tabs.
dol_now($mode= 'auto')
Return date for now.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
Class to manage customers or prospects.
actions_prepare_head($object)
Prepare array with list of tabs.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
Class to manage third parties objects (customers, suppliers, prospects...)
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
show_array_last_actions_done($max=5)
Show last actions array.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
print $_SERVER["PHP_SELF"]
Edit parameters.
static count($db, $objecttype, $objectid)
Return nb of links.
print
Draft customers invoices.
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...
show_array_actions_to_do($max=5)
Show actions to do array.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode= 'add')
Complete or removed entries into a head array (used to build tabs).