33require
'../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
41if (isModEnabled(
'categorie')) {
42 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
43 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
47$langs->loadLangs(array(
'projects',
'companies',
'commercial'));
48if (isModEnabled(
'eventorganization') && $conf->eventorganization->enabled) {
49 $langs->loadLangs(array(
'eventorganization'));
52$action =
GETPOST(
'action',
'aZ09');
53$massaction =
GETPOST(
'massaction',
'alpha');
54$show_files =
GETPOST(
'show_files',
'int');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$toselect =
GETPOST(
'toselect',
'array');
57$optioncss =
GETPOST(
'optioncss',
'alpha');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'projectlist';
59$mode =
GETPOST(
'mode',
'alpha');
62$title = $langs->trans(
"Projects");
65$socid =
GETPOST(
'socid',
'int');
70 $title .=
' (<a href="list.php">'.$soc->name.
'</a>)';
72if (!$user->hasRight(
'projet',
'lire')) {
76$diroutputmassaction = $conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
78$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
79$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
80$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
81$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
82if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
92$offset = $limit * $page;
96$search_all =
GETPOST(
'search_all',
'alphanohtml') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml');
97$search_ref =
GETPOST(
"search_ref",
'alpha');
98$search_label =
GETPOST(
"search_label",
'alpha');
99$search_societe =
GETPOST(
"search_societe",
'alpha');
100$search_societe_alias =
GETPOST(
"search_societe_alias",
'alpha');
101$search_opp_status =
GETPOST(
"search_opp_status",
'alpha');
102$search_opp_percent =
GETPOST(
"search_opp_percent",
'alpha');
103$search_opp_amount =
GETPOST(
"search_opp_amount",
'alpha');
104$search_budget_amount =
GETPOST(
"search_budget_amount",
'alpha');
105$search_public =
GETPOST(
"search_public",
'int');
106$search_project_user =
GETPOST(
'search_project_user',
'int');
107$search_project_contact =
GETPOST(
'search_project_contact',
'int');
108$search_sale =
GETPOST(
'search_sale',
'int');
109$search_usage_opportunity =
GETPOST(
'search_usage_opportunity',
'int');
110$search_usage_task =
GETPOST(
'search_usage_task',
'int');
111$search_usage_bill_time =
GETPOST(
'search_usage_bill_time',
'int');
112$search_usage_event_organization =
GETPOST(
'search_usage_event_organization',
'int');
113$search_accept_conference_suggestions =
GETPOST(
'search_accept_conference_suggestions',
'int');
114$search_accept_booth_suggestions =
GETPOST(
'search_accept_booth_suggestions',
'int');
115$search_price_registration =
GETPOST(
"search_price_registration",
'alpha');
116$search_price_booth =
GETPOST(
"search_price_booth",
'alpha');
117$search_login =
GETPOST(
'search_login',
'alpha');
118$search_import_key =
GETPOST(
'search_import_key',
'alpha');
119$searchCategoryCustomerOperator = 0;
120if (GETPOSTISSET(
'formfilteraction')) {
121 $searchCategoryCustomerOperator =
GETPOST(
'search_category_customer_operator',
'int');
123 $searchCategoryCustomerOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
125$searchCategoryCustomerList =
GETPOST(
'search_category_customer_list',
'array');
127 $search_omitChildren =
GETPOST(
'search_omitChildren',
'alpha') ==
'on' ? 1 : 0;
131$mine = ((
GETPOST(
'mode') ==
'mine') ? 1 : 0);
133 $search_project_user = $user->id;
137$search_sday =
GETPOST(
'search_sday',
'int');
138$search_smonth =
GETPOST(
'search_smonth',
'int');
139$search_syear =
GETPOST(
'search_syear',
'int');
140$search_eday =
GETPOST(
'search_eday',
'int');
141$search_emonth =
GETPOST(
'search_emonth',
'int');
142$search_eyear =
GETPOST(
'search_eyear',
'int');
144$search_date_start_startmonth =
GETPOST(
'search_date_start_startmonth',
'int');
145$search_date_start_startyear =
GETPOST(
'search_date_start_startyear',
'int');
146$search_date_start_startday =
GETPOST(
'search_date_start_startday',
'int');
147$search_date_start_start =
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear);
148$search_date_start_endmonth =
GETPOST(
'search_date_start_endmonth',
'int');
149$search_date_start_endyear =
GETPOST(
'search_date_start_endyear',
'int');
150$search_date_start_endday =
GETPOST(
'search_date_start_endday',
'int');
151$search_date_start_end =
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);
153$search_date_end_startmonth =
GETPOST(
'search_date_end_startmonth',
'int');
154$search_date_end_startyear =
GETPOST(
'search_date_end_startyear',
'int');
155$search_date_end_startday =
GETPOST(
'search_date_end_startday',
'int');
156$search_date_end_start =
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);
157$search_date_end_endmonth =
GETPOST(
'search_date_end_endmonth',
'int');
158$search_date_end_endyear =
GETPOST(
'search_date_end_endyear',
'int');
159$search_date_end_endday =
GETPOST(
'search_date_end_endday',
'int');
160$search_date_end_end =
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
162$search_date_creation_startmonth =
GETPOST(
'search_date_creation_startmonth',
'int');
163$search_date_creation_startyear =
GETPOST(
'search_date_creation_startyear',
'int');
164$search_date_creation_startday =
GETPOST(
'search_date_creation_startday',
'int');
165$search_date_creation_start =
dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
166$search_date_creation_endmonth =
GETPOST(
'search_date_creation_endmonth',
'int');
167$search_date_creation_endyear =
GETPOST(
'search_date_creation_endyear',
'int');
168$search_date_creation_endday =
GETPOST(
'search_date_creation_endday',
'int');
169$search_date_creation_end =
dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
171$search_date_modif_startmonth =
GETPOST(
'search_date_modif_startmonth',
'int');
172$search_date_modif_startyear =
GETPOST(
'search_date_modif_startyear',
'int');
173$search_date_modif_startday =
GETPOST(
'search_date_modif_startday',
'int');
174$search_date_modif_start =
dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);
175$search_date_modif_endmonth =
GETPOST(
'search_date_modif_endmonth',
'int');
176$search_date_modif_endyear =
GETPOST(
'search_date_modif_endyear',
'int');
177$search_date_modif_endday =
GETPOST(
'search_date_modif_endday',
'int');
178$search_date_modif_end =
dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);
180$search_category_array = array();
182if (isModEnabled(
'categorie')) {
183 $search_category_array =
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list",
"array");
187 $search_status = join(
',',
GETPOST(
'search_status',
'array:intcomma'));
189 $search_status = (
GETPOST(
'search_status',
'intcomma') !=
'' ?
GETPOST(
'search_status',
'intcomma') :
'0,1');
195$hookmanager->initHooks(array(
'projectlist'));
199$extrafields->fetch_name_optionals_label($object->table_element);
201$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
204$fieldstosearchall = array();
205foreach ($object->fields as $key => $val) {
206 if (empty($val[
'searchall'])) {
211 if (!empty($user->socid) && $key ==
"note_private") {
215 $fieldstosearchall[
'p.'.$key] = $val[
'label'];
219$fieldstosearchall[
's.nom'] =
"ThirdPartyName";
220$fieldstosearchall[
's.name_alias'] =
"AliasNameShort";
221$fieldstosearchall[
's.code_client'] =
"CustomerCode";
224$arrayfields = array();
225foreach ($object->fields as $key => $val) {
227 if (!empty($val[
'visible'])) {
228 $visible =
dol_eval($val[
'visible'], 1, 1,
'1');
229 $arrayfields[
'p.'.$key] = array(
230 'label'=>$val[
'label'],
231 'checked'=>(($visible < 0) ? 0 : 1),
232 'enabled'=>($visible != 3 &&
dol_eval($val[
'enabled'], 1, 1,
'1')),
233 'position'=>$val[
'position'],
234 'help'=> isset($val[
'help']) ? $val[
'help'] :
''
239include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
242$arrayfields[
's.nom'] = array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>21,
'enabled'=>(!isModEnabled(
'societe') ? 0 : 1));
243$arrayfields[
's.name_alias'] = array(
'label'=>
"AliasNameShort",
'checked'=>0,
'position'=>22);
244$arrayfields[
'commercial'] = array(
'label'=>$langs->trans(
"SaleRepresentativesOfThirdParty"),
'checked'=>0,
'position'=>23);
245$arrayfields[
'c.assigned'] = array(
'label'=>$langs->trans(
"AssignedTo"),
'checked'=>1,
'position'=>120);
246$arrayfields[
'opp_weighted_amount'] = array(
'label'=>$langs->trans(
'OpportunityWeightedAmountShort'),
'checked'=>0,
'enabled'=>(!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ? 0 : 1),
'position'=>106);
247$arrayfields[
'u.login'] = array(
'label'=>
"Author",
'checked'=>-1,
'position'=>165);
249if (
GETPOST(
'search_usage_opportunity')) {
253if (
GETPOST(
'search_usage_event_organization')) {
254 $arrayfields[
'p.fk_opp_status'][
'enabled'] = 0;
255 $arrayfields[
'p.opp_amount'][
'enabled'] = 0;
256 $arrayfields[
'p.opp_percent'][
'enabled'] = 0;
257 $arrayfields[
'opp_weighted_amount'][
'enabled'] = 0;
258 $arrayfields[
'p.usage_organize_event'][
'visible'] = 1;
259 $arrayfields[
'p.usage_organize_event'][
'checked'] = 1;
270if (
GETPOST(
'cancel',
'alpha')) {
274if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
278$parameters = array(
'socid'=>$socid);
279$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
284if (empty($reshook)) {
286 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
289 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
293 $search_societe =
"";
294 $search_societe_alias =
'';
296 $search_opp_status = -1;
297 $search_opp_amount =
'';
298 $search_opp_percent =
'';
299 $search_budget_amount =
'';
302 $search_project_user =
'';
303 $search_project_contact =
'';
310 $search_date_start_startmonth =
"";
311 $search_date_start_startyear =
"";
312 $search_date_start_startday =
"";
313 $search_date_start_start =
"";
314 $search_date_start_endmonth =
"";
315 $search_date_start_endyear =
"";
316 $search_date_start_endday =
"";
317 $search_date_start_end =
"";
318 $search_date_end_startmonth =
"";
319 $search_date_end_startyear =
"";
320 $search_date_end_startday =
"";
321 $search_date_end_start =
"";
322 $search_date_end_endmonth =
"";
323 $search_date_end_endyear =
"";
324 $search_date_end_endday =
"";
325 $search_date_end_end =
"";
326 $search_date_creation_startmonth =
"";
327 $search_date_creation_startyear =
"";
328 $search_date_creation_startday =
"";
329 $search_date_creation_start =
"";
330 $search_date_creation_endmonth =
"";
331 $search_date_creation_endyear =
"";
332 $search_date_creation_endday =
"";
333 $search_date_creation_end =
"";
334 $search_date_modif_startmonth =
"";
335 $search_date_modif_startyear =
"";
336 $search_date_modif_startday =
"";
337 $search_date_modif_start =
"";
338 $search_date_modif_endmonth =
"";
339 $search_date_modif_endyear =
"";
340 $search_date_modif_endday =
"";
341 $search_date_modif_end =
"";
342 $search_usage_opportunity =
'';
343 $search_usage_task =
'';
344 $search_usage_bill_time =
'';
345 $search_usage_event_organization =
'';
346 $search_accept_conference_suggestions =
'';
347 $search_accept_booth_suggestions =
'';
348 $search_price_registration =
'';
349 $search_price_booth =
'';
351 $search_import_key =
'';
353 $search_array_options = array();
354 $search_category_array = array();
359 $objectclass =
'Project';
360 $objectlabel =
'Project';
361 $permissiontoread = $user->hasRight(
'projet',
'lire');
362 $permissiontodelete = $user->hasRight(
'projet',
'supprimer');
363 $permissiontoadd = $user->hasRight(
'projet',
'creer');
364 $uploaddir = $conf->project->dir_output;
365 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
368 if (!$error && $massaction ==
'close' && $user->hasRight(
'projet',
'creer')) {
371 $objecttmp =
new $objectclass($db);
373 foreach ($toselect as $toselectid) {
374 $result = $objecttmp->fetch($toselectid);
376 $userWrite = $object->restrictedProjectArea($user,
'write');
377 if ($userWrite > 0 && $objecttmp->statut == 1) {
378 $result = $objecttmp->setClose($user);
386 } elseif ($userWrite <= 0) {
387 setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref),
null,
'warnings');
389 setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref),
null,
'warnings');
416unset($_SESSION[
'pageforbacktolist'][
'project']);
418$form =
new Form($db);
423$companystatic =
new Societe($db);
424$taskstatic =
new Task($db);
427$userstatic =
new User($db);
429$help_url =
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
430$title = $langs->trans(
"LeadsOrProjects");
432 $title = $langs->trans(
"Projects");
435 $title = $langs->trans(
"Leads");
443if (!$user->hasRight(
'projet',
'all',
'lire')) {
444 $projectsListId = $object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
448$listofprojectcontacttype = array();
449$listofprojectcontacttypeexternal = array();
450$sql =
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
451$sql .=
" WHERE ctc.element = '".$db->escape($object->element).
"'";
452$resql = $db->query($sql);
454 while ($obj = $db->fetch_object($resql)) {
455 if ($obj->source ==
'internal') {
456 $listofprojectcontacttype[$obj->rowid] = $obj->code;
458 $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
464if (count($listofprojectcontacttype) == 0) {
465 $listofprojectcontacttype[0] =
'0';
467if (count($listofprojectcontacttypeexternal) == 0) {
468 $listofprojectcontacttypeexternal[0] =
'0';
471$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
472$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage);
474$distinct =
'DISTINCT';
475$sql =
"SELECT ".$distinct.
" p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
476$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_update, p.budget_amount,";
477$sql .=
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
478$sql .=
" p.email_msgid, p.import_key,";
479$sql .=
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
480$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,";
481$sql .=
" country.code as country_code,";
482$sql .=
" cls.code as opp_status_code,";
483$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';
485if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
486 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
487 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
491$parameters = array();
492$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object);
493$sql .= $hookmanager->resPrint;
494$sql = preg_replace(
'/,\s*$/',
'', $sql);
498$sql .=
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as p";
499if (!empty($extrafields->attributes[$object->table_element][
'label']) &&is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
500 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
502$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
503$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
504$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
505$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
509if ($search_sale > 0) {
510 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON sc.fk_soc = s.rowid";
512if ($search_project_user > 0) {
513 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ecp";
515if ($search_project_contact > 0) {
516 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ecp_contact";
519$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
520$sql .= $hookmanager->resPrint;
522$sql .=
" WHERE p.entity IN (".getEntity(
'project', (
GETPOST(
'search_current_entity',
'int') ? 0 : 1)).
')';
523if (!$user->hasRight(
'projet',
'all',
'lire')) {
524 $sql .=
" AND p.rowid IN (".$db->sanitize($projectsListId).
")";
528 $sql .=
" AND (p.fk_soc = ".((int) $socid).
")";
536if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
537 $sql .=
natural_search(array(
"s.nom",
"s.name_alias"), $search_societe);
539 if ($search_societe) {
542 if ($search_societe_alias) {
546if ($search_opp_amount) {
549if ($search_opp_percent) {
552$sql .=
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
553$sql .=
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
555if ($search_date_start_start) {
556 $sql .=
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
558if ($search_date_start_end) {
559 $sql .=
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
562if ($search_date_end_start) {
563 $sql .=
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
565if ($search_date_end_end) {
566 $sql .=
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
569if ($search_date_creation_start) {
570 $sql .=
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
572if ($search_date_creation_end) {
573 $sql .=
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
576if ($search_date_modif_start) {
577 $sql .=
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
579if ($search_date_modif_end) {
580 $sql .=
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
584 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
586if ($search_status !=
'' && $search_status !=
'-1') {
587 if ($search_status == 99) {
588 $sql .=
" AND p.fk_statut IN (0,1)";
590 $sql .=
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
593if ($search_opp_status) {
594 if (is_numeric($search_opp_status) && $search_opp_status > 0) {
595 $sql .=
" AND p.fk_opp_status = ".((int) $search_opp_status);
597 if ($search_opp_status ==
'all') {
598 $sql .=
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
600 if ($search_opp_status ==
'openedopp') {
601 $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'))";
603 if ($search_opp_status ==
'notopenedopp') {
604 $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'))";
606 if ($search_opp_status ==
'none') {
607 $sql .=
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
610if ($search_public !=
'') {
611 $sql .=
" AND p.public = ".((int) $search_public);
615if ($search_sale > 0) {
616 $sql .=
" AND sc.fk_user = ".((int) $search_sale);
620if ($search_project_user > 0) {
622 $sql .=
" AND ecp.fk_c_type_contact IN (".$db->sanitize(join(
',', array_keys($listofprojectcontacttype))).
") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".((int) $search_project_user);
624if ($search_project_contact > 0) {
626 $sql .=
" AND ecp_contact.fk_c_type_contact IN (".$db->sanitize(join(
',', array_keys($listofprojectcontacttypeexternal))).
") AND ecp_contact.element_id = p.rowid AND ecp_contact.fk_socpeople = ".((int) $search_project_contact);
628if ($search_opp_amount !=
'') {
631if ($search_budget_amount !=
'') {
632 $sql .=
natural_search(
'p.budget_amount', $search_budget_amount, 1);
634if ($search_usage_opportunity !=
'' && $search_usage_opportunity >= 0) {
635 $sql .=
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
637if ($search_usage_task !=
'' && $search_usage_task >= 0) {
640if ($search_usage_bill_time !=
'' && $search_usage_bill_time >= 0) {
641 $sql .=
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
643if ($search_usage_event_organization !=
'' && $search_usage_event_organization >= 0) {
644 $sql .=
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
646if ($search_accept_conference_suggestions !=
'' && $search_accept_conference_suggestions >= 0) {
647 $sql .=
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
649if ($search_accept_booth_suggestions !=
'' && $search_accept_booth_suggestions >= 0) {
650 $sql .=
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
652if ($search_price_registration !=
'') {
653 $sql .=
natural_search(
'p.price_registration', $search_price_registration, 1);
655if ($search_price_booth !=
'') {
659 $sql .=
natural_search(array(
'u.login',
'u.firstname',
'u.lastname'), $search_login);
661if ($search_import_key) {
662 $sql .=
natural_search(array(
'p.import_key'), $search_import_key);
665 if ($search_omitChildren == 1) {
666 $sql .=
" AND p.fk_project IS NULL";
671$searchCategoryProjectList = $search_category_array;
672$searchCategoryProjectOperator = 0;
673if (!empty($searchCategoryProjectList)) {
674 $searchCategoryProjectSqlList = array();
675 $listofcategoryid =
'';
676 foreach ($searchCategoryProjectList as $searchCategoryProject) {
677 if (intval($searchCategoryProject) == -2) {
678 $searchCategoryProjectSqlList[] =
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
679 } elseif (intval($searchCategoryProject) > 0) {
680 if ($searchCategoryProjectOperator == 0) {
681 $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).
")";
683 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProject);
687 if ($listofcategoryid) {
688 $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).
"))";
690 if ($searchCategoryProjectOperator == 1) {
691 if (!empty($searchCategoryProjectSqlList)) {
692 $sql .=
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
695 if (!empty($searchCategoryProjectSqlList)) {
696 $sql .=
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
700$searchCategoryCustomerSqlList = array();
701if ($searchCategoryCustomerOperator == 1) {
702 $existsCategoryCustomerList = array();
703 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
704 if (intval($searchCategoryCustomer) == -2) {
705 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
706 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
707 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
708 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
709 $sqlCategoryCustomerNotExists .=
" )";
710 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
711 } elseif (intval($searchCategoryCustomer) > 0) {
712 $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
715 if (!empty($existsCategoryCustomerList)) {
716 $sqlCategoryCustomerExists =
" EXISTS (";
717 $sqlCategoryCustomerExists .=
" SELECT cat_cus.fk_soc";
718 $sqlCategoryCustomerExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
719 $sqlCategoryCustomerExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
720 $sqlCategoryCustomerExists .=
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
721 $sqlCategoryCustomerExists .=
" )";
722 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
724 if (!empty($searchCategoryCustomerSqlList)) {
725 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
728 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
729 if (intval($searchCategoryCustomer) == -2) {
730 $sqlCategoryCustomerNotExists =
" NOT EXISTS (";
731 $sqlCategoryCustomerNotExists .=
" SELECT cat_cus.fk_soc";
732 $sqlCategoryCustomerNotExists .=
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
733 $sqlCategoryCustomerNotExists .=
" WHERE cat_cus.fk_soc = p.fk_soc";
734 $sqlCategoryCustomerNotExists .=
" )";
735 $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
736 } elseif (intval($searchCategoryCustomer) > 0) {
737 $searchCategoryCustomerSqlList[] =
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
740 if (!empty($searchCategoryCustomerSqlList)) {
741 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
745include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
747$parameters = array();
748$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object);
749$sql .= $hookmanager->resPrint;
753$nbtotalofrecords =
'';
756 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
757 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
758 $resql = $db->query($sqlforcount);
760 $objforcount = $db->fetch_object($resql);
761 $nbtotalofrecords = $objforcount->nbtotalofrecords;
766 if (($page * $limit) > $nbtotalofrecords) {
774$sql .= $db->order($sortfield, $sortorder);
776 $sql .= $db->plimit($limit + 1, $offset);
779$resql = $db->query($sql);
785$num = $db->num_rows($resql);
788if ($num == 1 &&
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
789 $obj = $db->fetch_object($resql);
790 header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
800$arrayofselected = is_array($toselect) ? $toselect : array();
804 $param .=
'&mode='.urlencode($mode);
806if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
807 $param .=
'&contextpage='.urlencode($contextpage);
809if ($limit > 0 && $limit != $conf->liste_limit) {
810 $param .=
'&limit='.((int) $limit);
812if ($optioncss !=
'') {
813 $param .=
'&optioncss='.urlencode($optioncss);
816 $param .=
'&socid='.urlencode($socid);
818if ($search_all !=
'') {
819 $param .=
'&search_all='.urlencode($search_all);
822 $param .=
'&search_sday='.urlencode($search_sday);
825 $param .=
'&search_smonth='.urlencode($search_smonth);
828 $param .=
'&search_syear='.urlencode($search_syear);
831 $param .=
'&search_eday='.urlencode($search_eday);
834 $param .=
'&search_emonth='.urlencode($search_emonth);
837 $param .=
'&search_eyear='.urlencode($search_eyear);
839if ($search_date_start_startmonth) {
840 $param .=
'&search_date_start_startmonth='.urlencode($search_date_start_startmonth);
842if ($search_date_start_startyear) {
843 $param .=
'&search_date_start_startyear='.urlencode($search_date_start_startyear);
845if ($search_date_start_startday) {
846 $param .=
'&search_date_start_startday='.urlencode($search_date_start_startday);
848if ($search_date_start_start) {
849 $param .=
'&search_date_start_start='.urlencode($search_date_start_start);
851if ($search_date_start_endmonth) {
852 $param .=
'&search_date_start_endmonth='.urlencode($search_date_start_endmonth);
854if ($search_date_start_endyear) {
855 $param .=
'&search_date_start_endyear='.urlencode($search_date_start_endyear);
857if ($search_date_start_endday) {
858 $param .=
'&search_date_start_endday='.urlencode($search_date_start_endday);
860if ($search_date_start_end) {
861 $param .=
'&search_date_start_end='.urlencode($search_date_start_end);
863if ($search_date_end_startmonth) {
864 $param .=
'&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
866if ($search_date_end_startyear) {
867 $param .=
'&search_date_end_startyear='.urlencode($search_date_end_startyear);
869if ($search_date_end_startday) {
870 $param .=
'&search_date_end_startday='.urlencode($search_date_end_startday);
872if ($search_date_end_start) {
873 $param .=
'&search_date_end_start='.urlencode($search_date_end_start);
875if ($search_date_end_endmonth) {
876 $param .=
'&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
878if ($search_date_end_endyear) {
879 $param .=
'&search_date_end_endyear='.urlencode($search_date_end_endyear);
881if ($search_date_end_endday) {
882 $param .=
'&search_date_end_endday='.urlencode($search_date_end_endday);
884if ($search_date_end_end) {
885 $param .=
'&search_date_end_end=' . urlencode($search_date_end_end);
887if ($search_date_creation_startmonth) {
888 $param .=
'&search_date_creation_startmonth='.urlencode($search_date_creation_startmonth);
890if ($search_date_creation_startyear) {
891 $param .=
'&search_date_creation_startyear='.urlencode($search_date_creation_startyear);
893if ($search_date_creation_startday) {
894 $param .=
'&search_date_creation_startday='.urlencode($search_date_creation_startday);
896if ($search_date_creation_start) {
897 $param .=
'&search_date_creation_start='.urlencode($search_date_creation_start);
899if ($search_date_creation_endmonth) {
900 $param .=
'&search_date_creation_endmonth='.urlencode($search_date_creation_endmonth);
902if ($search_date_creation_endyear) {
903 $param .=
'&search_date_creation_endyear='.urlencode($search_date_creation_endyear);
905if ($search_date_creation_endday) {
906 $param .=
'&search_date_creation_endday='.urlencode($search_date_creation_endday);
908if ($search_date_creation_end) {
909 $param .=
'&search_date_creation_end='.urlencode($search_date_creation_end);
911if ($search_date_modif_startmonth) {
912 $param .=
'&search_date_modif_startmonth='.urlencode($search_date_modif_startmonth);
914if ($search_date_modif_startyear) {
915 $param .=
'&search_date_modif_startyear='.urlencode($search_date_modif_startyear);
917if ($search_date_modif_startday) {
918 $param .=
'&search_date_modif_startday='.urlencode($search_date_modif_startday);
920if ($search_date_modif_start) {
921 $param .=
'&search_date_modif_start='.urlencode($search_date_modif_start);
923if ($search_date_modif_endmonth) {
924 $param .=
'&search_date_modif_endmonth='.urlencode($search_date_modif_endmonth);
926if ($search_date_modif_endyear) {
927 $param .=
'&search_date_modif_endyear='.urlencode($search_date_modif_endyear);
929if ($search_date_modif_endday) {
930 $param .=
'&search_date_modif_endday='.urlencode($search_date_modif_endday);
932if ($search_date_modif_end) {
933 $param .=
'&search_date_modif_end=' . urlencode($search_date_modif_end);
935if (!empty($search_category_array)) {
936 foreach ($search_category_array as $tmpval) {
937 $param .=
'&search_categegory_project_list[]='.urlencode($tmpval);
940if ($search_ref !=
'') {
941 $param .=
'&search_ref='.urlencode($search_ref);
943if ($search_label !=
'') {
944 $param .=
'&search_label='.urlencode($search_label);
946if ($search_societe !=
'') {
947 $param .=
'&search_societe='.urlencode($search_societe);
949if ($search_societe_alias !=
'') {
950 $param .=
'&search_societe_alias='.urlencode($search_societe_alias);
952if ($search_status !=
'' && $search_status !=
'-1') {
953 $param .=
"&search_status=".urlencode($search_status);
955if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all',
'openedopp',
'notopenedopp',
'none'))) {
956 $param .=
'&search_opp_status='.urlencode($search_opp_status);
958if ($search_opp_percent !=
'') {
959 $param .=
'&search_opp_percent='.urlencode($search_opp_percent);
961if ($search_public !=
'') {
962 $param .=
'&search_public='.urlencode($search_public);
964if ($search_project_user > 0) {
965 $param .=
'&search_project_user='.urlencode($search_project_user);
967if ($search_project_contact > 0) {
968 $param .=
'&search_project_contact='.urlencode($search_project_contact);
970if ($search_sale > 0) {
971 $param .=
'&search_sale='.urlencode($search_sale);
973if ($search_opp_amount !=
'') {
974 $param .=
'&search_opp_amount='.urlencode($search_opp_amount);
976if ($search_budget_amount !=
'') {
977 $param .=
'&search_budget_amount='.urlencode($search_budget_amount);
979if ($search_usage_task !=
'') {
980 $param .=
'&search_usage_task='.urlencode($search_usage_task);
982if ($search_usage_bill_time !=
'') {
983 $param .=
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
985if ($search_usage_event_organization !=
'') {
986 $param .=
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
988if ($search_accept_conference_suggestions !=
'') {
989 $param .=
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
991if ($search_accept_booth_suggestions !=
'') {
992 $param .=
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
994if ($search_price_registration !=
'') {
995 $param .=
'&search_price_registration='.urlencode($search_price_registration);
997if ($search_price_booth !=
'') {
998 $param .=
'&search_price_booth='.urlencode($search_price_booth);
1001 $param .=
'&search_login='.urlencode($search_login);
1003if ($search_import_key) {
1004 $param .=
'&search_import_key='.urlencode($search_import_key);
1006foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
1007 $param .=
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
1010include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
1013$parameters = array(
'param' => &$param);
1014$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
1015$param .= $hookmanager->resPrint;
1018$arrayofmassactions = array(
1019 'validate'=>
img_picto(
'',
'check',
'class="pictofixedwidth"').$langs->trans(
"Validate"),
1020 'generate_doc'=>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
1025if ($user->hasRight(
'projet',
'creer')) {
1026 $arrayofmassactions[
'close'] =
img_picto(
'',
'close_title',
'class="pictofixedwidth"').$langs->trans(
"Close");
1027 $arrayofmassactions[
'preaffectuser'] =
img_picto(
'',
'user',
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
1029if ($user->hasRight(
'projet',
'supprimer')) {
1030 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
1032if (isModEnabled(
'category') && $user->hasRight(
'projet',
'creer')) {
1033 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
1035if (in_array($massaction, array(
'presend',
'predelete',
'preaffecttag',
'preaffectuser'))) {
1036 $arrayofmassactions = array();
1039$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1041$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
1042if (!empty($socid)) {
1043 $url .=
'&socid='.$socid;
1045if ($search_usage_event_organization == 1) {
1046 $url .=
'&usage_organize_event=1';
1047 if (((
int) $search_usage_opportunity) < 1) {
1048 $url .=
'&usage_opportunity=0';
1053$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
1054$newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
1056$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewProject'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'projet',
'creer'));
1058print
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
1059if ($optioncss !=
'') {
1060 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1062print
'<input type="hidden" name="token" value="'.newToken().
'">';
1063print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1064print
'<input type="hidden" name="action" value="list">';
1065print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1066print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1067print
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
1068print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1073if ($search_project_user == $user->id) {
1074 $texthelp .= $langs->trans(
"MyProjectsDesc");
1076 if ($user->hasRight(
'projet',
'all',
'lire') && !$socid) {
1077 $texthelp .= $langs->trans(
"ProjectsDesc");
1079 $texthelp .= $langs->trans(
"ProjectsPublicDesc");
1083print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'project', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1086$topicmail =
"Information";
1087$modelmail =
"project";
1089$trackid =
'proj'.$object->id;
1090include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1093 foreach ($fieldstosearchall as $key => $val) {
1094 $fieldstosearchall[$key] = $langs->trans($val);
1096 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
1102$moreforfilter .=
'<div class="divsearchfield">';
1103$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
1106if (!$user->hasRight(
'user',
'user',
'lire')) {
1107 $includeonly = array($user->id);
1109$moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user :
'',
'search_project_user', $tmptitle,
'', 0, $includeonly,
'', 0, 0, 0,
'', 0,
'',
'maxwidth300 widthcentpercentminusx');
1110$moreforfilter .=
'</div>';
1112$moreforfilter .=
'<div class="divsearchfield">';
1113$tmptitle = $langs->trans(
'ProjectsWithThisContact');
1114$moreforfilter .=
img_picto($tmptitle,
'contact',
'class="pictofixedwidth"').$form->selectcontacts(0, $search_project_contact ? $search_project_contact :
'',
'search_project_contact', $tmptitle,
'',
'', 0,
'maxwidth300 widthcentpercentminusx');
1115$moreforfilter .=
'</div>';
1118if ($user->hasRight(
'user',
'user',
'lire')) {
1119 $langs->load(
"commercial");
1120 $moreforfilter .=
'<div class="divsearchfield">';
1121 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1122 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth300 widthcentpercentminusx');
1123 $moreforfilter .=
'</div>';
1127if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
1129 $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array,
'minwidth300imp minwidth300 widthcentpercentminusx');
1132if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"categorie") && $user->hasRight(
'categorie',
'lire')) {
1133 $moreforfilter .=
'<div class="divsearchfield">';
1134 $tmptitle = $langs->transnoentities(
'CustomersProspectsCategoriesShort');
1135 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1136 $categoriesArr = $form->select_all_categories(Categorie::TYPE_CUSTOMER,
'',
'', 64, 0, 1);
1137 $categoriesArr[-2] =
'- '.$langs->trans(
'NotCategorized').
' -';
1138 $moreforfilter .=
Form::multiselectarray(
'search_category_customer_list', $categoriesArr, $searchCategoryCustomerList, 0, 0,
'minwidth300im minwidth300 widthcentpercentminusx', 0, 0,
'',
'category', $tmptitle);
1139 $moreforfilter .=
' <input type="checkbox" class="valignmiddle" id="search_category_customer_operator" name="search_category_customer_operator" value="1"'.($searchCategoryCustomerOperator == 1 ?
' checked="checked"' :
'').
'/>';
1140 $moreforfilter .= $form->textwithpicto(
'', $langs->trans(
'UseOrOperatorForCategories') .
' : ' . $tmptitle, 1,
'help',
'', 0, 2,
'tooltip_cat_cus');
1141 $moreforfilter .=
'</div>';
1146 $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"' :
'').
'"> ';
1149if (!empty($moreforfilter)) {
1150 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1151 print $moreforfilter;
1152 $parameters = array();
1153 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
1154 print $hookmanager->resPrint;
1158$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1159$selectedfields = ($mode !=
'kanban' ? $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
'')) :
'');
1160$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) :
'');
1163print
'<div class="div-table-responsive">';
1164print
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1168print
'<tr class="liste_titre_filter">';
1171 print
'<td class="liste_titre maxwidthsearch">';
1172 $searchpicto = $form->showFilterButtons(
'left');
1177if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1178 print
'<td class="liste_titre">';
1179 print
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
1183if (!empty($arrayfields[
'p.title'][
'checked'])) {
1184 print
'<td class="liste_titre">';
1185 print
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
1189if (!empty($arrayfields[
's.nom'][
'checked'])) {
1190 print
'<td class="liste_titre">';
1192 $tmpthirdparty =
new Societe($db);
1193 $tmpthirdparty->fetch($socid);
1194 $search_societe = $tmpthirdparty->name;
1196 print
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
1201if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1202 print
'<td class="liste_titre">';
1204 $tmpthirdparty =
new Societe($db);
1205 $tmpthirdparty->fetch($socid);
1206 $search_societe_alias = $tmpthirdparty->name_alias;
1208 print
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
1212if (!empty($arrayfields[
'commercial'][
'checked'])) {
1213 print
'<td class="liste_titre"> </td>';
1216if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1217 print
'<td class="liste_titre center nowraponall">';
1223 print
'<div class="nowrapfordate">';
1224 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'));
1226 print
'<div class="nowrapfordate">';
1227 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'));
1232if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1233 print
'<td class="liste_titre center nowraponall">';
1239 print
'<div class="nowrapfordate">';
1240 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'));
1242 print
'<div class="nowrapfordate">';
1243 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'));
1248if (!empty($arrayfields[
'p.public'][
'checked'])) {
1249 print
'<td class="liste_titre center">';
1250 $array = array(
''=>
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
1251 print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0,
'', 0, 0, 0,
'',
'maxwidth75');
1254if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1255 print
'<td class="liste_titre center">';
1259if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1260 print
'<td class="liste_titre nowrap center">';
1261 print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0,
'maxwidth125 nowrapoption', 1, 1);
1264if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1265 print
'<td class="liste_titre nowrap right">';
1266 print
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
1269if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1270 print
'<td class="liste_titre nowrap right">';
1271 print
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
1274if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1275 print
'<td class="liste_titre nowrap right">';
1278if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1279 print
'<td class="liste_titre nowrap right">';
1280 print
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
1283if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1284 print
'<td class="liste_titre nowrap">';
1285 print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1,
false, 1, 1);
1289if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1290 print
'<td class="liste_titre nowrap">';
1291 print $form->selectyesno(
'search_usage_task', $search_usage_task, 1,
false, 1, 1);
1294if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1295 print
'<td class="liste_titre nowrap">';
1296 print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1,
false, 1, 1);
1299if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1300 print
'<td class="liste_titre nowrap">';
1301 print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1,
false, 1, 1);
1304if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1305 print
'<td class="liste_titre nowrap">';
1306 print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1,
false, 1, 1);
1309if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1310 print
'<td class="liste_titre nowrap">';
1311 print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1,
false, 1, 1);
1314if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1315 print
'<td class="liste_titre nowrap right">';
1316 print
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
1319if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1320 print
'<td class="liste_titre nowrap right">';
1321 print
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
1324if (!empty($arrayfields[
'u.login'][
'checked'])) {
1326 print
'<td class="liste_titre" align="center">';
1327 print
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
1331include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1334$parameters = array(
'arrayfields'=>$arrayfields);
1335$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
1336print $hookmanager->resPrint;
1338if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1339 print
'<td class="liste_titre center nowraponall">';
1340 print
'<div class="nowrapfordate">';
1341 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'));
1343 print
'<div class="nowrapfordate">';
1344 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'));
1349if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1350 print
'<td class="liste_titre center nowraponall">';
1351 print
'<div class="nowrapfordate">';
1352 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'));
1354 print
'<div class="nowrapfordate">';
1355 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'));
1359if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1361 print
'<td class="liste_titre">';
1364if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1366 print
'<td class="liste_titre">';
1367 print
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
1370if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1371 print
'<td class="liste_titre center parentonrightofpage">';
1372 $formproject->selectProjectsStatus($search_status, 1,
'search_status');
1377 print
'<td class="liste_titre maxwidthsearch">';
1378 $searchpicto = $form->showFilterButtons();
1384$totalarray = array();
1385$totalarray[
'nbfield'] = 0;
1389print
'<tr class="liste_titre">';
1391 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1392 $totalarray[
'nbfield']++;
1394if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1395 print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"p.ref",
"", $param,
"", $sortfield, $sortorder);
1396 $totalarray[
'nbfield']++;
1398if (!empty($arrayfields[
'p.title'][
'checked'])) {
1399 print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"],
"p.title",
"", $param,
"", $sortfield, $sortorder);
1400 $totalarray[
'nbfield']++;
1402if (!empty($arrayfields[
's.nom'][
'checked'])) {
1403 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
1404 $totalarray[
'nbfield']++;
1406if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1407 print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"],
"s.name_alias",
"", $param,
"", $sortfield, $sortorder);
1408 $totalarray[
'nbfield']++;
1410if (!empty($arrayfields[
'commercial'][
'checked'])) {
1411 print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder,
'tdoverflowmax100imp ');
1412 $totalarray[
'nbfield']++;
1414if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1415 print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"],
"p.dateo",
"", $param,
'', $sortfield, $sortorder,
'center ');
1416 $totalarray[
'nbfield']++;
1418if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1419 print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datee",
"", $param,
'', $sortfield, $sortorder,
'center ');
1420 $totalarray[
'nbfield']++;
1422if (!empty($arrayfields[
'p.public'][
'checked'])) {
1423 print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"],
"p.public",
"", $param,
"", $sortfield, $sortorder,
'center ');
1424 $totalarray[
'nbfield']++;
1426if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1427 print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"],
"",
'', $param,
'', $sortfield, $sortorder,
'center ',
'');
1428 $totalarray[
'nbfield']++;
1430if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1431 print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"],
'p.fk_opp_status',
"", $param,
'', $sortfield, $sortorder,
'center ');
1432 $totalarray[
'nbfield']++;
1434if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1435 print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.opp_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1436 $totalarray[
'nbfield']++;
1438if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1439 print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'],
'p.opp_percent',
"", $param,
'', $sortfield, $sortorder,
'right ');
1440 $totalarray[
'nbfield']++;
1442if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1443 print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'],
'opp_weighted_amount',
'', $param,
'', $sortfield, $sortorder,
'right ');
1444 $totalarray[
'nbfield']++;
1446if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1447 print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"],
'p.budget_amount',
"", $param,
'', $sortfield, $sortorder,
'right ');
1448 $totalarray[
'nbfield']++;
1450if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1451 print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_opportunity',
"", $param,
'', $sortfield, $sortorder,
'');
1452 $totalarray[
'nbfield']++;
1454if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1455 print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_task',
"", $param,
'', $sortfield, $sortorder,
'');
1456 $totalarray[
'nbfield']++;
1458if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1459 print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_bill_time',
"", $param,
'', $sortfield, $sortorder,
'');
1460 $totalarray[
'nbfield']++;
1462if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1463 print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"],
'p.usage_organize_event',
"", $param,
'', $sortfield, $sortorder,
'');
1464 $totalarray[
'nbfield']++;
1466if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1467 print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_conference_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1468 $totalarray[
'nbfield']++;
1470if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1471 print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"],
'p.accept_booth_suggestions',
"", $param,
'', $sortfield, $sortorder,
'');
1472 $totalarray[
'nbfield']++;
1474if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1475 print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_registration',
"", $param,
'', $sortfield, $sortorder,
'right ');
1476 $totalarray[
'nbfield']++;
1478if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1479 print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"],
'p.price_booth',
"", $param,
'', $sortfield, $sortorder,
'right ');
1480 $totalarray[
'nbfield']++;
1482if (!empty($arrayfields[
'u.login'][
'checked'])) {
1483 print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"],
'u.login',
'', $param,
'align="center"', $sortfield, $sortorder);
1484 $totalarray[
'nbfield']++;
1487include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1489$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'totalarray'=>&$totalarray);
1490$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1491print $hookmanager->resPrint;
1492if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1493 print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"p.datec",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1494 $totalarray[
'nbfield']++;
1496if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1497 print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"p.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1498 $totalarray[
'nbfield']++;
1500if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
1501 print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"],
"p.email_msgid",
"", $param,
'', $sortfield, $sortorder,
'center ');
1502 $totalarray[
'nbfield']++;
1504if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
1505 print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"],
"p.import_key",
"", $param,
'', $sortfield, $sortorder,
'');
1506 $totalarray[
'nbfield']++;
1508if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
1509 print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"p.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'center ');
1510 $totalarray[
'nbfield']++;
1514 print
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"],
'',
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ').
"\n";
1515 $totalarray[
'nbfield']++;
1521$savnbfield = $totalarray[
'nbfield'];
1526$imaxinloop = ($limit ? min($num, $limit) : $num);
1527while ($i < $imaxinloop) {
1528 $obj = $db->fetch_object($resql);
1533 $object->id = $obj->id;
1534 $object->ref = $obj->ref;
1535 $object->title = $obj->title;
1536 $object->fk_opp_status = $obj->fk_opp_status;
1537 $object->user_author_id = $obj->fk_user_creat;
1538 $object->date_creation = $db->jdate($obj->date_creation);
1539 $object->date_start = $db->jdate($obj->date_start);
1540 $object->date_end = $db->jdate($obj->date_end);
1541 $object->statut = $obj->status;
1542 $object->status = $obj->status;
1543 $object->public = $obj->public;
1544 $object->opp_percent = $obj->opp_percent;
1545 $object->opp_status = $obj->fk_opp_status;
1546 $object->opp_status_code = $obj->opp_status_code;
1547 $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount :
"";
1548 $object->opp_weighted_amount = $obj->opp_weighted_amount;
1549 $object->budget_amount = $obj->budget_amount;
1550 $object->usage_opportunity = $obj->usage_opportunity;
1551 $object->usage_task = $obj->usage_task;
1552 $object->usage_bill_time = $obj->usage_bill_time;
1553 $object->usage_organize_event = $obj->usage_organize_event;
1554 $object->email_msgid = $obj->email_msgid;
1555 $object->import_key = $obj->import_key;
1561 $companystatic->id = $obj->socid;
1562 $companystatic->name = $obj->name;
1563 $companystatic->name_alias = $obj->alias;
1564 $companystatic->client = $obj->client;
1565 $companystatic->code_client = $obj->code_client;
1566 $companystatic->email = $obj->email;
1567 $companystatic->phone = $obj->phone;
1568 $companystatic->address = $obj->address;
1569 $companystatic->zip = $obj->zip;
1570 $companystatic->town = $obj->town;
1571 $companystatic->country_code = $obj->country_code;
1573 $object->thirdparty = $companystatic;
1575 $stringassignedusers =
'';
1577 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1579 foreach (array(
'internal',
'external') as $source) {
1580 $tab = $object->liste_contact(-1, $source, 0,
'', 1);
1581 $numcontact = count($tab);
1582 if (!empty($numcontact)) {
1583 foreach ($tab as $contactproject) {
1585 if ($source ==
'internal') {
1590 $c->fetch($contactproject[
'id']);
1593 if (get_class($c) ==
'User') {
1594 $stringassignedusers .= $c->getNomUrl(-2,
'', 0, 0, 24, 1,
'',
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1596 $stringassignedusers .= $c->getNomUrl(-2,
'', 0,
'', -1, 0,
'valignmiddle'.($ifisrt ?
'' :
' notfirst'));
1611 if ($mode ==
'kanban') {
1613 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1614 print
'<div class="box-flex-container kanban">';
1617 $selected = in_array($object->id, $arrayofselected);
1618 $arrayofdata = array(
'assignedusers' => $stringassignedusers,
'thirdparty'=>$companystatic,
'selected' => $selected);
1620 print $object->getKanbanView(
'', $arrayofdata);
1622 if ($i == ($imaxinloop - 1)) {
1628 $userstatic->id = $obj->fk_user_creat;
1629 $userstatic->login = $obj->login;
1630 $userstatic->lastname = $obj->lastname;
1631 $userstatic->firstname = $obj->firstname;
1632 $userstatic->email = $obj->user_email;
1633 $userstatic->statut = $obj->user_statut;
1634 $userstatic->entity = $obj->entity;
1635 $userstatic->photo = $obj->photo;
1636 $userstatic->office_phone = $obj->office_phone;
1637 $userstatic->office_fax = $obj->office_fax;
1638 $userstatic->user_mobile = $obj->user_mobile;
1639 $userstatic->job = $obj->job;
1640 $userstatic->gender = $obj->gender;
1644 print
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
1647 print
'<td class="nowrap center">';
1648 if ($massactionbutton || $massaction) {
1650 if (in_array($object->id, $arrayofselected)) {
1653 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1657 $totalarray[
'nbfield']++;
1661 if (!empty($arrayfields[
'p.ref'][
'checked'])) {
1662 print
'<td class="nowraponall tdoverflowmax200">';
1663 print $object->getNomUrl(1, (!empty(
GETPOST(
'search_usage_event_organization',
'int')) ?
'eventorganization' :
''));
1664 if ($object->hasDelay()) {
1669 $totalarray[
'nbfield']++;
1673 if (!empty($arrayfields[
'p.title'][
'checked'])) {
1674 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
1678 $totalarray[
'nbfield']++;
1682 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1683 print
'<td class="tdoverflowmax125">';
1685 print $companystatic->getNomUrl(1,
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
1691 $totalarray[
'nbfield']++;
1695 if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
1696 print
'<td class="tdoverflowmax100">';
1698 print $companystatic->name_alias;
1704 $totalarray[
'nbfield']++;
1708 if (!empty($arrayfields[
'commercial'][
'checked'])) {
1709 print
'<td class="tdoverflowmax150">';
1711 $companystatic->id = $obj->socid;
1712 $companystatic->name = $obj->name;
1713 $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
1714 $nbofsalesrepresentative = count($listsalesrepresentatives);
1715 if ($nbofsalesrepresentative > 6) {
1717 print $nbofsalesrepresentative;
1718 } elseif ($nbofsalesrepresentative > 0) {
1719 $userstatic =
new User($db);
1721 foreach ($listsalesrepresentatives as $val) {
1722 $userstatic->id = $val[
'id'];
1723 $userstatic->lastname = $val[
'lastname'];
1724 $userstatic->firstname = $val[
'firstname'];
1725 $userstatic->email = $val[
'email'];
1726 $userstatic->statut = $val[
'statut'];
1727 $userstatic->entity = $val[
'entity'];
1728 $userstatic->photo = $val[
'photo'];
1729 $userstatic->login = $val[
'login'];
1730 $userstatic->office_phone = $val[
'office_phone'];
1731 $userstatic->office_fax = $val[
'office_fax'];
1732 $userstatic->user_mobile = $val[
'user_mobile'];
1733 $userstatic->job = $val[
'job'];
1734 $userstatic->gender = $val[
'gender'];
1735 print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1,
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
1737 if ($j < $nbofsalesrepresentative) {
1748 $totalarray[
'nbfield']++;
1753 if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
1754 print
'<td class="center">';
1758 $totalarray[
'nbfield']++;
1762 if (!empty($arrayfields[
'p.datee'][
'checked'])) {
1763 print
'<td class="center">';
1767 $totalarray[
'nbfield']++;
1772 if (!empty($arrayfields[
'p.public'][
'checked'])) {
1773 print
'<td class="center">';
1775 print
img_picto($langs->trans(
'SharedProject'),
'world',
'class="paddingrightonly"');
1778 print
img_picto($langs->trans(
'PrivateProject'),
'private',
'class="paddingrightonly"');
1783 $totalarray[
'nbfield']++;
1787 if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
1788 print
'<td class="center nowraponall tdoverflowmax200">';
1789 print $stringassignedusers;
1792 $totalarray[
'nbfield']++;
1796 if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
1797 print
'<td class="center">';
1798 if ($obj->opp_status_code) {
1799 print $langs->trans(
"OppStatus".$obj->opp_status_code);
1803 $totalarray[
'nbfield']++;
1807 if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
1808 print
'<td class="right">';
1810 if (strcmp($obj->opp_amount,
'')) {
1811 print
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1812 if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
1813 $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
1815 $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
1820 $totalarray[
'nbfield']++;
1823 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.opp_amount';
1827 if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
1828 print
'<td class="right">';
1829 if ($obj->opp_percent) {
1830 print
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
1834 $totalarray[
'nbfield']++;
1838 if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
1839 if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
1840 $totalarray[
'val'][
'opp_weighted_amount'] = 0;
1842 print
'<td align="right">';
1843 if ($obj->opp_weighted_amount) {
1844 print
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1,
'').
'</span>';
1845 $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
1849 $totalarray[
'nbfield']++;
1850 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'opp_weighted_amount';
1854 if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
1855 print
'<td class="right">';
1856 if ($obj->budget_amount !=
'') {
1857 print
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
1858 if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
1859 $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
1861 $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
1866 $totalarray[
'nbfield']++;
1867 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.budget_amount';
1871 if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
1872 print
'<td class="">';
1873 if ($obj->usage_opportunity) {
1874 print
yn($obj->usage_opportunity);
1878 $totalarray[
'nbfield']++;
1882 if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
1883 print
'<td class="">';
1884 if ($obj->usage_task) {
1885 print
yn($obj->usage_task);
1889 $totalarray[
'nbfield']++;
1893 if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
1894 print
'<td class="">';
1895 if ($obj->usage_bill_time) {
1896 print
yn($obj->usage_bill_time);
1900 $totalarray[
'nbfield']++;
1904 if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
1905 print
'<td class="">';
1906 if ($obj->usage_organize_event) {
1907 print
yn($obj->usage_organize_event);
1911 $totalarray[
'nbfield']++;
1915 if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
1916 print
'<td class="">';
1917 if ($obj->accept_conference_suggestions) {
1918 print
yn($obj->accept_conference_suggestions);
1922 $totalarray[
'nbfield']++;
1926 if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
1927 print
'<td class="">';
1928 if ($obj->accept_booth_suggestions) {
1929 print
yn($obj->accept_booth_suggestions);
1933 $totalarray[
'nbfield']++;
1937 if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
1938 print
'<td class="right">';
1939 if ($obj->price_registration !=
'') {
1940 print
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
1941 $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
1945 $totalarray[
'nbfield']++;
1948 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_registration';
1952 if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
1953 print
'<td class="right">';
1954 if ($obj->price_booth !=
'') {
1955 print
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
1956 $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
1960 $totalarray[
'nbfield']++;
1963 $totalarray[
'pos'][$totalarray[
'nbfield']] =
'p.price_booth';
1967 if (!empty($arrayfields[
'u.login'][
'checked'])) {
1968 print
'<td class="center tdoverflowmax150">';
1969 if ($userstatic->id) {
1970 print $userstatic->getNomUrl(-1);
1976 $totalarray[
'nbfield']++;
1980 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1982 $parameters = array(
'arrayfields'=>$arrayfields,
'object'=>$object,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1983 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1984 print $hookmanager->resPrint;
1986 if (!empty($arrayfields[
'p.datec'][
'checked'])) {
1987 print
'<td class="center nowraponall">';
1988 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1991 $totalarray[
'nbfield']++;
1995 if (!empty($arrayfields[
'p.tms'][
'checked'])) {
1996 print
'<td class="center nowraponall">';
1997 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
2000 $totalarray[
'nbfield']++;
2004 if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
2005 print
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
2009 $totalarray[
'nbfield']++;
2013 if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
2014 print
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
2016 $totalarray[
'nbfield']++;
2020 if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
2021 print
'<td class="center">'.$object->getLibStatut(5).
'</td>';
2023 $totalarray[
'nbfield']++;
2028 print
'<td class="nowrap center">';
2029 if ($massactionbutton || $massaction) {
2031 if (in_array($object->id, $arrayofselected)) {
2034 print
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
2038 $totalarray[
'nbfield']++;
2050include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
2055 foreach ($arrayfields as $key => $val) {
2056 if (!empty($val[
'checked'])) {
2060 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
2065$parameters = array(
'arrayfields'=>$arrayfields,
'sql' => $sql);
2066$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
2067print $hookmanager->resPrint;
2069print
'</table>'.
"\n";
2072print
'</form>'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
dol_eval($s, $returnvalue=0, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.