37require
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
44if (isModEnabled(
'category')) {
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
50$langs->loadLangs(array(
'projects',
'companies',
'commercial'));
51if (isModEnabled(
'eventorganization') && $conf->eventorganization->enabled) {
52 $langs->loadLangs(array(
'eventorganization'));
55$action =
GETPOST(
'action',
'aZ09');
56$massaction =
GETPOST(
'massaction',
'alpha');
58$confirm =
GETPOST(
'confirm',
'alpha');
59$toselect =
GETPOST(
'toselect',
'array');
60$optioncss =
GETPOST(
'optioncss',
'alpha');
61$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projectlist';
62$mode =
GETPOST(
'mode',
'alpha');
63$groupby =
GETPOST(
'groupby',
'aZ09');
65$title = $langs->trans(
"Projects");
73 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
75if (!$user->hasRight(
'projet',
'lire')) {
79$diroutputmassaction = $conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
82$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
83$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
85if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
95$offset = $limit * $page;
99$search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
100$search_ref =
GETPOST(
"search_ref",
'alpha');
101$search_label =
GETPOST(
"search_label",
'alpha');
102$search_societe =
GETPOST(
"search_societe",
'alpha');
103$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
104$search_societe_country =
GETPOST(
"search_societe_country",
'alpha');
105$search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
106$search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
107$search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
108$search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
109$search_public =
GETPOST(
"search_public",
'intcomma');
110$search_project_user =
GETPOSTINT(
'search_project_user');
111$search_project_contact =
GETPOSTINT(
'search_project_contact');
113$search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'intcomma');
114$search_usage_task =
GETPOST(
'search_usage_task',
'intcomma');
115$search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'intcomma');
116$search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'intcomma');
117$search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'intcomma');
118$search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'intcomma');
119$search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
120$search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
121$search_login =
GETPOST(
'search_login',
'alpha');
122$search_import_key =
GETPOST(
'search_import_key',
'alpha');
123$searchCategoryCustomerOperator = 0;
124if (GETPOSTISSET(
'formfilteraction')) {
125 $searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
127 $searchCategoryCustomerOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
129$searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
131 $search_omitChildren =
GETPOST(
'search_omitChildren',
'alpha') ==
'on' ? 1 : 0;
135$mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
137 $search_project_user = $user->id;
148$search_date_start_startmonth =
GETPOSTINT(
'search_date_start_startmonth');
149$search_date_start_startyear =
GETPOSTINT(
'search_date_start_startyear');
150$search_date_start_startday =
GETPOSTINT(
'search_date_start_startday');
151$search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
152$search_date_start_endmonth =
GETPOSTINT(
'search_date_start_endmonth');
153$search_date_start_endyear =
GETPOSTINT(
'search_date_start_endyear');
154$search_date_start_endday =
GETPOSTINT(
'search_date_start_endday');
155$search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
157$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
158$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
159$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
160$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
161$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
162$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
163$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
164$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
166$search_date_creation_startmonth =
GETPOSTINT(
'search_date_creation_startmonth');
167$search_date_creation_startyear =
GETPOSTINT(
'search_date_creation_startyear');
168$search_date_creation_startday =
GETPOSTINT(
'search_date_creation_startday');
169$search_date_creation_start =
dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
170$search_date_creation_endmonth =
GETPOSTINT(
'search_date_creation_endmonth');
171$search_date_creation_endyear =
GETPOSTINT(
'search_date_creation_endyear');
172$search_date_creation_endday =
GETPOSTINT(
'search_date_creation_endday');
173$search_date_creation_end =
dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
175$search_date_modif_startmonth =
GETPOSTINT(
'search_date_modif_startmonth');
176$search_date_modif_startyear =
GETPOSTINT(
'search_date_modif_startyear');
177$search_date_modif_startday =
GETPOSTINT(
'search_date_modif_startday');
178$search_date_modif_start =
dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);
179$search_date_modif_endmonth =
GETPOSTINT(
'search_date_modif_endmonth');
180$search_date_modif_endyear =
GETPOSTINT(
'search_date_modif_endyear');
181$search_date_modif_endday =
GETPOSTINT(
'search_date_modif_endday');
182$search_date_modif_end =
dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);
184$search_category_array = array();
186if (isModEnabled(
'category')) {
187 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
191 $search_status = implode(
',',
GETPOST(
'search_status',
'array:intcomma'));
193 $search_status = (
GETPOST(
'search_status',
'intcomma') !=
'' ?
GETPOST(
'search_status',
'intcomma') :
'0,1');
196$search_option =
GETPOST(
'search_option',
'alpha');
197if ($search_option ==
'late') {
198 $search_status =
'1';
202$hookmanager->initHooks(array(
'projectlist'));
206$extrafields->fetch_name_optionals_label(
$object->table_element);
208$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
211$fieldstosearchall = array();
212foreach (
$object->fields as $key => $val) {
213 if (empty($val[
'searchall'])) {
218 if (!empty($user->socid) && $key ==
"note_private") {
222 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
226$fieldstosearchall[
's.nom'] =
"ThirdPartyName";
227$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
228$fieldstosearchall[
's.code_client'] =
"CustomerCode";
231$arrayfields = array();
232foreach (
$object->fields as $key => $val) {
234 if (!empty($val[
'visible'])) {
235 $visible = (int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1');
236 $arrayfields[
'p.'.$key] = array(
237 'label' => $val[
'label'],
238 'checked' => (($visible < 0) ? 0 : 1),
239 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
240 'position' => $val[
'position'],
241 'help' => isset($val[
'help']) ? $val[
'help'] :
''
246include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
249$arrayfields[
's.nom'] = array(
'label' => $langs->trans(
"ThirdParty"),
'checked' => 1,
'position' => 21,
'enabled' => (!isModEnabled(
'societe') ? 0 : 1));
250$arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'checked' => 0,
'position' => 22);
251$arrayfields[
'co.country_code'] = array(
'label' =>
"Country",
'checked' => -1,
'position' => 23);
252$arrayfields[
'commercial'] = array(
'label' => $langs->trans(
"SaleRepresentativesOfThirdParty"),
'checked' => 0,
'position' => 25);
253$arrayfields[
'c.assigned'] = array(
'label' => $langs->trans(
"AssignedTo"),
'checked' => 1,
'position' => 120);
254$arrayfields[
'opp_weighted_amount'] = array(
'label' => $langs->trans(
'OpportunityWeightedAmountShort'),
'checked' => 0,
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ? 0 : 1),
'position' => 106);
255$arrayfields[
'u.login'] = array(
'label' =>
"Author",
'checked' => -1,
'position' => 165);
257if (
GETPOST(
'search_usage_opportunity')) {
261if (
GETPOST(
'search_usage_event_organization')) {
262 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 0;
263 $arrayfields[
'p.opp_amount'][
'enabled'] = 0;
264 $arrayfields[
'p.opp_percent'][
'enabled'] = 0;
265 $arrayfields[
'opp_weighted_amount'][
'enabled'] = 0;
266 $arrayfields[
'p.usage_organize_event'][
'visible'] = 1;
267 $arrayfields[
'p.usage_organize_event'][
'checked'] = 1;
269$arrayfields[
'p.fk_project'][
'enabled'] = 0;
272if ($contextpage ==
'lead') {
273 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 1;
274 $arrayfields[
'p.fk_opp_status'][
'visible'] = 1;
280'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
284$groupbyvalues = array();
285$groupofcollpasedvalues = array();
286if ($mode ==
'kanban' && $groupby) {
288 $groupbyfield = preg_replace(
'/[a-z]\./',
'', $groupby);
289 if (!empty(
$object->fields[$groupbyfield][
'alias'])) {
290 $groupbyfield =
$object->fields[$groupbyfield][
'alias'];
292 if (!in_array(preg_replace(
'/[a-z]\./',
'', $groupby), array_keys(
$object->fields))) {
295 if (!empty(
$object->fields[$groupby][
'arrayofkeyval'])) {
296 $groupbyvalues =
$object->fields[$groupby][
'arrayofkeyval'];
297 } elseif (!empty(
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'])) {
298 $groupbyvalues =
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'];
305 $sql =
"SELECT cls.rowid, cls.code, cls.percent, cls.label";
306 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_lead_status as cls";
307 $sql .=
" WHERE active = 1";
310 $sql .= $db->order(
'cls.rowid',
'ASC');
311 $resql = $db->query($sql);
313 $num = $db->num_rows($resql);
317 $objp = $db->fetch_object($resql);
318 $groupbyvalues[$objp->rowid] = $objp->label;
323 $groupofcollpasedvalues = array(6,7);
328 if ($groupby && !preg_match(
'/^'.preg_quote($db->sanitize($groupby),
'/').
'/', $sortfield)) {
330 $sortfield = $db->sanitize($groupby).($sortfield ?
",".$sortfield :
"");
331 $sortorder =
"ASC".($sortfield ?
",".$sortorder :
"");
340if (
GETPOST(
'cancel',
'alpha')) {
344if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
348$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
349$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
354if (empty($reshook)) {
356 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
359 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
363 $search_societe =
"";
364 $search_societe_alias =
'';
365 $search_societe_country =
'';
368 $search_opp_status = -1;
369 $search_opp_amount =
'';
370 $search_opp_percent =
'';
371 $search_budget_amount =
'';
374 $search_project_user =
'';
375 $search_project_contact =
'';
382 $search_date_start_startmonth =
"";
383 $search_date_start_startyear =
"";
384 $search_date_start_startday =
"";
385 $search_date_start_start =
"";
386 $search_date_start_endmonth =
"";
387 $search_date_start_endyear =
"";
388 $search_date_start_endday =
"";
389 $search_date_start_end =
"";
390 $search_date_end_startmonth =
"";
391 $search_date_end_startyear =
"";
392 $search_date_end_startday =
"";
393 $search_date_end_start =
"";
394 $search_date_end_endmonth =
"";
395 $search_date_end_endyear =
"";
396 $search_date_end_endday =
"";
397 $search_date_end_end =
"";
398 $search_date_creation_startmonth =
"";
399 $search_date_creation_startyear =
"";
400 $search_date_creation_startday =
"";
401 $search_date_creation_start =
"";
402 $search_date_creation_endmonth =
"";
403 $search_date_creation_endyear =
"";
404 $search_date_creation_endday =
"";
405 $search_date_creation_end =
"";
406 $search_date_modif_startmonth =
"";
407 $search_date_modif_startyear =
"";
408 $search_date_modif_startday =
"";
409 $search_date_modif_start =
"";
410 $search_date_modif_endmonth =
"";
411 $search_date_modif_endyear =
"";
412 $search_date_modif_endday =
"";
413 $search_date_modif_end =
"";
414 $search_usage_opportunity =
'';
415 $search_usage_task =
'';
416 $search_usage_bill_time =
'';
417 $search_usage_event_organization =
'';
418 $search_accept_conference_suggestions =
'';
419 $search_accept_booth_suggestions =
'';
420 $search_price_registration =
'';
421 $search_price_booth =
'';
423 $search_import_key =
'';
425 $search_array_options = array();
426 $search_category_array = array();
431 $objectclass =
'Project';
432 $objectlabel =
'Project';
433 $permissiontoread = $user->hasRight(
'projet',
'lire');
434 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
435 $permissiontoadd = $user->hasRight(
'projet',
'creer');
436 $uploaddir = $conf->project->dir_output;
437 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
440 if (!$error && $massaction ==
'close' && $user->hasRight(
'projet',
'creer')) {
443 $objecttmp =
new $objectclass($db);
445 foreach ($toselect as $toselectid) {
446 $result = $objecttmp->fetch($toselectid);
448 $userWrite =
$object->restrictedProjectArea($user,
'write');
449 if ($userWrite > 0 && $objecttmp->statut == 1) {
450 $result = $objecttmp->setClose($user);
458 } elseif ($userWrite <= 0) {
459 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
461 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
484unset($_SESSION[
'pageforbacktolist'][
'project']);
486$form =
new Form($db);
491$companystatic =
new Societe($db);
492$taskstatic =
new Task($db);
495$userstatic =
new User($db);
497$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
498$title = $langs->trans(
"LeadsOrProjects");
500 $title = $langs->trans(
"Projects");
503 $title = $langs->trans(
"Leads");
511if (!$user->hasRight(
'projet',
'all',
'lire')) {
512 $projectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
516$listofprojectcontacttype = array();
517$listofprojectcontacttypeexternal = array();
518$sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
519$sql .=
" WHERE ctc.element = '".$db->escape(
$object->element).
"'";
520$resql = $db->query($sql);
522 while ($obj = $db->fetch_object($resql)) {
523 if ($obj->source ==
'internal') {
524 $listofprojectcontacttype[$obj->rowid] = $obj->code;
526 $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
532if (count($listofprojectcontacttype) == 0) {
533 $listofprojectcontacttype[0] =
'0';
535if (count($listofprojectcontacttypeexternal) == 0) {
536 $listofprojectcontacttypeexternal[0] =
'0';
539$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
540$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
542$sql =
"SELECT p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
543$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_modification, p.budget_amount,";
544$sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
545$sql .=
" p.email_msgid, p.import_key,";
546$sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
547$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,";
548$sql .=
" country.code as country_code,";
549$sql .=
" cls.code as opp_status_code,";
550$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';
552if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
553 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
554 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
558$parameters = array();
559$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
560$sql .= $hookmanager->resPrint;
561$sql = preg_replace(
'/,\s*$/',
'', $sql);
565$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as p";
566if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
567 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
569$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
570$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on country.rowid = s.fk_pays";
571$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
572$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
577$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
578$sql .= $hookmanager->resPrint;
580$sql .=
" WHERE p.entity IN (".getEntity(
'project', (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
')';
581if (!$user->hasRight(
'projet',
'all',
'lire')) {
582 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
586 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
594if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
595 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
597 if ($search_societe) {
600 if ($search_societe_alias) {
604if ($search_societe_country) {
607if ($search_opp_amount) {
610if ($search_opp_percent) {
613$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
614$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
616if ($search_date_start_start) {
617 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
619if ($search_date_start_end) {
620 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
623if ($search_date_end_start) {
624 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
626if ($search_date_end_end) {
627 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
630if ($search_date_creation_start) {
631 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
633if ($search_date_creation_end) {
634 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
637if ($search_date_modif_start) {
638 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
640if ($search_date_modif_end) {
641 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
645 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
647if ($search_status !=
'' && $search_status !=
'-1') {
648 if ($search_status == 99) {
649 $sql .=
" AND p.fk_statut IN (0,1)";
651 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
654if ($search_option ==
'late') {
655 $sql .=
" AND p.datee < '".$db->idate(
dol_now() - $conf->project->warning_delay).
"'";
657if ($search_opp_status) {
658 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
659 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
661 if ($search_opp_status ==
'all') {
662 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
664 if ($search_opp_status ==
'openedopp') {
665 $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'))";
667 if ($search_opp_status ==
'notopenedopp') {
668 $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'))";
670 if ($search_opp_status ==
'none') {
671 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
674if ($search_public !=
'') {
675 $sql .=
" AND p.public = ".((int) $search_public);
680if ($search_sale && $search_sale !=
'-1') {
681 if ($search_sale == -2) {
682 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
683 } elseif ($search_sale > 0) {
684 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
687if ($search_project_user > 0) {
688 $sql .=
" AND EXISTS (SELECT ecp.rowid FROM ".MAIN_DB_PREFIX.
"element_contact as ecp WHERE ecp.fk_c_type_contact IN (".$db->sanitize(implode(
',', array_keys($listofprojectcontacttype))).
") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".((int) $search_project_user).
")";
690if ($search_project_contact > 0) {
691 $sql .=
" AND EXISTS (SELECT ecp_contact.rowid FROM ".MAIN_DB_PREFIX.
"element_contact as ecp_contact WHERE ecp_contact.fk_c_type_contact IN (".$db->sanitize(implode(
',', array_keys($listofprojectcontacttypeexternal))).
") AND ecp_contact.element_id = p.rowid AND ecp_contact.fk_socpeople = ".((int) $search_project_contact).
")";
693if ($search_opp_amount !=
'') {
696if ($search_budget_amount !=
'') {
697 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
699if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
700 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
702if ($search_usage_task !=
'' && $search_usage_task >= 0) {
705if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
706 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
708if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
709 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
711if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
712 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
714if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
715 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
717if ($search_price_registration !=
'') {
718 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
720if ($search_price_booth !=
'') {
724 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
726if ($search_import_key) {
727 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
730 if ($search_omitChildren == 1) {
731 $sql .=
" AND p.fk_project IS NULL";
736$searchCategoryProjectList = $search_category_array;
737$searchCategoryProjectOperator = 0;
738if (!empty($searchCategoryProjectList)) {
739 $searchCategoryProjectSqlList = array();
740 $listofcategoryid =
'';
741 foreach ($searchCategoryProjectList as $searchCategoryProject) {
742 if (intval($searchCategoryProject) == -2) {
743 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
744 } elseif (intval($searchCategoryProject) > 0) {
745 if ($searchCategoryProjectOperator == 0) {
746 $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).
")";
748 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
752 if ($listofcategoryid) {
753 $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).
"))";
755 if ($searchCategoryProjectOperator == 1) {
756 if (!empty($searchCategoryProjectSqlList)) {
757 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
760 if (!empty($searchCategoryProjectSqlList)) {
761 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
765$searchCategoryCustomerSqlList = array();
766if ($searchCategoryCustomerOperator == 1) {
767 $existsCategoryCustomerList = array();
768 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
769 if (intval($searchCategoryCustomer) == -2) {
770 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
771 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
772 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
773 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
774 $sqlCategoryCustomerNotExists .=
" )";
775 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
776 } elseif (intval($searchCategoryCustomer) > 0) {
777 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
780 if (!empty($existsCategoryCustomerList)) {
781 $sqlCategoryCustomerExists =
" EXISTS (";
782 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
783 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
784 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
785 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
786 $sqlCategoryCustomerExists .=
" )";
787 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
789 if (!empty($searchCategoryCustomerSqlList)) {
790 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
793 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
794 if (intval($searchCategoryCustomer) == -2) {
795 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
796 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
797 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
798 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
799 $sqlCategoryCustomerNotExists .=
" )";
800 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
801 } elseif (intval($searchCategoryCustomer) > 0) {
802 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
805 if (!empty($searchCategoryCustomerSqlList)) {
806 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
810include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
812$parameters = array();
813$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
814$sql .= $hookmanager->resPrint;
818$nbtotalofrecords =
'';
821 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
822 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
823 $resql = $db->query($sqlforcount);
825 $objforcount = $db->fetch_object($resql);
826 $nbtotalofrecords = $objforcount->nbtotalofrecords;
831 if (($page * $limit) > $nbtotalofrecords) {
839$sql .= $db->order($sortfield, $sortorder);
841 $sql .= $db->plimit($limit + 1, $offset);
845$resql = $db->query($sql);
851$num = $db->num_rows($resql);
854if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
855 $obj = $db->fetch_object($resql);
856 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
864llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-project page-list');
866$arrayofselected = is_array($toselect) ? $toselect : array();
870 $param .=
'&mode='.urlencode($mode);
872if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
873 $param .=
'&contextpage='.urlencode($contextpage);
875if ($limit > 0 && $limit != $conf->liste_limit) {
876 $param .=
'&limit='.((int) $limit);
878if ($optioncss !=
'') {
879 $param .=
'&optioncss='.urlencode($optioncss);
882 $param .=
'&groupby='.urlencode($groupby);
886 $param .=
'&socid='.urlencode((
string) $socid);
888if ($search_all !=
'') {
889 $param .=
'&search_all='.urlencode($search_all);
892 $param .=
'&search_sday='.urlencode((
string) ($search_sday));
895 $param .=
'&search_smonth='.urlencode((
string) ($search_smonth));
898 $param .=
'&search_syear='.urlencode((
string) ($search_syear));
901 $param .=
'&search_eday='.urlencode((
string) ($search_eday));
904 $param .=
'&search_emonth='.urlencode((
string) ($search_emonth));
907 $param .=
'&search_eyear='.urlencode((
string) ($search_eyear));
909if ($search_date_start_startmonth) {
910 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
912if ($search_date_start_startyear) {
913 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
915if ($search_date_start_startday) {
916 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
918if ($search_date_start_start) {
919 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
921if ($search_date_start_endmonth) {
922 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
924if ($search_date_start_endyear) {
925 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
927if ($search_date_start_endday) {
928 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
930if ($search_date_start_end) {
931 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
933if ($search_date_end_startmonth) {
934 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
936if ($search_date_end_startyear) {
937 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
939if ($search_date_end_startday) {
940 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
942if ($search_date_end_start) {
943 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
945if ($search_date_end_endmonth) {
946 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
948if ($search_date_end_endyear) {
949 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
951if ($search_date_end_endday) {
952 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
954if ($search_date_end_end) {
955 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
957if ($search_date_creation_startmonth) {
958 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
960if ($search_date_creation_startyear) {
961 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
963if ($search_date_creation_startday) {
964 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
966if ($search_date_creation_start) {
967 $param .=
'&search_date_creation_start='.urlencode($search_date_creation_start);
969if ($search_date_creation_endmonth) {
970 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
972if ($search_date_creation_endyear) {
973 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
975if ($search_date_creation_endday) {
976 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
978if ($search_date_creation_end) {
979 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
981if ($search_date_modif_startmonth) {
982 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
984if ($search_date_modif_startyear) {
985 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
987if ($search_date_modif_startday) {
988 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
990if ($search_date_modif_start) {
991 $param .=
'&search_date_modif_start='.urlencode($search_date_modif_start);
993if ($search_date_modif_endmonth) {
994 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
996if ($search_date_modif_endyear) {
997 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
999if ($search_date_modif_endday) {
1000 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1002if ($search_date_modif_end) {
1003 $param .=
'&search_date_modif_end=' . urlencode($search_date_modif_end);
1005if (!empty($search_category_array)) {
1006 foreach ($search_category_array as $tmpval) {
1007 $param .=
'&search_categegory_project_list[]='.urlencode($tmpval);
1010if ($search_ref !=
'') {
1011 $param .=
'&search_ref='.urlencode($search_ref);
1013if ($search_label !=
'') {
1014 $param .=
'&search_label='.urlencode($search_label);
1016if ($search_societe !=
'') {
1017 $param .=
'&search_societe='.urlencode($search_societe);
1019if ($search_societe_alias !=
'') {
1020 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1022if ($search_societe_country !=
'') {
1023 $param .=
'&search_societe_country='.urlencode($search_societe_country);
1025if ($search_status !=
'' && $search_status !=
'-1') {
1026 $param .=
"&search_status=".urlencode($search_status);
1028if ($search_option) {
1029 $param .=
"&search_option=".urlencode($search_option);
1031if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
1032 $param .=
'&search_opp_status='.urlencode($search_opp_status);
1034if ($search_opp_percent !=
'') {
1035 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
1037if ($search_public !=
'') {
1038 $param .=
'&search_public='.urlencode($search_public);
1040if ($search_project_user > 0) {
1041 $param .=
'&search_project_user='.urlencode((
string) $search_project_user);
1043if ($search_project_contact > 0) {
1044 $param .=
'&search_project_contact='.urlencode((
string) ($search_project_contact));
1046if ($search_sale > 0) {
1047 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
1049if ($search_opp_amount !=
'') {
1050 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
1052if ($search_budget_amount !=
'') {
1053 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
1055if ($search_usage_task !=
'') {
1056 $param .=
'&search_usage_task='.urlencode($search_usage_task);
1058if ($search_usage_bill_time !=
'') {
1059 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
1061if ($search_usage_event_organization !=
'') {
1062 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
1064if ($search_accept_conference_suggestions !=
'') {
1065 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
1067if ($search_accept_booth_suggestions !=
'') {
1068 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
1070if ($search_price_registration !=
'') {
1071 $param .=
'&search_price_registration='.urlencode($search_price_registration);
1073if ($search_price_booth !=
'') {
1074 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1077 $param .=
'&search_login='.urlencode($search_login);
1079if ($search_import_key) {
1080 $param .=
'&search_import_key='.urlencode($search_import_key);
1082foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1083 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1086include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1089$parameters = array(
'param' => &$param);
1090$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1091$param .= $hookmanager->resPrint;
1094$arrayofmassactions = array(
1095 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1096 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1101if ($user->hasRight(
'projet',
'creer')) {
1102 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1103 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1105if ($user->hasRight(
'projet',
'supprimer')) {
1106 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1108if (isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1109 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1111if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1112 $arrayofmassactions = array();
1115$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1117$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1118if (!empty($socid)) {
1119 $url .=
'&socid='.$socid;
1121if ($search_usage_event_organization == 1) {
1122 $url .=
'&usage_organize_event=1';
1123 if (((
int) $search_usage_opportunity) < 1) {
1124 $url .=
'&usage_opportunity=0';
1129$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
1130$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
1132$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1134print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1135if ($optioncss !=
'') {
1136 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1138print
'<input type="hidden" name="token" value="'.newToken().
'">';
1139print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1140print
'<input type="hidden" name="action" value="list">';
1141print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1142print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1143print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1144print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1145print
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
1149if ($search_project_user == $user->id) {
1150 $texthelp .= $langs->trans(
"MyProjectsDesc");
1152 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1153 $texthelp .= $langs->trans(
"ProjectsDesc");
1155 $texthelp .= $langs->trans(
"ProjectsPublicDesc");
1159print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1162$topicmail =
"Information";
1163$modelmail =
"project";
1165$trackid =
'proj'.$object->id;
1166include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1169 foreach ($fieldstosearchall as $key => $val) {
1170 $fieldstosearchall[$key] = $langs->trans($val);
1172 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1178$moreforfilter .=
'<div class="divsearchfield">';
1179$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1182if (!$user->hasRight(
'user',
'user',
'lire')) {
1183 $includeonly = array($user->id);
1185$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,
'',
'maxwidth300 widthcentpercentminusx');
1186$moreforfilter .=
'</div>';
1188$moreforfilter .=
'<div class="divsearchfield">';
1189$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1190$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1192$moreforfilter .=
'</div>';
1195if ($user->hasRight(
'user',
'user',
'lire')) {
1196 $langs->load(
"commercial");
1197 $moreforfilter .=
'<div class="divsearchfield">';
1198 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1199 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1200 $moreforfilter .=
'</div>';
1204if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1206 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth300imp minwidth300 widthcentpercentminusx');
1210if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire')) {
1212 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
1216$moreforfilter .=
'<div class="divsearchfield">';
1217$moreforfilter .= $langs->trans(
'Alert').
' <input type="checkbox" name="search_option" value="late"'.($search_option ==
'late' ?
' checked' :
'').
'>';
1218$moreforfilter .=
'</div>';
1222 $moreforfilter .=
'<p style="display: inline-block; margin-left: 5px;">'.$langs->trans(
"Omit sub-projects").
' </p><input type="checkbox" style="margin-left: 10px" class="valignmiddle" id="search_omitChildren" name="search_omitChildren"'.($search_omitChildren ?
' checked="checked"' :
'').
'"> ';
1225if (!empty($moreforfilter)) {
1226 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1227 print $moreforfilter;
1228 $parameters = array();
1229 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1230 print $hookmanager->resPrint;
1234$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1235$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1236$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1237$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1240print
'<div class="div-table-responsive">';
1241print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1245print
'<tr class="liste_titre_filter">';
1248 print
'<td class="liste_titre maxwidthsearch">';
1249 $searchpicto = $form->showFilterButtons(
'left');
1254if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1255 print
'<td class="liste_titre">';
1256 print
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
1260if (!empty($arrayfields[
'p.title'][
'checked'])) {
1261 print
'<td class="liste_titre">';
1262 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1266if (!empty($arrayfields[
's.nom'][
'checked'])) {
1267 print
'<td class="liste_titre">';
1269 $tmpthirdparty =
new Societe($db);
1270 $tmpthirdparty->fetch($socid);
1271 $search_societe = $tmpthirdparty->name;
1273 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1278if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1279 print
'<td class="liste_titre">';
1281 $tmpthirdparty =
new Societe($db);
1282 $tmpthirdparty->fetch($socid);
1283 $search_societe_alias = $tmpthirdparty->name_alias;
1285 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1289if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1290 print
'<td class="liste_titre">';
1291 print
'<input type="text" class="flat width50" name="search_societe_country" value="'.dol_escape_htmltag($search_societe_country).
'">';
1295if (!empty($arrayfields[
'commercial'][
'checked'])) {
1296 print
'<td class="liste_titre"> </td>';
1299if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1300 print
'<td class="liste_titre center">';
1301 print
'<div class="nowrapfordate">';
1302 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'));
1304 print
'<div class="nowrapfordate">';
1305 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'));
1310if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1311 print
'<td class="liste_titre center">';
1312 print
'<div class="nowrapfordate">';
1313 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'));
1315 print
'<div class="nowrapfordate">';
1316 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'));
1321if (!empty($arrayfields[
'p.public'][
'checked'])) {
1322 print
'<td class="liste_titre center">';
1323 $array = array(
'' =>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1324 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1327if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1328 print
'<td class="liste_titre center">';
1332if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1333 print
'<td class="liste_titre nowrap center">';
1334 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1337if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1338 print
'<td class="liste_titre nowrap right">';
1339 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1342if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1343 print
'<td class="liste_titre nowrap right">';
1344 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1347if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1348 print
'<td class="liste_titre nowrap right">';
1351if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1352 print
'<td class="liste_titre nowrap right">';
1353 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1356if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1357 print
'<td class="liste_titre nowrap">';
1358 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1362if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1363 print
'<td class="liste_titre nowrap">';
1364 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1367if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1368 print
'<td class="liste_titre nowrap">';
1369 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1372if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1373 print
'<td class="liste_titre nowrap">';
1374 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1377if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1378 print
'<td class="liste_titre nowrap">';
1379 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1382if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1383 print
'<td class="liste_titre nowrap">';
1384 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1387if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1388 print
'<td class="liste_titre nowrap right">';
1389 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1392if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1393 print
'<td class="liste_titre nowrap right">';
1394 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1397if (!empty($arrayfields[
'u.login'][
'checked'])) {
1399 print
'<td class="liste_titre" align="center">';
1400 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1404include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1407$parameters = array(
'arrayfields' => $arrayfields);
1408$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1409print $hookmanager->resPrint;
1411if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1412 print
'<td class="liste_titre center">';
1413 print
'<div class="nowrapfordate">';
1414 print $form->selectDate($search_date_creation_start ? $search_date_creation_start : -1,
'search_date_creation_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1416 print
'<div class="nowrapfordate">';
1417 print $form->selectDate($search_date_creation_end ? $search_date_creation_end : -1,
'search_date_creation_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1422if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1423 print
'<td class="liste_titre center">';
1424 print
'<div class="nowrapfordate">';
1425 print $form->selectDate($search_date_modif_start ? $search_date_modif_start : -1,
'search_date_modif_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1427 print
'<div class="nowrapfordate">';
1428 print $form->selectDate($search_date_modif_end ? $search_date_modif_end : -1,
'search_date_modif_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1432if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1434 print
'<td class="liste_titre">';
1437if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1439 print
'<td class="liste_titre">';
1440 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1443if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1444 print
'<td class="liste_titre center parentonrightofpage">';
1445 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1450 print
'<td class="liste_titre maxwidthsearch">';
1451 $searchpicto = $form->showFilterButtons();
1457$totalarray = array();
1458$totalarray[
'nbfield'] = 0;
1462print
'<tr class="liste_titre">';
1464 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1465 $totalarray[
'nbfield']++;
1467if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1468 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1469 $totalarray[
'nbfield']++;
1471if (!empty($arrayfields[
'p.title'][
'checked'])) {
1472 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1473 $totalarray[
'nbfield']++;
1475if (!empty($arrayfields[
's.nom'][
'checked'])) {
1476 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1477 $totalarray[
'nbfield']++;
1479if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1481 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1482 $totalarray[
'nbfield']++;
1484if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1485 print_liste_field_titre($arrayfields[
'co.country_code'][
'label'], $_SERVER[
"PHP_SELF"],
"co.country_code",
"", $param,
"", $sortfield, $sortorder);
1486 $totalarray[
'nbfield']++;
1488if (!empty($arrayfields[
'commercial'][
'checked'])) {
1489 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1490 $totalarray[
'nbfield']++;
1492if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1493 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1494 $totalarray[
'nbfield']++;
1496if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1497 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1498 $totalarray[
'nbfield']++;
1500if (!empty($arrayfields[
'p.public'][
'checked'])) {
1501 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1502 $totalarray[
'nbfield']++;
1504if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1505 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1506 $totalarray[
'nbfield']++;
1508if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1510 $totalarray[
'nbfield']++;
1512if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1513 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1514 $totalarray[
'nbfield']++;
1516if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1517 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1518 $totalarray[
'nbfield']++;
1520if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1521 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1522 $totalarray[
'nbfield']++;
1524if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1525 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1526 $totalarray[
'nbfield']++;
1528if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1529 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1530 $totalarray[
'nbfield']++;
1532if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1533 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1534 $totalarray[
'nbfield']++;
1536if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1537 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1538 $totalarray[
'nbfield']++;
1540if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1541 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1542 $totalarray[
'nbfield']++;
1544if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1545 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1546 $totalarray[
'nbfield']++;
1548if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1549 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1550 $totalarray[
'nbfield']++;
1552if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1553 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1554 $totalarray[
'nbfield']++;
1556if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1557 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1558 $totalarray[
'nbfield']++;
1560if (!empty($arrayfields[
'u.login'][
'checked'])) {
1561 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1562 $totalarray[
'nbfield']++;
1565include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1567$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1568$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1569print $hookmanager->resPrint;
1570if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1571 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1572 $totalarray[
'nbfield']++;
1574if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1575 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1576 $totalarray[
'nbfield']++;
1578if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1579 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1580 $totalarray[
'nbfield']++;
1582if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1583 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1584 $totalarray[
'nbfield']++;
1586if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1587 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1588 $totalarray[
'nbfield']++;
1592 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1593 $totalarray[
'nbfield']++;
1599$savnbfield = $totalarray[
'nbfield'];
1604$imaxinloop = ($limit ? min($num, $limit) : $num);
1605while ($i < $imaxinloop) {
1606 $obj = $db->fetch_object($resql);
1612 $companystatic->id = $obj->socid;
1613 $companystatic->name = $obj->name;
1614 $companystatic->name_alias = $obj->alias;
1615 $companystatic->client = $obj->client;
1616 $companystatic->code_client = $obj->code_client;
1617 $companystatic->email = $obj->email;
1618 $companystatic->phone = $obj->phone;
1619 $companystatic->address = $obj->address;
1620 $companystatic->zip = $obj->zip;
1621 $companystatic->town = $obj->town;
1622 $companystatic->country_code = $obj->country_code;
1628 $object->fk_opp_status = $obj->fk_opp_status;
1629 $object->user_author_id = $obj->fk_user_creat;
1630 $object->date_creation = $db->jdate($obj->date_creation);
1631 $object->date_start = $db->jdate($obj->date_start);
1632 $object->date_end = $db->jdate($obj->date_end);
1633 $object->statut = $obj->status;
1634 $object->status = $obj->status;
1635 $object->public = $obj->public;
1636 $object->opp_percent = $obj->opp_percent;
1637 $object->opp_status = $obj->fk_opp_status;
1638 $object->opp_status_code = $obj->opp_status_code;
1639 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1640 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1641 $object->budget_amount = $obj->budget_amount;
1642 $object->usage_opportunity = $obj->usage_opportunity;
1643 $object->usage_task = $obj->usage_task;
1644 $object->usage_bill_time = $obj->usage_bill_time;
1645 $object->usage_organize_event = $obj->usage_organize_event;
1646 $object->email_msgid = $obj->email_msgid;
1647 $object->import_key = $obj->import_key;
1648 $object->thirdparty = $companystatic;
1652 $stringassignedusers =
'';
1654 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1656 foreach (array(
'internal',
'external') as $source) {
1657 $tab =
$object->liste_contact(-1, $source, 0,
'', 1);
1658 $numcontact = count($tab);
1659 if (!empty($numcontact)) {
1660 foreach ($tab as $contactproject) {
1662 if ($source ==
'internal') {
1663 if (!empty($conf->cache[
'user'][$contactproject[
'id']])) {
1664 $c = $conf->cache[
'user'][$contactproject[
'id']];
1667 $c->fetch($contactproject[
'id']);
1668 $conf->cache[
'user'][$contactproject[
'id']] = $c;
1671 if (!empty($conf->cache[
'contact'][$contactproject[
'id']])) {
1672 $c = $conf->cache[
'contact'][$contactproject[
'id']];
1675 $c->fetch($contactproject[
'id']);
1676 $conf->cache[
'contact'][$contactproject[
'id']] = $c;
1679 if (get_class($c) ==
'User') {
1680 $stringassignedusers .= $c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1682 $stringassignedusers .= $c->getNomUrl(-2,
'', 0,
'', -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1690 if ($mode ==
'kanban') {
1692 print
'<tr class="trkanban'.(empty($groupby) ?
'' :
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
1695 if (!empty($groupby)) {
1696 if (is_null($groupbyold)) {
1697 print
'<div class="box-flex-container-columns kanban">';
1700 if (is_null($obj->$groupbyfield)) {
1701 $groupbyvalue =
'undefined';
1703 $groupbyvalue = $obj->$groupbyfield;
1705 if ($groupbyold !== $groupbyvalue) {
1706 if (!is_null($groupbyold)) {
1709 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1711 if (!is_null($groupbyold) && ($tmpcursor <= $groupbyold)) {
1714 if ($tmpcursor >= $groupbyvalue) {
1718 print
'<div class="box-flex-container-column kanban column';
1719 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1720 print
' kanbancollapsed';
1722 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1723 print
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).
'</div>';
1726 print
'<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $groupbyvalue).
'">';
1727 print
'<div class="kanbanlabel">'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ?
'Undefined' : $groupbyvalues[$groupbyvalue]).
'</div>';
1729 $groupbyold = $groupbyvalue;
1730 } elseif ($i == 0) {
1731 print
'<div class="box-flex-container kanban">';
1736 if ($massactionbutton || $massaction) {
1738 if (in_array(
$object->id, $arrayofselected)) {
1742 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty' => $companystatic,
'selected' => $selected);
1744 print
$object->getKanbanView(
'', $arrayofdata, ($groupby ?
'small' :
''));
1747 if ($i == ($imaxinloop - 1)) {
1749 if (!empty($groupby)) {
1751 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1753 if ($tmpcursor <= $groupbyvalue) {
1757 print
'<div class="box-flex-container-column kanban column';
1758 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1759 print
' kanbancollapsed';
1761 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1762 print
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ?
'Undefined' : $tmpgroupbyvalue).
'</div>';
1774 $userstatic->id = $obj->fk_user_creat;
1775 $userstatic->login = $obj->login;
1776 $userstatic->lastname = $obj->lastname;
1777 $userstatic->firstname = $obj->firstname;
1778 $userstatic->email = $obj->user_email;
1779 $userstatic->status = $obj->user_statut;
1780 $userstatic->entity = $obj->entity;
1781 $userstatic->photo = $obj->photo;
1782 $userstatic->office_phone = $obj->office_phone;
1783 $userstatic->office_fax = $obj->office_fax;
1784 $userstatic->user_mobile = $obj->user_mobile;
1785 $userstatic->job = $obj->job;
1786 $userstatic->gender = $obj->gender;
1790 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 &&
$object->status > 1) ?
'opacitymedium' :
'').
'">';
1793 print
'<td class="nowrap center">';
1794 if ($massactionbutton || $massaction) {
1796 if (in_array(
$object->id, $arrayofselected)) {
1799 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1803 $totalarray[
'nbfield']++;
1807 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1808 print
'<td class="nowraponall tdoverflowmax200">';
1809 print
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ?
'eventorganization' :
''));
1815 $totalarray[
'nbfield']++;
1819 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1820 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1824 $totalarray[
'nbfield']++;
1828 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1829 print
'<td class="tdoverflowmax125">';
1831 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1837 $totalarray[
'nbfield']++;
1841 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1842 print
'<td class="tdoverflowmax100">';
1844 print $companystatic->name_alias;
1850 $totalarray[
'nbfield']++;
1854 if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1855 print
'<td class="tdoverflowmax125">';
1856 print $obj->country_code;
1859 $totalarray[
'nbfield']++;
1863 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1864 print
'<td class="tdoverflowmax150">';
1866 $companystatic->id = $obj->socid;
1867 $companystatic->name = $obj->name;
1868 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1869 $nbofsalesrepresentative = count($listsalesrepresentatives);
1870 if ($nbofsalesrepresentative > 6) {
1872 print $nbofsalesrepresentative;
1873 } elseif ($nbofsalesrepresentative > 0) {
1874 $userstatic =
new User($db);
1876 foreach ($listsalesrepresentatives as $val) {
1877 $userstatic->id = $val[
'id'];
1878 $userstatic->lastname = $val[
'lastname'];
1879 $userstatic->firstname = $val[
'firstname'];
1880 $userstatic->email = $val[
'email'];
1881 $userstatic->status = $val[
'statut'];
1882 $userstatic->entity = $val[
'entity'];
1883 $userstatic->photo = $val[
'photo'];
1884 $userstatic->login = $val[
'login'];
1885 $userstatic->office_phone = $val[
'office_phone'];
1886 $userstatic->office_fax = $val[
'office_fax'];
1887 $userstatic->user_mobile = $val[
'user_mobile'];
1888 $userstatic->job = $val[
'job'];
1889 $userstatic->gender = $val[
'gender'];
1890 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1892 if ($j < $nbofsalesrepresentative) {
1903 $totalarray[
'nbfield']++;
1908 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1909 print
'<td class="center">';
1913 $totalarray[
'nbfield']++;
1917 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1918 print
'<td class="center">';
1922 $totalarray[
'nbfield']++;
1927 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1928 print
'<td class="center">';
1930 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1933 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1938 $totalarray[
'nbfield']++;
1942 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1943 print
'<td class="center nowraponall tdoverflowmax200">';
1944 print $stringassignedusers;
1947 $totalarray[
'nbfield']++;
1951 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1953 if ($obj->opp_status_code) {
1954 $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
1955 if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
1956 $s .=
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
1959 print
'<td class="center tdoverflowmax150" title="'.$s.
'">';
1963 $totalarray[
'nbfield']++;
1967 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1968 print
'<td class="right">';
1970 if (isset($obj->opp_amount) && strcmp($obj->opp_amount,
'')) {
1971 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1972 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
1973 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
1975 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
1980 $totalarray[
'nbfield']++;
1983 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.opp_amount';
1987 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1988 print
'<td class="right">';
1989 if ($obj->opp_percent) {
1990 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
1994 $totalarray[
'nbfield']++;
1998 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1999 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
2000 $totalarray[
'val'][
'opp_weighted_amount'] = 0;
2002 print
'<td align="right">';
2003 if ($obj->opp_weighted_amount) {
2004 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2005 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
2009 $totalarray[
'nbfield']++;
2010 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'opp_weighted_amount';
2014 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
2015 print
'<td class="right">';
2016 if ($obj->budget_amount !=
'') {
2017 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
2018 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
2019 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
2021 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
2026 $totalarray[
'nbfield']++;
2027 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.budget_amount';
2031 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
2032 print
'<td class="">';
2033 if ($obj->usage_opportunity) {
2034 print
yn($obj->usage_opportunity);
2038 $totalarray[
'nbfield']++;
2042 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
2043 print
'<td class="">';
2044 if ($obj->usage_task) {
2045 print
yn($obj->usage_task);
2049 $totalarray[
'nbfield']++;
2053 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
2054 print
'<td class="">';
2055 if ($obj->usage_bill_time) {
2056 print
yn($obj->usage_bill_time);
2060 $totalarray[
'nbfield']++;
2064 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
2065 print
'<td class="">';
2066 if ($obj->usage_organize_event) {
2067 print
yn($obj->usage_organize_event);
2071 $totalarray[
'nbfield']++;
2075 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
2076 print
'<td class="">';
2077 if ($obj->accept_conference_suggestions) {
2078 print
yn($obj->accept_conference_suggestions);
2082 $totalarray[
'nbfield']++;
2086 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
2087 print
'<td class="">';
2088 if ($obj->accept_booth_suggestions) {
2089 print
yn($obj->accept_booth_suggestions);
2093 $totalarray[
'nbfield']++;
2097 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
2098 print
'<td class="right">';
2099 if ($obj->price_registration !=
'') {
2100 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
2101 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
2105 $totalarray[
'nbfield']++;
2108 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_registration';
2112 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
2113 print
'<td class="right">';
2114 if ($obj->price_booth !=
'') {
2115 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
2116 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
2120 $totalarray[
'nbfield']++;
2123 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_booth';
2127 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2128 print
'<td class="center tdoverflowmax150">';
2129 if ($userstatic->id) {
2130 print $userstatic->getNomUrl(-1);
2134 $totalarray[
'nbfield']++;
2138 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2140 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2141 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2142 print $hookmanager->resPrint;
2144 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2145 print
'<td class="center nowraponall">';
2146 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2149 $totalarray[
'nbfield']++;
2153 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2154 print
'<td class="center nowraponall">';
2155 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2158 $totalarray[
'nbfield']++;
2162 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2163 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2167 $totalarray[
'nbfield']++;
2171 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2172 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2174 $totalarray[
'nbfield']++;
2178 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2179 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2181 $totalarray[
'nbfield']++;
2186 print
'<td class="nowrap center">';
2187 if ($massactionbutton || $massaction) {
2189 if (in_array(
$object->id, $arrayofselected)) {
2192 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2196 $totalarray[
'nbfield']++;
2207include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2212 foreach ($arrayfields as $key => $val) {
2213 if (!empty($val[
'checked'])) {
2217 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2222$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2223$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2224print $hookmanager->resPrint;
2226print
'</table>'.
"\n";
2229print
'</form>'.
"\n";
2231if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2232 $hidegeneratedfilelistifempty = 1;
2233 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2234 $hidegeneratedfilelistifempty = 0;
2237 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2241 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2242 $urlsource .= str_replace(
'&',
'&', $param);
2244 $filedir = $diroutputmassaction;
2245 $genallowed = $permissiontoread;
2246 $delallowed = $permissiontoadd;
2248 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
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 information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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...
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.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.