36require 
'../main.inc.php';
 
   37require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
 
   38require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
 
   39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
 
   40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
 
   41require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
 
   42require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
 
   43if (isModEnabled(
'category')) {
 
   44  require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcategory.class.php';
 
   45  require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
 
   49$langs->loadLangs(array(
'projects', 
'companies', 
'commercial'));
 
   50if (isModEnabled(
'eventorganization') && $conf->eventorganization->enabled) {
 
   51  $langs->loadLangs(array(
'eventorganization'));
 
   54$action = 
GETPOST(
'action', 
'aZ09');
 
   55$massaction = 
GETPOST(
'massaction', 
'alpha');
 
   57$confirm = 
GETPOST(
'confirm', 
'alpha');
 
   58$toselect = 
GETPOST(
'toselect', 
'array');
 
   59$optioncss = 
GETPOST(
'optioncss', 
'alpha');
 
   60$contextpage = 
GETPOST(
'contextpage', 
'aZ') ? 
GETPOST(
'contextpage', 
'aZ') : 
'projectlist';
 
   61$mode = 
GETPOST(
'mode', 
'alpha');
 
   62$groupby = 
GETPOST(
'groupby', 
'aZ09');  
 
   64$title = $langs->trans(
"Projects");
 
   72  $title .= 
' (<a href="list.php">'.$soc->name.
'</a>)';
 
   74if (!$user->hasRight(
'projet', 
'lire')) {
 
   78$diroutputmassaction = $conf->project->dir_output.
'/temp/massgeneration/'.$user->id;
 
   81$sortfield = 
GETPOST(
'sortfield', 
'aZ09comma');
 
   82$sortorder = 
GETPOST(
'sortorder', 
'aZ09comma');
 
   84if (empty($page) || $page < 0 || 
GETPOST(
'button_search', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) {
 
   94$offset = $limit * $page;
 
   98$search_all = 
GETPOST(
'search_all', 
'alphanohtml') ? 
GETPOST(
'search_all', 
'alphanohtml') : 
GETPOST(
'sall', 
'alphanohtml');
 
   99$search_ref = 
GETPOST(
"search_ref", 
'alpha');
 
  100$search_label = 
GETPOST(
"search_label", 
'alpha');
 
  101$search_societe = 
GETPOST(
"search_societe", 
'alpha');
 
  102$search_societe_alias = 
GETPOST(
"search_societe_alias", 
'alpha');
 
  103$search_opp_status = 
GETPOST(
"search_opp_status", 
'alpha');
 
  104$search_opp_percent = 
GETPOST(
"search_opp_percent", 
'alpha');
 
  105$search_opp_amount = 
GETPOST(
"search_opp_amount", 
'alpha');
 
  106$search_budget_amount = 
GETPOST(
"search_budget_amount", 
'alpha');
 
  107$search_public = 
GETPOST(
"search_public", 
'intcomma');
 
  108$search_project_user = 
GETPOSTINT(
'search_project_user');
 
  109$search_project_contact = 
GETPOSTINT(
'search_project_contact');
 
  111$search_usage_opportunity = 
GETPOST(
'search_usage_opportunity', 
'intcomma');
 
  112$search_usage_task = 
GETPOST(
'search_usage_task', 
'intcomma');
 
  113$search_usage_bill_time = 
GETPOST(
'search_usage_bill_time', 
'intcomma');
 
  114$search_usage_event_organization = 
GETPOST(
'search_usage_event_organization', 
'intcomma');
 
  115$search_accept_conference_suggestions = 
GETPOST(
'search_accept_conference_suggestions', 
'intcomma');
 
  116$search_accept_booth_suggestions = 
GETPOST(
'search_accept_booth_suggestions', 
'intcomma');
 
  117$search_price_registration = 
GETPOST(
"search_price_registration", 
'alpha');
 
  118$search_price_booth = 
GETPOST(
"search_price_booth", 
'alpha');
 
  119$search_login = 
GETPOST(
'search_login', 
'alpha');
 
  120$search_import_key = 
GETPOST(
'search_import_key', 
'alpha');
 
  121$searchCategoryCustomerOperator = 0;
 
  122if (GETPOSTISSET(
'formfilteraction')) {
 
  123  $searchCategoryCustomerOperator = 
GETPOSTINT(
'search_category_customer_operator');
 
  125  $searchCategoryCustomerOperator = 
getDolGlobalString(
'MAIN_SEARCH_CAT_OR_BY_DEFAULT');
 
  127$searchCategoryCustomerList = 
GETPOST(
'search_category_customer_list', 
'array');
 
  129  $search_omitChildren = 
GETPOST(
'search_omitChildren', 
'alpha') == 
'on' ? 1 : 0;
 
  133$mine = ((
GETPOST(
'mode') == 
'mine') ? 1 : 0);
 
  135  $search_project_user = $user->id;
 
  146$search_date_start_startmonth = 
GETPOSTINT(
'search_date_start_startmonth');
 
  147$search_date_start_startyear = 
GETPOSTINT(
'search_date_start_startyear');
 
  148$search_date_start_startday = 
GETPOSTINT(
'search_date_start_startday');
 
  149$search_date_start_start = 
dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); 
 
  150$search_date_start_endmonth = 
GETPOSTINT(
'search_date_start_endmonth');
 
  151$search_date_start_endyear = 
GETPOSTINT(
'search_date_start_endyear');
 
  152$search_date_start_endday = 
GETPOSTINT(
'search_date_start_endday');
 
  153$search_date_start_end = 
dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear);  
 
  155$search_date_end_startmonth = 
GETPOSTINT(
'search_date_end_startmonth');
 
  156$search_date_end_startyear = 
GETPOSTINT(
'search_date_end_startyear');
 
  157$search_date_end_startday = 
GETPOSTINT(
'search_date_end_startday');
 
  158$search_date_end_start = 
dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); 
 
  159$search_date_end_endmonth = 
GETPOSTINT(
'search_date_end_endmonth');
 
  160$search_date_end_endyear = 
GETPOSTINT(
'search_date_end_endyear');
 
  161$search_date_end_endday = 
GETPOSTINT(
'search_date_end_endday');
 
  162$search_date_end_end = 
dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);  
 
  164$search_date_creation_startmonth = 
GETPOSTINT(
'search_date_creation_startmonth');
 
  165$search_date_creation_startyear = 
GETPOSTINT(
'search_date_creation_startyear');
 
  166$search_date_creation_startday = 
GETPOSTINT(
'search_date_creation_startday');
 
  167$search_date_creation_start = 
dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); 
 
  168$search_date_creation_endmonth = 
GETPOSTINT(
'search_date_creation_endmonth');
 
  169$search_date_creation_endyear = 
GETPOSTINT(
'search_date_creation_endyear');
 
  170$search_date_creation_endday = 
GETPOSTINT(
'search_date_creation_endday');
 
  171$search_date_creation_end = 
dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);  
 
  173$search_date_modif_startmonth = 
GETPOSTINT(
'search_date_modif_startmonth');
 
  174$search_date_modif_startyear = 
GETPOSTINT(
'search_date_modif_startyear');
 
  175$search_date_modif_startday = 
GETPOSTINT(
'search_date_modif_startday');
 
  176$search_date_modif_start = 
dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); 
 
  177$search_date_modif_endmonth = 
GETPOSTINT(
'search_date_modif_endmonth');
 
  178$search_date_modif_endyear = 
GETPOSTINT(
'search_date_modif_endyear');
 
  179$search_date_modif_endday = 
GETPOSTINT(
'search_date_modif_endday');
 
  180$search_date_modif_end = 
dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);  
 
  182$search_category_array = array();
 
  184if (isModEnabled(
'category')) {
 
  185  $search_category_array = 
GETPOST(
"search_category_".Categorie::TYPE_PROJECT.
"_list", 
"array");
 
  189  $search_status = implode(
',', 
GETPOST(
'search_status', 
'array:intcomma'));
 
  191  $search_status = (
GETPOST(
'search_status', 
'intcomma') != 
'' ? 
GETPOST(
'search_status', 
'intcomma') : 
'0,1');
 
  196$hookmanager->initHooks(array(
'projectlist'));
 
  200$extrafields->fetch_name_optionals_label(
$object->table_element);
 
  202$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element, 
'', 
'search_');
 
  205$fieldstosearchall = array();
 
  206foreach (
$object->fields as $key => $val) {
 
  207  if (empty($val[
'searchall'])) {
 
  212  if (!empty($user->socid) && $key == 
"note_private") {
 
  216  $fieldstosearchall[
'p.'.$key] = $val[
'label'];
 
  220$fieldstosearchall[
's.nom'] = 
"ThirdPartyName";
 
  221$fieldstosearchall[
's.name_alias'] = 
"AliasNameShort";
 
  222$fieldstosearchall[
's.code_client'] = 
"CustomerCode";
 
  225$arrayfields = array();
 
  226foreach (
$object->fields as $key => $val) {
 
  228  if (!empty($val[
'visible'])) {
 
  229    $visible = (int) 
dol_eval($val[
'visible'], 1, 1, 
'1');
 
  230    $arrayfields[
'p.'.$key] = array(
 
  231      'label' => $val[
'label'],
 
  232      'checked' => (($visible < 0) ? 0 : 1),
 
  233      'enabled' => (abs($visible) != 3 && (bool) 
dol_eval($val[
'enabled'], 1)),
 
  234      'position' => $val[
'position'],
 
  235      'help' => isset($val[
'help']) ? $val[
'help'] : 
'' 
  240include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
 
  243$arrayfields[
's.nom'] = array(
'label' => $langs->trans(
"ThirdParty"), 
'checked' => 1, 
'position' => 21, 
'enabled' => (!isModEnabled(
'societe') ? 0 : 1));
 
  244$arrayfields[
's.name_alias'] = array(
'label' => 
"AliasNameShort", 
'checked' => 0, 
'position' => 22);
 
  245$arrayfields[
'commercial'] = array(
'label' => $langs->trans(
"SaleRepresentativesOfThirdParty"), 
'checked' => 0, 
'position' => 23);
 
  246$arrayfields[
'c.assigned'] = array(
'label' => $langs->trans(
"AssignedTo"), 
'checked' => 1, 
'position' => 120);
 
  247$arrayfields[
'opp_weighted_amount'] = array(
'label' => $langs->trans(
'OpportunityWeightedAmountShort'), 
'checked' => 0, 
'enabled' => (!
getDolGlobalString(
'PROJECT_USE_OPPORTUNITIES') ? 0 : 1), 
'position' => 106);
 
  248$arrayfields[
'u.login'] = array(
'label' => 
"Author", 
'checked' => -1, 
'position' => 165);
 
  250if (
GETPOST(
'search_usage_opportunity')) {
 
  254if (
GETPOST(
'search_usage_event_organization')) {
 
  255  $arrayfields[
'p.fk_opp_status'][
'enabled'] = 0;
 
  256  $arrayfields[
'p.opp_amount'][
'enabled'] = 0;
 
  257  $arrayfields[
'p.opp_percent'][
'enabled'] = 0;
 
  258  $arrayfields[
'opp_weighted_amount'][
'enabled'] = 0;
 
  259  $arrayfields[
'p.usage_organize_event'][
'visible'] = 1;
 
  260  $arrayfields[
'p.usage_organize_event'][
'checked'] = 1;
 
  262$arrayfields[
'p.fk_project'][
'enabled'] = 0;
 
  265if ($contextpage == 
'lead') {
 
  266  $arrayfields[
'p.fk_opp_status'][
'enabled'] = 1;
 
  267  $arrayfields[
'p.fk_opp_status'][
'visible'] = 1;
 
  273'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  
 
  277$groupbyvalues = array();
 
  278$groupofcollpasedvalues = array();
 
  279if ($mode == 
'kanban' && $groupby) {
 
  281  $groupbyfield = preg_replace(
'/[a-z]\./', 
'', $groupby);
 
  282  if (!empty(
$object->fields[$groupbyfield][
'alias'])) {
 
  283    $groupbyfield = 
$object->fields[$groupbyfield][
'alias'];
 
  285  if (!in_array(preg_replace(
'/[a-z]\./', 
'', $groupby), array_keys(
$object->fields))) {
 
  288    if (!empty(
$object->fields[$groupby][
'arrayofkeyval'])) {
 
  289      $groupbyvalues = 
$object->fields[$groupby][
'arrayofkeyval'];
 
  290    } elseif (!empty(
$object->fields[preg_replace(
'/[a-z]\./', 
'', $groupby)][
'arrayofkeyval'])) {
 
  291      $groupbyvalues = 
$object->fields[preg_replace(
'/[a-z]\./', 
'', $groupby)][
'arrayofkeyval'];
 
  298      $sql = 
"SELECT cls.rowid, cls.code, cls.percent, cls.label";
 
  299      $sql .= 
" FROM ".MAIN_DB_PREFIX.
"c_lead_status as cls";
 
  300      $sql .= 
" WHERE active = 1";
 
  303      $sql .= $db->order(
'cls.rowid', 
'ASC'); 
 
  304      $resql = $db->query($sql);
 
  306        $num = $db->num_rows($resql);
 
  310          $objp = $db->fetch_object($resql);
 
  311          $groupbyvalues[$objp->rowid] = $objp->label;
 
  316      $groupofcollpasedvalues = array(6,7); 
 
  321  if ($groupby && !preg_match(
'/^'.preg_quote($db->sanitize($groupby), 
'/').
'/', $sortfield)) {
 
  323    $sortfield = $db->sanitize($groupby).($sortfield ? 
",".$sortfield : 
"");
 
  324    $sortorder = 
"ASC".($sortfield ? 
",".$sortorder : 
"");
 
  333if (
GETPOST(
'cancel', 
'alpha')) {
 
  337if (!
GETPOST(
'confirmmassaction', 
'alpha') && $massaction != 
'presend' && $massaction != 
'confirm_presend') {
 
  341$parameters = array(
'socid' => $socid, 
'arrayfields' => &$arrayfields);
 
  342$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action); 
 
  347if (empty($reshook)) {
 
  349  include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
 
  352  if (
GETPOST(
'button_removefilter_x', 
'alpha') || 
GETPOST(
'button_removefilter.x', 
'alpha') || 
GETPOST(
'button_removefilter', 
'alpha')) { 
 
  356    $search_societe = 
"";
 
  357    $search_societe_alias = 
'';
 
  359    $search_opp_status = -1;
 
  360    $search_opp_amount = 
'';
 
  361    $search_opp_percent = 
'';
 
  362    $search_budget_amount = 
'';
 
  365    $search_project_user = 
'';
 
  366    $search_project_contact = 
'';
 
  373    $search_date_start_startmonth = 
"";
 
  374    $search_date_start_startyear = 
"";
 
  375    $search_date_start_startday = 
"";
 
  376    $search_date_start_start = 
"";
 
  377    $search_date_start_endmonth = 
"";
 
  378    $search_date_start_endyear = 
"";
 
  379    $search_date_start_endday = 
"";
 
  380    $search_date_start_end = 
"";
 
  381    $search_date_end_startmonth = 
"";
 
  382    $search_date_end_startyear = 
"";
 
  383    $search_date_end_startday = 
"";
 
  384    $search_date_end_start = 
"";
 
  385    $search_date_end_endmonth = 
"";
 
  386    $search_date_end_endyear = 
"";
 
  387    $search_date_end_endday = 
"";
 
  388    $search_date_end_end = 
"";
 
  389    $search_date_creation_startmonth = 
"";
 
  390    $search_date_creation_startyear = 
"";
 
  391    $search_date_creation_startday = 
"";
 
  392    $search_date_creation_start = 
"";
 
  393    $search_date_creation_endmonth = 
"";
 
  394    $search_date_creation_endyear = 
"";
 
  395    $search_date_creation_endday = 
"";
 
  396    $search_date_creation_end = 
"";
 
  397    $search_date_modif_startmonth = 
"";
 
  398    $search_date_modif_startyear = 
"";
 
  399    $search_date_modif_startday = 
"";
 
  400    $search_date_modif_start = 
"";
 
  401    $search_date_modif_endmonth = 
"";
 
  402    $search_date_modif_endyear = 
"";
 
  403    $search_date_modif_endday = 
"";
 
  404    $search_date_modif_end = 
"";
 
  405    $search_usage_opportunity = 
'';
 
  406    $search_usage_task = 
'';
 
  407    $search_usage_bill_time = 
'';
 
  408    $search_usage_event_organization = 
'';
 
  409    $search_accept_conference_suggestions = 
'';
 
  410    $search_accept_booth_suggestions = 
'';
 
  411    $search_price_registration = 
'';
 
  412    $search_price_booth = 
'';
 
  414    $search_import_key = 
'';
 
  416    $search_array_options = array();
 
  417    $search_category_array = array();
 
  422  $objectclass = 
'Project';
 
  423  $objectlabel = 
'Project';
 
  424  $permissiontoread = $user->hasRight(
'projet', 
'lire');
 
  425  $permissiontodelete = $user->hasRight(
'projet', 
'supprimer');
 
  426  $permissiontoadd = $user->hasRight(
'projet', 
'creer');
 
  427  $uploaddir = $conf->project->dir_output;
 
  428  include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
 
  431  if (!$error && $massaction == 
'close' && $user->hasRight(
'projet', 
'creer')) {
 
  434    $objecttmp = 
new $objectclass($db);
 
  436    foreach ($toselect as $toselectid) {
 
  437      $result = $objecttmp->fetch($toselectid);
 
  439        $userWrite = 
$object->restrictedProjectArea($user, 
'write');
 
  440        if ($userWrite > 0 && $objecttmp->statut == 1) {
 
  441          $result = $objecttmp->setClose($user);
 
  449        } elseif ($userWrite <= 0) {
 
  450          setEventMessages($langs->trans(
"DontHavePermissionForCloseProject", $objecttmp->ref), 
null, 
'warnings');
 
  452          setEventMessages($langs->trans(
"DontHaveTheValidateStatus", $objecttmp->ref), 
null, 
'warnings');
 
  475unset($_SESSION[
'pageforbacktolist'][
'project']);
 
  477$form = 
new Form($db);
 
  482$companystatic = 
new Societe($db);
 
  483$taskstatic = 
new Task($db);
 
  486$userstatic = 
new User($db);
 
  488$help_url = 
"EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
 
  489$title = $langs->trans(
"LeadsOrProjects");
 
  491  $title = $langs->trans(
"Projects");
 
  494  $title = $langs->trans(
"Leads");
 
  502if (!$user->hasRight(
'projet', 
'all', 
'lire')) {
 
  503  $projectsListId = 
$object->getProjectsAuthorizedForUser($user, 0, 1, $socid);
 
  507$listofprojectcontacttype = array();
 
  508$listofprojectcontacttypeexternal = array();
 
  509$sql = 
"SELECT ctc.rowid, ctc.code, ctc.source FROM ".MAIN_DB_PREFIX.
"c_type_contact as ctc";
 
  510$sql .= 
" WHERE ctc.element = '".$db->escape(
$object->element).
"'";
 
  511$resql = $db->query($sql);
 
  513  while ($obj = $db->fetch_object($resql)) {
 
  514    if ($obj->source == 
'internal') {
 
  515      $listofprojectcontacttype[$obj->rowid] = $obj->code;
 
  517      $listofprojectcontacttypeexternal[$obj->rowid] = $obj->code;
 
  523if (count($listofprojectcontacttype) == 0) {
 
  524  $listofprojectcontacttype[0] = 
'0'; 
 
  526if (count($listofprojectcontacttypeexternal) == 0) {
 
  527  $listofprojectcontacttypeexternal[0] = 
'0'; 
 
  530$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
 
  531$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage); 
 
  533$sql = 
"SELECT p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
 
  534$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,";
 
  535$sql .= 
" p.usage_opportunity, p.usage_task, p.usage_bill_time, p.usage_organize_event,";
 
  536$sql .= 
" p.email_msgid, p.import_key,";
 
  537$sql .= 
" p.accept_conference_suggestions, p.accept_booth_suggestions, p.price_registration, p.price_booth,";
 
  538$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,";
 
  539$sql .= 
" country.code as country_code,";
 
  540$sql .= 
" cls.code as opp_status_code,";
 
  541$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';
 
  543if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
 
  544  foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
 
  545    $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] != 
'separate' ? 
", ef.".$key.
" as options_".$key : 
'');
 
  549$parameters = array();
 
  550$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object); 
 
  551$sql .= $hookmanager->resPrint;
 
  552$sql = preg_replace(
'/,\s*$/', 
'', $sql);
 
  556$sql .= 
" FROM ".MAIN_DB_PREFIX.$object->table_element.
" as p";
 
  557if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
 
  558  $sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (p.rowid = ef.fk_object)";
 
  560$sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s on p.fk_soc = s.rowid";
 
  561$sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on country.rowid = s.fk_pays";
 
  562$sql .= 
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_lead_status as cls on p.fk_opp_status = cls.rowid";
 
  563$sql .= 
' LEFT JOIN '.MAIN_DB_PREFIX.
'user AS u ON p.fk_user_creat = u.rowid';
 
  568$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object); 
 
  569$sql .= $hookmanager->resPrint;
 
  571$sql .= 
" WHERE p.entity IN (".getEntity(
'project', (
GETPOSTINT(
'search_current_entity') ? 0 : 1)).
')';
 
  572if (!$user->hasRight(
'projet', 
'all', 
'lire')) {
 
  573  $sql .= 
" AND p.rowid IN (".$db->sanitize($projectsListId).
")"; 
 
  577  $sql .= 
" AND (p.fk_soc = ".((int) $socid).
")"; 
 
  585if (empty($arrayfields[
's.name_alias'][
'checked']) && $search_societe) {
 
  586  $sql .= 
natural_search(array(
"s.nom", 
"s.name_alias"), $search_societe);
 
  588  if ($search_societe) {
 
  591  if ($search_societe_alias) {
 
  595if ($search_opp_amount) {
 
  598if ($search_opp_percent) {
 
  601$sql .= 
dolSqlDateFilter(
'p.dateo', $search_sday, $search_smonth, $search_syear);
 
  602$sql .= 
dolSqlDateFilter(
'p.datee', $search_eday, $search_emonth, $search_eyear);
 
  604if ($search_date_start_start) {
 
  605  $sql .= 
" AND p.dateo >= '".$db->idate($search_date_start_start).
"'";
 
  607if ($search_date_start_end) {
 
  608  $sql .= 
" AND p.dateo <= '".$db->idate($search_date_start_end).
"'";
 
  611if ($search_date_end_start) {
 
  612  $sql .= 
" AND p.datee >= '".$db->idate($search_date_end_start).
"'";
 
  614if ($search_date_end_end) {
 
  615  $sql .= 
" AND p.datee <= '".$db->idate($search_date_end_end).
"'";
 
  618if ($search_date_creation_start) {
 
  619  $sql .= 
" AND p.datec >= '".$db->idate($search_date_creation_start).
"'";
 
  621if ($search_date_creation_end) {
 
  622  $sql .= 
" AND p.datec <= '".$db->idate($search_date_creation_end).
"'";
 
  625if ($search_date_modif_start) {
 
  626  $sql .= 
" AND p.tms >= '".$db->idate($search_date_modif_start).
"'";
 
  628if ($search_date_modif_end) {
 
  629  $sql .= 
" AND p.tms <= '".$db->idate($search_date_modif_end).
"'";
 
  633  $sql .= 
natural_search(array_keys($fieldstosearchall), $search_all);
 
  635if ($search_status != 
'' && $search_status != 
'-1') {
 
  636  if ($search_status == 99) {
 
  637    $sql .= 
" AND p.fk_statut IN (0,1)";
 
  639    $sql .= 
" AND p.fk_statut IN (".$db->sanitize($db->escape($search_status)).
")";
 
  642if ($search_opp_status) {
 
  643  if (is_numeric($search_opp_status) && $search_opp_status > 0) {
 
  644    $sql .= 
" AND p.fk_opp_status = ".((int) $search_opp_status);
 
  646  if ($search_opp_status == 
'all') {
 
  647    $sql .= 
" AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)";
 
  649  if ($search_opp_status == 
'openedopp') {
 
  650    $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'))";
 
  652  if ($search_opp_status == 
'notopenedopp') {
 
  653    $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'))";
 
  655  if ($search_opp_status == 
'none') {
 
  656    $sql .= 
" AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)";
 
  659if ($search_public != 
'') {
 
  660  $sql .= 
" AND p.public = ".((int) $search_public);
 
  665if ($search_sale && $search_sale != 
'-1') {
 
  666  if ($search_sale == -2) {
 
  667    $sql .= 
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc)";
 
  668  } elseif ($search_sale > 0) {
 
  669    $sql .= 
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
 
  672if ($search_project_user > 0) {
 
  673  $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).
")";
 
  675if ($search_project_contact > 0) {
 
  676  $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).
")";
 
  678if ($search_opp_amount != 
'') {
 
  681if ($search_budget_amount != 
'') {
 
  682  $sql .= 
natural_search(
'p.budget_amount', $search_budget_amount, 1);
 
  684if ($search_usage_opportunity != 
'' && $search_usage_opportunity >= 0) {
 
  685  $sql .= 
natural_search(
'p.usage_opportunity', $search_usage_opportunity, 2);
 
  687if ($search_usage_task != 
'' && $search_usage_task >= 0) {
 
  690if ($search_usage_bill_time != 
'' && $search_usage_bill_time >= 0) {
 
  691  $sql .= 
natural_search(
'p.usage_bill_time', $search_usage_bill_time, 2);
 
  693if ($search_usage_event_organization != 
'' && $search_usage_event_organization >= 0) {
 
  694  $sql .= 
natural_search(
'p.usage_organize_event', $search_usage_event_organization, 2);
 
  696if ($search_accept_conference_suggestions != 
'' && $search_accept_conference_suggestions >= 0) {
 
  697  $sql .= 
natural_search(
'p.accept_conference_suggestions', $search_accept_conference_suggestions, 2);
 
  699if ($search_accept_booth_suggestions != 
'' && $search_accept_booth_suggestions >= 0) {
 
  700  $sql .= 
natural_search(
'p.accept_booth_suggestions', $search_accept_booth_suggestions, 2);
 
  702if ($search_price_registration != 
'') {
 
  703  $sql .= 
natural_search(
'p.price_registration', $search_price_registration, 1);
 
  705if ($search_price_booth != 
'') {
 
  709  $sql .= 
natural_search(array(
'u.login', 
'u.firstname', 
'u.lastname'), $search_login);
 
  711if ($search_import_key) {
 
  712  $sql .= 
natural_search(array(
'p.import_key'), $search_import_key);
 
  715  if ($search_omitChildren == 1) {
 
  716    $sql .= 
" AND p.fk_project IS NULL";
 
  721$searchCategoryProjectList = $search_category_array;
 
  722$searchCategoryProjectOperator = 0;
 
  723if (!empty($searchCategoryProjectList)) {
 
  724  $searchCategoryProjectSqlList = array();
 
  725  $listofcategoryid = 
'';
 
  726  foreach ($searchCategoryProjectList as $searchCategoryProject) {
 
  727    if (intval($searchCategoryProject) == -2) {
 
  728      $searchCategoryProjectSqlList[] = 
"NOT EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX.
"categorie_project as ck WHERE p.rowid = ck.fk_project)";
 
  729    } elseif (intval($searchCategoryProject) > 0) {
 
  730      if ($searchCategoryProjectOperator == 0) {
 
  731        $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).
")";
 
  733        $listofcategoryid .= ($listofcategoryid ? 
', ' : 
'') .((
int) $searchCategoryProject);
 
  737  if ($listofcategoryid) {
 
  738    $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).
"))";
 
  740  if ($searchCategoryProjectOperator == 1) {
 
  741    if (!empty($searchCategoryProjectSqlList)) {
 
  742      $sql .= 
" AND (".implode(
' OR ', $searchCategoryProjectSqlList).
")";
 
  745    if (!empty($searchCategoryProjectSqlList)) {
 
  746      $sql .= 
" AND (".implode(
' AND ', $searchCategoryProjectSqlList).
")";
 
  750$searchCategoryCustomerSqlList = array();
 
  751if ($searchCategoryCustomerOperator == 1) {
 
  752  $existsCategoryCustomerList = array();
 
  753  foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
 
  754    if (intval($searchCategoryCustomer) == -2) {
 
  755      $sqlCategoryCustomerNotExists  = 
" NOT EXISTS (";
 
  756      $sqlCategoryCustomerNotExists .= 
" SELECT cat_cus.fk_soc";
 
  757      $sqlCategoryCustomerNotExists .= 
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
 
  758      $sqlCategoryCustomerNotExists .= 
" WHERE cat_cus.fk_soc = p.fk_soc";
 
  759      $sqlCategoryCustomerNotExists .= 
" )";
 
  760      $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
 
  761    } elseif (intval($searchCategoryCustomer) > 0) {
 
  762      $existsCategoryCustomerList[] = $db->escape($searchCategoryCustomer);
 
  765  if (!empty($existsCategoryCustomerList)) {
 
  766    $sqlCategoryCustomerExists = 
" EXISTS (";
 
  767    $sqlCategoryCustomerExists .= 
" SELECT cat_cus.fk_soc";
 
  768    $sqlCategoryCustomerExists .= 
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
 
  769    $sqlCategoryCustomerExists .= 
" WHERE cat_cus.fk_soc = p.fk_soc";
 
  770    $sqlCategoryCustomerExists .= 
" AND cat_cus.fk_categorie IN (".$db->sanitize(implode(
',', $existsCategoryCustomerList)).
")";
 
  771    $sqlCategoryCustomerExists .= 
" )";
 
  772    $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerExists;
 
  774  if (!empty($searchCategoryCustomerSqlList)) {
 
  775    $sql .= 
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
 
  778  foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
 
  779    if (intval($searchCategoryCustomer) == -2) {
 
  780      $sqlCategoryCustomerNotExists = 
" NOT EXISTS (";
 
  781      $sqlCategoryCustomerNotExists .= 
" SELECT cat_cus.fk_soc";
 
  782      $sqlCategoryCustomerNotExists .= 
" FROM ".$db->prefix().
"categorie_societe AS cat_cus";
 
  783      $sqlCategoryCustomerNotExists .= 
" WHERE cat_cus.fk_soc = p.fk_soc";
 
  784      $sqlCategoryCustomerNotExists .= 
" )";
 
  785      $searchCategoryCustomerSqlList[] = $sqlCategoryCustomerNotExists;
 
  786    } elseif (intval($searchCategoryCustomer) > 0) {
 
  787      $searchCategoryCustomerSqlList[] = 
"p.fk_soc IN (SELECT fk_soc FROM ".$db->prefix().
"categorie_societe WHERE fk_categorie = ".((int) $searchCategoryCustomer).
")";
 
  790  if (!empty($searchCategoryCustomerSqlList)) {
 
  791    $sql .= 
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
 
  795include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
 
  797$parameters = array();
 
  798$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object); 
 
  799$sql .= $hookmanager->resPrint;
 
  803$nbtotalofrecords = 
'';
 
  806  $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields, 
'/').
'/', 
'SELECT COUNT(*) as nbtotalofrecords', $sql);
 
  807  $sqlforcount = preg_replace(
'/GROUP BY .*$/', 
'', $sqlforcount);
 
  808  $resql = $db->query($sqlforcount);
 
  810    $objforcount = $db->fetch_object($resql);
 
  811    $nbtotalofrecords = $objforcount->nbtotalofrecords;
 
  816  if (($page * $limit) > $nbtotalofrecords) { 
 
  824$sql .= $db->order($sortfield, $sortorder);
 
  826  $sql .= $db->plimit($limit + 1, $offset);
 
  830$resql = $db->query($sql);
 
  836$num = $db->num_rows($resql);
 
  839if ($num == 1 && 
getDolGlobalString(
'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
 
  840  $obj = $db->fetch_object($resql);
 
  841  header(
"Location: ".DOL_URL_ROOT.
'/projet/card.php?id='.$obj->id);
 
  849llxHeader(
'', $title, $help_url, 
'', 0, 0, 
'', 
'', 
'', 
'bodyforlist');
 
  851$arrayofselected = is_array($toselect) ? $toselect : array();
 
  855  $param .= 
'&mode='.urlencode($mode);
 
  857if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
 
  858  $param .= 
'&contextpage='.urlencode($contextpage);
 
  860if ($limit > 0 && $limit != $conf->liste_limit) {
 
  861  $param .= 
'&limit='.((int) $limit);
 
  863if ($optioncss != 
'') {
 
  864  $param .= 
'&optioncss='.urlencode($optioncss);
 
  867  $param .= 
'&groupby='.urlencode($groupby);
 
  871  $param .= 
'&socid='.urlencode((
string) $socid);
 
  873if ($search_all != 
'') {
 
  874  $param .= 
'&search_all='.urlencode($search_all);
 
  877  $param .= 
'&search_sday='.urlencode((
string) ($search_sday));
 
  880  $param .= 
'&search_smonth='.urlencode((
string) ($search_smonth));
 
  883  $param .= 
'&search_syear='.urlencode((
string) ($search_syear));
 
  886  $param .= 
'&search_eday='.urlencode((
string) ($search_eday));
 
  889  $param .= 
'&search_emonth='.urlencode((
string) ($search_emonth));
 
  892  $param .= 
'&search_eyear='.urlencode((
string) ($search_eyear));
 
  894if ($search_date_start_startmonth) {
 
  895  $param .= 
'&search_date_start_startmonth='.urlencode((
string) ($search_date_start_startmonth));
 
  897if ($search_date_start_startyear) {
 
  898  $param .= 
'&search_date_start_startyear='.urlencode((
string) ($search_date_start_startyear));
 
  900if ($search_date_start_startday) {
 
  901  $param .= 
'&search_date_start_startday='.urlencode((
string) ($search_date_start_startday));
 
  903if ($search_date_start_start) {
 
  904  $param .= 
'&search_date_start_start='.urlencode($search_date_start_start);
 
  906if ($search_date_start_endmonth) {
 
  907  $param .= 
'&search_date_start_endmonth='.urlencode((
string) ($search_date_start_endmonth));
 
  909if ($search_date_start_endyear) {
 
  910  $param .= 
'&search_date_start_endyear='.urlencode((
string) ($search_date_start_endyear));
 
  912if ($search_date_start_endday) {
 
  913  $param .= 
'&search_date_start_endday='.urlencode((
string) ($search_date_start_endday));
 
  915if ($search_date_start_end) {
 
  916  $param .= 
'&search_date_start_end='.urlencode($search_date_start_end);
 
  918if ($search_date_end_startmonth) {
 
  919  $param .= 
'&search_date_end_startmonth='.urlencode((
string) ($search_date_end_startmonth));
 
  921if ($search_date_end_startyear) {
 
  922  $param .= 
'&search_date_end_startyear='.urlencode((
string) ($search_date_end_startyear));
 
  924if ($search_date_end_startday) {
 
  925  $param .= 
'&search_date_end_startday='.urlencode((
string) ($search_date_end_startday));
 
  927if ($search_date_end_start) {
 
  928  $param .= 
'&search_date_end_start='.urlencode($search_date_end_start);
 
  930if ($search_date_end_endmonth) {
 
  931  $param .= 
'&search_date_end_endmonth='.urlencode((
string) ($search_date_end_endmonth));
 
  933if ($search_date_end_endyear) {
 
  934  $param .= 
'&search_date_end_endyear='.urlencode((
string) ($search_date_end_endyear));
 
  936if ($search_date_end_endday) {
 
  937  $param .= 
'&search_date_end_endday='.urlencode((
string) ($search_date_end_endday));
 
  939if ($search_date_end_end) {
 
  940  $param .= 
'&search_date_end_end=' . urlencode($search_date_end_end);
 
  942if ($search_date_creation_startmonth) {
 
  943  $param .= 
'&search_date_creation_startmonth='.urlencode((
string) ($search_date_creation_startmonth));
 
  945if ($search_date_creation_startyear) {
 
  946  $param .= 
'&search_date_creation_startyear='.urlencode((
string) ($search_date_creation_startyear));
 
  948if ($search_date_creation_startday) {
 
  949  $param .= 
'&search_date_creation_startday='.urlencode((
string) ($search_date_creation_startday));
 
  951if ($search_date_creation_start) {
 
  952  $param .= 
'&search_date_creation_start='.urlencode($search_date_creation_start);
 
  954if ($search_date_creation_endmonth) {
 
  955  $param .= 
'&search_date_creation_endmonth='.urlencode((
string) ($search_date_creation_endmonth));
 
  957if ($search_date_creation_endyear) {
 
  958  $param .= 
'&search_date_creation_endyear='.urlencode((
string) ($search_date_creation_endyear));
 
  960if ($search_date_creation_endday) {
 
  961  $param .= 
'&search_date_creation_endday='.urlencode((
string) ($search_date_creation_endday));
 
  963if ($search_date_creation_end) {
 
  964  $param .= 
'&search_date_creation_end='.urlencode($search_date_creation_end);
 
  966if ($search_date_modif_startmonth) {
 
  967  $param .= 
'&search_date_modif_startmonth='.urlencode((
string) ($search_date_modif_startmonth));
 
  969if ($search_date_modif_startyear) {
 
  970  $param .= 
'&search_date_modif_startyear='.urlencode((
string) ($search_date_modif_startyear));
 
  972if ($search_date_modif_startday) {
 
  973  $param .= 
'&search_date_modif_startday='.urlencode((
string) ($search_date_modif_startday));
 
  975if ($search_date_modif_start) {
 
  976  $param .= 
'&search_date_modif_start='.urlencode($search_date_modif_start);
 
  978if ($search_date_modif_endmonth) {
 
  979  $param .= 
'&search_date_modif_endmonth='.urlencode((
string) ($search_date_modif_endmonth));
 
  981if ($search_date_modif_endyear) {
 
  982  $param .= 
'&search_date_modif_endyear='.urlencode((
string) ($search_date_modif_endyear));
 
  984if ($search_date_modif_endday) {
 
  985  $param .= 
'&search_date_modif_endday='.urlencode((
string) ($search_date_modif_endday));
 
  987if ($search_date_modif_end) {
 
  988  $param .= 
'&search_date_modif_end=' . urlencode($search_date_modif_end);
 
  990if (!empty($search_category_array)) {
 
  991  foreach ($search_category_array as $tmpval) {
 
  992    $param .= 
'&search_categegory_project_list[]='.urlencode($tmpval);
 
  995if ($search_ref != 
'') {
 
  996  $param .= 
'&search_ref='.urlencode($search_ref);
 
  998if ($search_label != 
'') {
 
  999  $param .= 
'&search_label='.urlencode($search_label);
 
 1001if ($search_societe != 
'') {
 
 1002  $param .= 
'&search_societe='.urlencode($search_societe);
 
 1004if ($search_societe_alias != 
'') {
 
 1005  $param .= 
'&search_societe_alias='.urlencode($search_societe_alias);
 
 1007if ($search_status != 
'' && $search_status != 
'-1') {
 
 1008  $param .= 
"&search_status=".urlencode($search_status);
 
 1010if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array(
'all', 
'openedopp', 
'notopenedopp', 
'none'))) {
 
 1011  $param .= 
'&search_opp_status='.urlencode($search_opp_status);
 
 1013if ($search_opp_percent != 
'') {
 
 1014  $param .= 
'&search_opp_percent='.urlencode($search_opp_percent);
 
 1016if ($search_public != 
'') {
 
 1017  $param .= 
'&search_public='.urlencode($search_public);
 
 1019if ($search_project_user > 0) {
 
 1020  $param .= 
'&search_project_user='.urlencode($search_project_user);
 
 1022if ($search_project_contact > 0) {
 
 1023  $param .= 
'&search_project_contact='.urlencode((
string) ($search_project_contact));
 
 1025if ($search_sale > 0) {
 
 1026  $param .= 
'&search_sale='.urlencode((
string) ($search_sale));
 
 1028if ($search_opp_amount != 
'') {
 
 1029  $param .= 
'&search_opp_amount='.urlencode($search_opp_amount);
 
 1031if ($search_budget_amount != 
'') {
 
 1032  $param .= 
'&search_budget_amount='.urlencode($search_budget_amount);
 
 1034if ($search_usage_task != 
'') {
 
 1035  $param .= 
'&search_usage_task='.urlencode($search_usage_task);
 
 1037if ($search_usage_bill_time != 
'') {
 
 1038  $param .= 
'&search_usage_opportunity='.urlencode($search_usage_bill_time);
 
 1040if ($search_usage_event_organization != 
'') {
 
 1041  $param .= 
'&search_usage_event_organization='.urlencode($search_usage_event_organization);
 
 1043if ($search_accept_conference_suggestions != 
'') {
 
 1044  $param .= 
'&search_accept_conference_suggestions='.urlencode($search_accept_conference_suggestions);
 
 1046if ($search_accept_booth_suggestions != 
'') {
 
 1047  $param .= 
'&search_accept_booth_suggestions='.urlencode($search_accept_booth_suggestions);
 
 1049if ($search_price_registration != 
'') {
 
 1050  $param .= 
'&search_price_registration='.urlencode($search_price_registration);
 
 1052if ($search_price_booth != 
'') {
 
 1053  $param .= 
'&search_price_booth='.urlencode($search_price_booth);
 
 1056  $param .= 
'&search_login='.urlencode($search_login);
 
 1058if ($search_import_key) {
 
 1059  $param .= 
'&search_import_key='.urlencode($search_import_key);
 
 1061foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
 
 1062  $param .= 
"&search_category_customer_list[]=".urlencode($searchCategoryCustomer);
 
 1065include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
 
 1068$parameters = array(
'param' => &$param);
 
 1069$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action); 
 
 1070$param .= $hookmanager->resPrint;
 
 1073$arrayofmassactions = array(
 
 1074  'validate' => 
img_picto(
'', 
'check', 
'class="pictofixedwidth"').$langs->trans(
"Validate"),
 
 1075  'generate_doc' => 
img_picto(
'', 
'pdf', 
'class="pictofixedwidth"').$langs->trans(
"ReGeneratePDF"),
 
 1080if ($user->hasRight(
'projet', 
'creer')) {
 
 1081  $arrayofmassactions[
'close'] = 
img_picto(
'', 
'close_title', 
'class="pictofixedwidth"').$langs->trans(
"Close");
 
 1082  $arrayofmassactions[
'preaffectuser'] = 
img_picto(
'', 
'user', 
'class="pictofixedwidth"').$langs->trans(
"AffectUser");
 
 1084if ($user->hasRight(
'projet', 
'supprimer')) {
 
 1085  $arrayofmassactions[
'predelete'] = 
img_picto(
'', 
'delete', 
'class="pictofixedwidth"').$langs->trans(
"Delete");
 
 1087if (isModEnabled(
'category') && $user->hasRight(
'projet', 
'creer')) {
 
 1088  $arrayofmassactions[
'preaffecttag'] = 
img_picto(
'', 
'category', 
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
 
 1090if (in_array($massaction, array(
'presend', 
'predelete', 
'preaffecttag', 
'preaffectuser'))) {
 
 1091  $arrayofmassactions = array();
 
 1094$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
 
 1096$url = DOL_URL_ROOT.
'/projet/card.php?action=create';
 
 1097if (!empty($socid)) {
 
 1098  $url .= 
'&socid='.$socid;
 
 1100if ($search_usage_event_organization == 1) {
 
 1101  $url .= 
'&usage_organize_event=1';
 
 1102  if (((
int) $search_usage_opportunity) < 1) {
 
 1103    $url .= 
'&usage_opportunity=0';
 
 1108$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'));
 
 1109$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'));
 
 1111$newcardbutton .= 
dolGetButtonTitle($langs->trans(
'NewProject'), 
'', 
'fa fa-plus-circle', $url, 
'', $user->hasRight(
'projet', 
'creer'));
 
 1113print 
'<form method="POST" id="searchFormList" action="'.$_SERVER[
"PHP_SELF"].
'">';
 
 1114if ($optioncss != 
'') {
 
 1115  print 
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
 
 1117print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
 1118print 
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
 
 1119print 
'<input type="hidden" name="action" value="list">';
 
 1120print 
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
 
 1121print 
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
 
 1122print 
'<input type="hidden" name="contextpage" value="'.$contextpage.
'">';
 
 1123print 
'<input type="hidden" name="mode" value="'.$mode.
'">';
 
 1124print 
'<input type="hidden" name="groupby" value="'.$groupby.
'">';
 
 1128if ($search_project_user == $user->id) {
 
 1129  $texthelp .= $langs->trans(
"MyProjectsDesc");
 
 1131  if ($user->hasRight(
'projet', 
'all', 
'lire') && !$socid) {
 
 1132    $texthelp .= $langs->trans(
"ProjectsDesc");
 
 1134    $texthelp .= $langs->trans(
"ProjectsPublicDesc");
 
 1138print_barre_liste($form->textwithpicto($title, $texthelp), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 
'project', 0, $newcardbutton, 
'', $limit, 0, 0, 1);
 
 1141$topicmail = 
"Information";
 
 1142$modelmail = 
"project";
 
 1144$trackid = 
'proj'.$object->id;
 
 1145include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
 
 1148  foreach ($fieldstosearchall as $key => $val) {
 
 1149    $fieldstosearchall[$key] = $langs->trans($val);
 
 1151  print 
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
 
 1157$moreforfilter .= 
'<div class="divsearchfield">';
 
 1158$tmptitle = $langs->trans(
'ProjectsWithThisUserAsContact');
 
 1161if (!$user->hasRight(
'user', 
'user', 
'lire')) {
 
 1162  $includeonly = array($user->id);
 
 1164$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');
 
 1165$moreforfilter .= 
'</div>';
 
 1167$moreforfilter .= 
'<div class="divsearchfield">';
 
 1168$tmptitle = $langs->trans(
'ProjectsWithThisContact');
 
 1169$moreforfilter .= 
img_picto($tmptitle, 
'contact', 
'class="pictofixedwidth"').$form->select_contact(0, $search_project_contact ? $search_project_contact : 
'', 
'search_project_contact', $tmptitle, 
'', 
'', 0, 
'maxwidth300 widthcentpercentminusx');
 
 1171$moreforfilter .= 
'</div>';
 
 1174if ($user->hasRight(
'user', 
'user', 
'lire')) {
 
 1175  $langs->load(
"commercial");
 
 1176  $moreforfilter .= 
'<div class="divsearchfield">';
 
 1177  $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
 
 1178  $moreforfilter .= 
img_picto($tmptitle, 
'user', 
'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 
'search_sale', $user, 0, $tmptitle, 
'maxwidth300 widthcentpercentminusx');
 
 1179  $moreforfilter .= 
'</div>';
 
 1183if (isModEnabled(
'category') && $user->hasRight(
'categorie', 
'lire')) {
 
 1185  $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 
'minwidth300imp minwidth300 widthcentpercentminusx');
 
 1189if (
getDolGlobalString(
'MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled(
"category") && $user->hasRight(
'categorie', 
'lire')) {
 
 1191  $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 
'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0);
 
 1196  $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"' : 
'').
'"> ';
 
 1199if (!empty($moreforfilter)) {
 
 1200  print 
'<div class="liste_titre liste_titre_bydiv centpercent">';
 
 1201  print $moreforfilter;
 
 1202  $parameters = array();
 
 1203  $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action); 
 
 1204  print $hookmanager->resPrint;
 
 1208$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
 
 1209$htmlofselectarray = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage, 
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));  
 
 1210$selectedfields = ($mode != 
'kanban' ? $htmlofselectarray : 
'');
 
 1211$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons(
'checkforselect', 1) : 
'');
 
 1214print 
'<div class="div-table-responsive">';
 
 1215print 
'<table class="tagtable nobottomiftotal liste'.($moreforfilter ? 
" listwithfilterbefore" : 
"").
'">'.
"\n";
 
 1219print 
'<tr class="liste_titre_filter">';
 
 1222  print 
'<td class="liste_titre maxwidthsearch">';
 
 1223  $searchpicto = $form->showFilterButtons(
'left');
 
 1228if (!empty($arrayfields[
'p.ref'][
'checked'])) {
 
 1229  print 
'<td class="liste_titre">';
 
 1230  print 
'<input type="text" class="flat" name="search_ref" value="'.dol_escape_htmltag($search_ref).
'" size="6">';
 
 1234if (!empty($arrayfields[
'p.title'][
'checked'])) {
 
 1235  print 
'<td class="liste_titre">';
 
 1236  print 
'<input type="text" class="flat" name="search_label" size="8" value="'.dol_escape_htmltag($search_label).
'">';
 
 1240if (!empty($arrayfields[
's.nom'][
'checked'])) {
 
 1241  print 
'<td class="liste_titre">';
 
 1243    $tmpthirdparty = 
new Societe($db);
 
 1244    $tmpthirdparty->fetch($socid);
 
 1245    $search_societe = $tmpthirdparty->name;
 
 1247  print 
'<input type="text" class="flat" name="search_societe" size="8" value="'.dol_escape_htmltag($search_societe).
'">';
 
 1252if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
 
 1253  print 
'<td class="liste_titre">';
 
 1255    $tmpthirdparty = 
new Societe($db);
 
 1256    $tmpthirdparty->fetch($socid);
 
 1257    $search_societe_alias = $tmpthirdparty->name_alias;
 
 1259  print 
'<input type="text" class="flat" name="search_societe_alias" size="8" value="'.dol_escape_htmltag($search_societe_alias).
'">';
 
 1263if (!empty($arrayfields[
'commercial'][
'checked'])) {
 
 1264  print 
'<td class="liste_titre"> </td>';
 
 1267if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
 
 1268  print 
'<td class="liste_titre center">';
 
 1269  print 
'<div class="nowrapfordate">';
 
 1270  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'));
 
 1272  print 
'<div class="nowrapfordate">';
 
 1273  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'));
 
 1278if (!empty($arrayfields[
'p.datee'][
'checked'])) {
 
 1279  print 
'<td class="liste_titre center">';
 
 1280  print 
'<div class="nowrapfordate">';
 
 1281  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'));
 
 1283  print 
'<div class="nowrapfordate">';
 
 1284  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'));
 
 1289if (!empty($arrayfields[
'p.public'][
'checked'])) {
 
 1290  print 
'<td class="liste_titre center">';
 
 1291  $array = array(
'' => 
'', 0 => $langs->trans(
"PrivateProject"), 1 => $langs->trans(
"SharedProject"));
 
 1292  print $form->selectarray(
'search_public', $array, $search_public, 0, 0, 0, 
'', 0, 0, 0, 
'', 
'maxwidth75');
 
 1295if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
 
 1296  print 
'<td class="liste_titre center">';
 
 1300if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
 
 1301  print 
'<td class="liste_titre nowrap center">';
 
 1302  print $formproject->selectOpportunityStatus(
'search_opp_status', $search_opp_status, 1, 1, 1, 0, 
'maxwidth125 nowrapoption', 1, 1);
 
 1305if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
 
 1306  print 
'<td class="liste_titre nowrap right">';
 
 1307  print 
'<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.
'">';
 
 1310if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
 
 1311  print 
'<td class="liste_titre nowrap right">';
 
 1312  print 
'<input type="text" class="flat" name="search_opp_percent" size="2" value="'.$search_opp_percent.
'">';
 
 1315if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
 
 1316  print 
'<td class="liste_titre nowrap right">';
 
 1319if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
 
 1320  print 
'<td class="liste_titre nowrap right">';
 
 1321  print 
'<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.
'">';
 
 1324if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
 
 1325  print 
'<td class="liste_titre nowrap">';
 
 1326  print $form->selectyesno(
'search_usage_opportunity', $search_usage_opportunity, 1, 
false, 1, 1);
 
 1330if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
 
 1331  print 
'<td class="liste_titre nowrap">';
 
 1332  print $form->selectyesno(
'search_usage_task', $search_usage_task, 1, 
false, 1, 1);
 
 1335if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
 
 1336  print 
'<td class="liste_titre nowrap">';
 
 1337  print $form->selectyesno(
'search_usage_bill_time', $search_usage_bill_time, 1, 
false, 1, 1);
 
 1340if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
 
 1341  print 
'<td class="liste_titre nowrap">';
 
 1342  print $form->selectyesno(
'search_usage_event_organization', $search_usage_event_organization, 1, 
false, 1, 1);
 
 1345if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
 
 1346  print 
'<td class="liste_titre nowrap">';
 
 1347  print $form->selectyesno(
'search_accept_conference_suggestions', $search_accept_conference_suggestions, 1, 
false, 1, 1);
 
 1350if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
 
 1351  print 
'<td class="liste_titre nowrap">';
 
 1352  print $form->selectyesno(
'search_accept_booth_suggestions', $search_accept_booth_suggestions, 1, 
false, 1, 1);
 
 1355if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
 
 1356  print 
'<td class="liste_titre nowrap right">';
 
 1357  print 
'<input type="text" class="flat" name="search_price_registration" size="4" value="'.dol_escape_htmltag($search_price_registration).
'">';
 
 1360if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
 
 1361  print 
'<td class="liste_titre nowrap right">';
 
 1362  print 
'<input type="text" class="flat" name="search_price_booth" size="4" value="'.dol_escape_htmltag($search_price_booth).
'">';
 
 1365if (!empty($arrayfields[
'u.login'][
'checked'])) {
 
 1367  print 
'<td class="liste_titre" align="center">';
 
 1368  print 
'<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).
'">';
 
 1372include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
 
 1375$parameters = array(
'arrayfields' => $arrayfields);
 
 1376$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters); 
 
 1377print $hookmanager->resPrint;
 
 1379if (!empty($arrayfields[
'p.datec'][
'checked'])) {
 
 1380  print 
'<td class="liste_titre center">';
 
 1381  print 
'<div class="nowrapfordate">';
 
 1382  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'));
 
 1384  print 
'<div class="nowrapfordate">';
 
 1385  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'));
 
 1390if (!empty($arrayfields[
'p.tms'][
'checked'])) {
 
 1391  print 
'<td class="liste_titre center">';
 
 1392  print 
'<div class="nowrapfordate">';
 
 1393  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'));
 
 1395  print 
'<div class="nowrapfordate">';
 
 1396  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'));
 
 1400if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
 
 1402  print 
'<td class="liste_titre">';
 
 1405if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
 
 1407  print 
'<td class="liste_titre">';
 
 1408  print 
'<input class="flat width75" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).
'">';
 
 1411if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
 
 1412  print 
'<td class="liste_titre center parentonrightofpage">';
 
 1413  $formproject->selectProjectsStatus($search_status, 1, 
'search_status');
 
 1418  print 
'<td class="liste_titre maxwidthsearch">';
 
 1419  $searchpicto = $form->showFilterButtons();
 
 1425$totalarray = array();
 
 1426$totalarray[
'nbfield'] = 0;
 
 1430print 
'<tr class="liste_titre">';
 
 1432  print 
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"], 
'', 
'', 
'', 
'', $sortfield, $sortorder, 
'center maxwidthsearch ').
"\n";
 
 1433  $totalarray[
'nbfield']++;
 
 1435if (!empty($arrayfields[
'p.ref'][
'checked'])) {
 
 1436  print_liste_field_titre($arrayfields[
'p.ref'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.ref", 
"", $param, 
"", $sortfield, $sortorder);
 
 1437  $totalarray[
'nbfield']++;
 
 1439if (!empty($arrayfields[
'p.title'][
'checked'])) {
 
 1440  print_liste_field_titre($arrayfields[
'p.title'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.title", 
"", $param, 
"", $sortfield, $sortorder);
 
 1441  $totalarray[
'nbfield']++;
 
 1443if (!empty($arrayfields[
's.nom'][
'checked'])) {
 
 1444  print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"], 
"s.nom", 
"", $param, 
"", $sortfield, $sortorder);
 
 1445  $totalarray[
'nbfield']++;
 
 1447if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
 
 1448  print_liste_field_titre($arrayfields[
's.name_alias'][
'label'], $_SERVER[
"PHP_SELF"], 
"s.name_alias", 
"", $param, 
"", $sortfield, $sortorder);
 
 1449  $totalarray[
'nbfield']++;
 
 1451if (!empty($arrayfields[
'commercial'][
'checked'])) {
 
 1452  print_liste_field_titre($arrayfields[
'commercial'][
'label'], $_SERVER[
"PHP_SELF"], 
"", 
"", $param, 
"", $sortfield, $sortorder, 
'tdoverflowmax100imp ');
 
 1453  $totalarray[
'nbfield']++;
 
 1455if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
 
 1456  print_liste_field_titre($arrayfields[
'p.dateo'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.dateo", 
"", $param, 
'', $sortfield, $sortorder, 
'center ');
 
 1457  $totalarray[
'nbfield']++;
 
 1459if (!empty($arrayfields[
'p.datee'][
'checked'])) {
 
 1460  print_liste_field_titre($arrayfields[
'p.datee'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.datee", 
"", $param, 
'', $sortfield, $sortorder, 
'center ');
 
 1461  $totalarray[
'nbfield']++;
 
 1463if (!empty($arrayfields[
'p.public'][
'checked'])) {
 
 1464  print_liste_field_titre($arrayfields[
'p.public'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.public", 
"", $param, 
"", $sortfield, $sortorder, 
'center ');
 
 1465  $totalarray[
'nbfield']++;
 
 1467if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
 
 1468  print_liste_field_titre($arrayfields[
'c.assigned'][
'label'], $_SERVER[
"PHP_SELF"], 
"", 
'', $param, 
'', $sortfield, $sortorder, 
'center ', 
'');
 
 1469  $totalarray[
'nbfield']++;
 
 1471if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
 
 1472  print_liste_field_titre($arrayfields[
'p.fk_opp_status'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.fk_opp_status', 
"", $param, 
'', $sortfield, $sortorder, 
'center ');
 
 1473  $totalarray[
'nbfield']++;
 
 1475if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
 
 1476  print_liste_field_titre($arrayfields[
'p.opp_amount'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.opp_amount', 
"", $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1477  $totalarray[
'nbfield']++;
 
 1479if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
 
 1480  print_liste_field_titre($arrayfields[
'p.opp_percent'][
'label'], $_SERVER[
'PHP_SELF'], 
'p.opp_percent', 
"", $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1481  $totalarray[
'nbfield']++;
 
 1483if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
 
 1484  print_liste_field_titre($arrayfields[
'opp_weighted_amount'][
'label'], $_SERVER[
'PHP_SELF'], 
'opp_weighted_amount', 
'', $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1485  $totalarray[
'nbfield']++;
 
 1487if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
 
 1488  print_liste_field_titre($arrayfields[
'p.budget_amount'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.budget_amount', 
"", $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1489  $totalarray[
'nbfield']++;
 
 1491if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
 
 1492  print_liste_field_titre($arrayfields[
'p.usage_opportunity'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.usage_opportunity', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1493  $totalarray[
'nbfield']++;
 
 1495if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
 
 1496  print_liste_field_titre($arrayfields[
'p.usage_task'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.usage_task', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1497  $totalarray[
'nbfield']++;
 
 1499if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
 
 1500  print_liste_field_titre($arrayfields[
'p.usage_bill_time'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.usage_bill_time', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1501  $totalarray[
'nbfield']++;
 
 1503if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
 
 1504  print_liste_field_titre($arrayfields[
'p.usage_organize_event'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.usage_organize_event', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1505  $totalarray[
'nbfield']++;
 
 1507if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
 
 1508  print_liste_field_titre($arrayfields[
'p.accept_conference_suggestions'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.accept_conference_suggestions', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1509  $totalarray[
'nbfield']++;
 
 1511if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
 
 1512  print_liste_field_titre($arrayfields[
'p.accept_booth_suggestions'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.accept_booth_suggestions', 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1513  $totalarray[
'nbfield']++;
 
 1515if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
 
 1516  print_liste_field_titre($arrayfields[
'p.price_registration'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.price_registration', 
"", $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1517  $totalarray[
'nbfield']++;
 
 1519if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
 
 1520  print_liste_field_titre($arrayfields[
'p.price_booth'][
'label'], $_SERVER[
"PHP_SELF"], 
'p.price_booth', 
"", $param, 
'', $sortfield, $sortorder, 
'right ');
 
 1521  $totalarray[
'nbfield']++;
 
 1523if (!empty($arrayfields[
'u.login'][
'checked'])) {
 
 1524  print_liste_field_titre($arrayfields[
'u.login'][
'label'], $_SERVER[
"PHP_SELF"], 
'u.login', 
'', $param, 
'align="center"', $sortfield, $sortorder);
 
 1525  $totalarray[
'nbfield']++;
 
 1528include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
 
 1530$parameters = array(
'arrayfields' => $arrayfields, 
'param' => $param, 
'sortfield' => $sortfield, 
'sortorder' => $sortorder, 
'totalarray' => &$totalarray);
 
 1531$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action); 
 
 1532print $hookmanager->resPrint;
 
 1533if (!empty($arrayfields[
'p.datec'][
'checked'])) {
 
 1534  print_liste_field_titre($arrayfields[
'p.datec'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.datec", 
"", $param, 
'', $sortfield, $sortorder, 
'center nowrap ');
 
 1535  $totalarray[
'nbfield']++;
 
 1537if (!empty($arrayfields[
'p.tms'][
'checked'])) {
 
 1538  print_liste_field_titre($arrayfields[
'p.tms'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.tms", 
"", $param, 
'', $sortfield, $sortorder, 
'center nowrap ');
 
 1539  $totalarray[
'nbfield']++;
 
 1541if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
 
 1542  print_liste_field_titre($arrayfields[
'p.email_msgid'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.email_msgid", 
"", $param, 
'', $sortfield, $sortorder, 
'center ');
 
 1543  $totalarray[
'nbfield']++;
 
 1545if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
 
 1546  print_liste_field_titre($arrayfields[
'p.import_key'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.import_key", 
"", $param, 
'', $sortfield, $sortorder, 
'');
 
 1547  $totalarray[
'nbfield']++;
 
 1549if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
 
 1550  print_liste_field_titre($arrayfields[
'p.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"], 
"p.fk_statut", 
"", $param, 
'', $sortfield, $sortorder, 
'center ');
 
 1551  $totalarray[
'nbfield']++;
 
 1555  print 
getTitleFieldOfList($selectedfields, 0, $_SERVER[
"PHP_SELF"], 
'', 
'', 
'', 
'', $sortfield, $sortorder, 
'center maxwidthsearch ').
"\n";
 
 1556  $totalarray[
'nbfield']++;
 
 1562$savnbfield = $totalarray[
'nbfield'];
 
 1567$imaxinloop = ($limit ? min($num, $limit) : $num);
 
 1568while ($i < $imaxinloop) {
 
 1569  $obj = $db->fetch_object($resql);
 
 1575  $companystatic->id = $obj->socid;
 
 1576  $companystatic->name = $obj->name;
 
 1577  $companystatic->name_alias = $obj->alias;
 
 1578  $companystatic->client = $obj->client;
 
 1579  $companystatic->code_client = $obj->code_client;
 
 1580  $companystatic->email = $obj->email;
 
 1581  $companystatic->phone = $obj->phone;
 
 1582  $companystatic->address = $obj->address;
 
 1583  $companystatic->zip = $obj->zip;
 
 1584  $companystatic->town = $obj->town;
 
 1585  $companystatic->country_code = $obj->country_code;
 
 1591  $object->fk_opp_status = $obj->fk_opp_status;
 
 1592  $object->user_author_id = $obj->fk_user_creat;
 
 1593  $object->date_creation = $db->jdate($obj->date_creation);
 
 1594  $object->date_start = $db->jdate($obj->date_start);
 
 1595  $object->date_end = $db->jdate($obj->date_end);
 
 1596  $object->statut = $obj->status; 
 
 1597  $object->status = $obj->status;
 
 1598  $object->public = $obj->public;
 
 1599  $object->opp_percent = $obj->opp_percent;
 
 1600  $object->opp_status = $obj->fk_opp_status;
 
 1601  $object->opp_status_code = $obj->opp_status_code;
 
 1602  $object->opp_amount = !empty($obj->opp_amount) ? $obj->opp_amount : 
"";
 
 1603  $object->opp_weighted_amount = $obj->opp_weighted_amount;
 
 1604  $object->budget_amount = $obj->budget_amount;
 
 1605  $object->usage_opportunity = $obj->usage_opportunity;
 
 1606  $object->usage_task = $obj->usage_task;
 
 1607  $object->usage_bill_time = $obj->usage_bill_time;
 
 1608  $object->usage_organize_event = $obj->usage_organize_event;
 
 1609  $object->email_msgid = $obj->email_msgid;
 
 1610  $object->import_key = $obj->import_key;
 
 1611  $object->thirdparty = $companystatic;
 
 1615  $stringassignedusers = 
'';
 
 1617  if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
 
 1619    foreach (array(
'internal', 
'external') as $source) {
 
 1620      $tab = 
$object->liste_contact(-1, $source, 0, 
'', 1);
 
 1621      $numcontact = count($tab);
 
 1622      if (!empty($numcontact)) {
 
 1623        foreach ($tab as $contactproject) {
 
 1625          if ($source == 
'internal') {
 
 1626            if (!empty($conf->cache[
'user'][$contactproject[
'id']])) {
 
 1627              $c = $conf->cache[
'user'][$contactproject[
'id']];
 
 1630              $c->fetch($contactproject[
'id']);
 
 1631              $conf->cache[
'user'][$contactproject[
'id']] = $c;
 
 1634            if (!empty($conf->cache[
'contact'][$contactproject[
'id']])) {
 
 1635              $c = $conf->cache[
'contact'][$contactproject[
'id']];
 
 1638              $c->fetch($contactproject[
'id']);
 
 1639              $conf->cache[
'contact'][$contactproject[
'id']] = $c;
 
 1642          if (get_class($c) == 
'User') {
 
 1643            $stringassignedusers .= $c->getNomUrl(-2, 
'', 0, 0, 24, 1, 
'', 
'valignmiddle'.($ifisrt ? 
'' : 
' notfirst'));
 
 1645            $stringassignedusers .= $c->getNomUrl(-2, 
'', 0, 
'', -1, 0, 
'valignmiddle'.($ifisrt ? 
'' : 
' notfirst'));
 
 1653  if ($mode == 
'kanban') {
 
 1655      print 
'<tr class="trkanban'.(empty($groupby) ? 
'' : 
' trkanbangroupby').
'"><td colspan="'.$savnbfield.
'">';
 
 1658    if (!empty($groupby)) {
 
 1659      if (is_null($groupbyold)) {
 
 1660        print 
'<div class="box-flex-container-columns kanban">';  
 
 1663      if (is_null($obj->$groupbyfield)) {
 
 1664        $groupbyvalue = 
'undefined';
 
 1666        $groupbyvalue = $obj->$groupbyfield;
 
 1668      if ($groupbyold !== $groupbyvalue) {
 
 1669        if (!is_null($groupbyold)) {
 
 1672        foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
 
 1674          if (!is_null($groupbyold) && ($tmpcursor <= $groupbyold)) { 
continue; }
 
 1675          if ($tmpcursor >= $groupbyvalue) { 
continue; }
 
 1677          print 
'<div class="box-flex-container-column kanban column';
 
 1678          if (in_array($tmpcursor, $groupofcollpasedvalues)) {
 
 1679            print 
' kanbancollapsed';
 
 1681          print 
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/', 
'', $tmpcursor).
'">';
 
 1682          print 
'<div class="kanbanlabel">'.$langs->trans($tmpgroupbyvalue).
'</div>';
 
 1685        print 
'<div class="box-flex-container-column kanban column" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/', 
'', $groupbyvalue).
'">';  
 
 1686        print 
'<div class="kanbanlabel">'.$langs->trans(empty($groupbyvalues[$groupbyvalue]) ? 
'Undefined' : $groupbyvalues[$groupbyvalue]).
'</div>';
 
 1688      $groupbyold = $groupbyvalue;
 
 1689    } elseif ($i == 0) {
 
 1690      print 
'<div class="box-flex-container kanban">';
 
 1695    if ($massactionbutton || $massaction) { 
 
 1697      if (in_array(
$object->id, $arrayofselected)) {
 
 1701    $arrayofdata = array(
'assignedusers' => $stringassignedusers, 
'thirdparty' => $companystatic, 
'selected' => $selected);
 
 1703    print 
$object->getKanbanView(
'', $arrayofdata, ($groupby ? 
'small' : 
''));
 
 1706    if ($i == ($imaxinloop - 1)) {
 
 1708      if (!empty($groupby)) {
 
 1710        foreach ($groupbyvalues as $tmpcursor => $tmpgroupbyvalue) {
 
 1712          if ($tmpcursor <= $groupbyvalue) { 
continue; }
 
 1714          print 
'<div class="box-flex-container-column kanban column';
 
 1715          if (in_array($tmpcursor, $groupofcollpasedvalues)) {
 
 1716            print 
' kanbancollapsed';
 
 1718          print 
'" data-groupbyid="'.preg_replace(
'/[^a-z0-9]/', 
'', $tmpcursor).
'">';
 
 1719          print 
'<div class="kanbanlabel">'.$langs->trans(empty($tmpgroupbyvalue) ? 
'Undefined' : $tmpgroupbyvalue).
'</div>';
 
 1731    $userstatic->id = $obj->fk_user_creat;
 
 1732    $userstatic->login = $obj->login;
 
 1733    $userstatic->lastname = $obj->lastname;
 
 1734    $userstatic->firstname = $obj->firstname;
 
 1735    $userstatic->email = $obj->user_email;
 
 1736    $userstatic->status = $obj->user_statut;
 
 1737    $userstatic->entity = $obj->entity;
 
 1738    $userstatic->photo = $obj->photo;
 
 1739    $userstatic->office_phone = $obj->office_phone;
 
 1740    $userstatic->office_fax = $obj->office_fax;
 
 1741    $userstatic->user_mobile = $obj->user_mobile;
 
 1742    $userstatic->job = $obj->job;
 
 1743    $userstatic->gender = $obj->gender;
 
 1747    print 
'<tr data-rowid="'.$object->id.
'" class="oddeven">';
 
 1750      print 
'<td class="nowrap center">';
 
 1751      if ($massactionbutton || $massaction) {   
 
 1753        if (in_array(
$object->id, $arrayofselected)) {
 
 1756        print 
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ? 
' checked="checked"' : 
'').
'>';
 
 1760        $totalarray[
'nbfield']++;
 
 1764    if (!empty($arrayfields[
'p.ref'][
'checked'])) {
 
 1765      print 
'<td class="nowraponall tdoverflowmax200">';
 
 1766      print 
$object->getNomUrl(1, (!empty(
GETPOSTINT(
'search_usage_event_organization')) ? 
'eventorganization' : 
''));
 
 1772        $totalarray[
'nbfield']++;
 
 1776    if (!empty($arrayfields[
'p.title'][
'checked'])) {
 
 1777      print 
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->title).
'">';
 
 1781        $totalarray[
'nbfield']++;
 
 1785    if (!empty($arrayfields[
's.nom'][
'checked'])) {
 
 1786      print 
'<td class="tdoverflowmax125">';
 
 1788        print $companystatic->getNomUrl(1, 
'', 0, 0, -1, empty($arrayfields[
's.name_alias'][
'checked']) ? 0 : 1);
 
 1794        $totalarray[
'nbfield']++;
 
 1798    if (!empty($arrayfields[
's.name_alias'][
'checked'])) {
 
 1799      print 
'<td class="tdoverflowmax100">';
 
 1801        print $companystatic->name_alias;
 
 1807        $totalarray[
'nbfield']++;
 
 1811    if (!empty($arrayfields[
'commercial'][
'checked'])) {
 
 1812      print 
'<td class="tdoverflowmax150">';
 
 1814        $companystatic->id = $obj->socid;
 
 1815        $companystatic->name = $obj->name;
 
 1816        $listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
 
 1817        $nbofsalesrepresentative = count($listsalesrepresentatives);
 
 1818        if ($nbofsalesrepresentative > 6) {
 
 1820          print $nbofsalesrepresentative;
 
 1821        } elseif ($nbofsalesrepresentative > 0) {
 
 1822          $userstatic = 
new User($db);
 
 1824          foreach ($listsalesrepresentatives as $val) {
 
 1825            $userstatic->id = $val[
'id'];
 
 1826            $userstatic->lastname = $val[
'lastname'];
 
 1827            $userstatic->firstname = $val[
'firstname'];
 
 1828            $userstatic->email = $val[
'email'];
 
 1829            $userstatic->status = $val[
'statut'];
 
 1830            $userstatic->entity = $val[
'entity'];
 
 1831            $userstatic->photo = $val[
'photo'];
 
 1832            $userstatic->login = $val[
'login'];
 
 1833            $userstatic->office_phone = $val[
'office_phone'];
 
 1834            $userstatic->office_fax = $val[
'office_fax'];
 
 1835            $userstatic->user_mobile = $val[
'user_mobile'];
 
 1836            $userstatic->job = $val[
'job'];
 
 1837            $userstatic->gender = $val[
'gender'];
 
 1838            print ($nbofsalesrepresentative < 2) ? $userstatic->getNomUrl(-1, 
'', 0, 0, 12) : $userstatic->getNomUrl(-2);
 
 1840            if ($j < $nbofsalesrepresentative) {
 
 1851        $totalarray[
'nbfield']++;
 
 1856    if (!empty($arrayfields[
'p.dateo'][
'checked'])) {
 
 1857      print 
'<td class="center">';
 
 1861        $totalarray[
'nbfield']++;
 
 1865    if (!empty($arrayfields[
'p.datee'][
'checked'])) {
 
 1866      print 
'<td class="center">';
 
 1870        $totalarray[
'nbfield']++;
 
 1875    if (!empty($arrayfields[
'p.public'][
'checked'])) {
 
 1876      print 
'<td class="center">';
 
 1878        print 
img_picto($langs->trans(
'SharedProject'), 
'world', 
'class="paddingrightonly"');
 
 1881        print 
img_picto($langs->trans(
'PrivateProject'), 
'private', 
'class="paddingrightonly"');
 
 1886        $totalarray[
'nbfield']++;
 
 1890    if (!empty($arrayfields[
'c.assigned'][
'checked'])) {
 
 1891      print 
'<td class="center nowraponall tdoverflowmax200">';
 
 1892      print $stringassignedusers;
 
 1895        $totalarray[
'nbfield']++;
 
 1899    if (!empty($arrayfields[
'p.fk_opp_status'][
'checked'])) {
 
 1901      if ($obj->opp_status_code) {
 
 1902        $s = $langs->trans(
"OppStatus".$obj->opp_status_code);
 
 1903        if (empty($arrayfields[
'p.opp_percent'][
'checked']) && $obj->opp_percent) {
 
 1904          $s .= 
' ('.dol_escape_htmltag(
price2num($obj->opp_percent, 1)).
'%)';
 
 1907      print 
'<td class="center tdoverflowmax150" title="'.$s.
'">';
 
 1911        $totalarray[
'nbfield']++;
 
 1915    if (!empty($arrayfields[
'p.opp_amount'][
'checked'])) {
 
 1916      print 
'<td class="right">';
 
 1918      if (isset($obj->opp_amount) && strcmp($obj->opp_amount, 
'')) {
 
 1919        print 
'<span class="amount">'.price($obj->opp_amount, 1, $langs, 1, -1, -1, 
'').
'</span>';
 
 1920        if (!isset($totalarray[
'val'][
'p.opp_amount'])) {
 
 1921          $totalarray[
'val'][
'p.opp_amount'] = $obj->opp_amount;
 
 1923          $totalarray[
'val'][
'p.opp_amount'] += $obj->opp_amount;
 
 1928        $totalarray[
'nbfield']++;
 
 1931        $totalarray[
'pos'][$totalarray[
'nbfield']] = 
'p.opp_amount';
 
 1935    if (!empty($arrayfields[
'p.opp_percent'][
'checked'])) {
 
 1936      print 
'<td class="right">';
 
 1937      if ($obj->opp_percent) {
 
 1938        print 
price($obj->opp_percent, 1, $langs, 1, 0).
'%';
 
 1942        $totalarray[
'nbfield']++;
 
 1946    if (!empty($arrayfields[
'opp_weighted_amount'][
'checked'])) {
 
 1947      if (!isset($totalarray[
'val'][
'opp_weighted_amount'])) {
 
 1948        $totalarray[
'val'][
'opp_weighted_amount'] = 0;
 
 1950      print 
'<td align="right">';
 
 1951      if ($obj->opp_weighted_amount) {
 
 1952        print 
'<span class="amount">'.price($obj->opp_weighted_amount, 1, $langs, 1, -1, -1, 
'').
'</span>';
 
 1953        $totalarray[
'val'][
'opp_weighted_amount'] += $obj->opp_weighted_amount;
 
 1957        $totalarray[
'nbfield']++;
 
 1958        $totalarray[
'pos'][$totalarray[
'nbfield']] = 
'opp_weighted_amount';
 
 1962    if (!empty($arrayfields[
'p.budget_amount'][
'checked'])) {
 
 1963      print 
'<td class="right">';
 
 1964      if ($obj->budget_amount != 
'') {
 
 1965        print 
'<span class="amount">'.price($obj->budget_amount, 1, $langs, 1, -1, -1).
'</span>';
 
 1966        if (!isset($totalarray[
'val'][
'p.budget_amount'])) {
 
 1967          $totalarray[
'val'][
'p.budget_amount'] = $obj->budget_amount;
 
 1969          $totalarray[
'val'][
'p.budget_amount'] += $obj->budget_amount;
 
 1974        $totalarray[
'nbfield']++;
 
 1975        $totalarray[
'pos'][$totalarray[
'nbfield']] = 
'p.budget_amount';
 
 1979    if (!empty($arrayfields[
'p.usage_opportunity'][
'checked'])) {
 
 1980      print 
'<td class="">';
 
 1981      if ($obj->usage_opportunity) {
 
 1982        print 
yn($obj->usage_opportunity);
 
 1986        $totalarray[
'nbfield']++;
 
 1990    if (!empty($arrayfields[
'p.usage_task'][
'checked'])) {
 
 1991      print 
'<td class="">';
 
 1992      if ($obj->usage_task) {
 
 1993        print 
yn($obj->usage_task);
 
 1997        $totalarray[
'nbfield']++;
 
 2001    if (!empty($arrayfields[
'p.usage_bill_time'][
'checked'])) {
 
 2002      print 
'<td class="">';
 
 2003      if ($obj->usage_bill_time) {
 
 2004        print 
yn($obj->usage_bill_time);
 
 2008        $totalarray[
'nbfield']++;
 
 2012    if (!empty($arrayfields[
'p.usage_organize_event'][
'checked'])) {
 
 2013      print 
'<td class="">';
 
 2014      if ($obj->usage_organize_event) {
 
 2015        print 
yn($obj->usage_organize_event);
 
 2019        $totalarray[
'nbfield']++;
 
 2023    if (!empty($arrayfields[
'p.accept_conference_suggestions'][
'checked'])) {
 
 2024      print 
'<td class="">';
 
 2025      if ($obj->accept_conference_suggestions) {
 
 2026        print 
yn($obj->accept_conference_suggestions);
 
 2030        $totalarray[
'nbfield']++;
 
 2034    if (!empty($arrayfields[
'p.accept_booth_suggestions'][
'checked'])) {
 
 2035      print 
'<td class="">';
 
 2036      if ($obj->accept_booth_suggestions) {
 
 2037        print 
yn($obj->accept_booth_suggestions);
 
 2041        $totalarray[
'nbfield']++;
 
 2045    if (!empty($arrayfields[
'p.price_registration'][
'checked'])) {
 
 2046      print 
'<td class="right">';
 
 2047      if ($obj->price_registration != 
'') {
 
 2048        print 
'<span class="amount">'.price($obj->price_registration, 1, $langs, 1, -1, -1).
'</span>';
 
 2049        $totalarray[
'val'][
'p.price_registration'] += $obj->price_registration;
 
 2053        $totalarray[
'nbfield']++;
 
 2056        $totalarray[
'pos'][$totalarray[
'nbfield']] = 
'p.price_registration';
 
 2060    if (!empty($arrayfields[
'p.price_booth'][
'checked'])) {
 
 2061      print 
'<td class="right">';
 
 2062      if ($obj->price_booth != 
'') {
 
 2063        print 
'<span class="amount">'.price($obj->price_booth, 1, $langs, 1, -1, -1).
'</span>';
 
 2064        $totalarray[
'val'][
'p.price_booth'] += $obj->price_booth;
 
 2068        $totalarray[
'nbfield']++;
 
 2071        $totalarray[
'pos'][$totalarray[
'nbfield']] = 
'p.price_booth';
 
 2075    if (!empty($arrayfields[
'u.login'][
'checked'])) {
 
 2076      print 
'<td class="center tdoverflowmax150">';
 
 2077      if ($userstatic->id) {
 
 2078        print $userstatic->getNomUrl(-1);
 
 2082        $totalarray[
'nbfield']++;
 
 2086    include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
 
 2088    $parameters = array(
'arrayfields' => $arrayfields, 
'object' => $object, 
'obj' => $obj, 
'i' => $i, 
'totalarray' => &$totalarray);
 
 2089    $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action); 
 
 2090    print $hookmanager->resPrint;
 
 2092    if (!empty($arrayfields[
'p.datec'][
'checked'])) {
 
 2093      print 
'<td class="center nowraponall">';
 
 2094      print 
dol_print_date($db->jdate($obj->date_creation), 
'dayhour', 
'tzuser');
 
 2097        $totalarray[
'nbfield']++;
 
 2101    if (!empty($arrayfields[
'p.tms'][
'checked'])) {
 
 2102      print 
'<td class="center nowraponall">';
 
 2103      print 
dol_print_date($db->jdate($obj->date_modification), 
'dayhour', 
'tzuser');
 
 2106        $totalarray[
'nbfield']++;
 
 2110    if (!empty($arrayfields[
'p.email_msgid'][
'checked'])) {
 
 2111      print 
'<td class="tdoverflowmax125" title="'.dol_escape_htmltag($obj->email_msgid).
'">';
 
 2115        $totalarray[
'nbfield']++;
 
 2119    if (!empty($arrayfields[
'p.import_key'][
'checked'])) {
 
 2120      print 
'<td class="right">'.dol_escape_htmltag($obj->import_key).
'</td>';
 
 2122        $totalarray[
'nbfield']++;
 
 2126    if (!empty($arrayfields[
'p.fk_statut'][
'checked'])) {
 
 2127      print 
'<td class="center">'.$object->getLibStatut(5).
'</td>';
 
 2129        $totalarray[
'nbfield']++;
 
 2134      print 
'<td class="nowrap center">';
 
 2135      if ($massactionbutton || $massaction) {   
 
 2137        if (in_array(
$object->id, $arrayofselected)) {
 
 2140        print 
'<input id="cb'.$object->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.
$object->id.
'"'.($selected ? 
' checked="checked"' : 
'').
'>';
 
 2144        $totalarray[
'nbfield']++;
 
 2155include DOL_DOCUMENT_ROOT.
'/core/tpl/list_print_total.tpl.php';
 
 2160  foreach ($arrayfields as $key => $val) {
 
 2161    if (!empty($val[
'checked'])) {
 
 2165  print 
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
 
 2170$parameters = array(
'arrayfields' => $arrayfields, 
'sql' => $sql);
 
 2171$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action); 
 
 2172print $hookmanager->resPrint;
 
 2174print 
'</table>'.
"\n";
 
 2177print 
'</form>'.
"\n";
 
 2179if (in_array(
'builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === 
'' || $nbtotalofrecords)) {
 
 2180  $hidegeneratedfilelistifempty = 1;
 
 2181  if ($massaction == 
'builddoc' || $action == 
'remove_file' || $show_files) {
 
 2182    $hidegeneratedfilelistifempty = 0;
 
 2185  require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
 
 2189  $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
 
 2190  $urlsource .= str_replace(
'&', 
'&', $param);
 
 2192  $filedir = $diroutputmassaction;
 
 2193  $genallowed = $permissiontoread;
 
 2194  $delallowed = $permissiontoadd;
 
 2196  print $formfile->showdocuments(
'massfilesarea_'.
$object->module, 
'', $filedir, $urlsource, 0, $delallowed, 
'', 1, 1, 0, 48, 1, $param, $title, 
'', 
'', 
'', 
null, $hidegeneratedfilelistifempty);
 
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
 
Class to manage projects.
 
Class to manage third parties objects (customers, suppliers, prospects...)
 
Class to manage Dolibarr users.
 
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0, $gm=false)
Generate a SQL string to make a filter into a range (for second of date until last second of date).
 
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
 
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
 
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
 
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
 
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
 
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
 
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
 
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
 
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
 
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
 
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
 
dol_now($mode='auto')
Return date for now.
 
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
 
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
 
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
 
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
 
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.
 
print_barre_liste($title, $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.
 
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.
 
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 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.