66  $showextcals = array(),
 
   73  global $user, $langs, $db, $hookmanager;
 
   76  $langs->load(
"companies");
 
   78  include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
 
   83  print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
   84  print 
'<input type="hidden" name="year" value="'.((int) $year).
'">';
 
   85  print 
'<input type="hidden" name="month" value="'.((int) $month).
'">';
 
   86  print 
'<input type="hidden" name="day" value="'.((int) $day).
'">';
 
   87  if ($massaction != 
'predelete' && $massaction != 
'preaffecttag') {    
 
   88    print 
'<input type="hidden" name="action" value="'.$action.
'">';
 
   90  print 
'<input type="hidden" name="search_showbirthday" value="'.((int) $showbirthday).
'">';
 
   92  print 
'<div class="divsearchfield">';
 
   98  print 
img_picto($langs->trans(
"ActionType"), 
'square', 
'class="pictofixedwidth inline-block" style="color: #ddd;"');
 
   99  print $formactions->select_type_actions($actioncode, 
"search_actioncode", $excludetype, (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : -1), 0, $multiselect, 0, 
'minwidth200 maxwidth250 widthcentpercentminusx');
 
  104    print 
'<div class="divsearchfield">';
 
  105    print 
img_picto($langs->trans(
"ActionsToDoBy"), 
'user', 
'class="pictofixedwidth inline-block"');
 
  106    print $form->select_dolusers($filtert, 
'search_filtert', 1, 
'', !$canedit, 
'', 
'', 0, 0, 0, 
'', 0, 
'', 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  110    print 
'<div class="divsearchfield">';
 
  111    print 
img_picto($langs->trans(
"ToUserOfGroup"), 
'object_group', 
'class="pictofixedwidth inline-block"');
 
  112    print $form->select_dolgroups($usergroupid, 
'usergroup', 1, 
'', !$canedit, 
'', 
'', 
'0', 
false, 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  115    if (isModEnabled(
'resource')) {
 
  116      include_once DOL_DOCUMENT_ROOT.
'/resource/class/html.formresource.class.php';
 
  120      print 
'<div class="divsearchfield">';
 
  121      print 
img_picto($langs->trans(
"Resource"), 
'object_resource', 
'class="pictofixedwidth inline-block"');
 
  122      print $formresource->select_resource_list($resourceid, 
"search_resourceid", [], 1, 0, 0, [], [], 2, 0, 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  127  if (isModEnabled(
'societe') && $user->hasRight(
'societe', 
'lire')) {
 
  128    print 
'<div class="divsearchfield">';
 
  129    print 
img_picto($langs->trans(
"ThirdParty"), 
'company', 
'class="pictofixedwidth inline-block"');
 
  130    print $form->select_company($socid, 
'search_socid', 
'', 
' ', 0, 0, 
null, 0, 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  134  if (isModEnabled(
'project') && $user->hasRight(
'projet', 
'lire')) {
 
  135    require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
 
  138    print 
'<div class="divsearchfield">';
 
  139    print 
img_picto($langs->trans(
"Project"), 
'project', 
'class="pictofixedwidth inline-block"');
 
  140    print $formproject->select_projects($socid ? $socid : -1, $pid, 
'search_projectid', 0, 0, 1, 0, 0, 0, 0, 
'', 1, 0, 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  144  if (isModEnabled(
'category') && $user->hasRight(
'categorie', 
'lire')) {
 
  145    require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
 
  146    require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
 
  148    $langs->load(
'categories');
 
  150    print 
'<div class="divsearchfield">';
 
  151    print 
img_picto($langs->trans(
'Categories'), 
'category', 
'class="pictofixedwidth"');
 
  152    print $formother->select_categories(
'actioncomm', $search_categ_cus, 
'search_categ_cus', 1, $langs->trans(
'ActionCommCategoriesArea'), 
'minwidth100 maxwidth250 widthcentpercentminusx');
 
  156  if ($canedit && !preg_match(
'/list/', $_SERVER[
"PHP_SELF"])) {
 
  158    print 
'<div class="divsearchfield">';
 
  159    print 
img_picto($langs->trans(
"Status"), 
'status', 
'class="pictofixedwidth inline-block"');
 
  160    $formactions->form_select_status_action(
'formaction', $status, 1, 
'search_status', 1, 2, 
'minwidth100');
 
  165  $parameters = array(
'canedit'=>$canedit, 
'pid'=>$pid, 
'socid'=>$socid);
 
  167  $reshook = $hookmanager->executeHooks(
'searchAgendaFrom', $parameters, 
$object, $action); 
 
  169  print 
'<div class="clearboth"></div>';
 
 
  181  global $langs, $conf, $user, $db, $socid;
 
  185  include_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
 
  186  include_once DOL_DOCUMENT_ROOT.
'/societe/class/client.class.php';
 
  188  $sql = 
"SELECT a.id, a.label, a.datep as dp, a.datep2 as dp2, a.fk_user_author, a.percent";
 
  189  $sql .= 
", c.code, c.libelle as type_label";
 
  190  $sql .= 
", s.rowid as socid, s.nom as name, s.name_alias";
 
  191  $sql .= 
", s.code_client, s.code_compta, s.client";
 
  192  $sql .= 
", s.logo, s.email, s.entity";
 
  193  $sql .= 
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
 
  194  $sql .= 
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
 
  195  $sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
 
  196  if (!$user->hasRight(
'societe', 
'client', 
'voir')) {
 
  197    $sql .= 
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
 
  199  $sql .= 
" WHERE a.entity IN (".getEntity(
'agenda').
")";
 
  200  $sql .= 
" AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now).
"'))";
 
  201  if (!$user->hasRight(
'societe', 
'client', 
'voir')) {
 
  202    $sql .= 
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
 
  205    $sql .= 
" AND s.rowid = ".((int) $socid);
 
  207  $sql .= 
" ORDER BY a.datep DESC, a.id DESC";
 
  208  $sql .= $db->plimit($max, 0);
 
  210  $resql = $db->query($sql);
 
  212    $num = $db->num_rows($resql);
 
  214    print 
'<div class="div-table-responsive-no-min">';
 
  215    print 
'<table class="noborder centpercent">';
 
  216    print 
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastActionsToDo", $max).
'</th>';
 
  217    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>';
 
  223    $customerstatic = 
new Client($db);
 
  226      $obj = $db->fetch_object($resql);
 
  229      print 
'<tr class="oddeven">';
 
  231      $staticaction->type_code = $obj->code;
 
  232      $staticaction->label = ($obj->label ? $obj->label : $obj->type_label);
 
  233      $staticaction->id = $obj->id;
 
  234      print 
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
 
  239      if ($obj->socid > 0) {
 
  240        $customerstatic->id = $obj->socid;
 
  241        $customerstatic->name = $obj->name;
 
  243        $customerstatic->code_client = $obj->code_client;
 
  244        $customerstatic->code_compta = $obj->code_compta;
 
  245        $customerstatic->client = $obj->client;
 
  246        $customerstatic->logo = $obj->logo;
 
  247        $customerstatic->email = $obj->email;
 
  248        $customerstatic->entity = $obj->entity;
 
  249        print $customerstatic->getNomUrl(1, 
'', 40);
 
  253      $datep = $db->jdate($obj->dp);
 
  254      $datep2 = $db->jdate($obj->dp2);
 
  257      print 
'<td width="100" class="right tddate">'.dol_print_date($datep, 
'day').
' ';
 
  259      if ($obj->percent == 0 && $datep && $datep < time()) {
 
  262      if ($obj->percent == 0 && !$datep && $datep2 && $datep2 < time()) {
 
  265      if ($obj->percent > 0 && $obj->percent < 100 && $datep2 && $datep2 < time()) {
 
  268      if ($obj->percent > 0 && $obj->percent < 100 && !$datep2 && $datep && $datep < time()) {
 
  277      print 
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
 
  283    print 
"</table></div><br>";
 
 
  300  global $langs, $conf, $user, $db, $socid;
 
  304  $sql = 
"SELECT a.id, a.percent, a.datep as da, a.datep2 as da2, a.fk_user_author, a.label";
 
  305  $sql .= 
", c.code, c.libelle";
 
  306  $sql .= 
", s.rowid as socid, s.nom as name, s.name_alias";
 
  307  $sql .= 
", s.code_client, s.code_compta, s.client";
 
  308  $sql .= 
", s.logo, s.email, s.entity";
 
  309  $sql .= 
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a LEFT JOIN ";
 
  310  $sql .= 
" ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action ";
 
  311  $sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
 
  312  if (!$user->hasRight(
'societe', 
'client', 
'voir')) {
 
  313    $sql .= 
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
 
  315  $sql .= 
" WHERE a.entity IN (".getEntity(
'agenda').
")";
 
  316  $sql .= 
" AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now).
"'))";
 
  317  if (!$user->hasRight(
'societe', 
'client', 
'voir')) {
 
  318    $sql .= 
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
 
  321    $sql .= 
" AND s.rowid = ".((int) $socid);
 
  323  $sql .= 
" ORDER BY a.datep2 DESC";
 
  324  $sql .= $db->plimit($max, 0);
 
  326  $resql = $db->query($sql);
 
  328    $num = $db->num_rows($resql);
 
  330    print 
'<div class="div-table-responsive-no-min">';
 
  331    print 
'<table class="noborder centpercent">';
 
  332    print 
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastDoneTasks", $max).
'</th>';
 
  333    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>';
 
  339    $customerstatic = 
new Societe($db);
 
  342      $obj = $db->fetch_object($resql);
 
  345      print 
'<tr class="oddeven">';
 
  347      $staticaction->type_code = $obj->code;
 
  348      $staticaction->label = $obj->label;
 
  349      $staticaction->id = $obj->id;
 
  350      print 
'<td>'.$staticaction->getNomUrl(1, 34).
'</td>';
 
  355      if ($obj->socid > 0) {
 
  356        $customerstatic->id = $obj->socid;
 
  357        $customerstatic->name = $obj->name;
 
  359        $customerstatic->code_client = $obj->code_client;
 
  360        $customerstatic->code_compta = $obj->code_compta;
 
  361        $customerstatic->client = $obj->client;
 
  362        $customerstatic->logo = $obj->logo;
 
  363        $customerstatic->email = $obj->email;
 
  364        $customerstatic->entity = $obj->entity;
 
  365        print $customerstatic->getNomUrl(1, 
'', 30);
 
  370      print 
'<td width="100" class="right tddate">'.dol_print_date($db->jdate($obj->da2), 
'day');
 
  374      print 
'<td class="right" width="14">'.$staticaction->LibStatut($obj->percent, 3).
"</td>\n";
 
  381    print 
"</table></div><br>";
 
 
  397  global $langs, $conf, $user, $db;
 
  400  $extrafields->fetch_name_optionals_label(
'actioncomm');
 
  405  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_other.php";
 
  406  $head[$h][1] = $langs->trans(
"Miscellaneous");
 
  407  $head[$h][2] = 
'other';
 
  410  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda.php";
 
  411  $head[$h][1] = $langs->trans(
"AutoActions");
 
  412  $head[$h][2] = 
'autoactions';
 
  415  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_reminder.php";
 
  416  $head[$h][1] = $langs->trans(
"Reminders");
 
  417  $head[$h][2] = 
'reminders';
 
  420  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_xcal.php";
 
  421  $head[$h][1] = $langs->trans(
"ExportCal");
 
  422  $head[$h][2] = 
'xcal';
 
  425  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extsites.php";
 
  426  $head[$h][1] = $langs->trans(
"ExtSites");
 
  427  $head[$h][2] = 
'extsites';
 
  432  $head[$h][0] = DOL_URL_ROOT.
"/admin/agenda_extrafields.php";
 
  433  $head[$h][1] = $langs->trans(
"ExtraFields");
 
  434  $nbExtrafields = $extrafields->attributes[
'actioncomm'][
'count'];
 
  435  if ($nbExtrafields > 0) {
 
  436    $head[$h][1] .= 
'<span class="badge marginleftonlyshort">'.$nbExtrafields.
'</span>';
 
  438  $head[$h][2] = 
'attributes';
 
 
  455  global $db, $langs, $conf, $user;
 
  460  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/card.php?id='.
$object->id;
 
  461  $head[$h][1] = $langs->trans(
"CardAction");
 
  462  $head[$h][2] = 
'card';
 
  466  if (isModEnabled(
'resource')) {
 
  467    include_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
 
  470    $head[$h][0] = DOL_URL_ROOT.
'/resource/element_resource.php?element=action&element_id='.
$object->id;
 
  471    $listofresourcelinked = $resource->getElementResources(
$object->element, 
$object->id);
 
  472    $nbResources = (is_array($listofresourcelinked) ? count($listofresourcelinked) : 0);
 
  473    $head[$h][1] = $langs->trans(
"Resources");
 
  474    if ($nbResources > 0) {
 
  475      $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ? 
'<span class="badge marginleftonlyshort">'.($nbResources).
'</span>' : 
'');
 
  477    $head[$h][2] = 
'resources';
 
  482  require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
 
  483  require_once DOL_DOCUMENT_ROOT.
'/core/class/link.class.php';
 
  484  $upload_dir = $conf->agenda->dir_output.
"/".
$object->id;
 
  485  $nbFiles = count(
dol_dir_list($upload_dir, 
'files', 0, 
'', 
'(\.meta|_preview.*\.png)$'));
 
  487  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/document.php?id='.
$object->id;
 
  488  $head[$h][1] = $langs->trans(
"Documents");
 
  489  if (($nbFiles + $nbLinks) > 0) {
 
  490    $head[$h][1] .= (!
getDolGlobalString(
'MAIN_OPTIMIZEFORTEXTBROWSER') ? 
'<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).
'</span>' : 
'');
 
  492  $head[$h][2] = 
'documents';
 
  495  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/info.php?id='.
$object->id;
 
  496  $head[$h][1] = $langs->trans(
'Info');
 
  497  $head[$h][2] = 
'info';
 
 
  516  global $langs, $conf, $user;
 
  521  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list'.($param ? 
'&'.$param : 
'');
 
  522  $head[$h][1] = $langs->trans(
"ViewList");
 
  523  $head[$h][2] = 
'cardlist';
 
  526  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month'.($param ? 
'&'.$param : 
'');
 
  527  $head[$h][1] = $langs->trans(
"ViewCal");
 
  528  $head[$h][2] = 
'cardmonth';
 
  531  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week'.($param ? 
'&'.$param : 
'');
 
  532  $head[$h][1] = $langs->trans(
"ViewWeek");
 
  533  $head[$h][2] = 
'cardweek';
 
  536  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day'.($param ? 
'&'.$param : 
'');
 
  537  $head[$h][1] = $langs->trans(
"ViewDay");
 
  538  $head[$h][2] = 
'cardday';
 
  543    $head[$h][0] = DOL_URL_ROOT.
'/comm/action/pertype.php'.($param ? 
'?'.$param : 
'');
 
  544    $head[$h][1] = $langs->trans(
"ViewPerType");
 
  545    $head[$h][2] = 
'cardpertype';
 
  550  $newparam = preg_replace(
'/&?search_filtert=\d+/', 
'', $newparam);
 
  551  $head[$h][0] = DOL_URL_ROOT.
'/comm/action/peruser.php'.($newparam ? 
'?'.$newparam : 
'');
 
  552  $head[$h][1] = $langs->trans(
"ViewPerUser");
 
  553  $head[$h][2] = 
'cardperuser';
 
 
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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)
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.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_now($mode='auto')
Return date for now.
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 dolibarr global constant string value.