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';
58$langs->loadLangs(array(
'projects',
'companies',
'commercial'));
59if (isModEnabled(
'eventorganization') &&
$conf->eventorganization->enabled) {
60 $langs->loadLangs(array(
'eventorganization'));
63$action =
GETPOST(
'action',
'aZ09');
64$massaction =
GETPOST(
'massaction',
'alpha');
66$confirm =
GETPOST(
'confirm',
'alpha');
67$toselect =
GETPOST(
'toselect',
'array');
68$optioncss =
GETPOST(
'optioncss',
'alpha');
69$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projectlist';
70$mode =
GETPOST(
'mode',
'alpha');
71$groupby =
GETPOST(
'groupby',
'aZ09');
73$title = $langs->trans(
"Projects");
81 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
83if (!$user->hasRight(
'projet',
'lire')) {
87$diroutputmassaction =
$conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
90$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
91$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
93if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
103$offset = $limit * $page;
104$pageprev = $page - 1;
105$pagenext = $page + 1;
107$search_all =
GETPOST(
'search_all',
'alphanohtml');
109$search_ref =
GETPOST(
"search_ref",
'alpha');
110$search_label =
GETPOST(
"search_label",
'alpha');
111$search_societe =
GETPOST(
"search_societe",
'alpha');
112$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
113$search_societe_country =
GETPOST(
"search_societe_country",
'alpha');
114$search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
115$search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
116$search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
117$search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
118$search_public =
GETPOST(
"search_public",
'intcomma');
119$search_project_user =
GETPOSTINT(
'search_project_user');
120$search_project_contact =
GETPOSTINT(
'search_project_contact');
122$search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'intcomma');
123$search_usage_task =
GETPOST(
'search_usage_task',
'intcomma');
124$search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'intcomma');
125$search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'intcomma');
126$search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'intcomma');
127$search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'intcomma');
128$search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
129$search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
130$search_login =
GETPOST(
'search_login',
'alpha');
131$search_import_key =
GETPOST(
'search_import_key',
'alpha');
132$searchCategoryCustomerOperator = 0;
133if (GETPOSTISSET(
'formfilteraction')) {
134 $searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
136 $searchCategoryCustomerOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
138$searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
139$search_omitChildren = 0;
141 $search_omitChildren =
GETPOST(
'search_omitChildren',
'alpha') ==
'on' ? 1 : 0;
145$mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
147 $search_project_user = $user->id;
158$search_date_start_startmonth =
GETPOSTINT(
'search_date_start_startmonth');
159$search_date_start_startyear =
GETPOSTINT(
'search_date_start_startyear');
160$search_date_start_startday =
GETPOSTINT(
'search_date_start_startday');
161$search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
162$search_date_start_endmonth =
GETPOSTINT(
'search_date_start_endmonth');
163$search_date_start_endyear =
GETPOSTINT(
'search_date_start_endyear');
164$search_date_start_endday =
GETPOSTINT(
'search_date_start_endday');
165$search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
167$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
168$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
169$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
170$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
171$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
172$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
173$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
174$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
176$search_date_creation_startmonth =
GETPOSTINT(
'search_date_creation_startmonth');
177$search_date_creation_startyear =
GETPOSTINT(
'search_date_creation_startyear');
178$search_date_creation_startday =
GETPOSTINT(
'search_date_creation_startday');
179$search_date_creation_start =
dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
180$search_date_creation_endmonth =
GETPOSTINT(
'search_date_creation_endmonth');
181$search_date_creation_endyear =
GETPOSTINT(
'search_date_creation_endyear');
182$search_date_creation_endday =
GETPOSTINT(
'search_date_creation_endday');
183$search_date_creation_end =
dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
185$search_date_modif_startmonth =
GETPOSTINT(
'search_date_modif_startmonth');
186$search_date_modif_startyear =
GETPOSTINT(
'search_date_modif_startyear');
187$search_date_modif_startday =
GETPOSTINT(
'search_date_modif_startday');
188$search_date_modif_start =
dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);
189$search_date_modif_endmonth =
GETPOSTINT(
'search_date_modif_endmonth');
190$search_date_modif_endyear =
GETPOSTINT(
'search_date_modif_endyear');
191$search_date_modif_endday =
GETPOSTINT(
'search_date_modif_endday');
192$search_date_modif_end =
dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);
194$search_category_array = array();
196if (isModEnabled(
'category')) {
197 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
201 $search_status = implode(
',',
GETPOST(
'search_status',
'array:intcomma'));
203 $search_status = (
GETPOST(
'search_status',
'intcomma') !=
'' ?
GETPOST(
'search_status',
'intcomma') : (GETPOSTISSET(
'search_all') ?
'' :
'0,1'));
206$search_option =
GETPOST(
'search_option',
'alpha');
207if ($search_option ==
'late') {
208 $search_status =
'1';
212$hookmanager->initHooks(array(
'projectlist'));
216$extrafields->fetch_name_optionals_label(
$object->table_element);
218$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
221$fieldstosearchall = array();
222foreach (
$object->fields as $key => $val) {
223 if (empty($val[
'searchall'])) {
228 if (!empty($user->socid) && $key ==
"note_private") {
232 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
236$fieldstosearchall[
's.nom'] =
"ThirdPartyName";
237$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
238$fieldstosearchall[
's.code_client'] =
"CustomerCode";
241$arrayfields = array();
242foreach (
$object->fields as $key => $val) {
244 if (!empty($val[
'visible'])) {
245 $visible = (int)
dol_eval((
string) $val[
'visible'], 1, 1,
'1');
246 $arrayfields[
'p.'.$key] = array(
247 'label' => $val[
'label'],
248 'checked' => (($visible < 0) ? 0 : 1),
249 'enabled' => (abs($visible) != 3 && (bool)
dol_eval($val[
'enabled'], 1)),
250 'position' => $val[
'position'],
251 'help' => isset($val[
'help']) ? $val[
'help'] :
''
256include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
259$arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'checked' => 1,
'position' => 21,
'enabled' => (!isModEnabled(
'societe') ? 0 : 1));
260$arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'checked' => 0,
'position' => 22);
261$arrayfields[
'co.country_code'] = array(
'label' =>
"Country",
'checked' => -1,
'position' => 23);
262$arrayfields[
'commercial'] = array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' => 0,
'position' => 25);
263$arrayfields[
'c.assigned'] = array(
'label' =>
"AssignedTo",
'checked' => 1,
'position' => 120);
264$arrayfields[
'opp_weighted_amount'] = array(
'label' =>
'OpportunityWeightedAmountShort',
'checked' => 0,
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ? 0 : 1),
'position' => 106);
265$arrayfields[
'u.login'] = array(
'label' =>
"Author",
'checked' => -1,
'position' => 165);
271if (
GETPOST(
'search_usage_event_organization')) {
272 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 0;
273 $arrayfields[
'p.opp_amount'][
'enabled'] = 0;
274 $arrayfields[
'p.opp_percent'][
'enabled'] = 0;
275 $arrayfields[
'opp_weighted_amount'][
'enabled'] = 0;
276 $arrayfields[
'p.usage_organize_event'][
'visible'] = 1;
277 $arrayfields[
'p.usage_organize_event'][
'checked'] = 1;
279$arrayfields[
'p.fk_project'][
'enabled'] = 0;
282if ($contextpage ==
'lead') {
283 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 1;
284 $arrayfields[
'p.fk_opp_status'][
'visible'] = 1;
290'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
294$groupbyvalues = array();
295$groupofcollpasedvalues = array();
297if ($mode ==
'kanban' && $groupby) {
298 $groupbyfield = preg_replace(
'/[a-z]\./',
'', $groupby);
299 if (!empty(
$object->fields[$groupbyfield][
'alias'])) {
300 $groupbyfield =
$object->fields[$groupbyfield][
'alias'];
302 if (!in_array(preg_replace(
'/[a-z]\./',
'', $groupby), array_keys(
$object->fields))) {
305 if (!empty(
$object->fields[$groupby][
'arrayofkeyval'])) {
306 $groupbyvalues =
$object->fields[$groupby][
'arrayofkeyval'];
307 } elseif (!empty(
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'])) {
308 $groupbyvalues =
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'];
315 $sql =
"SELECT cls.rowid, cls.code, cls.percent, cls.label";
316 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_lead_status as cls";
317 $sql .=
" WHERE active = 1";
320 $sql .= $db->order(
'cls.rowid',
'ASC');
321 $resql = $db->query($sql);
323 $num = $db->num_rows($resql);
327 $objp = $db->fetch_object($resql);
328 $groupbyvalues[$objp->rowid] = $objp->label;
333 $groupofcollpasedvalues = array(6,7);
338 if ($groupby && !preg_match(
'/^'.preg_quote($db->sanitize($groupby),
'/').
'/', $sortfield)) {
340 $sortfield = $db->sanitize($groupby).($sortfield ?
",".$sortfield :
"");
341 $sortorder =
"ASC".($sortfield ?
",".$sortorder :
"");
350if (
GETPOST(
'cancel',
'alpha')) {
354if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
358$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
359$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
364if (empty($reshook)) {
366 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
369 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
373 $search_societe =
"";
374 $search_societe_alias =
'';
375 $search_societe_country =
'';
378 $search_opp_status = -1;
379 $search_opp_amount =
'';
380 $search_opp_percent =
'';
381 $search_budget_amount =
'';
384 $search_project_user =
'';
385 $search_project_contact =
'';
392 $search_date_start_startmonth =
"";
393 $search_date_start_startyear =
"";
394 $search_date_start_startday =
"";
395 $search_date_start_start =
"";
396 $search_date_start_endmonth =
"";
397 $search_date_start_endyear =
"";
398 $search_date_start_endday =
"";
399 $search_date_start_end =
"";
400 $search_date_end_startmonth =
"";
401 $search_date_end_startyear =
"";
402 $search_date_end_startday =
"";
403 $search_date_end_start =
"";
404 $search_date_end_endmonth =
"";
405 $search_date_end_endyear =
"";
406 $search_date_end_endday =
"";
407 $search_date_end_end =
"";
408 $search_date_creation_startmonth =
"";
409 $search_date_creation_startyear =
"";
410 $search_date_creation_startday =
"";
411 $search_date_creation_start =
"";
412 $search_date_creation_endmonth =
"";
413 $search_date_creation_endyear =
"";
414 $search_date_creation_endday =
"";
415 $search_date_creation_end =
"";
416 $search_date_modif_startmonth =
"";
417 $search_date_modif_startyear =
"";
418 $search_date_modif_startday =
"";
419 $search_date_modif_start =
"";
420 $search_date_modif_endmonth =
"";
421 $search_date_modif_endyear =
"";
422 $search_date_modif_endday =
"";
423 $search_date_modif_end =
"";
424 $search_usage_opportunity =
'';
425 $search_usage_task =
'';
426 $search_usage_bill_time =
'';
427 $search_usage_event_organization =
'';
428 $search_accept_conference_suggestions =
'';
429 $search_accept_booth_suggestions =
'';
430 $search_price_registration =
'';
431 $search_price_booth =
'';
433 $search_import_key =
'';
436 $search_array_options = array();
437 $search_category_array = array();
442 $objectclass =
'Project';
443 $objectlabel =
'Project';
444 $permissiontoread = $user->hasRight(
'projet',
'lire');
445 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
446 $permissiontoadd = $user->hasRight(
'projet',
'creer');
447 $uploaddir =
$conf->project->dir_output;
450 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
453 if (!$error && $massaction ==
'close' && $user->hasRight(
'projet',
'creer')) {
456 $objecttmp =
new $objectclass($db);
458 foreach ($toselect as $toselectid) {
459 $result = $objecttmp->fetch($toselectid);
461 $userWrite =
$object->restrictedProjectArea($user,
'write');
462 if ($userWrite > 0 && $objecttmp->statut == 1) {
463 $result = $objecttmp->setClose($user);
471 } elseif ($userWrite <= 0) {
472 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
474 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
497unset($_SESSION[
'pageforbacktolist'][
'project']);
499$form =
new Form($db);
504$companystatic =
new Societe($db);
505$taskstatic =
new Task($db);
508$userstatic =
new User($db);
510$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
511$title = $langs->trans(
"LeadsOrProjects");
513 $title = $langs->trans(
"Projects");
516 $title = $langs->trans(
"Leads");
524if (!$user->hasRight(
'projet',
'all',
'lire')) {
525 $projectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
529$listofprojectcontacttype = array();
530$listofprojectcontacttypeexternal = array();
531$sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
532$sql .=
" WHERE ctc.element = '".$db->escape(
$object->element).
"'";
533$resql = $db->query($sql);
535 while ($obj = $db->fetch_object($resql)) {
536 if ($obj->source ==
'internal') {
537 $listofprojectcontacttype[$obj->rowid] = $obj->code;
539 $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
545if (count($listofprojectcontacttype) == 0) {
546 $listofprojectcontacttype[0] =
'0';
548if (count($listofprojectcontacttypeexternal) == 0) {
549 $listofprojectcontacttypeexternal[0] =
'0';
552$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
553$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
555$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,";
556$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,";
557$sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
558$sql .=
" p.email_msgid, p.import_key,";
559$sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
560$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,";
561$sql .=
" country.code as country_code,";
562$sql .=
" cls.code as opp_status_code,";
563$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';
565if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
566 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
567 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
571$parameters = array();
572$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
573$sql .= $hookmanager->resPrint;
574$sql = preg_replace(
'/,\s*$/',
'', $sql);
578$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as p";
579if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
580 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
582$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
583$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on country.rowid = s.fk_pays";
584$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
585$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
590$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
591$sql .= $hookmanager->resPrint;
592if ($search_entity > 0) {
593 $sql .=
" WHERE p.entity = ".((int) $search_entity);
595 $sql .=
" WHERE p.entity IN (".getEntity(
'project').
')';
597if (!$user->hasRight(
'projet',
'all',
'lire')) {
598 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
602 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
610if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
611 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
613 if ($search_societe) {
616 if ($search_societe_alias) {
620if ($search_societe_country) {
623if ($search_opp_amount) {
626if ($search_opp_percent) {
629$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
630$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
632if ($search_date_start_start) {
633 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
635if ($search_date_start_end) {
636 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
639if ($search_date_end_start) {
640 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
642if ($search_date_end_end) {
643 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
646if ($search_date_creation_start) {
647 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
649if ($search_date_creation_end) {
650 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
653if ($search_date_modif_start) {
654 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
656if ($search_date_modif_end) {
657 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
661 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
663if ($search_status !=
'' && $search_status !=
'-1') {
664 if ($search_status == 99) {
665 $sql .=
" AND p.fk_statut IN (0,1)";
667 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
670if ($search_option ==
'late') {
671 $sql .=
" AND p.datee < '".$db->idate(
dol_now() -
$conf->project->warning_delay).
"'";
673if ($search_opp_status) {
674 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
675 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
677 if ($search_opp_status ==
'all') {
678 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
680 if ($search_opp_status ==
'openedopp') {
681 $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'))";
683 if ($search_opp_status ==
'notopenedopp') {
684 $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'))";
686 if ($search_opp_status ==
'none') {
687 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
690if ($search_public !=
'') {
691 $sql .=
" AND p.public = ".((int) $search_public);
696if ($search_sale && $search_sale !=
'-1') {
697 if ($search_sale == -2) {
698 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
699 } elseif ($search_sale > 0) {
700 $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).
")";
703if ($search_project_user > 0) {
704 $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).
")";
706if ($search_project_contact > 0) {
707 $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).
")";
709if ($search_opp_amount !=
'') {
712if ($search_budget_amount !=
'') {
713 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
715if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
716 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
718if ($search_usage_task !=
'' && $search_usage_task >= 0) {
721if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
722 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
724if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
725 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
727if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
728 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
730if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
731 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
733if ($search_price_registration !=
'') {
734 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
736if ($search_price_booth !=
'') {
740 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
742if ($search_import_key) {
743 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
746 if ($search_omitChildren == 1) {
747 $sql .=
" AND p.fk_project IS NULL";
752$searchCategoryProjectList = $search_category_array;
753$searchCategoryProjectOperator = 0;
754if (!empty($searchCategoryProjectList)) {
755 $searchCategoryProjectSqlList = array();
756 $listofcategoryid =
'';
757 foreach ($searchCategoryProjectList as $searchCategoryProject) {
758 if (intval($searchCategoryProject) == -2) {
759 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
760 } elseif (intval($searchCategoryProject) > 0) {
761 if ($searchCategoryProjectOperator == 0) {
762 $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).
")";
764 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
768 if ($listofcategoryid) {
769 $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).
"))";
771 if ($searchCategoryProjectOperator == 1) {
772 if (!empty($searchCategoryProjectSqlList)) {
773 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
776 if (!empty($searchCategoryProjectSqlList)) {
777 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
781$searchCategoryCustomerSqlList = array();
782if ($searchCategoryCustomerOperator == 1) {
783 $existsCategoryCustomerList = array();
784 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
785 if (intval($searchCategoryCustomer) == -2) {
786 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
787 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
788 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
789 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
790 $sqlCategoryCustomerNotExists .=
" )";
791 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
792 } elseif (intval($searchCategoryCustomer) > 0) {
793 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
796 if (!empty($existsCategoryCustomerList)) {
797 $sqlCategoryCustomerExists =
" EXISTS (";
798 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
799 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
800 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
801 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
802 $sqlCategoryCustomerExists .=
" )";
803 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
805 if (!empty($searchCategoryCustomerSqlList)) {
806 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
809 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
810 if (intval($searchCategoryCustomer) == -2) {
811 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
812 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
813 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
814 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
815 $sqlCategoryCustomerNotExists .=
" )";
816 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
817 } elseif (intval($searchCategoryCustomer) > 0) {
818 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
821 if (!empty($searchCategoryCustomerSqlList)) {
822 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
826include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
828$parameters = array();
829$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
830$sql .= $hookmanager->resPrint;
834$nbtotalofrecords =
'';
837 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
838 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
839 $resql = $db->query($sqlforcount);
841 $objforcount = $db->fetch_object($resql);
842 $nbtotalofrecords = $objforcount->nbtotalofrecords;
847 if (($page * $limit) > $nbtotalofrecords) {
855$sql .= $db->order($sortfield, $sortorder);
857 $sql .= $db->plimit($limit + 1, $offset);
861$resql = $db->query($sql);
867$num = $db->num_rows($resql);
870if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
871 $obj = $db->fetch_object($resql);
872 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
880llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-project page-list');
882$arrayofselected = is_array($toselect) ? $toselect : array();
886 $param .=
'&mode='.urlencode($mode);
888if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
889 $param .=
'&contextpage='.urlencode($contextpage);
891if ($limit > 0 && $limit !=
$conf->liste_limit) {
892 $param .=
'&limit='.((int) $limit);
894if ($optioncss !=
'') {
895 $param .=
'&optioncss='.urlencode($optioncss);
897if ($search_all !=
'') {
898 $param .=
'&search_all='.urlencode($search_all);
900if ($search_entity !=
'') {
901 $param .=
'&search_entity='.((int) $search_entity);
904 $param .=
'&groupby='.urlencode($groupby);
908 $param .=
'&socid='.urlencode((
string) $socid);
911 $param .=
'&search_sday='.urlencode((
string) ($search_sday));
914 $param .=
'&search_smonth='.urlencode((
string) ($search_smonth));
917 $param .=
'&search_syear='.urlencode((
string) ($search_syear));
920 $param .=
'&search_eday='.urlencode((
string) ($search_eday));
923 $param .=
'&search_emonth='.urlencode((
string) ($search_emonth));
926 $param .=
'&search_eyear='.urlencode((
string) ($search_eyear));
928if ($search_date_start_startmonth) {
929 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
931if ($search_date_start_startyear) {
932 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
934if ($search_date_start_startday) {
935 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
937if ($search_date_start_start) {
938 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
940if ($search_date_start_endmonth) {
941 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
943if ($search_date_start_endyear) {
944 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
946if ($search_date_start_endday) {
947 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
949if ($search_date_start_end) {
950 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
952if ($search_date_end_startmonth) {
953 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
955if ($search_date_end_startyear) {
956 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
958if ($search_date_end_startday) {
959 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
961if ($search_date_end_start) {
962 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
964if ($search_date_end_endmonth) {
965 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
967if ($search_date_end_endyear) {
968 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
970if ($search_date_end_endday) {
971 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
973if ($search_date_end_end) {
974 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
976if ($search_date_creation_startmonth) {
977 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
979if ($search_date_creation_startyear) {
980 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
982if ($search_date_creation_startday) {
983 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
985if ($search_date_creation_start) {
986 $param .=
'&search_date_creation_start='.urlencode($search_date_creation_start);
988if ($search_date_creation_endmonth) {
989 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
991if ($search_date_creation_endyear) {
992 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
994if ($search_date_creation_endday) {
995 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
997if ($search_date_creation_end) {
998 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
1000if ($search_date_modif_startmonth) {
1001 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
1003if ($search_date_modif_startyear) {
1004 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
1006if ($search_date_modif_startday) {
1007 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
1009if ($search_date_modif_start) {
1010 $param .=
'&search_date_modif_start='.urlencode($search_date_modif_start);
1012if ($search_date_modif_endmonth) {
1013 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
1015if ($search_date_modif_endyear) {
1016 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
1018if ($search_date_modif_endday) {
1019 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1021if ($search_date_modif_end) {
1022 $param .=
'&search_date_modif_end=' . urlencode($search_date_modif_end);
1024if (!empty($search_category_array)) {
1025 foreach ($search_category_array as $tmpval) {
1026 $param .=
'&search_categegory_project_list[]='.urlencode($tmpval);
1029if ($search_ref !=
'') {
1030 $param .=
'&search_ref='.urlencode($search_ref);
1032if ($search_label !=
'') {
1033 $param .=
'&search_label='.urlencode($search_label);
1035if ($search_societe !=
'') {
1036 $param .=
'&search_societe='.urlencode($search_societe);
1038if ($search_societe_alias !=
'') {
1039 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1041if ($search_societe_country !=
'') {
1042 $param .=
'&search_societe_country='.urlencode($search_societe_country);
1044if ($search_status !=
'' && $search_status !=
'-1') {
1045 $param .=
"&search_status=".urlencode($search_status);
1047if ($search_option) {
1048 $param .=
"&search_option=".urlencode($search_option);
1050if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
1051 $param .=
'&search_opp_status='.urlencode($search_opp_status);
1053if ($search_opp_percent !=
'') {
1054 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
1056if ($search_public !=
'') {
1057 $param .=
'&search_public='.urlencode($search_public);
1059if ($search_project_user > 0) {
1060 $param .=
'&search_project_user='.urlencode((
string) $search_project_user);
1062if ($search_project_contact > 0) {
1063 $param .=
'&search_project_contact='.urlencode((
string) ($search_project_contact));
1065if ($search_sale > 0) {
1066 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
1068if ($search_opp_amount !=
'') {
1069 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
1071if ($search_budget_amount !=
'') {
1072 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
1074if ($search_usage_task !=
'') {
1075 $param .=
'&search_usage_task='.urlencode($search_usage_task);
1077if ($search_usage_bill_time !=
'') {
1078 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
1080if ($search_usage_event_organization !=
'') {
1081 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
1083if ($search_accept_conference_suggestions !=
'') {
1084 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
1086if ($search_accept_booth_suggestions !=
'') {
1087 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
1089if ($search_price_registration !=
'') {
1090 $param .=
'&search_price_registration='.urlencode($search_price_registration);
1092if ($search_price_booth !=
'') {
1093 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1096 $param .=
'&search_login='.urlencode($search_login);
1098if ($search_import_key) {
1099 $param .=
'&search_import_key='.urlencode($search_import_key);
1101foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1102 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1105include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1108$parameters = array(
'param' => &$param);
1109$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1110$param .= $hookmanager->resPrint;
1113$arrayofmassactions = array(
1114 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1115 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1120if ($user->hasRight(
'projet',
'creer')) {
1121 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1122 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1124if ($user->hasRight(
'projet',
'supprimer')) {
1125 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1127if (isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1128 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1130if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1131 $arrayofmassactions = array();
1134$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1136$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1137if (!empty($socid)) {
1138 $url .=
'&socid='.$socid;
1140if ($search_usage_event_organization == 1) {
1141 $url .=
'&usage_organize_event=1';
1142 if (((
int) $search_usage_opportunity) < 1) {
1143 $url .=
'&usage_opportunity=0';
1148$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'));
1149$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'));
1151$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1153print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1154if ($optioncss !=
'') {
1155 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1157print
'<input type="hidden" name="token" value="'.newToken().
'">';
1158print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1159print
'<input type="hidden" name="action" value="list">';
1160print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1161print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1162print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1163print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1164print
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
1168if ($search_project_user == $user->id) {
1169 $htmltooltip .= $langs->trans(
"MyProjectsDesc");
1171 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1172 $htmltooltip .= $langs->trans(
"ProjectsDesc");
1174 $htmltooltip .= $langs->trans(
"ProjectsPublicDesc");
1178print_barre_liste($form->textwithpicto($title, $htmltooltip), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1181$topicmail =
"Information";
1182$modelmail =
"project";
1184$trackid =
'proj'.$object->id;
1185include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1188 foreach ($fieldstosearchall as $key => $val) {
1189 $fieldstosearchall[$key] = $langs->trans($val);
1191 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1197$moreforfilter .=
'<div class="divsearchfield">';
1198$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1201if (!$user->hasRight(
'user',
'user',
'lire')) {
1202 $includeonly = array($user->id);
1204$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');
1205$moreforfilter .=
'</div>';
1207$moreforfilter .=
'<div class="divsearchfield">';
1208$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1209$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1211$moreforfilter .=
'</div>';
1214if ($user->hasRight(
'user',
'user',
'lire')) {
1215 $langs->load(
"commercial");
1216 $moreforfilter .=
'<div class="divsearchfield">';
1217 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1218 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1219 $moreforfilter .=
'</div>';
1223if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1225 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth300imp minwidth300 widthcentpercentminusx');
1229if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire')) {
1231 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
1235$moreforfilter .=
'<div class="divsearchfield">';
1236$moreforfilter .=
'<label for="search_option" title="'.$langs->trans(
"Late").
'">'.$langs->trans(
'Alert').
' </label><input type="checkbox" id="search_option" name="search_option" value="late"'.($search_option ==
'late' ?
' checked' :
'').
'>';
1237$moreforfilter .=
'</div>';
1241 $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"' :
'').
'"> ';
1244if (!empty($moreforfilter)) {
1245 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1246 print $moreforfilter;
1247 $parameters = array();
1248 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1249 print $hookmanager->resPrint;
1253$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1254$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1255$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1256$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1259print
'<div class="div-table-responsive">';
1260print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1264print
'<tr class="liste_titre_filter">';
1267 print
'<td class="liste_titre maxwidthsearch">';
1268 $searchpicto = $form->showFilterButtons(
'left');
1273if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1274 print
'<td class="liste_titre">';
1275 print
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
1279if (!empty($arrayfields[
'p.title'][
'checked'])) {
1280 print
'<td class="liste_titre">';
1281 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1285if (!empty($arrayfields[
's.nom'][
'checked'])) {
1286 print
'<td class="liste_titre">';
1288 $tmpthirdparty =
new Societe($db);
1289 $tmpthirdparty->fetch($socid);
1290 $search_societe = $tmpthirdparty->name;
1292 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1297if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1298 print
'<td class="liste_titre">';
1300 $tmpthirdparty =
new Societe($db);
1301 $tmpthirdparty->fetch($socid);
1302 $search_societe_alias = $tmpthirdparty->name_alias;
1304 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1308if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1309 print
'<td class="liste_titre">';
1310 print
'<input type="text" class="flat width50" name="search_societe_country" value="'.dol_escape_htmltag($search_societe_country).
'">';
1314if (!empty($arrayfields[
'commercial'][
'checked'])) {
1315 print
'<td class="liste_titre"> </td>';
1318if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1319 print
'<td class="liste_titre center">';
1320 print
'<div class="nowrapfordate">';
1321 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'));
1323 print
'<div class="nowrapfordate">';
1324 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'));
1329if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1330 print
'<td class="liste_titre center">';
1331 print
'<div class="nowrapfordate">';
1332 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'));
1334 print
'<div class="nowrapfordate">';
1335 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'));
1340if (!empty($arrayfields[
'p.public'][
'checked'])) {
1341 print
'<td class="liste_titre center">';
1342 $array = array(
'' =>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1343 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1346if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1347 print
'<td class="liste_titre center">';
1351if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1352 print
'<td class="liste_titre nowrap center">';
1353 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1356if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1357 print
'<td class="liste_titre nowrap right">';
1358 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1361if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1362 print
'<td class="liste_titre nowrap right">';
1363 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1366if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1367 print
'<td class="liste_titre nowrap right">';
1370if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1371 print
'<td class="liste_titre nowrap right">';
1372 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1375if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1376 print
'<td class="liste_titre nowrap">';
1377 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1381if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1382 print
'<td class="liste_titre nowrap">';
1383 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1386if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1387 print
'<td class="liste_titre nowrap">';
1388 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1391if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1392 print
'<td class="liste_titre nowrap">';
1393 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1396if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1397 print
'<td class="liste_titre nowrap">';
1398 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1401if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1402 print
'<td class="liste_titre nowrap">';
1403 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1406if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1407 print
'<td class="liste_titre nowrap right">';
1408 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1411if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1412 print
'<td class="liste_titre nowrap right">';
1413 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1416if (!empty($arrayfields[
'u.login'][
'checked'])) {
1418 print
'<td class="liste_titre" align="center">';
1419 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1423include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1426$parameters = array(
'arrayfields' => $arrayfields);
1427$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1428print $hookmanager->resPrint;
1430if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1431 print
'<td class="liste_titre center">';
1432 print
'<div class="nowrapfordate">';
1433 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'));
1435 print
'<div class="nowrapfordate">';
1436 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'));
1441if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1442 print
'<td class="liste_titre center">';
1443 print
'<div class="nowrapfordate">';
1444 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'));
1446 print
'<div class="nowrapfordate">';
1447 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'));
1451if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1453 print
'<td class="liste_titre">';
1456if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1458 print
'<td class="liste_titre">';
1459 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1462if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1463 print
'<td class="liste_titre center parentonrightofpage">';
1464 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1469 print
'<td class="liste_titre maxwidthsearch">';
1470 $searchpicto = $form->showFilterButtons();
1476$totalarray = array();
1477$totalarray[
'nbfield'] = 0;
1481print
'<tr class="liste_titre">';
1483 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1484 $totalarray[
'nbfield']++;
1486if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1487 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1488 $totalarray[
'nbfield']++;
1490if (!empty($arrayfields[
'p.title'][
'checked'])) {
1491 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1492 $totalarray[
'nbfield']++;
1494if (!empty($arrayfields[
's.nom'][
'checked'])) {
1495 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1496 $totalarray[
'nbfield']++;
1498if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1500 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1501 $totalarray[
'nbfield']++;
1503if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1504 print_liste_field_titre($arrayfields[
'co.country_code'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code",
"", $param,
"", $sortfield, $sortorder,
'center ');
1505 $totalarray[
'nbfield']++;
1507if (!empty($arrayfields[
'commercial'][
'checked'])) {
1508 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1509 $totalarray[
'nbfield']++;
1511if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1512 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1513 $totalarray[
'nbfield']++;
1515if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1516 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1517 $totalarray[
'nbfield']++;
1519if (!empty($arrayfields[
'p.public'][
'checked'])) {
1520 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1521 $totalarray[
'nbfield']++;
1523if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1524 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1525 $totalarray[
'nbfield']++;
1527if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1528 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1529 $totalarray[
'nbfield']++;
1531if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1532 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1533 $totalarray[
'nbfield']++;
1535if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1536 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1537 $totalarray[
'nbfield']++;
1539if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1540 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1541 $totalarray[
'nbfield']++;
1543if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1544 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1545 $totalarray[
'nbfield']++;
1547if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1548 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1549 $totalarray[
'nbfield']++;
1551if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1552 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1553 $totalarray[
'nbfield']++;
1555if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1556 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1557 $totalarray[
'nbfield']++;
1559if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1560 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1561 $totalarray[
'nbfield']++;
1563if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1564 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1565 $totalarray[
'nbfield']++;
1567if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1568 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1569 $totalarray[
'nbfield']++;
1571if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1572 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1573 $totalarray[
'nbfield']++;
1575if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1576 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1577 $totalarray[
'nbfield']++;
1579if (!empty($arrayfields[
'u.login'][
'checked'])) {
1580 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1581 $totalarray[
'nbfield']++;
1584include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1586$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1587$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1588print $hookmanager->resPrint;
1589if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1590 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1591 $totalarray[
'nbfield']++;
1593if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1594 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1595 $totalarray[
'nbfield']++;
1597if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1598 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1599 $totalarray[
'nbfield']++;
1601if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1602 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1603 $totalarray[
'nbfield']++;
1605if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1606 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1607 $totalarray[
'nbfield']++;
1611 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1612 $totalarray[
'nbfield']++;
1618$savnbfield = $totalarray[
'nbfield'];
1623$imaxinloop = ($limit ? min($num, $limit) : $num);
1624while ($i < $imaxinloop) {
1625 $obj = $db->fetch_object($resql);
1631 $companystatic->id = $obj->socid;
1632 $companystatic->name = $obj->name;
1633 $companystatic->name_alias = $obj->alias;
1634 $companystatic->client = $obj->client;
1635 $companystatic->code_client = $obj->code_client;
1636 $companystatic->email = $obj->email;
1637 $companystatic->phone = $obj->phone;
1638 $companystatic->address = $obj->address;
1639 $companystatic->zip = $obj->zip;
1640 $companystatic->town = $obj->town;
1641 $companystatic->country_code = $obj->country_code;
1647 $object->fk_opp_status = $obj->fk_opp_status;
1648 $object->user_author_id = $obj->fk_user_creat;
1649 $object->date_creation = $db->jdate($obj->date_creation);
1650 $object->date_start = $db->jdate($obj->date_start);
1651 $object->date_end = $db->jdate($obj->date_end);
1652 $object->statut = $obj->status;
1653 $object->status = $obj->status;
1654 $object->public = $obj->public;
1655 $object->opp_percent = $obj->opp_percent;
1656 $object->opp_status = $obj->fk_opp_status;
1657 $object->opp_status_code = $obj->opp_status_code;
1658 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1659 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1660 $object->budget_amount = $obj->budget_amount;
1661 $object->usage_opportunity = $obj->usage_opportunity;
1662 $object->usage_task = $obj->usage_task;
1663 $object->usage_bill_time = $obj->usage_bill_time;
1664 $object->usage_organize_event = $obj->usage_organize_event;
1665 $object->email_msgid = $obj->email_msgid;
1666 $object->import_key = $obj->import_key;
1667 $object->thirdparty = $companystatic;
1671 $stringassignedusers =
'';
1673 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1675 foreach (array(
'internal',
'external') as $source) {
1676 $tab =
$object->liste_contact(-1, $source, 0,
'', 1);
1677 $numcontact = count($tab);
1678 if (!empty($numcontact)) {
1679 foreach ($tab as $contactproject) {
1681 if ($source ==
'internal') {
1682 if (!empty(
$conf->cache[
'user'][$contactproject[
'id']])) {
1683 $c =
$conf->cache[
'user'][$contactproject[
'id']];
1686 $c->fetch($contactproject[
'id']);
1687 $conf->cache[
'user'][$contactproject[
'id']] =
$c;
1690 if (!empty(
$conf->cache[
'contact'][$contactproject[
'id']])) {
1691 $c =
$conf->cache[
'contact'][$contactproject[
'id']];
1694 $c->fetch($contactproject[
'id']);
1695 $conf->cache[
'contact'][$contactproject[
'id']] =
$c;
1698 if (get_class(
$c) ==
'User') {
1699 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1701 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1709 if ($mode ==
'kanban') {
1711 print
'<tr class="trkanban'.(empty($groupby) ?
'' :
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
1714 $groupbyvalue =
'unset';
1715 $groupbyfield =
'unsetfield';
1716 if (!empty($groupby)) {
1717 if (is_null($groupbyold)) {
1718 print
'<div class="box-flex-container-columns kanban">';
1721 if (is_null($obj->$groupbyfield)) {
1722 $groupbyvalue =
'undefined';
1724 $groupbyvalue = $obj->$groupbyfield;
1726 if ($groupbyold !== $groupbyvalue) {
1727 if (!is_null($groupbyold)) {
1730 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1732 if (!is_null($groupbyold) && ($tmpcursor <= $groupbyold)) {
1735 if ($tmpcursor >= $groupbyvalue) {
1739 print
'<div class="box-flex-container-column kanban column';
1740 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1741 print
' kanbancollapsed';
1743 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1744 print
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).
'</div>';
1747 print
'<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $groupbyvalue).
'">';
1748 print
'<div class="kanbanlabel">'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ?
'Undefined' : $groupbyvalues[$groupbyvalue]).
'</div>';
1750 $groupbyold = $groupbyvalue;
1751 } elseif ($i == 0) {
1752 print
'<div class="box-flex-container kanban">';
1757 if ($massactionbutton || $massaction) {
1759 if (in_array(
$object->id, $arrayofselected)) {
1763 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty' => $companystatic,
'selected' => $selected);
1765 print
$object->getKanbanView(
'', $arrayofdata, ($groupby ?
'small' :
''));
1768 if ($i == ($imaxinloop - 1)) {
1770 if (!empty($groupby)) {
1772 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1774 if ($tmpcursor <= $groupbyvalue) {
1778 print
'<div class="box-flex-container-column kanban column';
1779 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1780 print
' kanbancollapsed';
1782 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1783 print
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ?
'Undefined' : $tmpgroupbyvalue).
'</div>';
1795 $userstatic->id = $obj->fk_user_creat;
1796 $userstatic->login = $obj->login;
1797 $userstatic->lastname = $obj->lastname;
1798 $userstatic->firstname = $obj->firstname;
1799 $userstatic->email = $obj->user_email;
1800 $userstatic->status = $obj->user_statut;
1801 $userstatic->entity = $obj->entity;
1802 $userstatic->photo = $obj->photo;
1803 $userstatic->office_phone = $obj->office_phone;
1804 $userstatic->office_fax = $obj->office_fax;
1805 $userstatic->user_mobile = $obj->user_mobile;
1806 $userstatic->job = $obj->job;
1807 $userstatic->gender = $obj->gender;
1811 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 &&
$object->status > 1) ?
'opacitymedium' :
'').
'">';
1814 print
'<td class="nowrap center">';
1815 if ($massactionbutton || $massaction) {
1817 if (in_array(
$object->id, $arrayofselected)) {
1820 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1824 $totalarray[
'nbfield']++;
1828 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1829 print
'<td class="nowraponall tdoverflowmax200">';
1830 print
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ?
'eventorganization' :
''));
1836 $totalarray[
'nbfield']++;
1840 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1841 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1845 $totalarray[
'nbfield']++;
1849 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1850 print
'<td class="tdoverflowmax125">';
1852 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1858 $totalarray[
'nbfield']++;
1862 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1863 print
'<td class="tdoverflowmax100">';
1865 print $companystatic->name_alias;
1871 $totalarray[
'nbfield']++;
1875 if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1876 print
'<td class="tdoverflowmax125 center">';
1877 print $obj->country_code;
1880 $totalarray[
'nbfield']++;
1884 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1885 print
'<td class="tdoverflowmax150">';
1887 $companystatic->id = $obj->socid;
1888 $companystatic->name = $obj->name;
1889 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1890 $nbofsalesrepresentative = count($listsalesrepresentatives);
1891 if ($nbofsalesrepresentative > 6) {
1893 print $nbofsalesrepresentative;
1894 } elseif ($nbofsalesrepresentative > 0) {
1895 $userstatic =
new User($db);
1897 foreach ($listsalesrepresentatives as $val) {
1898 $userstatic->id = $val[
'id'];
1899 $userstatic->lastname = $val[
'lastname'];
1900 $userstatic->firstname = $val[
'firstname'];
1901 $userstatic->email = $val[
'email'];
1902 $userstatic->status = $val[
'statut'];
1903 $userstatic->entity = $val[
'entity'];
1904 $userstatic->photo = $val[
'photo'];
1905 $userstatic->login = $val[
'login'];
1906 $userstatic->office_phone = $val[
'office_phone'];
1907 $userstatic->office_fax = $val[
'office_fax'];
1908 $userstatic->user_mobile = $val[
'user_mobile'];
1909 $userstatic->job = $val[
'job'];
1910 $userstatic->gender = $val[
'gender'];
1911 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1913 if ($j < $nbofsalesrepresentative) {
1924 $totalarray[
'nbfield']++;
1929 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1930 print
'<td class="center">';
1934 $totalarray[
'nbfield']++;
1938 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1939 print
'<td class="center">';
1943 $totalarray[
'nbfield']++;
1948 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1949 print
'<td class="center">';
1951 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1954 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1959 $totalarray[
'nbfield']++;
1963 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1964 print
'<td class="center nowraponall tdoverflowmax200">';
1965 print $stringassignedusers;
1968 $totalarray[
'nbfield']++;
1972 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1974 if ($obj->opp_status_code) {
1975 $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
1976 if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
1977 $s .=
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
1980 print
'<td class="center tdoverflowmax150" title="'.$s.
'">';
1984 $totalarray[
'nbfield']++;
1988 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1989 print
'<td class="right">';
1991 if (isset($obj->opp_amount) && strcmp($obj->opp_amount,
'')) {
1992 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1993 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
1994 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
1996 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
2001 $totalarray[
'nbfield']++;
2004 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.opp_amount';
2008 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
2009 print
'<td class="right">';
2010 if ($obj->opp_percent) {
2011 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
2015 $totalarray[
'nbfield']++;
2019 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
2020 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
2021 $totalarray[
'val'][
'opp_weighted_amount'] = 0;
2023 print
'<td align="right">';
2024 if ($obj->opp_weighted_amount) {
2025 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2026 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
2030 $totalarray[
'nbfield']++;
2031 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'opp_weighted_amount';
2035 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
2036 print
'<td class="right">';
2037 if ($obj->budget_amount !=
'') {
2038 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
2039 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
2040 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
2042 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
2047 $totalarray[
'nbfield']++;
2048 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.budget_amount';
2052 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
2053 print
'<td class="">';
2054 if ($obj->usage_opportunity) {
2055 print
yn($obj->usage_opportunity);
2059 $totalarray[
'nbfield']++;
2063 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
2064 print
'<td class="">';
2065 if ($obj->usage_task) {
2066 print
yn($obj->usage_task);
2070 $totalarray[
'nbfield']++;
2074 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
2075 print
'<td class="">';
2076 if ($obj->usage_bill_time) {
2077 print
yn($obj->usage_bill_time);
2081 $totalarray[
'nbfield']++;
2085 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
2086 print
'<td class="">';
2087 if ($obj->usage_organize_event) {
2088 print
yn($obj->usage_organize_event);
2092 $totalarray[
'nbfield']++;
2096 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
2097 print
'<td class="">';
2098 if ($obj->accept_conference_suggestions) {
2099 print
yn($obj->accept_conference_suggestions);
2103 $totalarray[
'nbfield']++;
2107 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
2108 print
'<td class="">';
2109 if ($obj->accept_booth_suggestions) {
2110 print
yn($obj->accept_booth_suggestions);
2114 $totalarray[
'nbfield']++;
2118 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
2119 print
'<td class="right">';
2120 if ($obj->price_registration !=
'') {
2121 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
2122 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
2126 $totalarray[
'nbfield']++;
2129 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_registration';
2133 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
2134 print
'<td class="right">';
2135 if ($obj->price_booth !=
'') {
2136 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
2137 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
2141 $totalarray[
'nbfield']++;
2144 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_booth';
2148 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2149 print
'<td class="center tdoverflowmax150">';
2150 if ($userstatic->id) {
2151 print $userstatic->getNomUrl(-1);
2155 $totalarray[
'nbfield']++;
2159 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2161 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2162 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2163 print $hookmanager->resPrint;
2165 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2166 print
'<td class="center nowraponall">';
2167 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2170 $totalarray[
'nbfield']++;
2174 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2175 print
'<td class="center nowraponall">';
2176 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2179 $totalarray[
'nbfield']++;
2183 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2184 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2188 $totalarray[
'nbfield']++;
2192 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2193 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2195 $totalarray[
'nbfield']++;
2199 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2200 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2202 $totalarray[
'nbfield']++;
2207 print
'<td class="nowrap center">';
2208 if ($massactionbutton || $massaction) {
2210 if (in_array(
$object->id, $arrayofselected)) {
2213 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2217 $totalarray[
'nbfield']++;
2228include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2233 foreach ($arrayfields as $key => $val) {
2234 if (!empty($val[
'checked'])) {
2238 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2243$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2244$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2245print $hookmanager->resPrint;
2247print
'</table>'.
"\n";
2250print
'</form>'.
"\n";
2252if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2253 $hidegeneratedfilelistifempty = 1;
2254 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2255 $hidegeneratedfilelistifempty = 0;
2258 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2262 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2263 $urlsource .= str_replace(
'&',
'&', $param);
2265 $filedir = $diroutputmassaction;
2266 $genallowed = $permissiontoread;
2267 $delallowed = $permissiontoadd;
2269 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
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.