38require
'../main.inc.php';
46require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
51require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
53 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
54 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:int');
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");
76$diroutputmassaction = $conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
79$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
80$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
82if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
92$offset = $limit * $page;
96$search_all =
GETPOST(
'search_all',
'alphanohtml');
98$search_id =
GETPOST(
"search_id",
'alpha');
99$search_ref =
GETPOST(
"search_ref",
'alpha');
100$search_label =
GETPOST(
"search_label",
'alpha');
101$search_societe =
GETPOST(
"search_societe",
'alpha');
102$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
103$search_societe_country =
GETPOST(
"search_societe_country",
'alpha');
104$search_societe_ref_customer =
GETPOST(
"search_societe_ref_customer",
'alpha');
105$search_societe_ref_supplier =
GETPOST(
"search_societe_ref_supplier",
'alpha');
106$search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
107$search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
108$search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
109$search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
110$search_parent_ref =
GETPOST(
'search_parent_ref',
'alpha');
111$search_parent_label =
GETPOST(
'search_parent_label',
'alpha');
112$search_public =
GETPOST(
"search_public",
'intcomma');
113$search_project_user =
GETPOSTINT(
'search_project_user');
114$search_project_contact =
GETPOSTINT(
'search_project_contact');
116$search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'intcomma');
117$search_usage_task =
GETPOST(
'search_usage_task',
'intcomma');
118$search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'intcomma');
119$search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'intcomma');
120$search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'intcomma');
121$search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'intcomma');
122$search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
123$search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
124$search_login =
GETPOST(
'search_login',
'alpha');
125$search_import_key =
GETPOST(
'search_import_key',
'alpha');
127$searchCategoryUserOperator = 0;
128if (GETPOSTISSET(
'formfilteraction')) {
129 $searchCategoryUserOperator =
GETPOSTINT(
'search_category_user_operator');
131 $searchCategoryUserOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_USER_OR_BY_DEFAULT');
134$searchCategoryProjectOperator = 0;
135if (GETPOSTISSET(
'formfilteraction')) {
136 $searchCategoryUserOperator =
GETPOSTINT(
'search_category_project_operator');
138 $searchCategoryUserOperator =
getDolGlobalString(
'MAIN_SEARCH_CAT_PROJECT_OR_BY_DEFAULT');
151$search_omitChildren = 0;
153 $search_omitChildren =
GETPOST(
'search_omitChildren',
'alpha') ==
'on' ? 1 : 0;
157$mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
159 $search_project_user = $user->id;
170$search_date_start_startmonth =
GETPOSTINT(
'search_date_start_startmonth');
171$search_date_start_startyear =
GETPOSTINT(
'search_date_start_startyear');
172$search_date_start_startday =
GETPOSTINT(
'search_date_start_startday');
173$search_date_start_start =
GETPOSTDATE(
'search_date_start_start');
174$search_date_start_endmonth =
GETPOSTINT(
'search_date_start_endmonth');
175$search_date_start_endyear =
GETPOSTINT(
'search_date_start_endyear');
176$search_date_start_endday =
GETPOSTINT(
'search_date_start_endday');
177$search_date_start_end =
GETPOSTDATE(
'search_date_start_end',
'end');
179$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
180$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
181$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
182$search_date_end_start =
GETPOSTDATE(
'search_date_end_start');
183$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
184$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
185$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
186$search_date_end_end =
GETPOSTDATE(
'search_date_end_end',
'end'); ;
188$search_date_creation_startmonth =
GETPOSTINT(
'search_date_creation_startmonth');
189$search_date_creation_startyear =
GETPOSTINT(
'search_date_creation_startyear');
190$search_date_creation_startday =
GETPOSTINT(
'search_date_creation_startday');
191$search_date_creation_start =
GETPOSTDATE(
'search_date_creation_start');
192$search_date_creation_endmonth =
GETPOSTINT(
'search_date_creation_endmonth');
193$search_date_creation_endyear =
GETPOSTINT(
'search_date_creation_endyear');
194$search_date_creation_endday =
GETPOSTINT(
'search_date_creation_endday');
195$search_date_creation_end =
GETPOSTDATE(
'search_date_creation_end',
'end');
197$search_date_modif_startmonth =
GETPOSTINT(
'search_date_modif_startmonth');
198$search_date_modif_startyear =
GETPOSTINT(
'search_date_modif_startyear');
199$search_date_modif_startday =
GETPOSTINT(
'search_date_modif_startday');
200$search_date_modif_start =
GETPOSTDATE(
'search_date_modif_start');
201$search_date_modif_endmonth =
GETPOSTINT(
'search_date_modif_endmonth');
202$search_date_modif_endyear =
GETPOSTINT(
'search_date_modif_endyear');
203$search_date_modif_endday =
GETPOSTINT(
'search_date_modif_endday');
204$search_date_modif_end =
GETPOSTDATE(
'search_date_modif_end',
'end');
206$search_category_array = array();
207$search_category_user_array = array();
210 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
211 $search_category_user_array =
GETPOST(
"search_category_".Categorie::TYPE_USER.
"_list",
"array");
215 $search_status = implode(
',',
GETPOST(
'search_status',
'array:intcomma'));
217 $search_status = (
GETPOST(
'search_status',
'intcomma') !=
'' ?
GETPOST(
'search_status',
'intcomma') : (GETPOSTISSET(
'search_all') ?
'' :
'0,1'));
220$search_option =
GETPOST(
'search_option',
'alpha');
221if ($search_option ==
'late') {
222 $search_status =
'1';
226$hookmanager->initHooks(array(
'projectlist'));
230$extrafields->fetch_name_optionals_label(
$object->table_element);
232$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
234$fieldstosearchall = array();
236foreach (
$object->fields as $key => $val) {
237 if (empty($val[
'searchall'])) {
242 if (!empty($user->socid) && $key ==
"note_private") {
246 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
250$fieldstosearchall[
's.nom'] =
"ThirdPartyName";
251$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
252$fieldstosearchall[
's.code_client'] =
"CustomerCode";
256$arrayfields = array();
257foreach (
$object->fields as $key => $val) {
259 if (!empty($val[
'visible'])) {
260 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
261 $arrayfields[$tableprefix.
'.'.$key] = array(
262 'label' => $val[
'label'],
263 'checked' => (($visible < 0) ?
'0' :
'1'),
264 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
265 'position' => $val[
'position'],
266 'help' => isset($val[
'help']) ? $val[
'help'] :
''
271include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
274$arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 21,
'enabled' => (!
isModEnabled(
'societe') ?
'0' :
'1'));
275$arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'checked' =>
'0',
'position' => 22);
276$arrayfields[
's.code_client'] = array(
'label' =>
"RefCustomer",
'checked' =>
'0',
'position' => 23);
277$arrayfields[
's.code_fournisseur'] = array(
'label' =>
"RefSupplier",
'checked' =>
'0',
'position' => 24);
278$arrayfields[
'co.country_code'] = array(
'label' =>
"Country",
'checked' =>
'-1',
'position' => 25);
279$arrayfields[
'commercial'] = array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' =>
'0',
'position' => 26);
280$arrayfields[
'c.assigned'] = array(
'label' =>
"AssignedTo",
'checked' =>
'1',
'position' => 120);
281$arrayfields[
'opp_weighted_amount'] = array(
'label' =>
'OpportunityWeightedAmountShort',
'checked' =>
'0',
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ?
'0' :
'1'),
'position' => 106);
282$arrayfields[
'u.login'] = array(
'label' =>
"Author",
'checked' =>
'-1',
'position' => 165);
288if (
GETPOST(
'search_usage_event_organization')) {
289 if (array_key_exists(
'p.fk_opp_status', $arrayfields)) {
290 $arrayfields[
'p.fk_opp_status'][
'enabled'] =
'0';
292 if (array_key_exists(
'p.fk_opp_amount', $arrayfields)) {
293 $arrayfields[
'p.opp_amount'][
'enabled'] =
'0';
295 if (array_key_exists(
'p.fk_opp_percent', $arrayfields)) {
296 $arrayfields[
'p.opp_percent'][
'enabled'] =
'0';
298 $arrayfields[
'opp_weighted_amount'][
'enabled'] =
'0';
299 if (array_key_exists(
'p.usage_organize_event', $arrayfields)) {
300 $arrayfields[
'p.usage_organize_event'][
'visible'] =
'1';
301 $arrayfields[
'p.usage_organize_event'][
'checked'] =
'1';
306if ($contextpage ==
'lead') {
307 if (array_key_exists(
'p.fk_opp_status', $arrayfields)) {
308 $arrayfields[
'p.fk_opp_status'][
'enabled'] =
'1';
309 $arrayfields[
'p.fk_opp_status'][
'visible'] =
'1';
319$groupbyvalues = array();
320$groupofcollpasedvalues = array();
322if ($mode ==
'kanbangroupby' && $groupby) {
323 $groupbyfield = preg_replace(
'/[a-z]+\./',
'', $groupby);
324 if (!empty(
$object->fields[$groupbyfield][
'alias'])) {
325 $groupbyfield =
$object->fields[$groupbyfield][
'alias'];
327 if (!in_array(preg_replace(
'/[a-z]+\./',
'', $groupby), array_keys(
$object->fields))) {
330 if (!empty(
$object->fields[$groupby][
'arrayofkeyval'])) {
331 $groupbyvalues =
$object->fields[$groupby][
'arrayofkeyval'];
332 } elseif (!empty(
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'])) {
333 $groupbyvalues =
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'];
340 $sql =
"SELECT cls.rowid, cls.code, cls.percent, cls.label, cls.position";
341 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_lead_status as cls";
342 $sql .=
" WHERE active = 1";
345 $sql .= $db->order(
'cls.position,cls.rowid',
'ASC');
346 $resql = $db->query($sql);
348 $num = $db->num_rows($resql);
351 while ($i < ($num + 1)) {
352 $objp = $db->fetch_object($resql);
353 $groupbyvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
355 if ($objp->code ==
'WON') {
356 $groupofcollpasedvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
357 } elseif ($objp->code ==
'LOST') {
358 $groupofcollpasedvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
371 $groupbystringforsql = $groupby;
373 if ($groupby ==
'p.fk_opp_status') {
374 $groupbystringforsql =
'cls.position,p.fk_opp_status';
377 if ($groupbystringforsql && !preg_match(
'/^'.preg_quote($db->sanitize($groupbystringforsql),
'/').
'/', $sortfield)) {
378 $sortfield = $db->sanitize($groupbystringforsql).($sortfield ?
",".$sortfield :
"");
379 $sortorder =
"ASC".($sortfield ?
",".$sortorder :
"");
389 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
392if (!$user->hasRight(
'project',
'read')) {
402if (
GETPOST(
'cancel',
'alpha')) {
406if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
410$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
411$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
416if (empty($reshook)) {
418 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
421 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
426 $search_societe =
"";
427 $search_societe_ref_customer =
"";
428 $search_societe_ref_supplier =
"";
429 $search_societe_alias =
'';
430 $search_societe_country =
'';
433 $search_opp_status = -1;
434 $search_opp_amount =
'';
435 $search_opp_percent =
'';
436 $search_budget_amount =
'';
437 $search_parent_ref =
'';
438 $search_parent_label =
'';
441 $search_project_user =
'';
442 $search_project_contact =
'';
449 $search_date_start_startmonth =
"";
450 $search_date_start_startyear =
"";
451 $search_date_start_startday =
"";
452 $search_date_start_start =
"";
453 $search_date_start_endmonth =
"";
454 $search_date_start_endyear =
"";
455 $search_date_start_endday =
"";
456 $search_date_start_end =
"";
457 $search_date_end_startmonth =
"";
458 $search_date_end_startyear =
"";
459 $search_date_end_startday =
"";
460 $search_date_end_start =
"";
461 $search_date_end_endmonth =
"";
462 $search_date_end_endyear =
"";
463 $search_date_end_endday =
"";
464 $search_date_end_end =
"";
465 $search_date_creation_startmonth =
"";
466 $search_date_creation_startyear =
"";
467 $search_date_creation_startday =
"";
468 $search_date_creation_start =
"";
469 $search_date_creation_endmonth =
"";
470 $search_date_creation_endyear =
"";
471 $search_date_creation_endday =
"";
472 $search_date_creation_end =
"";
473 $search_date_modif_startmonth =
"";
474 $search_date_modif_startyear =
"";
475 $search_date_modif_startday =
"";
476 $search_date_modif_start =
"";
477 $search_date_modif_endmonth =
"";
478 $search_date_modif_endyear =
"";
479 $search_date_modif_endday =
"";
480 $search_date_modif_end =
"";
481 $search_usage_opportunity =
'';
482 $search_usage_task =
'';
483 $search_usage_bill_time =
'';
484 $search_usage_event_organization =
'';
485 $search_accept_conference_suggestions =
'';
486 $search_accept_booth_suggestions =
'';
487 $search_price_registration =
'';
488 $search_price_booth =
'';
490 $search_import_key =
'';
493 $search_array_options = array();
494 $search_category_array = array();
495 $search_category_user_array = array();
500 $objectclass =
'Project';
501 $objectlabel =
'Project';
502 $permissiontoread = $user->hasRight(
'projet',
'lire');
503 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
504 $permissiontoadd = $user->hasRight(
'projet',
'creer');
505 $uploaddir = $conf->project->dir_output;
508 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
511 if (!$error && $massaction ==
'close' && $user->hasRight(
'projet',
'creer')) {
514 $objecttmp =
new $objectclass($db);
516 foreach ($toselect as $toselectid) {
517 $result = $objecttmp->fetch($toselectid);
519 $userWrite =
$object->restrictedProjectArea($user,
'write');
520 if ($userWrite > 0 && $objecttmp->statut == 1) {
521 $result = $objecttmp->setClose($user);
529 } elseif ($userWrite <= 0) {
530 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
532 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
555unset($_SESSION[
'pageforbacktolist'][
'project']);
557$form =
new Form($db);
559$companystatic =
new Societe($db);
560$taskstatic =
new Task($db);
563$userstatic =
new User($db);
567$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
568$title = $langs->trans(
"LeadsOrProjects");
570 $title = $langs->trans(
"Projects");
573 $title = $langs->trans(
"Leads");
581if (!$user->hasRight(
'projet',
'all',
'lire')) {
582 $projectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
586$listofprojectcontacttype = array();
587$listofprojectcontacttypeexternal = array();
588$sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
589$sql .=
" WHERE ctc.element = '".$db->escape(
$object->element).
"'";
590$resql = $db->query($sql);
592 while ($obj = $db->fetch_object($resql)) {
593 if ($obj->source ==
'internal') {
594 $listofprojectcontacttype[$obj->rowid] = $obj->code;
596 $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
602if (count($listofprojectcontacttype) == 0) {
603 $listofprojectcontacttype[0] =
'0';
605if (count($listofprojectcontacttypeexternal) == 0) {
606 $listofprojectcontacttypeexternal[0] =
'0';
609$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
610$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
615$sql .=
" p.rowid as id, p.ref, p.title, p.fk_statut as status, cls.position, p.fk_project, ";
616$sql .= $db->ifsql(
"p.fk_opp_status IS NULL",
"0",
"p.fk_opp_status").
" as fk_opp_status, p.public, p.fk_user_creat,";
617$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,";
618$sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
619$sql .=
" p.email_msgid, p.import_key,";
620$sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
621$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, s.code_fournisseur,";
622$sql .=
" country.code as country_code,";
623$sql .=
" cls.code as opp_status_code,";
624$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';
626if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
627 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
628 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
632$parameters = array();
633$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
634$sql .= $hookmanager->resPrint;
635$sql = preg_replace(
'/,\s*$/',
'', $sql);
639$sql .=
" FROM ".$db->prefix().$object->table_element.
" as p";
640if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
641 $sql .=
" LEFT JOIN ".$db->prefix().$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
643$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
644$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on country.rowid = s.fk_pays";
645$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
646$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
647$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.$object->table_element.
' AS pa ON p.fk_project = pa.rowid';
652$parameters = array();
653$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
654$sql .= $hookmanager->resPrint;
655if ($search_entity > 0) {
656 $sql .=
" WHERE p.entity = ".((int) $search_entity);
658 $sql .=
" WHERE p.entity IN (".getEntity(
'project').
')';
660if (!$user->hasRight(
'projet',
'all',
'lire')) {
661 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
665 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
676if ($search_parent_ref) {
679if ($search_parent_label) {
682if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
683 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
685 if ($search_societe) {
688 if ($search_societe_alias) {
692if ($search_societe_ref_customer) {
693 $sql .=
natural_search(
's.code_client', $search_societe_ref_customer);
695if ($search_societe_ref_supplier) {
696 $sql .=
natural_search(
's.code_fournisseur', $search_societe_ref_supplier);
698if ($search_societe_country) {
701if ($search_opp_amount) {
704if ($search_opp_percent) {
707$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
708$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
710if ($search_date_start_start) {
711 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
713if ($search_date_start_end) {
714 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
717if ($search_date_end_start) {
718 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
720if ($search_date_end_end) {
721 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
724if ($search_date_creation_start) {
725 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
727if ($search_date_creation_end) {
728 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
731if ($search_date_modif_start) {
732 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
734if ($search_date_modif_end) {
735 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
739 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
741if ($search_status !=
'' && $search_status !=
'-1') {
742 if ($search_status == 99) {
743 $sql .=
" AND p.fk_statut IN (0,1)";
745 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
748if ($search_option ==
'late') {
749 $sql .=
" AND p.datee < '".$db->idate(
dol_now() - $conf->project->warning_delay).
"'";
751if ($search_opp_status) {
752 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
753 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
755 if ($search_opp_status ==
'all') {
756 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
758 if ($search_opp_status ==
'openedopp') {
759 $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'))";
761 if ($search_opp_status ==
'notopenedopp') {
762 $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'))";
764 if ($search_opp_status ==
'none') {
765 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
768if ($search_public !=
'') {
769 $sql .=
" AND p.public = ".((int) $search_public);
774if ($search_sale && $search_sale !=
'-1') {
775 if ($search_sale == -2) {
776 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
777 } elseif ($search_sale > 0) {
778 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
781if ($search_project_user > 0) {
782 $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).
")";
784if ($search_project_contact > 0) {
785 $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).
")";
787if ($search_opp_amount !=
'') {
790if ($search_budget_amount !=
'') {
791 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
793if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
794 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
796if ($search_usage_task !=
'' && $search_usage_task >= 0) {
799if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
800 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
802if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
803 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
805if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
806 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
808if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
809 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
811if ($search_price_registration !=
'') {
812 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
814if ($search_price_booth !=
'') {
818 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
820if ($search_import_key) {
821 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
824 if ($search_omitChildren == 1) {
825 $sql .=
" AND p.fk_project IS NULL";
830$searchCategoryUserList = $search_category_user_array;
831if (!empty($searchCategoryUserList)) {
832 $searchCategoryUserSqlList = array();
833 $listofcategoryid =
'';
834 foreach ($searchCategoryUserList as $searchCategoryUser) {
835 if (intval($searchCategoryUser) == -2) {
836 $searchCategoryUserSqlList[] =
"NOT EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user)";
837 } elseif (intval($searchCategoryUser) > 0) {
838 if ($searchCategoryUserOperator == 0) {
839 $searchCategoryUserSqlList[] =
" EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_user AND ck.fk_categorie = ".((int) $searchCategoryUser).
")";
841 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryUser);
845 if ($listofcategoryid) {
846 $searchCategoryUserSqlList[] =
" EXISTS (SELECT ck.fk_user FROM ".MAIN_DB_PREFIX.
"categorie_user as ck WHERE u.rowid = ck.fk_User AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
848 if ($searchCategoryUserOperator == 1) {
849 if (!empty($searchCategoryUserSqlList)) {
850 $sql .=
" AND (".implode(
' OR ', $searchCategoryUserSqlList).
")";
853 if (!empty($searchCategoryUserSqlList)) {
854 $sql .=
" AND (".implode(
' AND ', $searchCategoryUserSqlList).
")";
860$searchCategoryProjectList = $search_category_array;
861if (!empty($searchCategoryProjectList)) {
862 $searchCategoryProjectSqlList = array();
863 $listofcategoryid =
'';
864 foreach ($searchCategoryProjectList as $searchCategoryProject) {
865 if (intval($searchCategoryProject) == -2) {
866 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
867 } elseif (intval($searchCategoryProject) > 0) {
868 if ($searchCategoryProjectOperator == 0) {
869 $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).
")";
871 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
875 if ($listofcategoryid) {
876 $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).
"))";
878 if ($searchCategoryProjectOperator == 1) {
879 if (!empty($searchCategoryProjectSqlList)) {
880 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
883 if (!empty($searchCategoryProjectSqlList)) {
884 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
938include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
940$parameters = array();
941$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
942$sql .= $hookmanager->resPrint;
946$nbtotalofrecords =
'';
949 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
950 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
951 $resql = $db->query($sqlforcount);
953 $objforcount = $db->fetch_object($resql);
954 $nbtotalofrecords = $objforcount->nbtotalofrecords;
959 if (($page * $limit) > (
int) $nbtotalofrecords) {
967$sql .= $db->order($sortfield, $sortorder);
969 $sql .= $db->plimit($limit + 1, $offset);
973$resql = $db->query($sql);
979$num = $db->num_rows($resql);
982if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
983 $obj = $db->fetch_object($resql);
984 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
992llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-project page-list bodyforlist');
994$arrayofselected = is_array($toselect) ? $toselect : array();
998 $param .=
'&mode='.urlencode($mode);
1000if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
1001 $param .=
'&contextpage='.urlencode($contextpage);
1003if ($limit > 0 && $limit != $conf->liste_limit) {
1004 $param .=
'&limit='.((int) $limit);
1006if ($optioncss !=
'') {
1007 $param .=
'&optioncss='.urlencode($optioncss);
1009if ($search_all !=
'') {
1010 $param .=
'&search_all='.urlencode($search_all);
1012if ($search_entity !=
'') {
1013 $param .=
'&search_entity='.((int) $search_entity);
1015if ($groupby !=
'') {
1016 $param .=
'&groupby='.urlencode($groupby);
1019if ($search_parent_ref !=
'') {
1020 $param .=
'&search_parent_ref='.urlencode($search_parent_ref);
1022if ($search_parent_label !=
'') {
1023 $param .=
'&search_parent_label='.urlencode($search_parent_label);
1027 $param .=
'&socid='.urlencode((
string) $socid);
1030 $param .=
'&search_sday='.urlencode((
string) ($search_sday));
1032if ($search_smonth) {
1033 $param .=
'&search_smonth='.urlencode((
string) ($search_smonth));
1036 $param .=
'&search_syear='.urlencode((
string) ($search_syear));
1039 $param .=
'&search_eday='.urlencode((
string) ($search_eday));
1041if ($search_emonth) {
1042 $param .=
'&search_emonth='.urlencode((
string) ($search_emonth));
1045 $param .=
'&search_eyear='.urlencode((
string) ($search_eyear));
1047if ($search_date_start_startmonth) {
1048 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
1050if ($search_date_start_startyear) {
1051 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
1053if ($search_date_start_startday) {
1054 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
1056if ($search_date_start_start) {
1057 $param .=
'&search_date_start_start='.urlencode((
string) $search_date_start_start);
1059if ($search_date_start_endmonth) {
1060 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
1062if ($search_date_start_endyear) {
1063 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
1065if ($search_date_start_endday) {
1066 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
1068if ($search_date_start_end) {
1069 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
1071if ($search_date_end_startmonth) {
1072 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
1074if ($search_date_end_startyear) {
1075 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
1077if ($search_date_end_startday) {
1078 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
1080if ($search_date_end_start) {
1081 $param .=
'&search_date_end_start='.urlencode((
string) $search_date_end_start);
1083if ($search_date_end_endmonth) {
1084 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
1086if ($search_date_end_endyear) {
1087 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
1089if ($search_date_end_endday) {
1090 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
1092if ($search_date_end_end) {
1093 $param .=
'&search_date_end_end=' . urlencode((
string) $search_date_end_end);
1095if ($search_date_creation_startmonth) {
1096 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
1098if ($search_date_creation_startyear) {
1099 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
1101if ($search_date_creation_startday) {
1102 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
1104if ($search_date_creation_start) {
1105 $param .=
'&search_date_creation_start='.urlencode((
string) $search_date_creation_start);
1107if ($search_date_creation_endmonth) {
1108 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
1110if ($search_date_creation_endyear) {
1111 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
1113if ($search_date_creation_endday) {
1114 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
1116if ($search_date_creation_end) {
1117 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
1119if ($search_date_modif_startmonth) {
1120 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
1122if ($search_date_modif_startyear) {
1123 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
1125if ($search_date_modif_startday) {
1126 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
1128if ($search_date_modif_start) {
1129 $param .=
'&search_date_modif_start='.urlencode((
string) $search_date_modif_start);
1131if ($search_date_modif_endmonth) {
1132 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
1134if ($search_date_modif_endyear) {
1135 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
1137if ($search_date_modif_endday) {
1138 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1140if ($search_date_modif_end) {
1141 $param .=
'&search_date_modif_end=' . urlencode((
string) $search_date_modif_end);
1143if (!empty($search_category_user_array)) {
1144 foreach ($search_category_user_array as $tmpval) {
1145 $param .=
'&search_category_user_list[]='.urlencode($tmpval);
1148if (!empty($search_category_array)) {
1149 foreach ($search_category_array as $tmpval) {
1150 $param .=
'&search_category_project_list[]='.urlencode($tmpval);
1153if (!empty($searchCategoryCustomerList)) {
1154 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1155 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1158if ($search_id !=
'') {
1159 $param .=
'&search_id='.urlencode($search_id);
1161if ($search_ref !=
'') {
1162 $param .=
'&search_ref='.urlencode($search_ref);
1164if ($search_label !=
'') {
1165 $param .=
'&search_label='.urlencode($search_label);
1167if ($search_societe !=
'') {
1168 $param .=
'&search_societe='.urlencode($search_societe);
1170if ($search_societe_alias !=
'') {
1171 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1173if ($search_societe_country !=
'') {
1174 $param .=
'&search_societe_country='.urlencode($search_societe_country);
1176if ($search_societe_ref_customer !=
'') {
1177 $param .=
'&search_societe_ref_customer='.urlencode($search_societe_ref_customer);
1179if ($search_societe_ref_supplier !=
'') {
1180 $param .=
'&search_societe_ref_supplier='.urlencode($search_societe_ref_supplier);
1182if ($search_status !=
'' && $search_status !=
'-1') {
1183 $param .=
"&search_status=".urlencode($search_status);
1185if ($search_option) {
1186 $param .=
"&search_option=".urlencode($search_option);
1188if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
1189 $param .=
'&search_opp_status='.urlencode($search_opp_status);
1191if ($search_opp_percent !=
'') {
1192 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
1194if ($search_public !=
'') {
1195 $param .=
'&search_public='.urlencode($search_public);
1197if ($search_project_user > 0) {
1198 $param .=
'&search_project_user='.urlencode((
string) $search_project_user);
1200if ($search_project_contact > 0) {
1201 $param .=
'&search_project_contact='.urlencode((
string) ($search_project_contact));
1203if ($search_sale > 0) {
1204 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
1206if ($search_opp_amount !=
'') {
1207 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
1209if ($search_budget_amount !=
'') {
1210 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
1212if ($search_usage_opportunity !=
'') {
1213 $param .=
'&search_usage_opportunity='.urlencode($search_usage_opportunity);
1215if ($search_usage_task !=
'') {
1216 $param .=
'&search_usage_task='.urlencode($search_usage_task);
1218if ($search_usage_bill_time !=
'') {
1219 $param .=
'&search_usage_bill_time='.urlencode($search_usage_bill_time);
1221if ($search_usage_event_organization !=
'') {
1222 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
1224if ($search_accept_conference_suggestions !=
'') {
1225 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
1227if ($search_accept_booth_suggestions !=
'') {
1228 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
1230if ($search_price_registration !=
'') {
1231 $param .=
'&search_price_registration='.urlencode($search_price_registration);
1233if ($search_price_booth !=
'') {
1234 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1237 $param .=
'&search_login='.urlencode($search_login);
1239if ($search_import_key) {
1240 $param .=
'&search_import_key='.urlencode($search_import_key);
1243include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1246$parameters = array(
'param' => &$param);
1247$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1248$param .= $hookmanager->resPrint;
1251$arrayofmassactions = array(
1252 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1253 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1258if ($user->hasRight(
'projet',
'creer')) {
1259 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1260 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1262if ($user->hasRight(
'projet',
'supprimer')) {
1263 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1265if (
isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1266 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1268if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1269 $arrayofmassactions = array();
1272$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1274$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1275if (!empty($socid)) {
1276 $url .=
'&socid='.$socid;
1278if ($search_usage_event_organization == 1) {
1279 $url .=
'&usage_organize_event=1';
1280 if (((
int) $search_usage_opportunity) < 1) {
1281 $url .=
'&usage_opportunity=0';
1286$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss' =>
'reposition'));
1287$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss' =>
'reposition'));
1288if ($contextpage ==
'lead') {
1289 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanbanGroupBy'),
'',
'fa fa-grip-vertical imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanbangroupby&groupby=p.fk_opp_status'.preg_replace(
'/(&|\?)*(mode|groupby)=[^&]+/',
'', $param),
'', ($mode ==
'kanbangroupby' ? 2 : 1), array(
'morecss' =>
'reposition'));
1292$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1294print
'<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
1295if ($optioncss !=
'') {
1296 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1298print
'<input type="hidden" name="token" value="'.newToken().
'">';
1299print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1300print
'<input type="hidden" name="action" value="list">';
1301print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1302print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1303print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1304print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1305print
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
1309if ($search_project_user == $user->id) {
1310 $htmltooltip .= $langs->trans(
"MyProjectsDesc");
1312 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1313 $htmltooltip .= $langs->trans(
"ProjectsDesc");
1315 $htmltooltip .= $langs->trans(
"ProjectsPublicDesc");
1319print_barre_liste($form->textwithpicto($title, $htmltooltip), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1322$topicmail =
"Information";
1323$modelmail =
"project";
1325$trackid =
'proj'.$object->id;
1326include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1329 foreach ($fieldstosearchall as $key => $val) {
1330 $fieldstosearchall[$key] = $langs->trans($val);
1332 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1338$moreforfilter .=
'<div class="divsearchfield">';
1339$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1342if (!$user->hasRight(
'user',
'user',
'lire')) {
1343 $includeonly = array($user->id);
1345$moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user :
'',
'search_project_user', $tmptitle, null, 0, $includeonly,
'',
'0', 0, 0,
'', 0,
'',
'maxwidth300 widthcentpercentminusx');
1346$moreforfilter .=
'</div>';
1349if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1350 $langs->load(
"categories");
1352 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_USER, $search_category_user_array,
'minwidth200imp minwidth200 widthcentpercentminusx', -1, 1, 1, $langs->transnoentitiesnoconv(
"UsersCategoryShort"));
1356$moreforfilter .=
'<div class="divsearchfield">';
1357$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1358$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1360$moreforfilter .=
'</div>';
1363if ($user->hasRight(
'user',
'user',
'lire')) {
1364 $langs->load(
"commercial");
1365 $moreforfilter .=
'<div class="divsearchfield">';
1366 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1367 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1368 $moreforfilter .=
'</div>';
1372if (
isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1374 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth200imp minwidth200 widthcentpercentminusx', -1, 1, 1, $langs->transnoentitiesnoconv(
"ProjectsCategoryShort"));
1380 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth200imp minwidth200 widthcentpercentminusx', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
1384$moreforfilter .=
'<div class="divsearchfield">';
1385$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' :
'').
'>';
1386$moreforfilter .=
'</div>';
1390 $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"' :
'').
'"> ';
1393if (!empty($moreforfilter)) {
1394 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1395 print $moreforfilter;
1396 $parameters = array();
1397 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1398 print $hookmanager->resPrint;
1402$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1403$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1404$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
1405$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1408print
'<div class="div-table-responsive">';
1409print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1413print
'<tr class="liste_titre_filter">';
1416 print
'<td class="liste_titre maxwidthsearch" id="action_column_left">';
1417 $searchpicto = $form->showFilterButtons(
'left');
1422if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1423 print
'<td class="liste_titre" id="search_id">';
1424 print
'<input type="text" class="flat width50" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
1428if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1429 print
'<td class="liste_titre" id="search_ref">';
1430 print
'<input type="text" class="flat width75" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1434if (!empty($arrayfields[
'p.title'][
'checked'])) {
1435 print
'<td class="liste_titre" id="search_label">';
1436 print
'<input type="text" class="flat width100" name="search_label" value="'.dol_escape_htmltag($search_label).
'">';
1441if (!empty($arrayfields[
'p.fk_project'][
'checked'])) {
1442 print
'<td class="liste_titre" id="parent_project">';
1443 print
'<div class="nowrap">';
1444 $ref_placeholder = $langs->trans(
'Ref');
1445 print
'<input id="search_parent_ref" placeholder="'.$ref_placeholder.
'" type="text" class="flat width75" name="search_parent_ref" value="'.
dol_escape_htmltag($search_parent_ref).
'">';
1447 print
'<div class="nowrap">';
1448 $label_placeholder = $langs->trans(
'Label');
1449 print
'<input id="search_parent_label" placeholder="'.$label_placeholder.
'" type="text" class="flat width75" name="search_parent_label" value="'.
dol_escape_htmltag($search_parent_label).
'">';
1455if (!empty($arrayfields[
's.nom'][
'checked'])) {
1456 print
'<td class="liste_titre" id="search_societe">';
1458 $tmpthirdparty =
new Societe($db);
1459 $tmpthirdparty->fetch($socid);
1460 $search_societe = $tmpthirdparty->name;
1462 print
'<input type="text" class="flat width100" name="search_societe" value="'.dol_escape_htmltag((
string) $search_societe).
'">';
1467if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1468 print
'<td class="liste_titre" id="search_societe_alias">';
1470 $tmpthirdparty =
new Societe($db);
1471 $tmpthirdparty->fetch($socid);
1472 $search_societe_alias = $tmpthirdparty->name_alias;
1474 print
'<input type="text" class="flat width100" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1479if (!empty($arrayfields[
's.code_client'][
'checked'])) {
1480 print
'<td class="liste_titre" id="search_societe_ref_customer">';
1481 print
'<input type="text" class="flat width75" name="search_societe_ref_customer" value="'.dol_escape_htmltag($search_societe_ref_customer).
'">';
1485if (!empty($arrayfields[
's.code_fournisseur'][
'checked'])) {
1486 print
'<td class="liste_titre" id="search_societe_ref_supplier">';
1487 print
'<input type="text" class="flat width75" name="search_societe_ref_supplier" value="'.dol_escape_htmltag($search_societe_ref_supplier).
'">';
1492if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1493 print
'<td class="liste_titre" id="search_societe_country">';
1494 print
'<input type="text" class="flat width50" name="search_societe_country" value="'.dol_escape_htmltag($search_societe_country).
'">';
1498if (!empty($arrayfields[
'commercial'][
'checked'])) {
1499 print
'<td class="liste_titre" id="sale_representative"> </td>';
1502if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1503 print
'<td class="liste_titre center" id="search_date_start">';
1504 print
'<div class="nowrapfordate">';
1505 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'));
1507 print
'<div class="nowrapfordate">';
1508 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'));
1513if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1514 print
'<td class="liste_titre center" id="search_date_end">';
1515 print
'<div class="nowrapfordate">';
1516 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'));
1518 print
'<div class="nowrapfordate">';
1519 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'));
1524if (!empty($arrayfields[
'p.public'][
'checked'])) {
1525 print
'<td class="liste_titre center">';
1526 $array = array(
'' =>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1527 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1530if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1531 print
'<td class="liste_titre center">';
1535if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1536 print
'<td class="liste_titre nowrap center">';
1537 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1540if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1541 print
'<td class="liste_titre nowrap right" id="search_opp_amount">';
1542 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1545if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1546 print
'<td class="liste_titre nowrap right" id="search_opp_percent">';
1547 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1550if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1551 print
'<td class="liste_titre nowrap right">';
1554if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1555 print
'<td class="liste_titre nowrap right" id="search_budget_amount">';
1556 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1559if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1560 print
'<td class="liste_titre nowrap">';
1561 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1565if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1566 print
'<td class="liste_titre nowrap">';
1567 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1570if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1571 print
'<td class="liste_titre nowrap">';
1572 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1575if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1576 print
'<td class="liste_titre nowrap">';
1577 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1580if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1581 print
'<td class="liste_titre nowrap">';
1582 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1585if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1586 print
'<td class="liste_titre nowrap">';
1587 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1590if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1591 print
'<td class="liste_titre nowrap right" id="search_price_registration">';
1592 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1595if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1596 print
'<td class="liste_titre nowrap right" id="search_price_booth">';
1597 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1600if (!empty($arrayfields[
'u.login'][
'checked'])) {
1602 print
'<td class="liste_titre" align="center" id="search_login">';
1603 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1607include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1610$parameters = array(
'arrayfields' => $arrayfields);
1611$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1612print $hookmanager->resPrint;
1614if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1615 print
'<td class="liste_titre center" id="search_date_creation">';
1616 print
'<div class="nowrapfordate">';
1617 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'));
1619 print
'<div class="nowrapfordate">';
1620 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'));
1625if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1626 print
'<td class="liste_titre center" id="search_date_modif">';
1627 print
'<div class="nowrapfordate">';
1628 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'));
1630 print
'<div class="nowrapfordate">';
1631 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'));
1635if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1637 print
'<td class="liste_titre">';
1640if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1642 print
'<td class="liste_titre" id="search_import_key">';
1643 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1647if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1648 print
'<td class="liste_titre center parentonrightofpage">';
1649 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1654 print
'<td class="liste_titre maxwidthsearch" id="action_column_right">';
1655 $searchpicto = $form->showFilterButtons();
1666print
'<tr class="liste_titre">';
1668 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1671if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1672 print_liste_field_titre($arrayfields[
'p.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
"", $sortfield, $sortorder);
1675if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1676 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1679if (!empty($arrayfields[
'p.title'][
'checked'])) {
1680 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1683if (!empty($arrayfields[
'p.fk_project'][
'checked'])) {
1684 print_liste_field_titre($arrayfields[
'p.fk_project'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_project",
"", $param,
"", $sortfield, $sortorder);
1687if (!empty($arrayfields[
's.nom'][
'checked'])) {
1688 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1691if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1693 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1696if (!empty($arrayfields[
's.code_client'][
'checked'])) {
1697 print_liste_field_titre($arrayfields[
's.code_client'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_client",
"", $param,
"", $sortfield, $sortorder);
1700if (!empty($arrayfields[
's.code_fournisseur'][
'checked'])) {
1701 print_liste_field_titre($arrayfields[
's.code_fournisseur'][
'label'], $_SERVER[
"PHP_SELF"],
"s.code_fournisseur",
"", $param,
"", $sortfield, $sortorder);
1704if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1705 print_liste_field_titre($arrayfields[
'co.country_code'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code",
"", $param,
"", $sortfield, $sortorder,
'center ');
1708if (!empty($arrayfields[
'commercial'][
'checked'])) {
1709 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1712if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1713 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1716if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1717 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1720if (!empty($arrayfields[
'p.public'][
'checked'])) {
1721 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1724if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1725 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1728if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1730 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1733if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1735 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1738if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1740 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1743if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1744 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1747if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1748 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1751if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1752 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1755if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1756 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1759if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1760 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1763if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1765 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1768if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1769 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1772if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1773 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1776if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1777 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1780if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1781 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1784if (!empty($arrayfields[
'u.login'][
'checked'])) {
1785 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1789include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1791$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1792$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1793print $hookmanager->resPrint;
1794if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1795 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1798if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1799 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1802if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1803 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1806if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1807 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1810if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1811 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1816 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1828$imaxinloop = ($limit ? min($num, $limit) : $num);
1829while ($i < $imaxinloop) {
1830 $obj = $db->fetch_object($resql);
1836 $companystatic->id = $obj->socid;
1837 $companystatic->name = $obj->name;
1838 $companystatic->name_alias = $obj->alias;
1839 $companystatic->client = $obj->client;
1840 $companystatic->code_client = $obj->code_client;
1841 $companystatic->code_fournisseur = $obj->code_fournisseur;
1842 $companystatic->email = $obj->email;
1843 $companystatic->phone = $obj->phone;
1844 $companystatic->address = $obj->address;
1845 $companystatic->zip = $obj->zip;
1846 $companystatic->town = $obj->town;
1847 $companystatic->country_code = $obj->country_code;
1853 $object->fk_project = $obj->fk_project;
1854 $object->fk_opp_status = $obj->fk_opp_status;
1855 $object->user_author_id = $obj->fk_user_creat;
1856 $object->date_creation = $db->jdate($obj->date_creation);
1857 $object->date_start = $db->jdate($obj->date_start);
1858 $object->date_end = $db->jdate($obj->date_end);
1859 $object->status = $obj->status;
1860 $object->public = $obj->public;
1861 $object->opp_percent = $obj->opp_percent;
1862 $object->opp_status = $obj->fk_opp_status;
1863 $object->opp_status_code = $obj->opp_status_code;
1864 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1865 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1866 $object->budget_amount = $obj->budget_amount;
1867 $object->usage_opportunity = $obj->usage_opportunity;
1868 $object->usage_task = $obj->usage_task;
1869 $object->usage_bill_time = $obj->usage_bill_time;
1870 $object->usage_organize_event = $obj->usage_organize_event;
1871 $object->email_msgid = $obj->email_msgid;
1872 $object->import_key = $obj->import_key;
1873 $object->thirdparty = $companystatic;
1877 $stringassignedusers =
'';
1879 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1881 foreach (array(
'internal',
'external') as $source) {
1882 $tab =
$object->liste_contact(-1, $source, 0,
'', 1);
1883 $numcontact = count($tab);
1884 if (!empty($numcontact)) {
1885 foreach ($tab as $contactproject) {
1887 if ($source ==
'internal') {
1888 if (!empty($conf->cache[
'user'][$contactproject[
'id']])) {
1889 $c = $conf->cache[
'user'][$contactproject[
'id']];
1892 $c->fetch($contactproject[
'id']);
1893 $conf->cache[
'user'][$contactproject[
'id']] =
$c;
1896 if (!empty($conf->cache[
'contact'][$contactproject[
'id']])) {
1897 $c = $conf->cache[
'contact'][$contactproject[
'id']];
1900 $c->fetch($contactproject[
'id']);
1901 $conf->cache[
'contact'][$contactproject[
'id']] =
$c;
1904 if (get_class(
$c) ==
'User') {
1905 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1907 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1915 if ($mode ==
'kanban' || $mode ==
'kanbangroupby') {
1917 print
'<tr class="trkanban'.(empty($groupby) ?
'' :
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
1920 $groupbyvalue =
'unset';
1921 $groupbyfield =
'unsetfield';
1924 if (!empty($groupby)) {
1925 $groupbyfield = preg_replace(
'/^[a-z]+\./',
'', $groupby);
1929 if (is_null($groupbyold)) {
1930 print
'<div class="box-flex-container-columns kanban">';
1933 if (is_null($obj->$groupbyfield)) {
1934 $groupbyvalue =
'undefined';
1936 $groupbyvalues[0] = array(
'id' =>
'0',
'label' =>
'Undefined');
1938 $groupbyvalue = $obj->$groupbyfield;
1941 if ($groupbyold !== $groupbyvalue) {
1942 if (!is_null($groupbyold)) {
1946 $indexofgroupbyvalue =
null;
1950 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1952 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1953 if ($tmpgroupbyvalue2[
'id'] == $groupbyvalue) {
1954 $indexofgroupbyvalue = $tmpcursor2;
1960 if (!is_null($groupbyold)) {
1961 $indexofgroupbyold =
null;
1962 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1963 if ($tmpgroupbyvalue2[
'id'] == $groupbyold) {
1964 $indexofgroupbyold = $tmpcursor2;
1970 if ($tmpcursor <= $indexofgroupbyold) {
1974 if ($tmpcursor >= $indexofgroupbyvalue) {
1979 print
'<!-- empty column before column of fetched value --><div class="box-flex-container-column kanban column';
1980 if (array_key_exists($tmpcursor, $groupofcollpasedvalues)) {
1981 print
' kanbancollapsed';
1983 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpgroupbyvalue[
'id']).
'" data-groupbyfield="'.$groupbyfield.
'">';
1984 print
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue[
'label']).
'</div>';
1988 print
'<!-- start column for value --><div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/i',
'', $groupbyvalue).
'" data-groupbyfield="'.$groupbyfield.
'">';
1989 print
'<div class="kanbanlabel">'.$langs->trans((is_null($indexofgroupbyvalue) || empty($groupbyvalues[$indexofgroupbyvalue][
'label'])) ?
'Undefined' : $groupbyvalues[$indexofgroupbyvalue][
'label']).
'</div>';
1991 $groupbyold = $groupbyvalue;
1992 } elseif ($i == 0) {
1993 print
'<div class="box-flex-container kanban">';
1998 if ($massactionbutton || $massaction) {
2000 if (in_array(
$object->id, $arrayofselected)) {
2004 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty' => $companystatic,
'selected' => $selected,
'mode' => $mode);
2006 print
$object->getKanbanView(
'', $arrayofdata, ($groupby ?
'small' :
''));
2009 if ($i == ($imaxinloop - 1)) {
2011 if (!empty($groupby)) {
2016 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
2018 $indexofgroupbyvalue =
null;
2019 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
2020 if ($tmpgroupbyvalue2[
'id'] == $groupbyvalue) {
2021 $indexofgroupbyvalue = $tmpcursor2;
2027 if (!is_null($groupbyold)) {
2028 $indexofgroupbyold =
null;
2029 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
2030 if ($tmpgroupbyvalue2[
'id'] == $groupbyold) {
2031 $indexofgroupbyold = $tmpcursor2;
2039 if ($tmpcursor <= $indexofgroupbyvalue) {
2043 print
'<!-- empty column after column of fetched value --><div class="box-flex-container-column kanban column';
2044 if (array_key_exists($tmpcursor, $groupofcollpasedvalues)) {
2045 print
' kanbancollapsed';
2047 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpgroupbyvalue[
'id']).
'" data-groupbyfield="'.$groupbyfield.
'">';
2048 print
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue[
'label']) ?
'Undefined' : $tmpgroupbyvalue[
'label']).
'</div>';
2060 $userstatic->id = $obj->fk_user_creat;
2061 $userstatic->login = $obj->login;
2062 $userstatic->lastname = $obj->lastname;
2063 $userstatic->firstname = $obj->firstname;
2064 $userstatic->email = $obj->user_email;
2065 $userstatic->status = $obj->user_statut;
2066 $userstatic->entity = $obj->entity;
2067 $userstatic->photo = $obj->photo;
2068 $userstatic->office_phone = $obj->office_phone;
2069 $userstatic->office_fax = $obj->office_fax;
2070 $userstatic->user_mobile = $obj->user_mobile;
2071 $userstatic->job = $obj->job;
2072 $userstatic->gender = $obj->gender;
2076 print
'<tr data-rowid="'.$object->id.
'" class="oddeven row-with-select '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 &&
$object->status > 1) ?
'opacitymedium' :
'').
'">';
2079 print
'<td class="nowrap center">';
2080 if ($massactionbutton || $massaction) {
2082 if (in_array(
$object->id, $arrayofselected)) {
2085 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2093 if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
2094 print
'<td class="nowraponall">';
2102 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
2103 print
'<td class="nowraponall tdoverflowmax200">';
2104 print
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ?
'eventorganization' :
''));
2114 if (!empty($arrayfields[
'p.title'][
'checked'])) {
2115 print
'<td class="tdoverflowmax250" title="'.dolPrintHTMLForAttribute($obj->title).
'">';
2123 if (!empty($arrayfields[
'p.fk_project'][
'checked'])) {
2124 print
'<td class="nowraponall">';
2126 $parent_object =
new Project($db);
2127 $parent_result = $parent_object->fetch(
$object->fk_project);
2128 if ($parent_result > 0) {
2129 $accessallowed =
checkUserAccessToObject($user, array(
'projet'), $parent_object,
'projet&project',
'',
'',
'rowid',
'');
2130 if ($accessallowed) {
2131 print $parent_object->getNomUrl(-1);
2133 $parent_url = DOL_URL_ROOT.
'/projet/card.php?id='.
$object->fk_project;
2134 print
'<a href="'.$parent_url.
'">';
2135 print
img_picto(
'',
'warning',
'class="pictofixedwidth error"');
2136 print
'<del title="You do not have access to see parent project">ACCESS DENIED!</del>';
2137 print
img_picto(
'',
'warning',
'class="pictofixedwidth error"');
2141 print ((
int)
$object->fk_project);
2152 if (!empty($arrayfields[
's.nom'][
'checked'])) {
2153 print
'<td class="tdoverflowmax125">';
2155 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
2165 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
2166 print
'<td class="tdoverflowmax100">';
2168 print $companystatic->name_alias;
2178 if (!empty($arrayfields[
's.code_client'][
'checked'])) {
2179 print
'<td class="tdoverflowmax100">';
2181 print $companystatic->code_client;
2191 if (!empty($arrayfields[
's.code_fournisseur'][
'checked'])) {
2192 print
'<td class="tdoverflowmax100">';
2194 print $companystatic->code_fournisseur;
2204 if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
2205 print
'<td class="tdoverflowmax125 center">';
2206 print $obj->country_code;
2213 if (!empty($arrayfields[
'commercial'][
'checked'])) {
2214 print
'<td class="tdoverflowmax150">';
2216 $companystatic->id = $obj->socid;
2217 $companystatic->name = $obj->name;
2218 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2219 $nbofsalesrepresentative = count($listsalesrepresentatives);
2220 if ($nbofsalesrepresentative > 6) {
2222 print $nbofsalesrepresentative;
2223 } elseif ($nbofsalesrepresentative > 0) {
2224 $userstatic =
new User($db);
2226 foreach ($listsalesrepresentatives as $val) {
2227 $userstatic->id = $val[
'id'];
2228 $userstatic->lastname = $val[
'lastname'];
2229 $userstatic->firstname = $val[
'firstname'];
2230 $userstatic->email = $val[
'email'];
2231 $userstatic->status = $val[
'statut'];
2232 $userstatic->entity = $val[
'entity'];
2233 $userstatic->photo = $val[
'photo'];
2234 $userstatic->login = $val[
'login'];
2235 $userstatic->office_phone = $val[
'office_phone'];
2236 $userstatic->office_fax = $val[
'office_fax'];
2237 $userstatic->user_mobile = $val[
'user_mobile'];
2238 $userstatic->job = $val[
'job'];
2239 $userstatic->gender = $val[
'gender'];
2240 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2242 if ($j < $nbofsalesrepresentative) {
2258 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
2259 print
'<td class="center">';
2267 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
2268 print
'<td class="center">';
2277 if (!empty($arrayfields[
'p.public'][
'checked'])) {
2278 print
'<td class="center">';
2280 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
2283 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
2292 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
2293 print
'<td class="center nowraponall tdoverflowmax200">';
2294 print $stringassignedusers;
2301 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
2303 if ($obj->opp_status_code) {
2304 $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
2305 if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
2306 $s .=
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
2309 print
'<td class="center tdoverflowmax150" title="'.$s.
'">';
2317 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
2318 print
'<td class="right">';
2320 if (isset($obj->opp_amount) && strcmp($obj->opp_amount,
'')) {
2321 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2322 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
2323 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
2325 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
2337 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
2338 print
'<td class="right">';
2339 if ($obj->opp_percent) {
2340 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
2348 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
2349 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
2352 print
'<td align="right">';
2353 if ($obj->opp_weighted_amount) {
2354 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2355 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
2364 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
2365 print
'<td class="right">';
2366 if ($obj->budget_amount !=
'') {
2367 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
2368 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
2369 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
2371 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
2381 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
2382 print
'<td class="center">';
2383 if ($obj->usage_opportunity) {
2384 print
yn($obj->usage_opportunity, 4);
2392 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
2393 print
'<td class="center">';
2394 if ($obj->usage_task) {
2395 print
yn($obj->usage_task, 4);
2403 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
2404 print
'<td class="center">';
2405 if ($obj->usage_bill_time) {
2406 print
yn($obj->usage_bill_time, 4);
2414 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
2415 print
'<td class="center">';
2416 if ($obj->usage_organize_event) {
2417 print
yn($obj->usage_organize_event, 4);
2425 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
2426 print
'<td class="center">';
2427 if ($obj->accept_conference_suggestions) {
2428 print
yn($obj->accept_conference_suggestions);
2436 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
2437 print
'<td class="">';
2438 if ($obj->accept_booth_suggestions) {
2439 print
yn($obj->accept_booth_suggestions);
2447 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
2448 print
'<td class="right">';
2449 if ($obj->price_registration !=
'') {
2450 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
2451 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
2462 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
2463 print
'<td class="right">';
2464 if ($obj->price_booth !=
'') {
2465 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
2466 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
2477 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2478 print
'<td class="center tdoverflowmax150">';
2479 if ($userstatic->id) {
2480 print $userstatic->getNomUrl(-1);
2488 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2490 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2491 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2492 print $hookmanager->resPrint;
2494 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2495 print
'<td class="center nowraponall">';
2496 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2503 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2504 print
'<td class="center nowraponall">';
2505 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2512 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2513 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2521 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2522 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2528 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2529 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2536 print
'<td class="nowrap center">';
2537 if ($massactionbutton || $massaction) {
2539 if (in_array(
$object->id, $arrayofselected)) {
2542 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2557include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2562 foreach ($arrayfields as $key => $val) {
2563 if (!empty($val[
'checked'])) {
2567 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2572$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2573$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2574print $hookmanager->resPrint;
2576print
'</table>'.
"\n";
2579print
'</form>'.
"\n";
2581if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2582 $hidegeneratedfilelistifempty = 1;
2583 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2584 $hidegeneratedfilelistifempty = 0;
2587 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2591 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2592 $urlsource .= str_replace(
'&',
'&', $param);
2594 $filedir = $diroutputmassaction;
2595 $genallowed = $permissiontoread;
2596 $delallowed = $permissiontoadd;
2598 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(! $sortfield) if(! $sortorder) $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_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTDATE($prefix, $hourTime='', $gm='auto', $saverestore='')
Helper function that combines values of a dolibarr DatePicker (such as Form\selectDate) for year,...
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
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_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
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.
isModEnabled($module)
Is Dolibarr module enabled.
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...
checkUserAccessToObject($user, array $featuresarray, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='', $dbt_select='rowid', $parenttableforentity='')
Check that access by a given user to an object is ok.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.