diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index d4b5733ef55..7715803f4de 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -34,7 +34,7 @@ if (!empty($conf->projet->enabled)) { } // Load traductions files requiredby by page -$langs->loadLangs(array("ticketsup","companies","other")); +$langs->loadLangs(array("ticketsup","companies","other","projects")); // Get parameters @@ -53,6 +53,7 @@ $id = GETPOST('id','int'); $msg_id = GETPOST('msg_id', 'int'); $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', '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'); @@ -112,6 +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']); +} // Filters @@ -121,7 +126,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); // $search_type = GETPOST("search_type", 'alpha'); // $search_category = GETPOST("search_category", 'alpha'); // $search_severity = GETPOST("search_severity", 'alpha'); -// $search_project = GETPOST("search_project", 'int'); +// $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'); @@ -218,7 +223,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_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; } @@ -336,11 +341,14 @@ if ($socid && !$projectid && $user->rights->societe->lire) { } } -if ($projectid) { +if ($projectid > 0) { $projectstat = new Project($db); if ($projectstat->fetch($projectid) > 0) { $projectstat->fetch_thirdparty(); + $savobject = $object; + $object = $projectstat; + // To verify role of users //$userAccess = $object->restrictedProjectArea($user,'read'); $userWrite = $projectstat->restrictedProjectArea($user, 'write'); @@ -348,55 +356,52 @@ if ($projectid) { //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete; $head = project_prepare_head($projectstat); - dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), 0, ($projectstat->public ? 'projectpub' : 'project')); + dol_fiche_head($head, 'ticketsup', $langs->trans("Project"), -1, ($projectstat->public ? 'projectpub' : 'project')); + + // Project card + + $linkback = ''.$langs->trans("BackToList").''; + + $morehtmlref='
| ' . $langs->trans('Ref') . ' | '; - // Define a complementary filter for search of next/prev ref. - if (!$user->rights->projet->all->lire) { - $objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0); - $projectstat->next_prev_filter = " rowid in (" . (count($objectsListId) ? join(',', array_keys($objectsListId)) : '0') . ")"; - } - print $form->showrefnav($projectstat, 'ref', $linkback, 1, 'ref', 'ref', ''); - print ' |
| ' . $langs->trans("Label") . ' | ' . $projectstat->title . ' |
| " . $langs->trans("ThirdParty") . " | "; - print ''; - if ($projectstat->thirdparty->id > 0) { - print $projectstat->thirdparty->getNomUrl(1); - } else { - print ' '; - } - - print ' |
| ' . $langs->trans("Visibility") . ' | '; + print ' |
| ' . $langs->trans("Visibility") . ' | '; if ($projectstat->public) { print $langs->trans('SharedProject'); } else { print $langs->trans('PrivateProject'); } - print ' |
| ' . $langs->trans("Status") . ' | ' . $projectstat->getLibStatut(4) . ' |