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');
108$search_entity = ($user->entity > 0 ? $user->entity :
GETPOSTINT(
'search_entity'));
110$search_ref =
GETPOST(
"search_ref",
'alpha');
111$search_label =
GETPOST(
"search_label",
'alpha');
112$search_societe =
GETPOST(
"search_societe",
'alpha');
113$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
114$search_societe_country =
GETPOST(
"search_societe_country",
'alpha');
115$search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
116$search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
117$search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
118$search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
119$search_public =
GETPOST(
"search_public",
'intcomma');
120$search_project_user =
GETPOSTINT(
'search_project_user');
121$search_project_contact =
GETPOSTINT(
'search_project_contact');
123$search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'intcomma');
124$search_usage_task =
GETPOST(
'search_usage_task',
'intcomma');
125$search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'intcomma');
126$search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'intcomma');
127$search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'intcomma');
128$search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'intcomma');
129$search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
130$search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
131$search_login =
GETPOST(
'search_login',
'alpha');
132$search_import_key =
GETPOST(
'search_import_key',
'alpha');
133$searchCategoryCustomerOperator = 0;
134if (GETPOSTISSET(
'formfilteraction')) {
135 $searchCategoryCustomerOperator =
GETPOSTINT(
'search_category_customer_operator');
137 $searchCategoryCustomerOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
139$searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
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') :
'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' => $langs->trans(
"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' => $langs->trans(
"SaleRepresentativesOfThirdParty"),
'checked' => 0,
'position' => 25);
263$arrayfields[
'c.assigned'] = array(
'label' => $langs->trans(
"AssignedTo"),
'checked' => 1,
'position' => 120);
264$arrayfields[
'opp_weighted_amount'] = array(
'label' => $langs->trans(
'OpportunityWeightedAmountShort'),
'checked' => 0,
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ? 0 : 1),
'position' => 106);
265$arrayfields[
'u.login'] = array(
'label' =>
"Author",
'checked' => -1,
'position' => 165);
267if (
GETPOST(
'search_usage_opportunity')) {
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();
296if ($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;
593if ($search_entity > 0) {
594 $sql .=
" WHERE p.entity = ".((int) $search_entity);
596 $sql .=
" WHERE p.entity IN (".getEntity(
'project', (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
')';
598if (!$user->hasRight(
'projet',
'all',
'lire')) {
599 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
603 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
611if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
612 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
614 if ($search_societe) {
617 if ($search_societe_alias) {
621if ($search_societe_country) {
624if ($search_opp_amount) {
627if ($search_opp_percent) {
630$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
631$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
633if ($search_date_start_start) {
634 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
636if ($search_date_start_end) {
637 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
640if ($search_date_end_start) {
641 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
643if ($search_date_end_end) {
644 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
647if ($search_date_creation_start) {
648 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
650if ($search_date_creation_end) {
651 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
654if ($search_date_modif_start) {
655 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
657if ($search_date_modif_end) {
658 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
662 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
664if ($search_status !=
'' && $search_status !=
'-1') {
665 if ($search_status == 99) {
666 $sql .=
" AND p.fk_statut IN (0,1)";
668 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
671if ($search_option ==
'late') {
672 $sql .=
" AND p.datee < '".$db->idate(
dol_now() -
$conf->project->warning_delay).
"'";
674if ($search_opp_status) {
675 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
676 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
678 if ($search_opp_status ==
'all') {
679 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
681 if ($search_opp_status ==
'openedopp') {
682 $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'))";
684 if ($search_opp_status ==
'notopenedopp') {
685 $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'))";
687 if ($search_opp_status ==
'none') {
688 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
691if ($search_public !=
'') {
692 $sql .=
" AND p.public = ".((int) $search_public);
697if ($search_sale && $search_sale !=
'-1') {
698 if ($search_sale == -2) {
699 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
700 } elseif ($search_sale > 0) {
701 $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).
")";
704if ($search_project_user > 0) {
705 $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).
")";
707if ($search_project_contact > 0) {
708 $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).
")";
710if ($search_opp_amount !=
'') {
713if ($search_budget_amount !=
'') {
714 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
716if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
717 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
719if ($search_usage_task !=
'' && $search_usage_task >= 0) {
722if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
723 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
725if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
726 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
728if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
729 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
731if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
732 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
734if ($search_price_registration !=
'') {
735 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
737if ($search_price_booth !=
'') {
741 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
743if ($search_import_key) {
744 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
747 if ($search_omitChildren == 1) {
748 $sql .=
" AND p.fk_project IS NULL";
753$searchCategoryProjectList = $search_category_array;
754$searchCategoryProjectOperator = 0;
755if (!empty($searchCategoryProjectList)) {
756 $searchCategoryProjectSqlList = array();
757 $listofcategoryid =
'';
758 foreach ($searchCategoryProjectList as $searchCategoryProject) {
759 if (intval($searchCategoryProject) == -2) {
760 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
761 } elseif (intval($searchCategoryProject) > 0) {
762 if ($searchCategoryProjectOperator == 0) {
763 $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).
")";
765 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
769 if ($listofcategoryid) {
770 $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).
"))";
772 if ($searchCategoryProjectOperator == 1) {
773 if (!empty($searchCategoryProjectSqlList)) {
774 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
777 if (!empty($searchCategoryProjectSqlList)) {
778 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
782$searchCategoryCustomerSqlList = array();
783if ($searchCategoryCustomerOperator == 1) {
784 $existsCategoryCustomerList = array();
785 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
786 if (intval($searchCategoryCustomer) == -2) {
787 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
788 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
789 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
790 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
791 $sqlCategoryCustomerNotExists .=
" )";
792 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
793 } elseif (intval($searchCategoryCustomer) > 0) {
794 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
797 if (!empty($existsCategoryCustomerList)) {
798 $sqlCategoryCustomerExists =
" EXISTS (";
799 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
800 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
801 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
802 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
803 $sqlCategoryCustomerExists .=
" )";
804 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
806 if (!empty($searchCategoryCustomerSqlList)) {
807 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
810 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
811 if (intval($searchCategoryCustomer) == -2) {
812 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
813 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
814 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
815 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
816 $sqlCategoryCustomerNotExists .=
" )";
817 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
818 } elseif (intval($searchCategoryCustomer) > 0) {
819 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
822 if (!empty($searchCategoryCustomerSqlList)) {
823 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
827include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
829$parameters = array();
830$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
831$sql .= $hookmanager->resPrint;
835$nbtotalofrecords =
'';
838 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
839 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
840 $resql = $db->query($sqlforcount);
842 $objforcount = $db->fetch_object($resql);
843 $nbtotalofrecords = $objforcount->nbtotalofrecords;
848 if (($page * $limit) > $nbtotalofrecords) {
856$sql .= $db->order($sortfield, $sortorder);
858 $sql .= $db->plimit($limit + 1, $offset);
862$resql = $db->query($sql);
868$num = $db->num_rows($resql);
871if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
872 $obj = $db->fetch_object($resql);
873 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
881llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist mod-project page-list');
883$arrayofselected = is_array($toselect) ? $toselect : array();
887 $param .=
'&mode='.urlencode($mode);
889if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
890 $param .=
'&contextpage='.urlencode($contextpage);
892if ($limit > 0 && $limit !=
$conf->liste_limit) {
893 $param .=
'&limit='.((int) $limit);
895if ($optioncss !=
'') {
896 $param .=
'&optioncss='.urlencode($optioncss);
898if ($search_all !=
'') {
899 $param .=
'&search_all='.urlencode($search_all);
901if ($search_entity !=
'') {
902 $param .=
'&search_entity='.((int) $search_entity);
905 $param .=
'&groupby='.urlencode($groupby);
909 $param .=
'&socid='.urlencode((
string) $socid);
912 $param .=
'&search_sday='.urlencode((
string) ($search_sday));
915 $param .=
'&search_smonth='.urlencode((
string) ($search_smonth));
918 $param .=
'&search_syear='.urlencode((
string) ($search_syear));
921 $param .=
'&search_eday='.urlencode((
string) ($search_eday));
924 $param .=
'&search_emonth='.urlencode((
string) ($search_emonth));
927 $param .=
'&search_eyear='.urlencode((
string) ($search_eyear));
929if ($search_date_start_startmonth) {
930 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
932if ($search_date_start_startyear) {
933 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
935if ($search_date_start_startday) {
936 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
938if ($search_date_start_start) {
939 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
941if ($search_date_start_endmonth) {
942 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
944if ($search_date_start_endyear) {
945 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
947if ($search_date_start_endday) {
948 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
950if ($search_date_start_end) {
951 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
953if ($search_date_end_startmonth) {
954 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
956if ($search_date_end_startyear) {
957 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
959if ($search_date_end_startday) {
960 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
962if ($search_date_end_start) {
963 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
965if ($search_date_end_endmonth) {
966 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
968if ($search_date_end_endyear) {
969 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
971if ($search_date_end_endday) {
972 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
974if ($search_date_end_end) {
975 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
977if ($search_date_creation_startmonth) {
978 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
980if ($search_date_creation_startyear) {
981 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
983if ($search_date_creation_startday) {
984 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
986if ($search_date_creation_start) {
987 $param .=
'&search_date_creation_start='.urlencode($search_date_creation_start);
989if ($search_date_creation_endmonth) {
990 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
992if ($search_date_creation_endyear) {
993 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
995if ($search_date_creation_endday) {
996 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
998if ($search_date_creation_end) {
999 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
1001if ($search_date_modif_startmonth) {
1002 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
1004if ($search_date_modif_startyear) {
1005 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
1007if ($search_date_modif_startday) {
1008 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
1010if ($search_date_modif_start) {
1011 $param .=
'&search_date_modif_start='.urlencode($search_date_modif_start);
1013if ($search_date_modif_endmonth) {
1014 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
1016if ($search_date_modif_endyear) {
1017 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
1019if ($search_date_modif_endday) {
1020 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1022if ($search_date_modif_end) {
1023 $param .=
'&search_date_modif_end=' . urlencode($search_date_modif_end);
1025if (!empty($search_category_array)) {
1026 foreach ($search_category_array as $tmpval) {
1027 $param .=
'&search_categegory_project_list[]='.urlencode($tmpval);
1030if ($search_ref !=
'') {
1031 $param .=
'&search_ref='.urlencode($search_ref);
1033if ($search_label !=
'') {
1034 $param .=
'&search_label='.urlencode($search_label);
1036if ($search_societe !=
'') {
1037 $param .=
'&search_societe='.urlencode($search_societe);
1039if ($search_societe_alias !=
'') {
1040 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1042if ($search_societe_country !=
'') {
1043 $param .=
'&search_societe_country='.urlencode($search_societe_country);
1045if ($search_status !=
'' && $search_status !=
'-1') {
1046 $param .=
"&search_status=".urlencode($search_status);
1048if ($search_option) {
1049 $param .=
"&search_option=".urlencode($search_option);
1051if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
1052 $param .=
'&search_opp_status='.urlencode($search_opp_status);
1054if ($search_opp_percent !=
'') {
1055 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
1057if ($search_public !=
'') {
1058 $param .=
'&search_public='.urlencode($search_public);
1060if ($search_project_user > 0) {
1061 $param .=
'&search_project_user='.urlencode((
string) $search_project_user);
1063if ($search_project_contact > 0) {
1064 $param .=
'&search_project_contact='.urlencode((
string) ($search_project_contact));
1066if ($search_sale > 0) {
1067 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
1069if ($search_opp_amount !=
'') {
1070 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
1072if ($search_budget_amount !=
'') {
1073 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
1075if ($search_usage_task !=
'') {
1076 $param .=
'&search_usage_task='.urlencode($search_usage_task);
1078if ($search_usage_bill_time !=
'') {
1079 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
1081if ($search_usage_event_organization !=
'') {
1082 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
1084if ($search_accept_conference_suggestions !=
'') {
1085 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
1087if ($search_accept_booth_suggestions !=
'') {
1088 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
1090if ($search_price_registration !=
'') {
1091 $param .=
'&search_price_registration='.urlencode($search_price_registration);
1093if ($search_price_booth !=
'') {
1094 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1097 $param .=
'&search_login='.urlencode($search_login);
1099if ($search_import_key) {
1100 $param .=
'&search_import_key='.urlencode($search_import_key);
1102foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1103 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1106include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1109$parameters = array(
'param' => &$param);
1110$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1111$param .= $hookmanager->resPrint;
1114$arrayofmassactions = array(
1115 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1116 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1121if ($user->hasRight(
'projet',
'creer')) {
1122 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1123 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1125if ($user->hasRight(
'projet',
'supprimer')) {
1126 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1128if (isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1129 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1131if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1132 $arrayofmassactions = array();
1135$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1137$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1138if (!empty($socid)) {
1139 $url .=
'&socid='.$socid;
1141if ($search_usage_event_organization == 1) {
1142 $url .=
'&usage_organize_event=1';
1143 if (((
int) $search_usage_opportunity) < 1) {
1144 $url .=
'&usage_opportunity=0';
1149$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'));
1150$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'));
1152$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1154print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1155if ($optioncss !=
'') {
1156 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1158print
'<input type="hidden" name="token" value="'.newToken().
'">';
1159print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1160print
'<input type="hidden" name="action" value="list">';
1161print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1162print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1163print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1164print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1165print
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
1169if ($search_project_user == $user->id) {
1170 $texthelp .= $langs->trans(
"MyProjectsDesc");
1172 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1173 $texthelp .= $langs->trans(
"ProjectsDesc");
1175 $texthelp .= $langs->trans(
"ProjectsPublicDesc");
1179print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1182$topicmail =
"Information";
1183$modelmail =
"project";
1185$trackid =
'proj'.$object->id;
1186include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1189 foreach ($fieldstosearchall as $key => $val) {
1190 $fieldstosearchall[$key] = $langs->trans($val);
1192 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1198$moreforfilter .=
'<div class="divsearchfield">';
1199$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1202if (!$user->hasRight(
'user',
'user',
'lire')) {
1203 $includeonly = array($user->id);
1205$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');
1206$moreforfilter .=
'</div>';
1208$moreforfilter .=
'<div class="divsearchfield">';
1209$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1210$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1212$moreforfilter .=
'</div>';
1215if ($user->hasRight(
'user',
'user',
'lire')) {
1216 $langs->load(
"commercial");
1217 $moreforfilter .=
'<div class="divsearchfield">';
1218 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1219 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1220 $moreforfilter .=
'</div>';
1224if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1226 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth300imp minwidth300 widthcentpercentminusx');
1230if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire')) {
1232 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
1236$moreforfilter .=
'<div class="divsearchfield">';
1237$moreforfilter .= $langs->trans(
'Alert').
' <input type="checkbox" name="search_option" value="late"'.($search_option ==
'late' ?
' checked' :
'').
'>';
1238$moreforfilter .=
'</div>';
1242 $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"' :
'').
'"> ';
1245if (!empty($moreforfilter)) {
1246 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1247 print $moreforfilter;
1248 $parameters = array();
1249 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1250 print $hookmanager->resPrint;
1254$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1255$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1256$selectedfields = ($mode !=
'kanban' ? $htmlofselectarray :
'');
1257$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1260print
'<div class="div-table-responsive">';
1261print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1265print
'<tr class="liste_titre_filter">';
1268 print
'<td class="liste_titre maxwidthsearch">';
1269 $searchpicto = $form->showFilterButtons(
'left');
1274if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1275 print
'<td class="liste_titre">';
1276 print
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
1280if (!empty($arrayfields[
'p.title'][
'checked'])) {
1281 print
'<td class="liste_titre">';
1282 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1286if (!empty($arrayfields[
's.nom'][
'checked'])) {
1287 print
'<td class="liste_titre">';
1289 $tmpthirdparty =
new Societe($db);
1290 $tmpthirdparty->fetch($socid);
1291 $search_societe = $tmpthirdparty->name;
1293 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1298if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1299 print
'<td class="liste_titre">';
1301 $tmpthirdparty =
new Societe($db);
1302 $tmpthirdparty->fetch($socid);
1303 $search_societe_alias = $tmpthirdparty->name_alias;
1305 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1309if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1310 print
'<td class="liste_titre">';
1311 print
'<input type="text" class="flat width50" name="search_societe_country" value="'.dol_escape_htmltag($search_societe_country).
'">';
1315if (!empty($arrayfields[
'commercial'][
'checked'])) {
1316 print
'<td class="liste_titre"> </td>';
1319if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1320 print
'<td class="liste_titre center">';
1321 print
'<div class="nowrapfordate">';
1322 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'));
1324 print
'<div class="nowrapfordate">';
1325 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'));
1330if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1331 print
'<td class="liste_titre center">';
1332 print
'<div class="nowrapfordate">';
1333 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'));
1335 print
'<div class="nowrapfordate">';
1336 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'));
1341if (!empty($arrayfields[
'p.public'][
'checked'])) {
1342 print
'<td class="liste_titre center">';
1343 $array = array(
'' =>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1344 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1347if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1348 print
'<td class="liste_titre center">';
1352if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1353 print
'<td class="liste_titre nowrap center">';
1354 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1357if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1358 print
'<td class="liste_titre nowrap right">';
1359 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1362if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1363 print
'<td class="liste_titre nowrap right">';
1364 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1367if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1368 print
'<td class="liste_titre nowrap right">';
1371if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1372 print
'<td class="liste_titre nowrap right">';
1373 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1376if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1377 print
'<td class="liste_titre nowrap">';
1378 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1382if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1383 print
'<td class="liste_titre nowrap">';
1384 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1387if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1388 print
'<td class="liste_titre nowrap">';
1389 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1392if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1393 print
'<td class="liste_titre nowrap">';
1394 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1397if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1398 print
'<td class="liste_titre nowrap">';
1399 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1402if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1403 print
'<td class="liste_titre nowrap">';
1404 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1407if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1408 print
'<td class="liste_titre nowrap right">';
1409 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1412if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1413 print
'<td class="liste_titre nowrap right">';
1414 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1417if (!empty($arrayfields[
'u.login'][
'checked'])) {
1419 print
'<td class="liste_titre" align="center">';
1420 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1424include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1427$parameters = array(
'arrayfields' => $arrayfields);
1428$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1429print $hookmanager->resPrint;
1431if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1432 print
'<td class="liste_titre center">';
1433 print
'<div class="nowrapfordate">';
1434 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'));
1436 print
'<div class="nowrapfordate">';
1437 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'));
1442if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1443 print
'<td class="liste_titre center">';
1444 print
'<div class="nowrapfordate">';
1445 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'));
1447 print
'<div class="nowrapfordate">';
1448 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'));
1452if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1454 print
'<td class="liste_titre">';
1457if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1459 print
'<td class="liste_titre">';
1460 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1463if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1464 print
'<td class="liste_titre center parentonrightofpage">';
1465 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1470 print
'<td class="liste_titre maxwidthsearch">';
1471 $searchpicto = $form->showFilterButtons();
1477$totalarray = array();
1478$totalarray[
'nbfield'] = 0;
1482print
'<tr class="liste_titre">';
1484 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1485 $totalarray[
'nbfield']++;
1487if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1488 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1489 $totalarray[
'nbfield']++;
1491if (!empty($arrayfields[
'p.title'][
'checked'])) {
1492 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1493 $totalarray[
'nbfield']++;
1495if (!empty($arrayfields[
's.nom'][
'checked'])) {
1496 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1497 $totalarray[
'nbfield']++;
1499if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1501 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1502 $totalarray[
'nbfield']++;
1504if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1505 print_liste_field_titre($arrayfields[
'co.country_code'][
'label'], $_SERVER[
"PHP_SELF"],
"co.country_code",
"", $param,
"", $sortfield, $sortorder);
1506 $totalarray[
'nbfield']++;
1508if (!empty($arrayfields[
'commercial'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1510 $totalarray[
'nbfield']++;
1512if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1513 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1514 $totalarray[
'nbfield']++;
1516if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1517 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1518 $totalarray[
'nbfield']++;
1520if (!empty($arrayfields[
'p.public'][
'checked'])) {
1521 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1522 $totalarray[
'nbfield']++;
1524if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1525 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1526 $totalarray[
'nbfield']++;
1528if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1529 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1530 $totalarray[
'nbfield']++;
1532if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1533 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1534 $totalarray[
'nbfield']++;
1536if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1537 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1538 $totalarray[
'nbfield']++;
1540if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1541 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1542 $totalarray[
'nbfield']++;
1544if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1545 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1546 $totalarray[
'nbfield']++;
1548if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1549 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1550 $totalarray[
'nbfield']++;
1552if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1553 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1554 $totalarray[
'nbfield']++;
1556if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1557 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1558 $totalarray[
'nbfield']++;
1560if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1561 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1562 $totalarray[
'nbfield']++;
1564if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1565 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1566 $totalarray[
'nbfield']++;
1568if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1569 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1570 $totalarray[
'nbfield']++;
1572if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1573 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1574 $totalarray[
'nbfield']++;
1576if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1577 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1578 $totalarray[
'nbfield']++;
1580if (!empty($arrayfields[
'u.login'][
'checked'])) {
1581 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1582 $totalarray[
'nbfield']++;
1585include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1587$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1588$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1589print $hookmanager->resPrint;
1590if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1591 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1592 $totalarray[
'nbfield']++;
1594if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1595 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1596 $totalarray[
'nbfield']++;
1598if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1599 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1600 $totalarray[
'nbfield']++;
1602if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1603 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1604 $totalarray[
'nbfield']++;
1606if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1607 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1608 $totalarray[
'nbfield']++;
1612 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1613 $totalarray[
'nbfield']++;
1619$savnbfield = $totalarray[
'nbfield'];
1624$imaxinloop = ($limit ? min($num, $limit) : $num);
1625while ($i < $imaxinloop) {
1626 $obj = $db->fetch_object($resql);
1632 $companystatic->id = $obj->socid;
1633 $companystatic->name = $obj->name;
1634 $companystatic->name_alias = $obj->alias;
1635 $companystatic->client = $obj->client;
1636 $companystatic->code_client = $obj->code_client;
1637 $companystatic->email = $obj->email;
1638 $companystatic->phone = $obj->phone;
1639 $companystatic->address = $obj->address;
1640 $companystatic->zip = $obj->zip;
1641 $companystatic->town = $obj->town;
1642 $companystatic->country_code = $obj->country_code;
1648 $object->fk_opp_status = $obj->fk_opp_status;
1649 $object->user_author_id = $obj->fk_user_creat;
1650 $object->date_creation = $db->jdate($obj->date_creation);
1651 $object->date_start = $db->jdate($obj->date_start);
1652 $object->date_end = $db->jdate($obj->date_end);
1653 $object->statut = $obj->status;
1654 $object->status = $obj->status;
1655 $object->public = $obj->public;
1656 $object->opp_percent = $obj->opp_percent;
1657 $object->opp_status = $obj->fk_opp_status;
1658 $object->opp_status_code = $obj->opp_status_code;
1659 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1660 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1661 $object->budget_amount = $obj->budget_amount;
1662 $object->usage_opportunity = $obj->usage_opportunity;
1663 $object->usage_task = $obj->usage_task;
1664 $object->usage_bill_time = $obj->usage_bill_time;
1665 $object->usage_organize_event = $obj->usage_organize_event;
1666 $object->email_msgid = $obj->email_msgid;
1667 $object->import_key = $obj->import_key;
1668 $object->thirdparty = $companystatic;
1672 $stringassignedusers =
'';
1674 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1676 foreach (array(
'internal',
'external') as $source) {
1677 $tab =
$object->liste_contact(-1, $source, 0,
'', 1);
1678 $numcontact = count($tab);
1679 if (!empty($numcontact)) {
1680 foreach ($tab as $contactproject) {
1682 if ($source ==
'internal') {
1683 if (!empty(
$conf->cache[
'user'][$contactproject[
'id']])) {
1684 $c =
$conf->cache[
'user'][$contactproject[
'id']];
1687 $c->fetch($contactproject[
'id']);
1688 $conf->cache[
'user'][$contactproject[
'id']] = $c;
1691 if (!empty(
$conf->cache[
'contact'][$contactproject[
'id']])) {
1692 $c =
$conf->cache[
'contact'][$contactproject[
'id']];
1695 $c->fetch($contactproject[
'id']);
1696 $conf->cache[
'contact'][$contactproject[
'id']] = $c;
1699 if (get_class($c) ==
'User') {
1700 $stringassignedusers .= $c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1702 $stringassignedusers .= $c->getNomUrl(-2,
'', 0,
'', -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1710 if ($mode ==
'kanban') {
1712 print
'<tr class="trkanban'.(empty($groupby) ?
'' :
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
1715 if (!empty($groupby)) {
1716 if (is_null($groupbyold)) {
1717 print
'<div class="box-flex-container-columns kanban">';
1720 if (is_null($obj->$groupbyfield)) {
1721 $groupbyvalue =
'undefined';
1723 $groupbyvalue = $obj->$groupbyfield;
1725 if ($groupbyold !== $groupbyvalue) {
1726 if (!is_null($groupbyold)) {
1729 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1731 if (!is_null($groupbyold) && ($tmpcursor <= $groupbyold)) {
1734 if ($tmpcursor >= $groupbyvalue) {
1738 print
'<div class="box-flex-container-column kanban column';
1739 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1740 print
' kanbancollapsed';
1742 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1743 print
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).
'</div>';
1746 print
'<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $groupbyvalue).
'">';
1747 print
'<div class="kanbanlabel">'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ?
'Undefined' : $groupbyvalues[$groupbyvalue]).
'</div>';
1749 $groupbyold = $groupbyvalue;
1750 } elseif ($i == 0) {
1751 print
'<div class="box-flex-container kanban">';
1756 if ($massactionbutton || $massaction) {
1758 if (in_array(
$object->id, $arrayofselected)) {
1762 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty' => $companystatic,
'selected' => $selected);
1764 print
$object->getKanbanView(
'', $arrayofdata, ($groupby ?
'small' :
''));
1767 if ($i == ($imaxinloop - 1)) {
1769 if (!empty($groupby)) {
1771 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1773 if ($tmpcursor <= $groupbyvalue) {
1777 print
'<div class="box-flex-container-column kanban column';
1778 if (in_array($tmpcursor, $groupofcollpasedvalues)) {
1779 print
' kanbancollapsed';
1781 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpcursor).
'">';
1782 print
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ?
'Undefined' : $tmpgroupbyvalue).
'</div>';
1794 $userstatic->id = $obj->fk_user_creat;
1795 $userstatic->login = $obj->login;
1796 $userstatic->lastname = $obj->lastname;
1797 $userstatic->firstname = $obj->firstname;
1798 $userstatic->email = $obj->user_email;
1799 $userstatic->status = $obj->user_statut;
1800 $userstatic->entity = $obj->entity;
1801 $userstatic->photo = $obj->photo;
1802 $userstatic->office_phone = $obj->office_phone;
1803 $userstatic->office_fax = $obj->office_fax;
1804 $userstatic->user_mobile = $obj->user_mobile;
1805 $userstatic->job = $obj->job;
1806 $userstatic->gender = $obj->gender;
1810 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 &&
$object->status > 1) ?
'opacitymedium' :
'').
'">';
1813 print
'<td class="nowrap center">';
1814 if ($massactionbutton || $massaction) {
1816 if (in_array(
$object->id, $arrayofselected)) {
1819 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1823 $totalarray[
'nbfield']++;
1827 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1828 print
'<td class="nowraponall tdoverflowmax200">';
1829 print
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ?
'eventorganization' :
''));
1835 $totalarray[
'nbfield']++;
1839 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1840 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1844 $totalarray[
'nbfield']++;
1848 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1849 print
'<td class="tdoverflowmax125">';
1851 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1857 $totalarray[
'nbfield']++;
1861 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1862 print
'<td class="tdoverflowmax100">';
1864 print $companystatic->name_alias;
1870 $totalarray[
'nbfield']++;
1874 if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1875 print
'<td class="tdoverflowmax125">';
1876 print $obj->country_code;
1879 $totalarray[
'nbfield']++;
1883 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1884 print
'<td class="tdoverflowmax150">';
1886 $companystatic->id = $obj->socid;
1887 $companystatic->name = $obj->name;
1888 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1889 $nbofsalesrepresentative = count($listsalesrepresentatives);
1890 if ($nbofsalesrepresentative > 6) {
1892 print $nbofsalesrepresentative;
1893 } elseif ($nbofsalesrepresentative > 0) {
1894 $userstatic =
new User($db);
1896 foreach ($listsalesrepresentatives as $val) {
1897 $userstatic->id = $val[
'id'];
1898 $userstatic->lastname = $val[
'lastname'];
1899 $userstatic->firstname = $val[
'firstname'];
1900 $userstatic->email = $val[
'email'];
1901 $userstatic->status = $val[
'statut'];
1902 $userstatic->entity = $val[
'entity'];
1903 $userstatic->photo = $val[
'photo'];
1904 $userstatic->login = $val[
'login'];
1905 $userstatic->office_phone = $val[
'office_phone'];
1906 $userstatic->office_fax = $val[
'office_fax'];
1907 $userstatic->user_mobile = $val[
'user_mobile'];
1908 $userstatic->job = $val[
'job'];
1909 $userstatic->gender = $val[
'gender'];
1910 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1912 if ($j < $nbofsalesrepresentative) {
1923 $totalarray[
'nbfield']++;
1928 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1929 print
'<td class="center">';
1933 $totalarray[
'nbfield']++;
1937 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1938 print
'<td class="center">';
1942 $totalarray[
'nbfield']++;
1947 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1948 print
'<td class="center">';
1950 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1953 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1958 $totalarray[
'nbfield']++;
1962 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1963 print
'<td class="center nowraponall tdoverflowmax200">';
1964 print $stringassignedusers;
1967 $totalarray[
'nbfield']++;
1971 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1973 if ($obj->opp_status_code) {
1974 $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
1975 if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
1976 $s .=
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
1979 print
'<td class="center tdoverflowmax150" title="'.$s.
'">';
1983 $totalarray[
'nbfield']++;
1987 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1988 print
'<td class="right">';
1990 if (isset($obj->opp_amount) && strcmp($obj->opp_amount,
'')) {
1991 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1992 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
1993 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
1995 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
2000 $totalarray[
'nbfield']++;
2003 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.opp_amount';
2007 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
2008 print
'<td class="right">';
2009 if ($obj->opp_percent) {
2010 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
2014 $totalarray[
'nbfield']++;
2018 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
2019 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
2020 $totalarray[
'val'][
'opp_weighted_amount'] = 0;
2022 print
'<td align="right">';
2023 if ($obj->opp_weighted_amount) {
2024 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2025 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
2029 $totalarray[
'nbfield']++;
2030 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'opp_weighted_amount';
2034 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
2035 print
'<td class="right">';
2036 if ($obj->budget_amount !=
'') {
2037 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
2038 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
2039 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
2041 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
2046 $totalarray[
'nbfield']++;
2047 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.budget_amount';
2051 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
2052 print
'<td class="">';
2053 if ($obj->usage_opportunity) {
2054 print
yn($obj->usage_opportunity);
2058 $totalarray[
'nbfield']++;
2062 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
2063 print
'<td class="">';
2064 if ($obj->usage_task) {
2065 print
yn($obj->usage_task);
2069 $totalarray[
'nbfield']++;
2073 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
2074 print
'<td class="">';
2075 if ($obj->usage_bill_time) {
2076 print
yn($obj->usage_bill_time);
2080 $totalarray[
'nbfield']++;
2084 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
2085 print
'<td class="">';
2086 if ($obj->usage_organize_event) {
2087 print
yn($obj->usage_organize_event);
2091 $totalarray[
'nbfield']++;
2095 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
2096 print
'<td class="">';
2097 if ($obj->accept_conference_suggestions) {
2098 print
yn($obj->accept_conference_suggestions);
2102 $totalarray[
'nbfield']++;
2106 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
2107 print
'<td class="">';
2108 if ($obj->accept_booth_suggestions) {
2109 print
yn($obj->accept_booth_suggestions);
2113 $totalarray[
'nbfield']++;
2117 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
2118 print
'<td class="right">';
2119 if ($obj->price_registration !=
'') {
2120 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
2121 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
2125 $totalarray[
'nbfield']++;
2128 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_registration';
2132 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
2133 print
'<td class="right">';
2134 if ($obj->price_booth !=
'') {
2135 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
2136 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
2140 $totalarray[
'nbfield']++;
2143 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_booth';
2147 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2148 print
'<td class="center tdoverflowmax150">';
2149 if ($userstatic->id) {
2150 print $userstatic->getNomUrl(-1);
2154 $totalarray[
'nbfield']++;
2158 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2160 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2161 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2162 print $hookmanager->resPrint;
2164 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2165 print
'<td class="center nowraponall">';
2166 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2169 $totalarray[
'nbfield']++;
2173 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2174 print
'<td class="center nowraponall">';
2175 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2178 $totalarray[
'nbfield']++;
2182 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2183 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2187 $totalarray[
'nbfield']++;
2191 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2192 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2194 $totalarray[
'nbfield']++;
2198 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2199 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2201 $totalarray[
'nbfield']++;
2206 print
'<td class="nowrap center">';
2207 if ($massactionbutton || $massaction) {
2209 if (in_array(
$object->id, $arrayofselected)) {
2212 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2216 $totalarray[
'nbfield']++;
2227include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2232 foreach ($arrayfields as $key => $val) {
2233 if (!empty($val[
'checked'])) {
2237 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2242$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2243$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2244print $hookmanager->resPrint;
2246print
'</table>'.
"\n";
2249print
'</form>'.
"\n";
2251if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2252 $hidegeneratedfilelistifempty = 1;
2253 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2254 $hidegeneratedfilelistifempty = 0;
2257 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2261 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2262 $urlsource .= str_replace(
'&',
'&', $param);
2264 $filedir = $diroutputmassaction;
2265 $genallowed = $permissiontoread;
2266 $delallowed = $permissiontoadd;
2268 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...
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.