';
$width = 80;
$height = 70;
diff --git a/htdocs/ticketsup/contacts.php b/htdocs/ticketsup/contact.php
similarity index 94%
rename from htdocs/ticketsup/contacts.php
rename to htdocs/ticketsup/contact.php
index 9ef592b22a7..356aa47ffd5 100644
--- a/htdocs/ticketsup/contacts.php
+++ b/htdocs/ticketsup/contact.php
@@ -19,9 +19,9 @@
*/
/**
- * \file ticketsup/contacts.php
+ * \file ticketsup/contact.php
* \ingroup ticketsup
- * \brief Contacts des tickets
+ * \brief Contacts of tickets
*/
require '../main.inc.php';
@@ -61,7 +61,7 @@ if ($user->societe_id > 0) {
}
// Store current page url
-$url_page_current = dol_buildpath('/ticketsup/contacts.php', 1);
+$url_page_current = dol_buildpath('/ticketsup/contact.php', 1);
$object = new Ticketsup($db);
@@ -129,8 +129,9 @@ $userstatic = new User($db);
/* *************************************************************************** */
if ($id > 0 || !empty($track_id) || !empty($ref)) {
- if ($object->fetch($id, $track_id, $ref) > 0) {
- if ($object->fk_soc > 0) {
+ if ($object->fetch($id, $track_id, $ref) > 0)
+ {
+ if ($socid > 0) {
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
@@ -143,8 +144,11 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
} elseif ($user->societe_id > 0) {
$object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
}
+
$head = ticketsup_prepare_head($object);
- dol_fiche_head($head, 'tabTicketContacts', $langs->trans("Ticket"), 0, 'ticketsup');
+
+ dol_fiche_head($head, 'contact', $langs->trans("Ticket"), -1, 'ticketsup');
+
$object->label = $object->ref;
// Author
if ($object->fk_user_create > 0) {
@@ -155,10 +159,11 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$object->label .= $fuser->getNomUrl(0);
}
$linkback = '
' . $langs->trans("BackToList") . ' ';
- $object->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback);
+ $object->ticketsupBannerTab('ref', '', ($user->societe_id ? 0 : 1), 'ref', 'subject', '', '', '', $morehtmlleft, $linkback, 1);
dol_fiche_end();
- print '
';
+
+ //print '
';
$permission = $user->rights->ticketsup->write;
diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php
index f221dce73c2..0f528ee17bb 100644
--- a/htdocs/ticketsup/document.php
+++ b/htdocs/ticketsup/document.php
@@ -109,7 +109,7 @@ if ($object->id) {
}
$form = new Form($db);
- if ($object->fk_soc > 0) {
+ if ($socid > 0) {
$object->fetch_thirdparty();
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
diff --git a/htdocs/ticketsup/history.php b/htdocs/ticketsup/history.php
index 9bd69ade897..b4e0e0e9249 100644
--- a/htdocs/ticketsup/history.php
+++ b/htdocs/ticketsup/history.php
@@ -88,7 +88,7 @@ if ($action == 'view') {
accessforbidden('', 0);
}
- if ($object->dao->fk_soc > 0) {
+ if ($socid > 0) {
$object->dao->fetch_thirdparty();
$head = societe_prepare_head($object->dao->thirdparty);
dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php
index 52102b53596..b4c208e270b 100644
--- a/htdocs/ticketsup/list.php
+++ b/htdocs/ticketsup/list.php
@@ -35,12 +35,7 @@ if (!empty($conf->projet->enabled)) {
}
// Load traductions files requiredby by page
-$langs->loadLangs(
- array(
- "ticketsup",
- "companies",
- "other")
- );
+$langs->loadLangs(array("ticketsup","companies","other"));
// Get parameters
@@ -143,8 +138,6 @@ $url_page_current = dol_buildpath('/ticketsup/list.php', 1);
/*
* Actions
- *
- * Put here all code to do according to value of "$action" parameter
*/
if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
@@ -308,8 +301,13 @@ if ($socid && !$projectid && $user->rights->societe->lire) {
$socstat = new Societe($db);
$res = $socstat->fetch($socid);
if ($res > 0) {
+
+ $tmpobject = $object;
+ $object = $socstat; // $object must be of type Societe when calling societe_prepare_head
$head = societe_prepare_head($socstat);
- dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company');
+ $object = $tmpobject;
+
+ dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), -1, 'company');
dol_banner_tab($socstat, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
@@ -320,7 +318,7 @@ if ($socid && !$projectid && $user->rights->societe->lire) {
// Customer code
if ($socstat->client && !empty($socstat->code_client)) {
- print '
| ';
+ print ' |
| ';
print $langs->trans('CustomerCode') . ' | ';
print $socstat->code_client;
if ($socstat->check_codeclient() != 0) {
@@ -360,7 +358,7 @@ if ($projectid) {
$linkback = '' . $langs->trans("BackToList") . '';
// Ref
- print ' |
| ' . $langs->trans('Ref') . ' | ';
+ print ' |
| ' . $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);
@@ -374,7 +372,7 @@ if ($projectid) {
// Customer
print " |
| " . $langs->trans("ThirdParty") . " | ";
- print '';
+ print ' | ';
if ($projectstat->thirdparty->id > 0) {
print $projectstat->thirdparty->getNomUrl(1);
} else {
@@ -504,25 +502,24 @@ foreach($object->fields as $key => $val)
if (in_array($val['type'], array('timestamp'))) $align.=($align?' ':'').'nowrap';
if ($key == 'status') $align.=($align?' ':'').'center';
if (! empty($arrayfields['t.'.$key]['checked'])) {
- if ($key == 'fk_statut') {
+ if ($key == 'type_code') {
print ' | ';
- $object->printSelectStatus(dol_escape_htmltag($search[$key]));
- print ' | ';
-
- } elseif ($key == 'type_code') {
- print '';
- $formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1);
+ $formTicket->selectTypesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, 'maxwidth200');
print ' | ';
} elseif ($key == 'category_code') {
print '';
- $formTicket->selectCategoriesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1);
+ $formTicket->selectCategoriesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, 'maxwidth200');
print ' | ';
} elseif ($key == 'severity_code') {
print '';
- $formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 2, 1, 1);
+ $formTicket->selectSeveritiesTickets(dol_escape_htmltag($search[$key]), 'search_'.$key.'', '', 0, 1, 1, 0, 'maxwidth200');
print ' | ';
- } else {
-
+ } elseif ($key == 'fk_statut') {
+ print '';
+ $object->printSelectStatus(dol_escape_htmltag($search[$key]));
+ print ' | ';
+ }
+ else {
print ' | ';
}
}