30require 
'../main.inc.php';
 
   31require_once DOL_DOCUMENT_ROOT.
'/core/lib/contract.lib.php';
 
   32require_once DOL_DOCUMENT_ROOT.
'/contrat/class/contrat.class.php';
 
   33if (isModEnabled(
'project')) {
 
   34  require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
 
   37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
 
   38require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
 
   39require_once DOL_DOCUMENT_ROOT.
"/ticket/class/ticket.class.php";
 
   49$langs->loadLangs(array(
'companies', 
'contracts', 
'tickets'));
 
   54$action = 
GETPOST(
'action', 
'alpha');
 
   56if ($id == 
'' && $ref == 
'') {
 
   63if ($user->socid > 0) {
 
   64  $socid = $user->socid;
 
   73$title = $langs->trans(
"Contract") . 
' - ' . $langs->trans(
"Tickets");
 
   74$help_url = 
'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio';
 
   76llxHeader(
"", $title, $help_url, 
'', 0, 0, 
'', 
'', 
'', 
'mod-contrat page-card_ticket');
 
   79$userstatic = 
new User($db);
 
   82$result = 
$object->fetch($id, $ref);
 
   83$ret = 
$object->fetch_thirdparty();
 
   89$linkback = 
'<a href="'.DOL_URL_ROOT.
'/contrat/list.php'.(! empty($socid) ? 
'?socid='.$socid : 
'').
'">';
 
   90$linkback .= $langs->trans(
"BackToList").
'</a>';
 
   95$morehtmlref .= 
'<div class="refidno">';
 
   97$morehtmlref .= $form->editfieldkey(
 
  108$morehtmlref .= $form->editfieldval(
 
  122$morehtmlref .= 
'<br>';
 
  123$morehtmlref .= $form->editfieldkey(
 
  134$morehtmlref .= $form->editfieldval(
 
  148$morehtmlref .= 
'<br>'.$langs->trans(
'ThirdParty') . 
' : ' . 
$object->thirdparty->getNomUrl(1);
 
  150if (! empty(
$conf->projet->enabled)) {
 
  151  require_once DOL_DOCUMENT_ROOT.
'/projet/class/task.class.php';
 
  153  $langs->load(
"projects");
 
  154  $morehtmlref .= 
'<br>'.$langs->trans(
'Project') . 
' : ';
 
  155  if (! empty(
$object->fk_project)) {
 
  157    $proj->fetch(
$object->fk_project);
 
  158    $morehtmlref .= 
'<a href="'.DOL_URL_ROOT.
'/projet/card.php?id=';
 
  159    $morehtmlref .= 
$object->fk_project . 
'" title="' . $langs->trans(
'ShowProject') . 
'">';
 
  160    $morehtmlref .= $proj->ref;
 
  161    $morehtmlref .= 
'</a>';
 
  166$morehtmlref .= 
'</div>';
 
  168dol_banner_tab($object, 
'ref', $linkback, 1, 
'ref', 
'none', $morehtmlref);
 
  170print 
'<div class="underbanner clearboth"></div>';
 
  177$title = $langs->trans(
"ListTicketsLinkToContract");
 
  179print 
'<table class="noborder" width="100%">';
 
  180print 
'<tr class="liste_titre">';
 
  181print 
'<td >'.$langs->trans(
"Ref").
'</td>';
 
  182print 
'<td width="300">'.$langs->trans(
"Subject").
'</td>';
 
  183print 
'<td align="left">'.$langs->trans(
"Type").
'</td>';
 
  184print 
'<td align="left" nowrap >'.$langs->trans(
"TicketCategory").
'</td>';
 
  185print 
'<td align="left">'.$langs->trans(
"Severity").
'</td>';
 
  186print 
'<td  align="center">'.$langs->trans(
"Date").
'</td>';
 
  187print 
'<td  align="center" nowrap >'.$langs->trans(
"DateEnd").
'</td>';
 
  188print 
'<td  align="right">'.$langs->trans(
"Progress").
'</td>';
 
  189print 
'<td align="right" width="100">'.$langs->trans(
"Status").
'</td>';
 
  192$allticketarray = 
$object->getTicketsArray();
 
  193if (is_array($allticketarray) && count($allticketarray) > 0) {
 
  194  foreach ($allticketarray as $key => $value) {
 
  203    print 
'<td align="left">';
 
  204    print $element->getNomUrl(1);
 
  208    print 
'<td align="left">'.$value->subject.
'</td>';
 
  209    print 
'<td align="left">'.$value->type_label.
'</td>';
 
  210    print 
'<td align="left">'.$value->category_label.
'</td>';
 
  211    print 
'<td align="left">'.$value->severity_label.
'</td>';
 
  214    print 
'<td align="center">'.dol_print_date($element->datec, 
'day').
'</td>';
 
  215    print 
'<td align="center">'.dol_print_date($element->date_close, 
'day').
'</td>';
 
  218    print 
'<td align="right">';
 
  219    print(isset($element->progress) ? $element->progress.
'%' : 
'');
 
  223    print 
'<td align="right">'.$element->getLibStatut(5).
'</td>';
 
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
 
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
 
Class to manage projects.
 
Class to manage Dolibarr users.
 
contract_prepare_head(Contrat $object)
Prepare array with list of tabs.
 
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
 
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
 
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
 
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.