27require 
'../main.inc.php';
 
   28require_once DOL_DOCUMENT_ROOT.
'/core/lib/contract.lib.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
 
   30if (isModEnabled(
'project')) {
 
   31  require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
 
   34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
 
   35require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
 
   36require_once DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php";
 
   38$langs->loadLangs(array(
'companies', 
'contracts', 
'tickets'));
 
   43$action=
GETPOST(
'action', 
'alpha');
 
   45if ($id == 
'' && $ref == 
'') {
 
   52if ($user->socid > 0) {
 
   63llxHeader(
"", $langs->trans(
"Tickets"), 
"Contrat");
 
   66$userstatic=
new User($db);
 
   69$result=$object->fetch($id, $ref);
 
   70$ret=$object->fetch_thirdparty();
 
   74dol_fiche_head($head, 
'ticket', $langs->trans(
"Contract"), -1, 
'contract');
 
   76$linkback = 
'<a href="'.DOL_URL_ROOT.
'/contrat/list.php'.(! empty($socid) ? 
'?socid='.$socid : 
'').
'">';
 
   77$linkback.= $langs->trans(
"BackToList").
'</a>';
 
   80$morehtmlref.=$object->ref;
 
   82$morehtmlref.=
'<div class="refidno">';
 
   84$morehtmlref.=$form->editfieldkey(
 
   87  $object->ref_customer,
 
   95$morehtmlref.=$form->editfieldval(
 
   98  $object->ref_customer,
 
  110$morehtmlref.=$form->editfieldkey(
 
  113  $object->ref_supplier,
 
  121$morehtmlref.=$form->editfieldval(
 
  124  $object->ref_supplier,
 
  135$morehtmlref.=
'<br>'.$langs->trans(
'ThirdParty') . 
' : ' . $object->thirdparty->getNomUrl(1);
 
  137if (! empty($conf->projet->enabled)) {
 
  138  require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
 
  140  $langs->load(
"projects");
 
  141  $morehtmlref.=
'<br>'.$langs->trans(
'Project') . 
' : ';
 
  142  if (! empty($object->fk_project)) {
 
  144    $proj->fetch($object->fk_project);
 
  145    $morehtmlref.=
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id=';
 
  146    $morehtmlref.=$object->fk_project . 
'" title="' . $langs->trans(
'ShowProject') . 
'">';
 
  147    $morehtmlref.=$proj->ref;
 
  148    $morehtmlref.=
'</a>';
 
  153$morehtmlref.=
'</div>';
 
  155dol_banner_tab($object, 
'ref', $linkback, 1, 
'ref', 
'none', $morehtmlref);
 
  157print 
'<div class="underbanner clearboth"></div>';
 
  164$title=$langs->trans(
"ListTicketsLinkToContract");
 
  166print 
'<table class="noborder" width="100%">';
 
  167print 
'<tr class="liste_titre">';
 
  168print 
'<td >'.$langs->trans(
"Ref").
'</td>';
 
  169print 
'<td width="300">'.$langs->trans(
"Subject").
'</td>';
 
  170print 
'<td align="left">'.$langs->trans(
"Type").
'</td>';
 
  171print 
'<td align="left" nowrap >'.$langs->trans(
"TicketCategory").
'</td>';
 
  172print 
'<td align="left">'.$langs->trans(
"Severity").
'</td>';
 
  173print 
'<td  align="center">'.$langs->trans(
"Date").
'</td>';
 
  174print 
'<td  align="center" nowrap >'.$langs->trans(
"DateEnd").
'</td>';
 
  175print 
'<td  align="right">'.$langs->trans(
"Progress").
'</td>';
 
  176print 
'<td align="right" width="100">'.$langs->trans(
"Status").
'</td>';
 
  179$allticketarray = $object->getTicketsArray();
 
  180if (is_array($allticketarray) && count($allticketarray) > 0) {
 
  181  foreach ($allticketarray as $key => $value) {
 
  190    print 
'<td align="left">';
 
  191    print $element->getNomUrl(1);
 
  195    print 
'<td align="left">'.$value->subject.
'</td>';
 
  196    print 
'<td align="left">'.$value->type_label.
'</td>';
 
  197    print 
'<td align="left">'.$value->category_label.
'</td>';
 
  198    print 
'<td align="left">'.$value->severity_label.
'</td>';
 
  201    print 
'<td align="center">'.dol_print_date($element->datec, 
'day').
'</td>';
 
  202    print 
'<td align="center">'.dol_print_date($element->date_close, 
'day').
'</td>';
 
  205    print 
'<td align="right">';
 
  206    print(isset($element->progress) ? $element->progress.
'%' : 
'');
 
  210    print 
'<td align="right">'.$element->getLibStatut(5).
'</td>';
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
 
Class to manage contracts.
 
Class to manage projects.
 
Class to manage Dolibarr users.
 
contract_prepare_head(Contrat $object)
Prepare array with list of tabs.
 
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
 
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
 
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tab header of a card.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.