33 require
'../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
47 $langs->loadLangs(array(
'projects',
'companies',
'commercial'));
48 if (
isModEnabled(
'eventorganization') && $conf->eventorganization->enabled) {
49 $langs->loadLangs(array(
'eventorganization'));
52 $action =
GETPOST(
'action',
'aZ09');
53 $massaction =
GETPOST(
'massaction',
'alpha');
54 $show_files =
GETPOST(
'show_files',
'int');
55 $confirm =
GETPOST(
'confirm',
'alpha');
56 $toselect =
GETPOST(
'toselect',
'array');
57 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projectlist';
59 $title = $langs->trans(
"Projects");
62 $socid =
GETPOST(
'socid',
'int');
67 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
69 if (!$user->rights->projet->lire) {
73 $diroutputmassaction = $conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
75 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
76 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
77 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
79 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
89 $offset = $limit * $page;
90 $pageprev = $page - 1;
91 $pagenext = $page + 1;
93 $search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
94 $search_ref =
GETPOST(
"search_ref",
'alpha');
95 $search_label =
GETPOST(
"search_label",
'alpha');
96 $search_societe =
GETPOST(
"search_societe",
'alpha');
97 $search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
98 $search_status =
GETPOST(
"search_status",
'int');
99 $search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
100 $search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
101 $search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
102 $search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
103 $search_public =
GETPOST(
"search_public",
'int');
104 $search_project_user =
GETPOST(
'search_project_user',
'int');
105 $search_project_contact =
GETPOST(
'search_project_contact',
'int');
106 $search_sale =
GETPOST(
'search_sale',
'int');
107 $search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'int');
108 $search_usage_task =
GETPOST(
'search_usage_task',
'int');
109 $search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'int');
110 $search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'int');
111 $search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'int');
112 $search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'int');
113 $search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
114 $search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
115 $search_login =
GETPOST(
'search_login',
'alpha');
116 $searchCategoryCustomerOperator = 0;
118 $searchCategoryCustomerOperator =
GETPOST(
'search_category_customer_operator',
'int');
119 } elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
120 $searchCategoryCustomerOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
122 $searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
123 $optioncss =
GETPOST(
'optioncss',
'alpha');
125 $mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
127 $search_project_user = $user->id; $mine = 0;
130 $search_sday =
GETPOST(
'search_sday',
'int');
131 $search_smonth =
GETPOST(
'search_smonth',
'int');
132 $search_syear =
GETPOST(
'search_syear',
'int');
133 $search_eday =
GETPOST(
'search_eday',
'int');
134 $search_emonth =
GETPOST(
'search_emonth',
'int');
135 $search_eyear =
GETPOST(
'search_eyear',
'int');
138 $search_date_start_startmonth =
GETPOST(
'search_date_start_startmonth',
'int');
139 $search_date_start_startyear =
GETPOST(
'search_date_start_startyear',
'int');
140 $search_date_start_startday =
GETPOST(
'search_date_start_startday',
'int');
141 $search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
142 $search_date_start_endmonth =
GETPOST(
'search_date_start_endmonth',
'int');
143 $search_date_start_endyear =
GETPOST(
'search_date_start_endyear',
'int');
144 $search_date_start_endday =
GETPOST(
'search_date_start_endday',
'int');
145 $search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
147 $search_date_end_startmonth =
GETPOST(
'search_date_end_startmonth',
'int');
148 $search_date_end_startyear =
GETPOST(
'search_date_end_startyear',
'int');
149 $search_date_end_startday =
GETPOST(
'search_date_end_startday',
'int');
150 $search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
151 $search_date_end_endmonth =
GETPOST(
'search_date_end_endmonth',
'int');
152 $search_date_end_endyear =
GETPOST(
'search_date_end_endyear',
'int');
153 $search_date_end_endday =
GETPOST(
'search_date_end_endday',
'int');
154 $search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
155 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
157 if ($search_status ==
'') {
164 $hookmanager->initHooks(array(
'projectlist'));
168 $extrafields->fetch_name_optionals_label($object->table_element);
170 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
173 $fieldstosearchall = array();
174 foreach ($object->fields as $key => $val) {
175 if (empty($val[
'searchall'])) {
180 if (!empty($user->socid) && $key ==
"note_private") {
184 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
188 $fieldstosearchall[
's.nom'] =
"ThirdPartyName";
191 $arrayfields = array();
192 foreach ($object->fields as $key => $val) {
194 if (!empty($val[
'visible'])) {
195 $visible =
dol_eval($val[
'visible'], 1, 1,
'1');
196 $arrayfields[
'p.'.$key] = array(
197 'label'=>$val[
'label'],
198 'checked'=>(($visible < 0) ? 0 : 1),
199 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
200 'position'=>$val[
'position'],
201 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
206 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
209 $arrayfields[
's.nom'] = array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>21,
'enabled'=>(!
isModEnabled(
'societe') ? 0 : 1));
210 $arrayfields[
's.name_alias'] = array(
'label'=>
"AliasNameShort",
'checked'=>0,
'position'=>22);
211 $arrayfields[
'commercial'] = array(
'label'=>$langs->trans(
"SaleRepresentativesOfThirdParty"),
'checked'=>0,
'position'=>23);
212 $arrayfields[
'c.assigned'] = array(
'label'=>$langs->trans(
"AssignedTo"),
'checked'=>-1,
'position'=>120);
213 $arrayfields[
'opp_weighted_amount'] = array(
'label'=>$langs->trans(
'OpportunityWeightedAmountShort'),
'checked'=>0,
'enabled'=>(empty($conf->global->PROJECT_USE_OPPORTUNITIES) ? 0 : 1),
'position'=>106);
214 $arrayfields[
'u.login'] = array(
'label'=>
"Author",
'checked'=>1,
'position'=>165);
216 if (
GETPOST(
'search_usage_opportunity')) {
220 if (
GETPOST(
'search_usage_event_organization')) {
221 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 0;
222 $arrayfields[
'p.opp_amount'][
'enabled'] = 0;
223 $arrayfields[
'p.opp_percent'][
'enabled'] = 0;
224 $arrayfields[
'opp_weighted_amount'][
'enabled'] = 0;
225 $arrayfields[
'p.usage_organize_event'][
'visible'] = 1;
226 $arrayfields[
'p.usage_organize_event'][
'checked'] = 1;
237 if (
GETPOST(
'cancel',
'alpha')) {
241 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
245 $parameters = array(
'socid'=>$socid);
246 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
251 if (empty($reshook)) {
253 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
256 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
260 $search_societe =
"";
261 $search_societe_alias =
'';
263 $search_opp_status = -1;
264 $search_opp_amount =
'';
265 $search_opp_percent =
'';
266 $search_budget_amount =
'';
269 $search_project_user =
'';
270 $search_project_contact =
'';
277 $search_date_start_startmonth =
"";
278 $search_date_start_startyear =
"";
279 $search_date_start_startday =
"";
280 $search_date_start_start =
"";
281 $search_date_start_endmonth =
"";
282 $search_date_start_endyear =
"";
283 $search_date_start_endday =
"";
284 $search_date_start_end =
"";
285 $search_date_end_startmonth =
"";
286 $search_date_end_startyear =
"";
287 $search_date_end_startday =
"";
288 $search_date_end_start =
"";
289 $search_date_end_endmonth =
"";
290 $search_date_end_endyear =
"";
291 $search_date_end_endday =
"";
292 $search_date_end_end =
"";
293 $search_usage_opportunity =
'';
294 $search_usage_task =
'';
295 $search_usage_bill_time =
'';
296 $search_usage_event_organization =
'';
297 $search_accept_conference_suggestions =
'';
298 $search_accept_booth_suggestions =
'';
299 $search_price_registration =
'';
300 $search_price_booth =
'';
303 $search_array_options = array();
304 $search_category_array = array();
309 $objectclass =
'Project';
310 $objectlabel =
'Project';
311 $permissiontoread = $user->rights->projet->lire;
312 $permissiontodelete = $user->rights->projet->supprimer;
313 $permissiontoadd = $user->rights->projet->creer;
314 $uploaddir = $conf->project->dir_output;
315 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
318 if (!$error && $massaction ==
'close' && $user->rights->projet->creer) {
321 $objecttmp =
new $objectclass($db);
323 foreach ($toselect as $toselectid) {
324 $result = $objecttmp->fetch($toselectid);
326 $userWrite = $object->restrictedProjectArea($user,
'write');
327 if ($userWrite > 0 && $objecttmp->statut == 1) {
328 $result = $objecttmp->setClose($user);
336 } elseif ($userWrite <= 0) {
337 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
339 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
369 $companystatic =
new Societe($db);
370 $taskstatic =
new Task($db);
374 $help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
375 $title = $langs->trans(
"LeadsOrProjects");
376 if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
377 $title = $langs->trans(
"Projects");
379 if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) {
380 $title = $langs->trans(
"Leads");
387 $projectsListId =
'';
388 if (empty($user->rights->projet->all->lire)) {
389 $projectsListId = $object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
393 $listofprojectcontacttype = array();
394 $listofprojectcontacttypeexternal = array();
395 $sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
396 $sql .=
" WHERE ctc.element = '".$db->escape($object->element).
"'";
397 $resql = $db->query($sql);
399 while ($obj = $db->fetch_object(
$resql)) {
400 if ($obj->source ==
'internal') $listofprojectcontacttype[$obj->rowid] = $obj->code;
401 else $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
406 if (count($listofprojectcontacttype) == 0) {
407 $listofprojectcontacttype[0] =
'0';
409 if (count($listofprojectcontacttypeexternal) == 0) {
410 $listofprojectcontacttypeexternal[0] =
'0';
413 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
414 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
416 $distinct =
'DISTINCT';
417 $sql =
"SELECT ".$distinct.
" p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
418 $sql .=
" p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,";
419 $sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
420 $sql .=
" p.email_msgid, p.import_key,";
421 $sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
422 $sql .=
" s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client,";
423 $sql .=
" country.code as country_code,";
424 $sql .=
" cls.code as opp_status_code,";
425 $sql .=
' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
427 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
428 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
429 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
433 $parameters = array();
434 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
435 $sql .= preg_replace(
'/^,/',
'', $hookmanager->resPrint);
436 $sql = preg_replace(
'/,\s*$/',
'', $sql);
437 $sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as p";
438 if (!empty($extrafields->attributes[$object->table_element][
'label']) &&is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
439 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
441 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
442 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
443 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
444 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
448 if ($search_sale > 0) {
449 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON sc.fk_soc = s.rowid";
451 if ($search_project_user > 0) {
452 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ecp";
454 if ($search_project_contact > 0) {
455 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ecp_contact";
458 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
459 $sql .= $hookmanager->resPrint;
461 $sql .=
" WHERE p.entity IN (".getEntity(
'project').
')';
462 if (empty($user->rights->projet->all->lire)) {
463 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
467 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
475 if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
476 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
478 if ($search_societe) {
481 if ($search_societe_alias) {
485 if ($search_opp_amount) {
488 if ($search_opp_percent) {
491 $sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
492 $sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
495 if ($search_date_start_start) {
496 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
498 if ($search_date_start_end) {
499 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
502 if ($search_date_end_start) {
503 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
505 if ($search_date_end_end) {
506 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
510 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
512 if ($search_status >= 0) {
513 if ($search_status == 99) {
514 $sql .=
" AND p.fk_statut <> 2";
516 $sql .=
" AND p.fk_statut = ".((int) $search_status);
519 if ($search_opp_status) {
520 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
521 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
523 if ($search_opp_status ==
'all') {
524 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
526 if ($search_opp_status ==
'openedopp') {
527 $sql .=
" AND p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1 AND p.fk_opp_status NOT IN (SELECT rowid FROM ".MAIN_DB_PREFIX.
"c_lead_status WHERE code IN ('WON','LOST'))";
529 if ($search_opp_status ==
'notopenedopp') {
530 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1 OR p.fk_opp_status IN (SELECT rowid FROM ".MAIN_DB_PREFIX.
"c_lead_status WHERE code = 'WON'))";
532 if ($search_opp_status ==
'none') {
533 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
536 if ($search_public !=
'') {
537 $sql .=
" AND p.public = ".((int) $search_public);
541 if ($search_sale > 0) {
542 $sql .=
" AND sc.fk_user = ".((int) $search_sale);
546 if ($search_project_user > 0) {
547 $sql .=
" AND ecp.fk_c_type_contact IN (".$db->sanitize(join(
',', array_keys($listofprojectcontacttype))).
") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".((int) $search_project_user);
549 if ($search_project_contact > 0) {
550 $sql .=
" AND ecp_contact.fk_c_type_contact IN (".$db->sanitize(join(
',', array_keys($listofprojectcontacttypeexternal))).
") AND ecp_contact.element_id = p.rowid AND ecp_contact.fk_socpeople = ".((int) $search_project_contact);
552 if ($search_opp_amount !=
'') {
555 if ($search_budget_amount !=
'') {
556 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
558 if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
559 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
561 if ($search_usage_task !=
'' && $search_usage_task >= 0) {
564 if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
565 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
567 if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
568 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
570 if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
571 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
573 if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
574 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
576 if ($search_price_registration !=
'') {
577 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
579 if ($search_price_booth !=
'') {
583 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
586 $searchCategoryProjectList = $search_category_array;
587 $searchCategoryProjectOperator = 0;
588 if (!empty($searchCategoryProjectList)) {
589 $searchCategoryProjectSqlList = array();
590 $listofcategoryid =
'';
591 foreach ($searchCategoryProjectList as $searchCategoryProject) {
592 if (intval($searchCategoryProject) == -2) {
593 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
594 } elseif (intval($searchCategoryProject) > 0) {
595 if ($searchCategoryProjectOperator == 0) {
596 $searchCategoryProjectSqlList[] =
" EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).
")";
598 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
602 if ($listofcategoryid) {
603 $searchCategoryProjectSqlList[] =
" EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
605 if ($searchCategoryProjectOperator == 1) {
606 if (!empty($searchCategoryProjectSqlList)) {
607 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
610 if (!empty($searchCategoryProjectSqlList)) {
611 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
615 $searchCategoryCustomerSqlList = array();
616 if ($searchCategoryCustomerOperator == 1) {
617 $existsCategoryCustomerList = array();
618 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
619 if (intval($searchCategoryCustomer) == -2) {
620 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
621 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
622 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
623 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
624 $sqlCategoryCustomerNotExists .=
" )";
625 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
626 } elseif (intval($searchCategoryCustomer) > 0) {
627 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
630 if (!empty($existsCategoryCustomerList)) {
631 $sqlCategoryCustomerExists =
" EXISTS (";
632 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
633 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
634 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
635 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
636 $sqlCategoryCustomerExists .=
" )";
637 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
639 if (!empty($searchCategoryCustomerSqlList)) {
640 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
643 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
644 if (intval($searchCategoryCustomer) == -2) {
645 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
646 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
647 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
648 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
649 $sqlCategoryCustomerNotExists .=
" )";
650 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
651 } elseif (intval($searchCategoryCustomer) > 0) {
652 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
655 if (!empty($searchCategoryCustomerSqlList)) {
656 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
660 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
662 $parameters = array();
663 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
664 $sql .= $hookmanager->resPrint;
665 $sql .= $db->order($sortfield, $sortorder);
669 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
670 $resql = $db->query($sql);
681 if (!empty($limit)) {
682 $sql .= $db->plimit($limit + 1, $offset);
685 $resql = $db->query($sql);
691 $num = $db->num_rows(
$resql);
695 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) {
696 $obj = $db->fetch_object(
$resql);
697 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
705 dol_syslog(
"list allowed project", LOG_DEBUG);
709 $arrayofselected = is_array($toselect) ? $toselect : array();
712 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
713 $param .=
'&contextpage='.urlencode($contextpage);
715 if ($limit > 0 && $limit != $conf->liste_limit) {
716 $param .=
'&limit='.urlencode($limit);
718 if ($search_all !=
'') {
719 $param .=
'&search_all='.urlencode($search_all);
722 $param .=
'&search_sday='.urlencode($search_sday);
724 if ($search_smonth) {
725 $param .=
'&search_smonth='.urlencode($search_smonth);
728 $param .=
'&search_syear='.urlencode($search_syear);
731 $param .=
'&search_eday='.urlencode($search_eday);
733 if ($search_emonth) {
734 $param .=
'&search_emonth='.urlencode($search_emonth);
737 $param .=
'&search_eyear='.urlencode($search_eyear);
739 if ($search_date_start_startmonth) {
740 $param .=
'&search_date_start_startmonth='.urlencode($search_date_start_startmonth);
742 if ($search_date_start_startyear) {
743 $param .=
'&search_date_start_startyear='.urlencode($search_date_start_startyear);
745 if ($search_date_start_startday) {
746 $param .=
'&search_date_start_startday='.urlencode($search_date_start_startday);
748 if ($search_date_start_start) {
749 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
751 if ($search_date_start_endmonth) {
752 $param .=
'&search_date_start_endmonth='.urlencode($search_date_start_endmonth);
754 if ($search_date_start_endyear) {
755 $param .=
'&search_date_start_endyear='.urlencode($search_date_start_endyear);
757 if ($search_date_start_endday) {
758 $param .=
'&search_date_start_endday='.urlencode($search_date_start_endday);
760 if ($search_date_start_end) {
761 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
763 if ($search_date_end_startmonth) {
764 $param .=
'&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
766 if ($search_date_end_startyear) {
767 $param .=
'&search_date_end_startyear='.urlencode($search_date_end_startyear);
769 if ($search_date_end_startday) {
770 $param .=
'&search_date_end_startday='.urlencode($search_date_end_startday);
772 if ($search_date_end_start) {
773 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
775 if ($search_date_end_endmonth) {
776 $param .=
'&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
778 if ($search_date_end_endyear) {
779 $param .=
'&search_date_end_endyear='.urlencode($search_date_end_endyear);
781 if ($search_date_end_endday) {
782 $param .=
'&search_date_end_endday='.urlencode($search_date_end_endday);
784 if ($search_date_end_end) {
785 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
788 $param .=
'&socid='.urlencode($socid);
790 if (!empty($search_categ)) {
791 $param .=
'&search_categ='.urlencode($search_categ);
793 if ($search_ref !=
'') {
794 $param .=
'&search_ref='.urlencode($search_ref);
796 if ($search_label !=
'') {
797 $param .=
'&search_label='.urlencode($search_label);
799 if ($search_societe !=
'') {
800 $param .=
'&search_societe='.urlencode($search_societe);
802 if ($search_societe_alias !=
'') {
803 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
805 if ($search_status >= 0) {
806 $param .=
'&search_status='.urlencode($search_status);
808 if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
809 $param .=
'&search_opp_status='.urlencode($search_opp_status);
811 if ($search_opp_percent !=
'') {
812 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
814 if ($search_public !=
'') {
815 $param .=
'&search_public='.urlencode($search_public);
817 if ($search_project_user > 0) {
818 $param .=
'&search_project_user='.urlencode($search_project_user);
820 if ($search_project_contact !=
'') {
821 $param .=
'&search_project_user='.urlencode($search_project_contact);
823 if ($search_sale > 0) {
824 $param .=
'&search_sale='.urlencode($search_sale);
826 if ($search_opp_amount !=
'') {
827 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
829 if ($search_budget_amount !=
'') {
830 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
832 if ($search_usage_task !=
'') {
833 $param .=
'&search_usage_task='.urlencode($search_usage_task);
835 if ($search_usage_bill_time !=
'') {
836 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
838 if ($search_usage_event_organization !=
'') {
839 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
841 if ($search_accept_conference_suggestions !=
'') {
842 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
844 if ($search_accept_booth_suggestions !=
'') {
845 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
847 if ($search_price_registration !=
'') {
848 $param .=
'&search_price_registration='.urlencode($search_price_registration);
850 if ($search_price_booth !=
'') {
851 $param .=
'&search_price_booth='.urlencode($search_price_booth);
854 $param .=
'&search_login='.urlencode($search_login);
856 if ($optioncss !=
'') {
857 $param .=
'&optioncss='.urlencode($optioncss);
859 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
860 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
863 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
866 $arrayofmassactions = array(
867 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
872 if ($user->rights->projet->creer) {
873 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
874 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
876 if ($user->rights->projet->supprimer) {
877 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
879 if (
isModEnabled(
'category') && $user->rights->projet->creer) {
880 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
882 if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
883 $arrayofmassactions = array();
886 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
888 $url = DOL_URL_ROOT.
'/projet/card.php?action=create';
889 if (!empty($socid)) {
890 $url .=
'&socid='.$socid;
892 if ($search_usage_event_organization == 1) {
893 $url .=
'&usage_organize_event=1';
895 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->projet->creer);
897 print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
898 if ($optioncss !=
'') {
899 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
901 print
'<input type="hidden" name="token" value="'.newToken().
'">';
902 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
903 print
'<input type="hidden" name="action" value="list">';
904 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
905 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
906 print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
910 if ($search_project_user == $user->id) {
911 $texthelp .= $langs->trans(
"MyProjectsDesc");
913 if ($user->rights->projet->all->lire && !$socid) {
914 $texthelp .= $langs->trans(
"ProjectsDesc");
916 $texthelp .= $langs->trans(
"ProjectsPublicDesc");
920 print_barre_liste(
$form->textwithpicto($title, $texthelp), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
923 $topicmail =
"Information";
924 $modelmail =
"project";
926 $trackid =
'proj'.$object->id;
927 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
930 foreach ($fieldstosearchall as $key => $val) {
931 $fieldstosearchall[$key] = $langs->trans($val);
933 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
939 $moreforfilter .=
'<div class="divsearchfield">';
940 $tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
943 if (empty($user->rights->user->user->lire)) {
944 $includeonly = array($user->id);
946 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user :
'',
'search_project_user', $tmptitle,
'', 0, $includeonly,
'', 0, 0, 0,
'', 0,
'',
'maxwidth250 widthcentpercentminusx');
947 $moreforfilter .=
'</div>';
949 $moreforfilter .=
'<div class="divsearchfield">';
950 $tmptitle = $langs->trans(
'ProjectsWithThisContact');
951 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth250 widthcentpercentminusx');
952 $moreforfilter .=
'</div>';
955 if ($user->rights->user->user->lire) {
956 $langs->load(
"commercial");
957 $moreforfilter .=
'<div class="divsearchfield">';
958 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
959 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth250 widthcentpercentminusx');
960 $moreforfilter .=
'</div>';
964 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
966 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array);
969 if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
970 $moreforfilter .=
'<div class="divsearchfield">';
971 $tmptitle = $langs->transnoentities(
'CustomersProspectsCategoriesShort');
972 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
973 $categoriesArr =
$form->select_all_categories(Categorie::TYPE_CUSTOMER,
'',
'', 64, 0, 1);
974 $categoriesArr[-2] =
'- '.$langs->trans(
'NotCategorized').
' -';
975 $moreforfilter .=
Form::multiselectarray(
'search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0,
'minwidth300', 0, 0,
'',
'category', $tmptitle);
976 $moreforfilter .=
' <input type="checkbox" class="valignmiddle" id="search_category_customer_operator" name="search_category_customer_operator" value="1"'.($searchCategoryCustomerOperator == 1 ?
' checked="checked"' :
'').
'/>';
977 $moreforfilter .=
$form->textwithpicto(
'', $langs->trans(
'UseOrOperatorForCategories') .
' : ' . $tmptitle, 1,
'help',
'', 0, 2,
'tooltip_cat_cus');
978 $moreforfilter .=
'</div>';
981 if (!empty($moreforfilter)) {
982 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
983 print $moreforfilter;
984 $parameters = array();
985 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
986 print $hookmanager->resPrint;
990 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
991 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
992 $selectedfields .= (count($arrayofmassactions) ?
$form->showCheckAddButtons(
'checkforselect', 1) :
'');
995 print
'<div class="div-table-responsive">';
996 print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1000 print
'<tr class="liste_titre_filter">';
1002 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1003 print
'<td class="liste_titre maxwidthsearch">';
1004 $searchpicto =
$form->showFilterButtons(
'left');
1009 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1010 print
'<td class="liste_titre">';
1011 print
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
1015 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1016 print
'<td class="liste_titre">';
1017 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1021 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1022 print
'<td class="liste_titre">';
1024 $tmpthirdparty =
new Societe($db);
1025 $tmpthirdparty->fetch($socid);
1026 $search_societe = $tmpthirdparty->name;
1028 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1033 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1034 print
'<td class="liste_titre">';
1036 $tmpthirdparty =
new Societe($db);
1037 $tmpthirdparty->fetch($socid);
1038 $search_societe_alias = $tmpthirdparty->name_alias;
1040 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1044 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1045 print
'<td class="liste_titre"> </td>';
1048 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1049 print
'<td class="liste_titre center nowraponall">';
1055 print
'<div class="nowrap">';
1056 print
$form->selectDate($search_date_start_start ? $search_date_start_start : -1,
'search_date_start_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1058 print
'<div class="nowrap">';
1059 print
$form->selectDate($search_date_start_end ? $search_date_start_end : -1,
'search_date_start_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1064 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1065 print
'<td class="liste_titre center nowraponall">';
1071 print
'<div class="nowrap">';
1072 print
$form->selectDate($search_date_end_start ? $search_date_end_start : -1,
'search_date_end_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1074 print
'<div class="nowrap">';
1075 print
$form->selectDate($search_date_end_end ? $search_date_end_end : -1,
'search_date_end_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1080 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1081 print
'<td class="liste_titre center">';
1082 $array = array(
''=>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1083 print
$form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1086 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1087 print
'<td class="liste_titre center">';
1091 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1092 print
'<td class="liste_titre nowrap center">';
1093 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1096 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1097 print
'<td class="liste_titre nowrap right">';
1098 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1101 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1102 print
'<td class="liste_titre nowrap right">';
1103 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1106 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1107 print
'<td class="liste_titre nowrap right">';
1110 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1111 print
'<td class="liste_titre nowrap right">';
1112 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1115 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1116 print
'<td class="liste_titre nowrap right">';
1117 print
$form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1);
1121 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1122 print
'<td class="liste_titre nowrap right">';
1123 print
$form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1);
1126 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1127 print
'<td class="liste_titre nowrap right">';
1128 print
$form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1);
1131 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1132 print
'<td class="liste_titre nowrap right">';
1133 print
$form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1);
1136 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1137 print
'<td class="liste_titre nowrap right">';
1138 print
$form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1);
1141 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1142 print
'<td class="liste_titre nowrap right">';
1143 print
$form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1);
1146 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1147 print
'<td class="liste_titre nowrap right">';
1148 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.$search_price_registration.
'">';
1151 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1152 print
'<td class="liste_titre nowrap right">';
1153 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.$search_price_booth.
'">';
1156 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1158 print
'<td class="liste_titre" align="center">';
1159 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1163 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1166 $parameters = array(
'arrayfields'=>$arrayfields);
1167 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1168 print $hookmanager->resPrint;
1169 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1171 print
'<td class="liste_titre">';
1174 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1176 print
'<td class="liste_titre">';
1179 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1181 print
'<td class="liste_titre">';
1184 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1186 print
'<td class="liste_titre">';
1189 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1190 print
'<td class="liste_titre nowrap center">';
1191 $arrayofstatus = array();
1192 foreach ($object->statuts_short as $key => $val) {
1193 $arrayofstatus[$key] = $langs->trans($val);
1195 $arrayofstatus[
'99'] = $langs->trans(
"NotClosed").
' ('.$langs->trans(
'Draft').
' + '.$langs->trans(
'Opened').
')';
1196 print
$form->selectarray(
'search_status', $arrayofstatus, $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'maxwidth125 onrightofpage', 1);
1200 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1201 print
'<td class="liste_titre maxwidthsearch">';
1202 $searchpicto =
$form->showFilterButtons();
1208 print
'<tr class="liste_titre">';
1209 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1210 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1212 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1213 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1215 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1216 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1218 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1219 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1221 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1222 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1224 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1225 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1227 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1228 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1230 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1231 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1233 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1234 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1236 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1237 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1239 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1240 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1242 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1243 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1245 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1246 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1248 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1249 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1251 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1252 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1254 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1255 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'right ');
1257 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1258 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'right ');
1260 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1261 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'right ');
1263 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1264 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'right ');
1266 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1267 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'right ');
1269 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1270 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'right ');
1272 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1273 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1275 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1276 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1278 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1279 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1282 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1284 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
1285 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
1286 print $hookmanager->resPrint;
1287 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1288 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1290 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1291 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1293 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1294 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1296 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1297 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1299 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1300 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1302 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1303 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1307 $userstatic =
new User($db);
1310 $totalarray = array(
1314 $imaxinloop = ($limit ? min($num, $limit) : $num);
1315 while ($i < $imaxinloop) {
1316 $obj = $db->fetch_object(
$resql);
1321 $object->id = $obj->id;
1322 $object->user_author_id = $obj->fk_user_creat;
1323 $object->public = $obj->public;
1324 $object->ref = $obj->ref;
1325 $object->datee = $db->jdate($obj->date_end);
1326 $object->statut = $obj->status;
1327 $object->status = $obj->status;
1328 $object->public = $obj->public;
1329 $object->opp_status = $obj->fk_opp_status;
1330 $object->title = $obj->title;
1332 $userAccess = $object->restrictedProjectArea($user);
1333 if ($userAccess >= 0) {
1334 $companystatic->id = $obj->socid;
1335 $companystatic->name = $obj->name;
1336 $companystatic->name_alias = $obj->alias;
1337 $companystatic->client = $obj->client;
1338 $companystatic->code_client = $obj->code_client;
1339 $companystatic->email = $obj->email;
1340 $companystatic->phone = $obj->phone;
1341 $companystatic->address = $obj->address;
1342 $companystatic->zip = $obj->zip;
1343 $companystatic->town = $obj->town;
1344 $companystatic->country_code = $obj->country_code;
1346 print
'<tr class="oddeven">';
1349 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1350 print
'<td class="nowrap center">';
1351 if ($massactionbutton || $massaction) {
1353 if (in_array($obj->id, $arrayofselected)) {
1356 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1360 $totalarray[
'nbfield']++;
1364 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1365 print
'<td class="nowraponall">';
1366 print $object->getNomUrl(1, (!empty(
GETPOST(
'search_usage_event_organization',
'int'))?
'eventorganization':
''));
1367 if ($object->hasDelay()) {
1372 $totalarray[
'nbfield']++;
1376 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1377 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1381 $totalarray[
'nbfield']++;
1385 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1386 print
'<td class="tdoverflowmax100">';
1388 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1394 $totalarray[
'nbfield']++;
1398 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1399 print
'<td class="tdoverflowmax100">';
1401 print $companystatic->name_alias;
1407 $totalarray[
'nbfield']++;
1411 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1412 print
'<td class="tdoverflowmax150">';
1414 $companystatic->id = $obj->socid;
1415 $companystatic->name = $obj->name;
1416 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1417 $nbofsalesrepresentative = count($listsalesrepresentatives);
1418 if ($nbofsalesrepresentative > 6) {
1420 print $nbofsalesrepresentative;
1421 } elseif ($nbofsalesrepresentative > 0) {
1422 $userstatic =
new User($db);
1424 foreach ($listsalesrepresentatives as $val) {
1425 $userstatic->id = $val[
'id'];
1426 $userstatic->lastname = $val[
'lastname'];
1427 $userstatic->firstname = $val[
'firstname'];
1428 $userstatic->email = $val[
'email'];
1429 $userstatic->statut = $val[
'statut'];
1430 $userstatic->entity = $val[
'entity'];
1431 $userstatic->photo = $val[
'photo'];
1432 $userstatic->login = $val[
'login'];
1433 $userstatic->office_phone = $val[
'office_phone'];
1434 $userstatic->office_fax = $val[
'office_fax'];
1435 $userstatic->user_mobile = $val[
'user_mobile'];
1436 $userstatic->job = $val[
'job'];
1437 $userstatic->gender = $val[
'gender'];
1438 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1440 if ($j < $nbofsalesrepresentative) {
1451 $totalarray[
'nbfield']++;
1456 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1457 print
'<td class="center">';
1461 $totalarray[
'nbfield']++;
1465 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1466 print
'<td class="center">';
1470 $totalarray[
'nbfield']++;
1475 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1476 print
'<td class="center">';
1478 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1481 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1486 $totalarray[
'nbfield']++;
1490 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1491 print
'<td class="center nowraponall tdoverflowmax200">';
1493 foreach (array(
'internal',
'external') as $source) {
1494 $tab = $object->liste_contact(-1, $source, 0,
'', 1);
1495 $numcontact = count($tab);
1496 if (!empty($numcontact)) {
1497 foreach ($tab as $contactproject) {
1499 if ($source ==
'internal') {
1504 $c->fetch($contactproject[
'id']);
1505 if (!empty($c->photo)) {
1506 if (get_class($c) ==
'User') {
1507 print $c->getNomUrl(-2,
'', 0, 0, 24, 1,
'', ($ifisrt ?
'' :
'notfirst'));
1509 print $c->getNomUrl(-2,
'', 0,
'', -1, 0, ($ifisrt ?
'' :
'notfirst'));
1512 if (get_class($c) ==
'User') {
1513 print $c->getNomUrl(2,
'', 0, 0, 24, 1,
'', ($ifisrt ?
'' :
'notfirst'));
1515 print $c->getNomUrl(2,
'', 0,
'', -1, 0, ($ifisrt ?
'' :
'notfirst'));
1524 $totalarray[
'nbfield']++;
1528 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1529 print
'<td class="center">';
1530 if ($obj->opp_status_code) {
1531 print $langs->trans(
"OppStatus".$obj->opp_status_code);
1535 $totalarray[
'nbfield']++;
1539 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1540 print
'<td class="right">';
1542 if (strcmp($obj->opp_amount,
'')) {
1543 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1544 if (empty($totalarray[
'val'][
'p.opp_amount'])) {
1545 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
1547 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
1552 $totalarray[
'nbfield']++;
1555 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.opp_amount';
1559 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1560 print
'<td class="right">';
1561 if ($obj->opp_percent) {
1562 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
1566 $totalarray[
'nbfield']++;
1570 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1571 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
1572 $totalarray[
'val'][
'opp_weighted_amount'] = 0;
1574 print
'<td align="right">';
1575 if ($obj->opp_weighted_amount) {
1576 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1577 if (empty($totalarray[
'val'][
'opp_weighted_amount'])) {
1578 $totalarray[
'val'][
'opp_weighted_amount'] = $obj->opp_weighted_amount;
1580 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
1585 $totalarray[
'nbfield']++;
1588 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'opp_weighted_amount';
1592 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1593 print
'<td class="right">';
1594 if ($obj->budget_amount !=
'') {
1595 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
1596 if (empty($totalarray[
'val'][
'p.budget_amount'])) {
1597 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
1599 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
1604 $totalarray[
'nbfield']++;
1607 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.budget_amount';
1611 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1612 print
'<td class="right">';
1613 if ($obj->usage_opportunity) {
1614 print
yn($obj->usage_opportunity);
1618 $totalarray[
'nbfield']++;
1622 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1623 print
'<td class="right">';
1624 if ($obj->usage_task) {
1625 print
yn($obj->usage_task);
1629 $totalarray[
'nbfield']++;
1633 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1634 print
'<td class="right">';
1635 if ($obj->usage_bill_time) {
1636 print
yn($obj->usage_bill_time);
1640 $totalarray[
'nbfield']++;
1644 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1645 print
'<td class="right">';
1646 if ($obj->usage_organize_event) {
1647 print
yn($obj->usage_organize_event);
1651 $totalarray[
'nbfield']++;
1655 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1656 print
'<td class="right">';
1657 if ($obj->accept_conference_suggestions) {
1658 print
yn($obj->accept_conference_suggestions);
1662 $totalarray[
'nbfield']++;
1666 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1667 print
'<td class="right">';
1668 if ($obj->accept_booth_suggestions) {
1669 print
yn($obj->accept_booth_suggestions);
1673 $totalarray[
'nbfield']++;
1677 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1678 print
'<td class="right">';
1679 if ($obj->price_registration !=
'') {
1680 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
1681 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
1685 $totalarray[
'nbfield']++;
1688 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_registration';
1692 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1693 print
'<td class="right">';
1694 if ($obj->price_booth !=
'') {
1695 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
1696 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
1700 $totalarray[
'nbfield']++;
1703 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_booth';
1707 $userstatic->id = $obj->fk_user_creat;
1708 $userstatic->login = $obj->login;
1709 $userstatic->lastname = $obj->lastname;
1710 $userstatic->firstname = $obj->firstname;
1711 $userstatic->email = $obj->user_email;
1712 $userstatic->statut = $obj->user_statut;
1713 $userstatic->entity = $obj->entity;
1714 $userstatic->photo = $obj->photo;
1715 $userstatic->office_phone = $obj->office_phone;
1716 $userstatic->office_fax = $obj->office_fax;
1717 $userstatic->user_mobile = $obj->user_mobile;
1718 $userstatic->job = $obj->job;
1719 $userstatic->gender = $obj->gender;
1721 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1722 print
'<td class="center tdoverflowmax150">';
1723 if ($userstatic->id) {
1724 print $userstatic->getNomUrl(-1);
1730 $totalarray[
'nbfield']++;
1734 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1736 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1737 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1738 print $hookmanager->resPrint;
1740 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1741 print
'<td class="center nowraponall">';
1742 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1745 $totalarray[
'nbfield']++;
1749 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1750 print
'<td class="center nowraponall">';
1751 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1754 $totalarray[
'nbfield']++;
1758 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1759 print
'<td class="center">';
1760 print $obj->email_msgid;
1762 if (!$i) $totalarray[
'nbfield']++;
1765 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1766 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
1768 $totalarray[
'nbfield']++;
1772 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1773 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
1775 $totalarray[
'nbfield']++;
1779 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1780 print
'<td class="nowrap center">';
1781 if ($massactionbutton || $massaction) {
1783 if (in_array($obj->id, $arrayofselected)) {
1786 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1790 $totalarray[
'nbfield']++;
1801 include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
1806 foreach ($arrayfields as $key => $val) {
1807 if (!empty($val[
'checked'])) {
1811 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1816 $parameters = array(
'arrayfields'=>$arrayfields,
'sql' => $sql);
1817 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1818 print $hookmanager->resPrint;
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$nbtotalofrecords
Count total nb of records.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.