From e6d8219396c37fea03c385a2ca495951b4c750f9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Mar 2018 13:26:03 +0100 Subject: [PATCH] Dolibarrize module ticket --- .../core/class/html.formticketsup.class.php | 29 ++++--- htdocs/core/lib/ticketsup.lib.php | 15 ++-- htdocs/ticketsup/card.php | 77 +++++++++++-------- htdocs/ticketsup/class/ticketsup.class.php | 17 ++-- .../ticketsup/{contacts.php => contact.php} | 21 +++-- htdocs/ticketsup/document.php | 2 +- htdocs/ticketsup/history.php | 2 +- htdocs/ticketsup/list.php | 43 +++++------ 8 files changed, 117 insertions(+), 89 deletions(-) rename htdocs/ticketsup/{contacts.php => contact.php} (94%) diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 47df19ae8f5..bb77649dfcc 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -418,9 +418,10 @@ class FormTicketsup * @param int $empty 1=peut etre vide, 0 sinon * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label + * @param string $morecss More CSS * @return void */ - public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0) + public function selectTypesTickets($selected = '', $htmlname = 'tickettype', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') { global $langs, $user; @@ -436,7 +437,7 @@ class FormTicketsup $ticketstat->loadCacheTypesTickets(); - print ''; if ($empty) { print ''; } @@ -503,6 +504,8 @@ class FormTicketsup if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } + + print ajax_combobox('select'.$htmlname); } /** @@ -513,11 +516,12 @@ class FormTicketsup * @param string $filtertype To filter on field type in llx_c_ticketsup_category (array('code'=>xx,'label'=>zz)) * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label - * @return void + * @param string $morecss More CSS + * @return void */ - public function selectCategoriesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0) + public function selectCategoriesTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') { global $langs, $user; @@ -533,7 +537,7 @@ class FormTicketsup $ticketstat->loadCacheCategoriesTickets(); - print ''; if ($empty) { print ''; } @@ -601,6 +605,8 @@ class FormTicketsup if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } + + print ajax_combobox('select'.$htmlname); } /** @@ -611,11 +617,12 @@ class FormTicketsup * @param string $filtertype To filter on field type in llx_c_ticketsup_severity (array('code'=>xx,'label'=>zz)) * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code * @param int $empty 1=peut etre vide, 0 sinon - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label - * @return void + * @param string $morecss More CSS + * @return void */ - public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0) + public function selectSeveritiesTickets($selected = '', $htmlname = 'ticketseverity', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss='') { global $langs, $user; @@ -631,7 +638,7 @@ class FormTicketsup $ticketstat->loadCacheSeveritiesTickets(); - print ''; if ($empty) { print ''; } @@ -698,6 +705,8 @@ class FormTicketsup if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } + + print ajax_combobox('select'.$htmlname); } /** diff --git a/htdocs/core/lib/ticketsup.lib.php b/htdocs/core/lib/ticketsup.lib.php index ca27e9e8024..68f8d820116 100644 --- a/htdocs/core/lib/ticketsup.lib.php +++ b/htdocs/core/lib/ticketsup.lib.php @@ -75,16 +75,19 @@ function ticketsup_prepare_head($object) $head[$h][2] = 'tabTicketsup'; $h++; - if (empty($user->socid)) { - $head[$h][0] = DOL_URL_ROOT.'/ticketsup/contacts.php?track_id=' . $object->track_id; - $head[$h][1] = $langs->trans('Contacts'); - $head[$h][2] = 'tabTicketContacts'; - $h++; + + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && empty($user->socid)) + { + $nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external')); + $head[$h][0] = DOL_URL_ROOT.'/ticketsup/contact.php?track_id='.$object->track_id; + $head[$h][1] = $langs->trans('ContactsAddresses'); + if ($nbContact > 0) $head[$h][1].= ' '.$nbContact.''; + $head[$h][2] = 'contact'; + $h++; } complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketsup'); - // Attached files include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; $upload_dir = $conf->ticketsup->dir_output . "/" . $object->track_id; diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 5bf64d34cc8..dfc0704e824 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -77,10 +77,28 @@ if (GETPOST('modelselected')) { // Store current page url $url_page_current = dol_buildpath('/ticketsup/card.php', 1); -/*************************************************** - * PAGE - * - ****************************************************/ +if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { + $res = $object->fetch($id, $track_id, $ref); +} + +// Security check +$result = restrictedArea($user, 'ticketsup', $object->dao->id); + + + +/* + * Actions + */ + +$permissiondellink = $user->rights->ticketsup->write; +include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once + + + + +/* + * View + */ $userstat = new User($db); $form = new Form($db); @@ -90,21 +108,14 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti $res = $object->fetch($id, $track_id, $ref); if ($res > 0) { - // Security check - $result = restrictedArea($user, 'ticketsup', $object->dao->id); - // or for unauthorized internals users if (!$user->societe_id && ($conf->global->TICKETS_LIMIT_VIEW_ASSIGNED_ONLY && $object->dao->fk_user_assign != $user->id) && !$user->rights->ticketsup->manage) { accessforbidden('', 0); } - - - $permissiondellink = $user->rights->ticketsup->write; - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - $help_url = 'FR:DocumentationModuleTicket'; $page_title = $object->getTitle($action); + llxHeader('', $page_title, $help_url); // Confirmation close @@ -193,7 +204,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } else { print "ErrorRecordNotFound"; } - } elseif ($object->dao->fk_soc > 0) { + } elseif ($socid > 0) { $object->dao->fetch_thirdparty(); $head = societe_prepare_head($object->dao->thirdparty); dol_fiche_head($head, 'ticketsup', $langs->trans("ThirdParty"), 0, 'company'); @@ -208,7 +219,9 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } $head = ticketsup_prepare_head($object->dao); - dol_fiche_head($head, 'tabTicketsup', $langs->trans("Ticket"), 0, 'ticketsup'); + + dol_fiche_head($head, 'tabTicketsup', $langs->trans("Ticket"), -1, 'ticketsup'); + $object->dao->label = $object->dao->ref; // Author if ($object->dao->fk_user_create > 0) { @@ -409,11 +422,11 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } } print ''; - + // View Original message $object->viewTicketOriginalMessage($user, $action); - - + + // Fin colonne gauche et début colonne droite print '
'; @@ -579,9 +592,9 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
' . $tab[$i]['libelle'] . '
'; print '
'; - + print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'
'; - + if (! empty($tab[$i]['phone_perso'])) { //print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' '; print '
'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'
'; @@ -594,7 +607,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print ''; - + // Contract if ($action == 'sel_contract') { if (!empty($conf->contrat->enabled)) { $langs->load('contrats'); print load_fiche_titre($langs->trans('LinkToAContract'), '', 'title_commercial.png'); - + $form_contract = new FormContract($db); $form_contract->formSelectContract( $url_page_current.'?track_id='.$object->dao->track_id, @@ -641,7 +654,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print '
'; print '
'; - + print dol_fiche_end(); /* ActionBar */ @@ -650,7 +663,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti // Show button to mark as read if (($object->dao->fk_statut == '0' || empty($object->dao->date_read)) && !$user->societe_id) { print '
'; - print '' . img_picto('', 'mark-read@ticketsup') . ' ' . $langs->trans('MarkAsRead') . ''; + print '' . img_picto('', 'mark-read@ticketsup', 'height="12px"') . ' ' . $langs->trans('MarkAsRead') . ''; print ''; print load_fiche_titre($langs->trans('TicketAddMessage'), '', 'messages@ticketsup'); @@ -724,7 +737,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { $newlang = $object->default_lang; } - + $formticket = new FormTicketsup($db); $formticket->action = $action; @@ -734,16 +747,16 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti $formticket->withfile = 2; $formticket->param = array('fk_user_create' => $user->id); $formticket->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); - + // Tableau des parametres complementaires du post $formticket->param['models']=$modelmail; $formticket->param['models_id']=GETPOST('modelmailselected', 'int'); //$formticket->param['socid']=$object->dao->fk_soc; $formticket->param['returnurl']=$_SERVER["PHP_SELF"].'?track_id='.$object->dao->track_id; - + $formticket->withsubstit = 1; - + if ($object->dao->fk_soc > 0) { $object->dao->fetch_thirdparty(); $formticket->substit['__THIRDPARTY_NAME__'] = $object->dao->thirdparty->name; @@ -761,13 +774,13 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti $userstat->fetch($object->dao->fk_user_assign); $formticket->substit['__TICKETSUP_USER_ASSIGN__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); } - + if ($object->dao->fk_user_create > 0) { $userstat->fetch($object->dao->fk_user_create); $formticket->substit['__TICKETSUP_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); } - - + + $formticket->showMessageForm('100%'); print '
'; } diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index f1f23b09dcd..f35f73c33e5 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -169,19 +169,19 @@ class Ticketsup extends CommonObject public $regeximgext = '\.jpg|\.jpeg|\.bmp|\.gif|\.png|\.tiff'; public $fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id"), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1), + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'position'=>1, 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id"), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'notnull'=>1, 'index'=>1), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-2, 'enabled'=>0, 'position'=>20, 'notnull'=>1, 'index'=>1), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TrackID', 'visible'=>0, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToProject"), - 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), + 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>11, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AuthorAssign', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), - 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), + 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>12, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>60, 'notnull'=>-1,), - 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'NotRead', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')), + 'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'NotRead', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-2, 'enabled'=>1, 'position'=>40, 'notnull'=>1), 'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>1, 'enabled'=>1, 'position'=>41, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), 'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), @@ -2411,9 +2411,10 @@ class Ticketsup extends CommonObject * @param int $nodbprefix Do not include DB prefix to forge table name * @param string $morehtmlleft More html code to show before ref * @param string $morehtmlright More html code to show before navigation arrows + * @param string $onlybanner 1 * @return void */ - public function ticketsupBannerTab($paramid, $morehtml = '', $shownav = 1, $fieldid = 'id', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlright = '') + public function ticketsupBannerTab($paramid, $morehtml = '', $shownav = 1, $fieldid = 'id', $fieldref = 'ref', $morehtmlref = '', $moreparam = '', $nodbprefix = 0, $morehtmlleft = '', $morehtmlright = '', $onlybanner=0) { global $conf, $form, $user, $langs; @@ -2425,7 +2426,7 @@ class Ticketsup extends CommonObject } $modulepart = 'ticketsup'; - print '
'; + print '
'; $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 ''; } }