diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang index cd79202c7fa..d46a6be5dbd 100644 --- a/htdocs/langs/en_US/ticketsup.lang +++ b/htdocs/langs/en_US/ticketsup.lang @@ -52,6 +52,7 @@ TypeContact_ticketsup_internal_SUPPORTTEC=Assigned user TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking TypeContact_ticketsup_external_CONTRIBUTOR=External contributor +OriginEmail=Email source Notify_TICKETMESSAGE_SENTBYMAIL=Send ticket answer by email # Status diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 7715803f4de..82539a38eab 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -49,10 +49,10 @@ $backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated $optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') $id = GETPOST('id','int'); - $msg_id = GETPOST('msg_id', 'int'); $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); +$search_fk_soc=GETPOST('$search_fk_soc','int')?GETPOST('$search_fk_soc','int'):GETPOST('socid','int'); $search_fk_project=GETPOST('search_fk_project','int')?GETPOST('search_fk_project','int'):GETPOST('projectid','int'); $search_fk_status = GETPOST('search_fk_status', 'alpha'); $mode = GETPOST('mode', 'alpha'); @@ -113,23 +113,10 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab } $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -if ($projectid > 0) -{ - unset($arrayfields['t.fk_project']); -} +if ($socid > 0) unset($arrayfields['t.fk_soc']); +if ($projectid > 0) unset($arrayfields['t.fk_project']); -// Filters -// $search_soc = GETPOST("search_soc"); -// $search_fk_status = GETPOST("search_fk_status", 'alpha'); -// $search_subject = GETPOST("search_subject"); -// $search_type = GETPOST("search_type", 'alpha'); -// $search_category = GETPOST("search_category", 'alpha'); -// $search_severity = GETPOST("search_severity", 'alpha'); -// $search_fk_project = GETPOST("search_fk_project", 'int'); -// $search_fk_user_create = GETPOST("search_fk_user_create", 'int'); -// $search_fk_user_assign = GETPOST("search_fk_user_assign", 'int'); - // Security check if (!$user->rights->ticketsup->read) { accessforbidden(); @@ -223,6 +210,7 @@ foreach($search as $key => $val) if ($search[$key] != '') $sql.=natural_search($key, $search[$key], (($key == 'fk_statut')?2:$mode_search)); } if ($search_all) $sql.= natural_search(array_keys($fieldstosearchall), $search_all); +if ($search_fk_soc) $sql.= natural_search('fk_soc', $search_fk_soc); if ($search_fk_project) $sql.= natural_search('fk_project', $search_fk_project); if (!$user->societe_id && ($mode == "my_assign" || (!$user->admin && $conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY))) { $sql.= " AND t.fk_user_assign=".$user->id; @@ -419,6 +407,8 @@ foreach($search as $key => $val) if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +if ($socid) $param.='&socid='.urlencode($socid); +if ($projectid) $param.='&projectid='.urlencode($projectid); // List of mass actions available $arrayofmassactions = array( @@ -440,6 +430,8 @@ print ''; print ''; print ''; print ''; +if ($socid) print ''; +if ($projectid) print ''; $buttontocreate = '' . $langs->trans('NewTicket') . ''; @@ -461,7 +453,6 @@ if ($sall) print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); } - if ($search_fk_status == 'non_closed') { print '
' . $langs->trans('TicketViewAllTickets') . '
'; $param .= '&search_fk_status=non_closed';