37require
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
44if (isModEnabled(
'category')) {
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
46 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
58$langs->loadLangs(array(
'projects',
'companies',
'commercial'));
59if (isModEnabled(
'eventorganization') &&
$conf->eventorganization->enabled) {
60 $langs->loadLangs(array(
'eventorganization'));
63$action =
GETPOST(
'action',
'aZ09');
64$massaction =
GETPOST(
'massaction',
'alpha');
66$confirm =
GETPOST(
'confirm',
'alpha');
67$toselect =
GETPOST(
'toselect',
'array');
68$optioncss =
GETPOST(
'optioncss',
'alpha');
69$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projectlist';
70$mode =
GETPOST(
'mode',
'alpha');
71$groupby =
GETPOST(
'groupby',
'aZ09');
73$title = $langs->trans(
"Projects");
81 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
83if (!$user->hasRight(
'projet',
'lire')) {
87$diroutputmassaction =
$conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
90$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
91$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
93if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
103$offset = $limit * $page;
104$pageprev = $page - 1;
105$pagenext = $page + 1;
107$search_all =
GETPOST(
'search_all',
'alphanohtml');
109$search_id =
GETPOST(
"search_id",
'alpha');
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');
140$search_omitChildren = 0;
142 $search_omitChildren =
GETPOST(
'search_omitChildren',
'alpha') ==
'on' ? 1 : 0;
146$mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
148 $search_project_user = $user->id;
159$search_date_start_startmonth =
GETPOSTINT(
'search_date_start_startmonth');
160$search_date_start_startyear =
GETPOSTINT(
'search_date_start_startyear');
161$search_date_start_startday =
GETPOSTINT(
'search_date_start_startday');
162$search_date_start_start =
GETPOSTDATE(
'search_date_start_start');
163$search_date_start_endmonth =
GETPOSTINT(
'search_date_start_endmonth');
164$search_date_start_endyear =
GETPOSTINT(
'search_date_start_endyear');
165$search_date_start_endday =
GETPOSTINT(
'search_date_start_endday');
166$search_date_start_end =
GETPOSTDATE(
'search_date_start_end',
'end');
168$search_date_end_startmonth =
GETPOSTINT(
'search_date_end_startmonth');
169$search_date_end_startyear =
GETPOSTINT(
'search_date_end_startyear');
170$search_date_end_startday =
GETPOSTINT(
'search_date_end_startday');
171$search_date_end_start =
GETPOSTDATE(
'search_date_end_start');
172$search_date_end_endmonth =
GETPOSTINT(
'search_date_end_endmonth');
173$search_date_end_endyear =
GETPOSTINT(
'search_date_end_endyear');
174$search_date_end_endday =
GETPOSTINT(
'search_date_end_endday');
175$search_date_end_end =
GETPOSTDATE(
'search_date_end_end',
'end'); ;
177$search_date_creation_startmonth =
GETPOSTINT(
'search_date_creation_startmonth');
178$search_date_creation_startyear =
GETPOSTINT(
'search_date_creation_startyear');
179$search_date_creation_startday =
GETPOSTINT(
'search_date_creation_startday');
180$search_date_creation_start =
GETPOSTDATE(
'search_date_creation_start');
181$search_date_creation_endmonth =
GETPOSTINT(
'search_date_creation_endmonth');
182$search_date_creation_endyear =
GETPOSTINT(
'search_date_creation_endyear');
183$search_date_creation_endday =
GETPOSTINT(
'search_date_creation_endday');
184$search_date_creation_end =
GETPOSTDATE(
'search_date_creation_end',
'end');
186$search_date_modif_startmonth =
GETPOSTINT(
'search_date_modif_startmonth');
187$search_date_modif_startyear =
GETPOSTINT(
'search_date_modif_startyear');
188$search_date_modif_startday =
GETPOSTINT(
'search_date_modif_startday');
189$search_date_modif_start =
GETPOSTDATE(
'search_date_modif_start');
190$search_date_modif_endmonth =
GETPOSTINT(
'search_date_modif_endmonth');
191$search_date_modif_endyear =
GETPOSTINT(
'search_date_modif_endyear');
192$search_date_modif_endday =
GETPOSTINT(
'search_date_modif_endday');
193$search_date_modif_end =
GETPOSTDATE(
'search_date_modif_end',
'end');
195$search_category_array = array();
197if (isModEnabled(
'category')) {
198 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
202 $search_status = implode(
',',
GETPOST(
'search_status',
'array:intcomma'));
204 $search_status = (
GETPOST(
'search_status',
'intcomma') !=
'' ?
GETPOST(
'search_status',
'intcomma') : (GETPOSTISSET(
'search_all') ?
'' :
'0,1'));
207$search_option =
GETPOST(
'search_option',
'alpha');
208if ($search_option ==
'late') {
209 $search_status =
'1';
213$hookmanager->initHooks(array(
'projectlist'));
217$extrafields->fetch_name_optionals_label(
$object->table_element);
219$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
221$fieldstosearchall = array();
223foreach (
$object->fields as $key => $val) {
224 if (empty($val[
'searchall'])) {
229 if (!empty($user->socid) && $key ==
"note_private") {
233 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
237$fieldstosearchall[
's.nom'] =
"ThirdPartyName";
238$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
239$fieldstosearchall[
's.code_client'] =
"CustomerCode";
243$arrayfields = array();
244foreach (
$object->fields as $key => $val) {
246 if (!empty($val[
'visible'])) {
247 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
248 $arrayfields[$tableprefix.
'.'.$key] = array(
249 'label' => $val[
'label'],
250 'checked' => (($visible < 0) ?
'0' :
'1'),
251 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
252 'position' => $val[
'position'],
253 'help' => isset($val[
'help']) ? $val[
'help'] :
''
258include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
261$arrayfields[
's.nom'] = array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 21,
'enabled' => (!isModEnabled(
'societe') ?
'0' :
'1'));
262$arrayfields[
's.name_alias'] = array(
'label' =>
"AliasNameShort",
'checked' =>
'0',
'position' => 22);
263$arrayfields[
'co.country_code'] = array(
'label' =>
"Country",
'checked' =>
'-1',
'position' => 23);
264$arrayfields[
'commercial'] = array(
'label' =>
"SaleRepresentativesOfThirdParty",
'checked' =>
'0',
'position' => 25);
265$arrayfields[
'c.assigned'] = array(
'label' =>
"AssignedTo",
'checked' =>
'1',
'position' => 120);
266$arrayfields[
'opp_weighted_amount'] = array(
'label' =>
'OpportunityWeightedAmountShort',
'checked' =>
'0',
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ?
'0' :
'1'),
'position' => 106);
267$arrayfields[
'u.login'] = array(
'label' =>
"Author",
'checked' =>
'-1',
'position' => 165);
273if (
GETPOST(
'search_usage_event_organization')) {
274 if (array_key_exists(
'p.fk_opp_status', $arrayfields)) {
275 $arrayfields[
'p.fk_opp_status'][
'enabled'] =
'0';
277 if (array_key_exists(
'p.fk_opp_amount', $arrayfields)) {
278 $arrayfields[
'p.opp_amount'][
'enabled'] =
'0';
280 if (array_key_exists(
'p.fk_opp_percent', $arrayfields)) {
281 $arrayfields[
'p.opp_percent'][
'enabled'] =
'0';
283 $arrayfields[
'opp_weighted_amount'][
'enabled'] =
'0';
284 if (array_key_exists(
'p.usage_organize_event', $arrayfields)) {
285 $arrayfields[
'p.usage_organize_event'][
'visible'] =
'1';
286 $arrayfields[
'p.usage_organize_event'][
'checked'] =
'1';
289$arrayfields[
'p.fk_project'][
'enabled'] =
'0';
292if ($contextpage ==
'lead') {
293 if (array_key_exists(
'p.fk_opp_status', $arrayfields)) {
294 $arrayfields[
'p.fk_opp_status'][
'enabled'] =
'1';
295 $arrayfields[
'p.fk_opp_status'][
'visible'] =
'1';
305$groupbyvalues = array();
306$groupofcollpasedvalues = array();
308if ($mode ==
'kanbangroupby' && $groupby) {
309 $groupbyfield = preg_replace(
'/[a-z]+\./',
'', $groupby);
310 if (!empty(
$object->fields[$groupbyfield][
'alias'])) {
311 $groupbyfield =
$object->fields[$groupbyfield][
'alias'];
313 if (!in_array(preg_replace(
'/[a-z]+\./',
'', $groupby), array_keys(
$object->fields))) {
316 if (!empty(
$object->fields[$groupby][
'arrayofkeyval'])) {
317 $groupbyvalues =
$object->fields[$groupby][
'arrayofkeyval'];
318 } elseif (!empty(
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'])) {
319 $groupbyvalues =
$object->fields[preg_replace(
'/[a-z]\./',
'', $groupby)][
'arrayofkeyval'];
326 $sql =
"SELECT cls.rowid, cls.code, cls.percent, cls.label, cls.position";
327 $sql .=
" FROM ".MAIN_DB_PREFIX.
"c_lead_status as cls";
328 $sql .=
" WHERE active = 1";
331 $sql .= $db->order(
'cls.position,cls.rowid',
'ASC');
332 $resql = $db->query($sql);
334 $num = $db->num_rows($resql);
337 while ($i < ($num + 1)) {
338 $objp = $db->fetch_object($resql);
339 $groupbyvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
341 if ($objp->code ==
'WON') {
342 $groupofcollpasedvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
343 } elseif ($objp->code ==
'LOST') {
344 $groupofcollpasedvalues[$i] = array(
'id' => (
string) $objp->rowid,
'label' => $objp->label);
357 $groupbystringforsql = $groupby;
359 if ($groupby ==
'p.fk_opp_status') {
360 $groupbystringforsql =
'cls.position,p.fk_opp_status';
363 if ($groupbystringforsql && !preg_match(
'/^'.preg_quote($db->sanitize($groupbystringforsql),
'/').
'/', $sortfield)) {
364 $sortfield = $db->sanitize($groupbystringforsql).($sortfield ?
",".$sortfield :
"");
365 $sortorder =
"ASC".($sortfield ?
",".$sortorder :
"");
375if (
GETPOST(
'cancel',
'alpha')) {
379if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
383$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
384$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
389if (empty($reshook)) {
391 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
394 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
399 $search_societe =
"";
400 $search_societe_alias =
'';
401 $search_societe_country =
'';
404 $search_opp_status = -1;
405 $search_opp_amount =
'';
406 $search_opp_percent =
'';
407 $search_budget_amount =
'';
410 $search_project_user =
'';
411 $search_project_contact =
'';
418 $search_date_start_startmonth =
"";
419 $search_date_start_startyear =
"";
420 $search_date_start_startday =
"";
421 $search_date_start_start =
"";
422 $search_date_start_endmonth =
"";
423 $search_date_start_endyear =
"";
424 $search_date_start_endday =
"";
425 $search_date_start_end =
"";
426 $search_date_end_startmonth =
"";
427 $search_date_end_startyear =
"";
428 $search_date_end_startday =
"";
429 $search_date_end_start =
"";
430 $search_date_end_endmonth =
"";
431 $search_date_end_endyear =
"";
432 $search_date_end_endday =
"";
433 $search_date_end_end =
"";
434 $search_date_creation_startmonth =
"";
435 $search_date_creation_startyear =
"";
436 $search_date_creation_startday =
"";
437 $search_date_creation_start =
"";
438 $search_date_creation_endmonth =
"";
439 $search_date_creation_endyear =
"";
440 $search_date_creation_endday =
"";
441 $search_date_creation_end =
"";
442 $search_date_modif_startmonth =
"";
443 $search_date_modif_startyear =
"";
444 $search_date_modif_startday =
"";
445 $search_date_modif_start =
"";
446 $search_date_modif_endmonth =
"";
447 $search_date_modif_endyear =
"";
448 $search_date_modif_endday =
"";
449 $search_date_modif_end =
"";
450 $search_usage_opportunity =
'';
451 $search_usage_task =
'';
452 $search_usage_bill_time =
'';
453 $search_usage_event_organization =
'';
454 $search_accept_conference_suggestions =
'';
455 $search_accept_booth_suggestions =
'';
456 $search_price_registration =
'';
457 $search_price_booth =
'';
459 $search_import_key =
'';
462 $search_array_options = array();
463 $search_category_array = array();
468 $objectclass =
'Project';
469 $objectlabel =
'Project';
470 $permissiontoread = $user->hasRight(
'projet',
'lire');
471 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
472 $permissiontoadd = $user->hasRight(
'projet',
'creer');
473 $uploaddir =
$conf->project->dir_output;
476 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
479 if (!$error && $massaction ==
'close' && $user->hasRight(
'projet',
'creer')) {
482 $objecttmp =
new $objectclass($db);
484 foreach ($toselect as $toselectid) {
485 $result = $objecttmp->fetch($toselectid);
487 $userWrite =
$object->restrictedProjectArea($user,
'write');
488 if ($userWrite > 0 && $objecttmp->statut == 1) {
489 $result = $objecttmp->setClose($user);
497 } elseif ($userWrite <= 0) {
498 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
500 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
523unset($_SESSION[
'pageforbacktolist'][
'project']);
525$form =
new Form($db);
527$companystatic =
new Societe($db);
528$taskstatic =
new Task($db);
531$userstatic =
new User($db);
535$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
536$title = $langs->trans(
"LeadsOrProjects");
538 $title = $langs->trans(
"Projects");
541 $title = $langs->trans(
"Leads");
549if (!$user->hasRight(
'projet',
'all',
'lire')) {
550 $projectsListId =
$object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
554$listofprojectcontacttype = array();
555$listofprojectcontacttypeexternal = array();
556$sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
557$sql .=
" WHERE ctc.element = '".$db->escape(
$object->element).
"'";
558$resql = $db->query($sql);
560 while ($obj = $db->fetch_object($resql)) {
561 if ($obj->source ==
'internal') {
562 $listofprojectcontacttype[$obj->rowid] = $obj->code;
564 $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
570if (count($listofprojectcontacttype) == 0) {
571 $listofprojectcontacttype[0] =
'0';
573if (count($listofprojectcontacttypeexternal) == 0) {
574 $listofprojectcontacttypeexternal[0] =
'0';
577$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
578$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
583$sql .=
" p.rowid as id, p.ref, p.title, p.fk_statut as status, cls.position, ";
584$sql .= $db->ifsql(
"p.fk_opp_status IS NULL",
"0",
"p.fk_opp_status").
" as fk_opp_status, p.public, p.fk_user_creat,";
585$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,";
586$sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
587$sql .=
" p.email_msgid, p.import_key,";
588$sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
589$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,";
590$sql .=
" country.code as country_code,";
591$sql .=
" cls.code as opp_status_code,";
592$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';
594if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
595 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
596 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
"");
600$parameters = array();
601$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
602$sql .= $hookmanager->resPrint;
603$sql = preg_replace(
'/,\s*$/',
'', $sql);
607$sql .=
" FROM ".$db->prefix().$object->table_element.
" as p";
608if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
609 $sql .=
" LEFT JOIN ".$db->prefix().$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
611$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
612$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on country.rowid = s.fk_pays";
613$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
614$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
619$parameters = array();
620$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
621$sql .= $hookmanager->resPrint;
622if ($search_entity > 0) {
623 $sql .=
" WHERE p.entity = ".((int) $search_entity);
625 $sql .=
" WHERE p.entity IN (".getEntity(
'project').
')';
627if (!$user->hasRight(
'projet',
'all',
'lire')) {
628 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
632 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
643if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
644 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
646 if ($search_societe) {
649 if ($search_societe_alias) {
653if ($search_societe_country) {
656if ($search_opp_amount) {
659if ($search_opp_percent) {
662$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
663$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
665if ($search_date_start_start) {
666 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
668if ($search_date_start_end) {
669 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
672if ($search_date_end_start) {
673 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
675if ($search_date_end_end) {
676 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
679if ($search_date_creation_start) {
680 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
682if ($search_date_creation_end) {
683 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
686if ($search_date_modif_start) {
687 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
689if ($search_date_modif_end) {
690 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
694 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
696if ($search_status !=
'' && $search_status !=
'-1') {
697 if ($search_status == 99) {
698 $sql .=
" AND p.fk_statut IN (0,1)";
700 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
703if ($search_option ==
'late') {
704 $sql .=
" AND p.datee < '".$db->idate(
dol_now() -
$conf->project->warning_delay).
"'";
706if ($search_opp_status) {
707 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
708 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
710 if ($search_opp_status ==
'all') {
711 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
713 if ($search_opp_status ==
'openedopp') {
714 $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'))";
716 if ($search_opp_status ==
'notopenedopp') {
717 $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'))";
719 if ($search_opp_status ==
'none') {
720 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
723if ($search_public !=
'') {
724 $sql .=
" AND p.public = ".((int) $search_public);
729if ($search_sale && $search_sale !=
'-1') {
730 if ($search_sale == -2) {
731 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".$db->prefix().
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
732 } elseif ($search_sale > 0) {
733 $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).
")";
736if ($search_project_user > 0) {
737 $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).
")";
739if ($search_project_contact > 0) {
740 $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).
")";
742if ($search_opp_amount !=
'') {
745if ($search_budget_amount !=
'') {
746 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
748if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
749 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
751if ($search_usage_task !=
'' && $search_usage_task >= 0) {
754if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
755 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
757if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
758 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
760if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
761 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
763if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
764 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
766if ($search_price_registration !=
'') {
767 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
769if ($search_price_booth !=
'') {
773 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
775if ($search_import_key) {
776 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
779 if ($search_omitChildren == 1) {
780 $sql .=
" AND p.fk_project IS NULL";
785$searchCategoryProjectList = $search_category_array;
786$searchCategoryProjectOperator = 0;
787if (!empty($searchCategoryProjectList)) {
788 $searchCategoryProjectSqlList = array();
789 $listofcategoryid =
'';
790 foreach ($searchCategoryProjectList as $searchCategoryProject) {
791 if (intval($searchCategoryProject) == -2) {
792 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
793 } elseif (intval($searchCategoryProject) > 0) {
794 if ($searchCategoryProjectOperator == 0) {
795 $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).
")";
797 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
801 if ($listofcategoryid) {
802 $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).
"))";
804 if ($searchCategoryProjectOperator == 1) {
805 if (!empty($searchCategoryProjectSqlList)) {
806 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
809 if (!empty($searchCategoryProjectSqlList)) {
810 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
814$searchCategoryCustomerSqlList = array();
815if ($searchCategoryCustomerOperator == 1) {
816 $existsCategoryCustomerList = array();
817 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
818 if (intval($searchCategoryCustomer) == -2) {
819 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
820 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
821 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
822 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
823 $sqlCategoryCustomerNotExists .=
" )";
824 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
825 } elseif (intval($searchCategoryCustomer) > 0) {
826 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
829 if (!empty($existsCategoryCustomerList)) {
830 $sqlCategoryCustomerExists =
" EXISTS (";
831 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
832 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
833 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
834 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
835 $sqlCategoryCustomerExists .=
" )";
836 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
838 if (!empty($searchCategoryCustomerSqlList)) {
839 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
842 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
843 if (intval($searchCategoryCustomer) == -2) {
844 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
845 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
846 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
847 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
848 $sqlCategoryCustomerNotExists .=
" )";
849 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
850 } elseif (intval($searchCategoryCustomer) > 0) {
851 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
854 if (!empty($searchCategoryCustomerSqlList)) {
855 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
859include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
861$parameters = array();
862$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
863$sql .= $hookmanager->resPrint;
867$nbtotalofrecords =
'';
870 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
871 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
872 $resql = $db->query($sqlforcount);
874 $objforcount = $db->fetch_object($resql);
875 $nbtotalofrecords = $objforcount->nbtotalofrecords;
880 if (($page * $limit) > $nbtotalofrecords) {
888$sql .= $db->order($sortfield, $sortorder);
890 $sql .= $db->plimit($limit + 1, $offset);
894$resql = $db->query($sql);
900$num = $db->num_rows($resql);
903if ($num == 1 &&
getDolGlobalInt(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
904 $obj = $db->fetch_object($resql);
905 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
913llxHeader(
'', $title, $help_url,
'', 0, 0, $morejs, $morecss,
'',
'mod-project page-list bodyforlist');
915$arrayofselected = is_array($toselect) ? $toselect : array();
919 $param .=
'&mode='.urlencode($mode);
921if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
922 $param .=
'&contextpage='.urlencode($contextpage);
924if ($limit > 0 && $limit !=
$conf->liste_limit) {
925 $param .=
'&limit='.((int) $limit);
927if ($optioncss !=
'') {
928 $param .=
'&optioncss='.urlencode($optioncss);
930if ($search_all !=
'') {
931 $param .=
'&search_all='.urlencode($search_all);
933if ($search_entity !=
'') {
934 $param .=
'&search_entity='.((int) $search_entity);
937 $param .=
'&groupby='.urlencode($groupby);
941 $param .=
'&socid='.urlencode((
string) $socid);
944 $param .=
'&search_sday='.urlencode((
string) ($search_sday));
947 $param .=
'&search_smonth='.urlencode((
string) ($search_smonth));
950 $param .=
'&search_syear='.urlencode((
string) ($search_syear));
953 $param .=
'&search_eday='.urlencode((
string) ($search_eday));
956 $param .=
'&search_emonth='.urlencode((
string) ($search_emonth));
959 $param .=
'&search_eyear='.urlencode((
string) ($search_eyear));
961if ($search_date_start_startmonth) {
962 $param .=
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
964if ($search_date_start_startyear) {
965 $param .=
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
967if ($search_date_start_startday) {
968 $param .=
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
970if ($search_date_start_start) {
971 $param .=
'&search_date_start_start='.urlencode((
string) $search_date_start_start);
973if ($search_date_start_endmonth) {
974 $param .=
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
976if ($search_date_start_endyear) {
977 $param .=
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
979if ($search_date_start_endday) {
980 $param .=
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
982if ($search_date_start_end) {
983 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
985if ($search_date_end_startmonth) {
986 $param .=
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
988if ($search_date_end_startyear) {
989 $param .=
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
991if ($search_date_end_startday) {
992 $param .=
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
994if ($search_date_end_start) {
995 $param .=
'&search_date_end_start='.urlencode((
string) $search_date_end_start);
997if ($search_date_end_endmonth) {
998 $param .=
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
1000if ($search_date_end_endyear) {
1001 $param .=
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
1003if ($search_date_end_endday) {
1004 $param .=
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
1006if ($search_date_end_end) {
1007 $param .=
'&search_date_end_end=' . urlencode((
string) $search_date_end_end);
1009if ($search_date_creation_startmonth) {
1010 $param .=
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
1012if ($search_date_creation_startyear) {
1013 $param .=
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
1015if ($search_date_creation_startday) {
1016 $param .=
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
1018if ($search_date_creation_start) {
1019 $param .=
'&search_date_creation_start='.urlencode((
string) $search_date_creation_start);
1021if ($search_date_creation_endmonth) {
1022 $param .=
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
1024if ($search_date_creation_endyear) {
1025 $param .=
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
1027if ($search_date_creation_endday) {
1028 $param .=
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
1030if ($search_date_creation_end) {
1031 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
1033if ($search_date_modif_startmonth) {
1034 $param .=
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
1036if ($search_date_modif_startyear) {
1037 $param .=
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
1039if ($search_date_modif_startday) {
1040 $param .=
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
1042if ($search_date_modif_start) {
1043 $param .=
'&search_date_modif_start='.urlencode((
string) $search_date_modif_start);
1045if ($search_date_modif_endmonth) {
1046 $param .=
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
1048if ($search_date_modif_endyear) {
1049 $param .=
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
1051if ($search_date_modif_endday) {
1052 $param .=
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
1054if ($search_date_modif_end) {
1055 $param .=
'&search_date_modif_end=' . urlencode((
string) $search_date_modif_end);
1057if (!empty($search_category_array)) {
1058 foreach ($search_category_array as $tmpval) {
1059 $param .=
'&search_categegory_project_list[]='.urlencode($tmpval);
1062if ($search_id !=
'') {
1063 $param .=
'&search_id='.urlencode($search_id);
1065if ($search_ref !=
'') {
1066 $param .=
'&search_ref='.urlencode($search_ref);
1068if ($search_label !=
'') {
1069 $param .=
'&search_label='.urlencode($search_label);
1071if ($search_societe !=
'') {
1072 $param .=
'&search_societe='.urlencode($search_societe);
1074if ($search_societe_alias !=
'') {
1075 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
1077if ($search_societe_country !=
'') {
1078 $param .=
'&search_societe_country='.urlencode($search_societe_country);
1080if ($search_status !=
'' && $search_status !=
'-1') {
1081 $param .=
"&search_status=".urlencode($search_status);
1083if ($search_option) {
1084 $param .=
"&search_option=".urlencode($search_option);
1086if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
1087 $param .=
'&search_opp_status='.urlencode($search_opp_status);
1089if ($search_opp_percent !=
'') {
1090 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
1092if ($search_public !=
'') {
1093 $param .=
'&search_public='.urlencode($search_public);
1095if ($search_project_user > 0) {
1096 $param .=
'&search_project_user='.urlencode((
string) $search_project_user);
1098if ($search_project_contact > 0) {
1099 $param .=
'&search_project_contact='.urlencode((
string) ($search_project_contact));
1101if ($search_sale > 0) {
1102 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
1104if ($search_opp_amount !=
'') {
1105 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
1107if ($search_budget_amount !=
'') {
1108 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
1110if ($search_usage_task !=
'') {
1111 $param .=
'&search_usage_task='.urlencode($search_usage_task);
1113if ($search_usage_bill_time !=
'') {
1114 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
1116if ($search_usage_event_organization !=
'') {
1117 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
1119if ($search_accept_conference_suggestions !=
'') {
1120 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
1122if ($search_accept_booth_suggestions !=
'') {
1123 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
1125if ($search_price_registration !=
'') {
1126 $param .=
'&search_price_registration='.urlencode($search_price_registration);
1128if ($search_price_booth !=
'') {
1129 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1132 $param .=
'&search_login='.urlencode($search_login);
1134if ($search_import_key) {
1135 $param .=
'&search_import_key='.urlencode($search_import_key);
1137foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1138 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1141include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1144$parameters = array(
'param' => &$param);
1145$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1146$param .= $hookmanager->resPrint;
1149$arrayofmassactions = array(
1150 'validate' =>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1151 'generate_doc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1156if ($user->hasRight(
'projet',
'creer')) {
1157 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1158 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1160if ($user->hasRight(
'projet',
'supprimer')) {
1161 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1163if (isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1164 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1166if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1167 $arrayofmassactions = array();
1170$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1172$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1173if (!empty($socid)) {
1174 $url .=
'&socid='.$socid;
1176if ($search_usage_event_organization == 1) {
1177 $url .=
'&usage_organize_event=1';
1178 if (((
int) $search_usage_opportunity) < 1) {
1179 $url .=
'&usage_opportunity=0';
1184$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'));
1185$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'));
1186if ($contextpage ==
'lead') {
1187 $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'));
1190$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1192print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1193if ($optioncss !=
'') {
1194 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1196print
'<input type="hidden" name="token" value="'.newToken().
'">';
1197print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1198print
'<input type="hidden" name="action" value="list">';
1199print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1200print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1201print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1202print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1203print
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
1207if ($search_project_user == $user->id) {
1208 $htmltooltip .= $langs->trans(
"MyProjectsDesc");
1210 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1211 $htmltooltip .= $langs->trans(
"ProjectsDesc");
1213 $htmltooltip .= $langs->trans(
"ProjectsPublicDesc");
1217print_barre_liste($form->textwithpicto($title, $htmltooltip), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1220$topicmail =
"Information";
1221$modelmail =
"project";
1223$trackid =
'proj'.$object->id;
1224include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1227 foreach ($fieldstosearchall as $key => $val) {
1228 $fieldstosearchall[$key] = $langs->trans($val);
1230 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1236$moreforfilter .=
'<div class="divsearchfield">';
1237$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1240if (!$user->hasRight(
'user',
'user',
'lire')) {
1241 $includeonly = array($user->id);
1243$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');
1244$moreforfilter .=
'</div>';
1246$moreforfilter .=
'<div class="divsearchfield">';
1247$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1248$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1250$moreforfilter .=
'</div>';
1253if ($user->hasRight(
'user',
'user',
'lire')) {
1254 $langs->load(
"commercial");
1255 $moreforfilter .=
'<div class="divsearchfield">';
1256 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1257 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1258 $moreforfilter .=
'</div>';
1262if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1264 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth300imp minwidth300 widthcentpercentminusx');
1268if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"category") && $user->hasRight(
'categorie',
'lire')) {
1270 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList,
'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
1274$moreforfilter .=
'<div class="divsearchfield">';
1275$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' :
'').
'>';
1276$moreforfilter .=
'</div>';
1280 $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"' :
'').
'"> ';
1283if (!empty($moreforfilter)) {
1284 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1285 print $moreforfilter;
1286 $parameters = array();
1287 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1288 print $hookmanager->resPrint;
1292$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1293$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1294$selectedfields = (($mode !=
'kanban' && $mode !=
'kanbangroupby') ? $htmlofselectarray :
'');
1295$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1298print
'<div class="div-table-responsive">';
1299print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1303print
'<tr class="liste_titre_filter">';
1306 print
'<td class="liste_titre maxwidthsearch">';
1307 $searchpicto = $form->showFilterButtons(
'left');
1312if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1313 print
'<td class="liste_titre">';
1314 print
'<input type="text" class="flat width50" name="search_id" value="'.dol_escape_htmltag($search_id).
'">';
1318if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1319 print
'<td class="liste_titre">';
1320 print
'<input type="text" class="flat width75" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'">';
1324if (!empty($arrayfields[
'p.title'][
'checked'])) {
1325 print
'<td class="liste_titre">';
1326 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1330if (!empty($arrayfields[
's.nom'][
'checked'])) {
1331 print
'<td class="liste_titre">';
1333 $tmpthirdparty =
new Societe($db);
1334 $tmpthirdparty->fetch($socid);
1335 $search_societe = $tmpthirdparty->name;
1337 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag((
string) $search_societe).
'">';
1342if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1343 print
'<td class="liste_titre">';
1345 $tmpthirdparty =
new Societe($db);
1346 $tmpthirdparty->fetch($socid);
1347 $search_societe_alias = $tmpthirdparty->name_alias;
1349 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1353if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1354 print
'<td class="liste_titre">';
1355 print
'<input type="text" class="flat width50" name="search_societe_country" value="'.dol_escape_htmltag($search_societe_country).
'">';
1359if (!empty($arrayfields[
'commercial'][
'checked'])) {
1360 print
'<td class="liste_titre"> </td>';
1363if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1364 print
'<td class="liste_titre center">';
1365 print
'<div class="nowrapfordate">';
1366 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'));
1368 print
'<div class="nowrapfordate">';
1369 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'));
1374if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1375 print
'<td class="liste_titre center">';
1376 print
'<div class="nowrapfordate">';
1377 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'));
1379 print
'<div class="nowrapfordate">';
1380 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'));
1385if (!empty($arrayfields[
'p.public'][
'checked'])) {
1386 print
'<td class="liste_titre center">';
1387 $array = array(
'' =>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1388 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1391if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1392 print
'<td class="liste_titre center">';
1396if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1397 print
'<td class="liste_titre nowrap center">';
1398 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1401if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1402 print
'<td class="liste_titre nowrap right">';
1403 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1406if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1407 print
'<td class="liste_titre nowrap right">';
1408 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1411if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1412 print
'<td class="liste_titre nowrap right">';
1415if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1416 print
'<td class="liste_titre nowrap right">';
1417 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1420if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1421 print
'<td class="liste_titre nowrap">';
1422 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1426if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1427 print
'<td class="liste_titre nowrap">';
1428 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1431if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1432 print
'<td class="liste_titre nowrap">';
1433 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1436if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1437 print
'<td class="liste_titre nowrap">';
1438 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1441if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1442 print
'<td class="liste_titre nowrap">';
1443 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1446if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1447 print
'<td class="liste_titre nowrap">';
1448 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1451if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1452 print
'<td class="liste_titre nowrap right">';
1453 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1456if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1457 print
'<td class="liste_titre nowrap right">';
1458 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1461if (!empty($arrayfields[
'u.login'][
'checked'])) {
1463 print
'<td class="liste_titre" align="center">';
1464 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1468include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1471$parameters = array(
'arrayfields' => $arrayfields);
1472$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1473print $hookmanager->resPrint;
1475if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1476 print
'<td class="liste_titre center">';
1477 print
'<div class="nowrapfordate">';
1478 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'));
1480 print
'<div class="nowrapfordate">';
1481 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'));
1486if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1487 print
'<td class="liste_titre center">';
1488 print
'<div class="nowrapfordate">';
1489 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'));
1491 print
'<div class="nowrapfordate">';
1492 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'));
1496if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1498 print
'<td class="liste_titre">';
1501if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1503 print
'<td class="liste_titre">';
1504 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1507if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1508 print
'<td class="liste_titre center parentonrightofpage">';
1509 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1514 print
'<td class="liste_titre maxwidthsearch">';
1515 $searchpicto = $form->showFilterButtons();
1526print
'<tr class="liste_titre">';
1528 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1531if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1532 print_liste_field_titre($arrayfields[
'p.rowid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.rowid",
"", $param,
"", $sortfield, $sortorder);
1535if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1536 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1539if (!empty($arrayfields[
'p.title'][
'checked'])) {
1540 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1543if (!empty($arrayfields[
's.nom'][
'checked'])) {
1544 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1547if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1549 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1552if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1553 print_liste_field_titre($arrayfields[
'co.country_code'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code",
"", $param,
"", $sortfield, $sortorder,
'center ');
1556if (!empty($arrayfields[
'commercial'][
'checked'])) {
1557 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1560if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1561 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1564if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1565 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1568if (!empty($arrayfields[
'p.public'][
'checked'])) {
1569 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1572if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1573 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1576if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1578 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1581if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1583 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1586if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1588 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1591if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1592 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1595if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1596 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1599if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1600 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1603if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1604 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1607if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1608 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1611if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1613 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1616if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1617 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1620if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1621 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1624if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1625 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1628if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1629 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1632if (!empty($arrayfields[
'u.login'][
'checked'])) {
1633 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1637include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1639$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'totalarray' => &$totalarray);
1640$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1641print $hookmanager->resPrint;
1642if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1643 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1646if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1647 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1650if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1651 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1654if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1655 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1658if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1659 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1664 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1676$imaxinloop = ($limit ? min($num, $limit) : $num);
1677while ($i < $imaxinloop) {
1678 $obj = $db->fetch_object($resql);
1684 $companystatic->id = $obj->socid;
1685 $companystatic->name = $obj->name;
1686 $companystatic->name_alias = $obj->alias;
1687 $companystatic->client = $obj->client;
1688 $companystatic->code_client = $obj->code_client;
1689 $companystatic->email = $obj->email;
1690 $companystatic->phone = $obj->phone;
1691 $companystatic->address = $obj->address;
1692 $companystatic->zip = $obj->zip;
1693 $companystatic->town = $obj->town;
1694 $companystatic->country_code = $obj->country_code;
1700 $object->fk_opp_status = $obj->fk_opp_status;
1701 $object->user_author_id = $obj->fk_user_creat;
1702 $object->date_creation = $db->jdate($obj->date_creation);
1703 $object->date_start = $db->jdate($obj->date_start);
1704 $object->date_end = $db->jdate($obj->date_end);
1705 $object->status = $obj->status;
1706 $object->public = $obj->public;
1707 $object->opp_percent = $obj->opp_percent;
1708 $object->opp_status = $obj->fk_opp_status;
1709 $object->opp_status_code = $obj->opp_status_code;
1710 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1711 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1712 $object->budget_amount = $obj->budget_amount;
1713 $object->usage_opportunity = $obj->usage_opportunity;
1714 $object->usage_task = $obj->usage_task;
1715 $object->usage_bill_time = $obj->usage_bill_time;
1716 $object->usage_organize_event = $obj->usage_organize_event;
1717 $object->email_msgid = $obj->email_msgid;
1718 $object->import_key = $obj->import_key;
1719 $object->thirdparty = $companystatic;
1723 $stringassignedusers =
'';
1725 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1727 foreach (array(
'internal',
'external') as $source) {
1728 $tab =
$object->liste_contact(-1, $source, 0,
'', 1);
1729 $numcontact = count($tab);
1730 if (!empty($numcontact)) {
1731 foreach ($tab as $contactproject) {
1733 if ($source ==
'internal') {
1734 if (!empty(
$conf->cache[
'user'][$contactproject[
'id']])) {
1735 $c =
$conf->cache[
'user'][$contactproject[
'id']];
1738 $c->fetch($contactproject[
'id']);
1739 $conf->cache[
'user'][$contactproject[
'id']] =
$c;
1742 if (!empty(
$conf->cache[
'contact'][$contactproject[
'id']])) {
1743 $c =
$conf->cache[
'contact'][$contactproject[
'id']];
1746 $c->fetch($contactproject[
'id']);
1747 $conf->cache[
'contact'][$contactproject[
'id']] =
$c;
1750 if (get_class(
$c) ==
'User') {
1751 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1753 $stringassignedusers .=
$c->getNomUrl(-2,
'', 0, 0, -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1761 if ($mode ==
'kanban' || $mode ==
'kanbangroupby') {
1763 print
'<tr class="trkanban'.(empty($groupby) ?
'' :
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
1766 $groupbyvalue =
'unset';
1767 $groupbyfield =
'unsetfield';
1770 if (!empty($groupby)) {
1771 $groupbyfield = preg_replace(
'/^[a-z]+\./',
'', $groupby);
1775 if (is_null($groupbyold)) {
1776 print
'<div class="box-flex-container-columns kanban">';
1779 if (is_null($obj->$groupbyfield)) {
1780 $groupbyvalue =
'undefined';
1782 $groupbyvalues[0] = array(
'id' =>
'0',
'label' =>
'Undefined');
1784 $groupbyvalue = $obj->$groupbyfield;
1787 if ($groupbyold !== $groupbyvalue) {
1788 if (!is_null($groupbyold)) {
1792 $indexofgroupbyvalue =
null;
1796 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1798 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1799 if ($tmpgroupbyvalue2[
'id'] == $groupbyvalue) {
1800 $indexofgroupbyvalue = $tmpcursor2;
1806 if (!is_null($groupbyold)) {
1807 $indexofgroupbyold =
null;
1808 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1809 if ($tmpgroupbyvalue2[
'id'] == $groupbyold) {
1810 $indexofgroupbyold = $tmpcursor2;
1816 if ($tmpcursor <= $indexofgroupbyold) {
1820 if ($tmpcursor >= $indexofgroupbyvalue) {
1825 print
'<!-- empty column before column of fetched value --><div class="box-flex-container-column kanban column';
1826 if (array_key_exists($tmpcursor, $groupofcollpasedvalues)) {
1827 print
' kanbancollapsed';
1829 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpgroupbyvalue[
'id']).
'" data-groupbyfield="'.$groupbyfield.
'">';
1830 print
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue[
'label']).
'</div>';
1834 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.
'">';
1835 print
'<div class="kanbanlabel">'.$langs->trans((is_null($indexofgroupbyvalue) || empty($groupbyvalues[$indexofgroupbyvalue][
'label'])) ?
'Undefined' : $groupbyvalues[$indexofgroupbyvalue][
'label']).
'</div>';
1837 $groupbyold = $groupbyvalue;
1838 } elseif ($i == 0) {
1839 print
'<div class="box-flex-container kanban">';
1844 if ($massactionbutton || $massaction) {
1846 if (in_array(
$object->id, $arrayofselected)) {
1850 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty' => $companystatic,
'selected' => $selected,
'mode' => $mode);
1852 print
$object->getKanbanView(
'', $arrayofdata, ($groupby ?
'small' :
''));
1855 if ($i == ($imaxinloop - 1)) {
1857 if (!empty($groupby)) {
1862 foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
1864 $indexofgroupbyvalue =
null;
1865 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1866 if ($tmpgroupbyvalue2[
'id'] == $groupbyvalue) {
1867 $indexofgroupbyvalue = $tmpcursor2;
1873 if (!is_null($groupbyold)) {
1874 $indexofgroupbyold =
null;
1875 foreach ($groupbyvalues as $tmpcursor2 => $tmpgroupbyvalue2) {
1876 if ($tmpgroupbyvalue2[
'id'] == $groupbyold) {
1877 $indexofgroupbyold = $tmpcursor2;
1885 if ($tmpcursor <= $indexofgroupbyvalue) {
1889 print
'<!-- empty column after column of fetched value --><div class="box-flex-container-column kanban column';
1890 if (array_key_exists($tmpcursor, $groupofcollpasedvalues)) {
1891 print
' kanbancollapsed';
1893 print
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/',
'', $tmpgroupbyvalue[
'id']).
'" data-groupbyfield="'.$groupbyfield.
'">';
1894 print
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue[
'label']) ?
'Undefined' : $tmpgroupbyvalue[
'label']).
'</div>';
1906 $userstatic->id = $obj->fk_user_creat;
1907 $userstatic->login = $obj->login;
1908 $userstatic->lastname = $obj->lastname;
1909 $userstatic->firstname = $obj->firstname;
1910 $userstatic->email = $obj->user_email;
1911 $userstatic->status = $obj->user_statut;
1912 $userstatic->entity = $obj->entity;
1913 $userstatic->photo = $obj->photo;
1914 $userstatic->office_phone = $obj->office_phone;
1915 $userstatic->office_fax = $obj->office_fax;
1916 $userstatic->user_mobile = $obj->user_mobile;
1917 $userstatic->job = $obj->job;
1918 $userstatic->gender = $obj->gender;
1922 print
'<tr data-rowid="'.$object->id.
'" class="oddeven '.((
getDolGlobalInt(
'MAIN_FINISHED_LINES_OPACITY') == 1 &&
$object->status > 1) ?
'opacitymedium' :
'').
'">';
1925 print
'<td class="nowrap center">';
1926 if ($massactionbutton || $massaction) {
1928 if (in_array(
$object->id, $arrayofselected)) {
1931 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1939 if (!empty($arrayfields[
'p.rowid'][
'checked'])) {
1940 print
'<td class="nowraponall">';
1948 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1949 print
'<td class="nowraponall tdoverflowmax200">';
1950 print
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ?
'eventorganization' :
''));
1960 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1961 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1969 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1970 print
'<td class="tdoverflowmax125">';
1972 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1982 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1983 print
'<td class="tdoverflowmax100">';
1985 print $companystatic->name_alias;
1995 if (!empty($arrayfields[
'co.country_code'][
'checked'])) {
1996 print
'<td class="tdoverflowmax125 center">';
1997 print $obj->country_code;
2004 if (!empty($arrayfields[
'commercial'][
'checked'])) {
2005 print
'<td class="tdoverflowmax150">';
2007 $companystatic->id = $obj->socid;
2008 $companystatic->name = $obj->name;
2009 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
2010 $nbofsalesrepresentative = count($listsalesrepresentatives);
2011 if ($nbofsalesrepresentative > 6) {
2013 print $nbofsalesrepresentative;
2014 } elseif ($nbofsalesrepresentative > 0) {
2015 $userstatic =
new User($db);
2017 foreach ($listsalesrepresentatives as $val) {
2018 $userstatic->id = $val[
'id'];
2019 $userstatic->lastname = $val[
'lastname'];
2020 $userstatic->firstname = $val[
'firstname'];
2021 $userstatic->email = $val[
'email'];
2022 $userstatic->status = $val[
'statut'];
2023 $userstatic->entity = $val[
'entity'];
2024 $userstatic->photo = $val[
'photo'];
2025 $userstatic->login = $val[
'login'];
2026 $userstatic->office_phone = $val[
'office_phone'];
2027 $userstatic->office_fax = $val[
'office_fax'];
2028 $userstatic->user_mobile = $val[
'user_mobile'];
2029 $userstatic->job = $val[
'job'];
2030 $userstatic->gender = $val[
'gender'];
2031 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
2033 if ($j < $nbofsalesrepresentative) {
2049 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
2050 print
'<td class="center">';
2058 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
2059 print
'<td class="center">';
2068 if (!empty($arrayfields[
'p.public'][
'checked'])) {
2069 print
'<td class="center">';
2071 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
2074 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
2083 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
2084 print
'<td class="center nowraponall tdoverflowmax200">';
2085 print $stringassignedusers;
2092 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
2094 if ($obj->opp_status_code) {
2095 $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
2096 if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
2097 $s .=
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
2100 print
'<td class="center tdoverflowmax150" title="'.$s.
'">';
2108 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
2109 print
'<td class="right">';
2111 if (isset($obj->opp_amount) && strcmp($obj->opp_amount,
'')) {
2112 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2113 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
2114 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
2116 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
2128 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
2129 print
'<td class="right">';
2130 if ($obj->opp_percent) {
2131 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
2139 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
2140 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
2143 print
'<td align="right">';
2144 if ($obj->opp_weighted_amount) {
2145 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
2146 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
2155 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
2156 print
'<td class="right">';
2157 if ($obj->budget_amount !=
'') {
2158 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
2159 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
2160 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
2162 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
2172 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
2173 print
'<td class="center">';
2174 if ($obj->usage_opportunity) {
2175 print
yn($obj->usage_opportunity, 4);
2183 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
2184 print
'<td class="center">';
2185 if ($obj->usage_task) {
2186 print
yn($obj->usage_task, 4);
2194 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
2195 print
'<td class="center">';
2196 if ($obj->usage_bill_time) {
2197 print
yn($obj->usage_bill_time, 4);
2205 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
2206 print
'<td class="center">';
2207 if ($obj->usage_organize_event) {
2208 print
yn($obj->usage_organize_event, 4);
2216 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
2217 print
'<td class="center">';
2218 if ($obj->accept_conference_suggestions) {
2219 print
yn($obj->accept_conference_suggestions);
2227 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
2228 print
'<td class="">';
2229 if ($obj->accept_booth_suggestions) {
2230 print
yn($obj->accept_booth_suggestions);
2238 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
2239 print
'<td class="right">';
2240 if ($obj->price_registration !=
'') {
2241 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
2242 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
2253 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
2254 print
'<td class="right">';
2255 if ($obj->price_booth !=
'') {
2256 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
2257 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
2268 if (!empty($arrayfields[
'u.login'][
'checked'])) {
2269 print
'<td class="center tdoverflowmax150">';
2270 if ($userstatic->id) {
2271 print $userstatic->getNomUrl(-1);
2279 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
2281 $parameters = array(
'arrayfields' => $arrayfields,
'object' => $object,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
2282 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
2283 print $hookmanager->resPrint;
2285 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
2286 print
'<td class="center nowraponall">';
2287 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
2294 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
2295 print
'<td class="center nowraponall">';
2296 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
2303 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2304 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2312 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2313 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2319 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2320 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2327 print
'<td class="nowrap center">';
2328 if ($massactionbutton || $massaction) {
2330 if (in_array(
$object->id, $arrayofselected)) {
2333 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2348include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2353 foreach ($arrayfields as $key => $val) {
2354 if (!empty($val[
'checked'])) {
2358 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2363$parameters = array(
'arrayfields' => $arrayfields,
'sql' => $sql);
2364$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2365print $hookmanager->resPrint;
2367print
'</table>'.
"\n";
2370print
'</form>'.
"\n";
2372if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords ===
'' || $nbtotalofrecords)) {
2373 $hidegeneratedfilelistifempty = 1;
2374 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
2375 $hidegeneratedfilelistifempty = 0;
2378 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
2382 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
2383 $urlsource .= str_replace(
'&',
'&', $param);
2385 $filedir = $diroutputmassaction;
2386 $genallowed = $permissiontoread;
2387 $delallowed = $permissiontoadd;
2389 print $formfile->showdocuments(
'massfilesarea_'.
$object->module,
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
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.
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...
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.