Dolibarrize module ticket

This commit is contained in:
Laurent Destailleur 2018-03-13 13:26:03 +01:00
parent 4380367923
commit e6d8219396
8 changed files with 117 additions and 89 deletions

View File

@ -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 '<select id="select' . $htmlname . '" class="flat select_tickettype" name="' . $htmlname . '">';
print '<select id="select' . $htmlname . '" class="flat select_tickettype'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
if ($empty) {
print '<option value="">&nbsp;</option>';
}
@ -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 '<select id="select' . $htmlname . '" class="flat select_ticketcategory" name="' . $htmlname . '">';
print '<select id="select' . $htmlname . '" class="flat select_ticketcategory'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
if ($empty) {
print '<option value="">&nbsp;</option>';
}
@ -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 '<select id="select' . $htmlname . '" class="flat select_ticketseverity" name="' . $htmlname . '">';
print '<select id="select' . $htmlname . '" class="flat select_ticketseverity'.($morecss?' '.$morecss:'').'" name="' . $htmlname . '">';
if ($empty) {
print '<option value="">&nbsp;</option>';
}
@ -698,6 +705,8 @@ class FormTicketsup
if ($user->admin && !$noadmininfo) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
print ajax_combobox('select'.$htmlname);
}
/**

View File

@ -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].= ' <span class="badge">'.$nbContact.'</span>';
$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;

View File

@ -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 '</table>';
// View Original message
$object->viewTicketOriginalMessage($user, $action);
// Fin colonne gauche et début colonne droite
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
@ -579,9 +592,9 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
<div class="tagtd">' . $tab[$i]['libelle'] . '</div>';
print '<div class="tagtd">';
print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'<br>';
if (! empty($tab[$i]['phone_perso'])) {
//print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' ';
print '<br>'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'<br>';
@ -594,7 +607,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
print '<div class="tagtd" align="center">';
if ($object->statut >= 0) {
echo '<a href="contacts.php?track_id=' . $object->dao->track_id . '&amp;action=swapstatut&amp;ligne=' . $tab[$i]['rowid'] . '">';
echo '<a href="contact.php?track_id=' . $object->dao->track_id . '&amp;action=swapstatut&amp;ligne=' . $tab[$i]['rowid'] . '">';
}
if ($tab[$i]['source'] == 'internal') {
@ -622,13 +635,13 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
}
print '</div><!-- contact list -->';
// 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 '</div></div></div>';
print '<div style="clear:both"></div>';
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 '<div class="inline-block divButAction">';
print '<a class="butAction" href="card.php?track_id=' . $object->dao->track_id . '&action=mark_ticket_read">' . img_picto('', 'mark-read@ticketsup') . ' ' . $langs->trans('MarkAsRead') . '</a>';
print '<a class="butAction" href="card.php?track_id=' . $object->dao->track_id . '&action=mark_ticket_read">' . img_picto('', 'mark-read@ticketsup', 'height="12px"') . ' ' . $langs->trans('MarkAsRead') . '</a>';
print '</div';
}
@ -711,7 +724,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti
} elseif ($action == 'add_message') {
$action='new_message';
$modelmail='ticketsup_send';
print '<div>';
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 '</div>';
}

View File

@ -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 '<div class="arearef heightref valignmiddle" width="100%">';
print '<div class="'.($onlybanner?'arearefnobottom':'arearef').' heightref valignmiddle" width="100%">';
$width = 80;
$height = 70;

View File

@ -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 = '<a href="' . dol_buildpath('/ticketsup/list.php', 1) . '"><strong>' . $langs->trans("BackToList") . '</strong></a> ';
$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 '<br>';
//print '<br>';
$permission = $user->rights->ticketsup->write;

View File

@ -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');

View File

@ -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');

View File

@ -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 '<tr><td>';
print '<tr><td class="titlefield">';
print $langs->trans('CustomerCode') . '</td><td colspan="' . (2 + (($showlogo || $showbarcode) ? 0 : 1)) . '">';
print $socstat->code_client;
if ($socstat->check_codeclient() != 0) {
@ -360,7 +358,7 @@ if ($projectid) {
$linkback = '<a href="' . DOL_URL_ROOT . '/projet/list.php">' . $langs->trans("BackToList") . '</a>';
// Ref
print '<tr><td width="30%">' . $langs->trans('Ref') . '</td><td colspan="3">';
print '<tr><td class="titlefield">' . $langs->trans('Ref') . '</td><td>';
// 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 "<tr><td>" . $langs->trans("ThirdParty") . "</td>";
print '<td colspan="3">';
print '<td>';
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 '<td class="liste_titre'.($align?' '.$align:'').'">';
$object->printSelectStatus(dol_escape_htmltag($search[$key]));
print '</td>';
} elseif ($key == 'type_code') {
print '<td class="liste_titre'.($align?' '.$align:'').'">';
$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 '</td>';
} elseif ($key == 'category_code') {
print '<td class="liste_titre'.($align?' '.$align:'').'">';
$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 '</td>';
} elseif ($key == 'severity_code') {
print '<td class="liste_titre'.($align?' '.$align:'').'">';
$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 '</td>';
} else {
} elseif ($key == 'fk_statut') {
print '<td class="liste_titre'.($align?' '.$align:'').'">';
$object->printSelectStatus(dol_escape_htmltag($search[$key]));
print '</td>';
}
else {
print '<td class="liste_titre'.($align?' '.$align:'').'"><input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'"></td>';
}
}