llxHeader('', $langs->trans("ContractCard"), "Contrat"); $form = new Form($db); $formcompany = new FormCompany($db); $contactstatic = new Contact($db); $userstatic = new User($db); dol_htmloutput_mesg($mesg); /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ /* *************************************************************************** */ if ($id > 0 || !empty($ref)) { if ($object->fetch($id, $ref) > 0) { dol_htmloutput_mesg($mesg); $object->fetch_thirdparty(); $head = contract_prepare_head($object); $hselected = 1; dol_fiche_head($head, $hselected, $langs->trans("Contract"), 0, 'contract'); /* * Contrat */ print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/contrat/liste.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>'; // Reference du contrat print '<tr><td width="25%">' . $langs->trans("Ref") . '</td><td colspan="3">'; print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', ''); print "</td></tr>"; // Customer print "<tr><td>" . $langs->trans("Customer") . "</td>"; print '<td colspan="3">' . $object->thirdparty->getNomUrl(1) . '</td></tr>'; // Ligne info remises tiers
/** * \file htdocs/contrat/info.php * \ingroup contrat * \brief Page des informations d'un contrat */ require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; $langs->load("contracts"); // Security check $contratid = GETPOST("id", 'int'); if ($user->societe_id) { $socid = $user->societe_id; } $result = restrictedArea($user, 'contrat', $contratid, ''); /* * View */ llxHeader(); $contrat = new Contrat($db); $contrat->fetch($contratid); $contrat->info($contratid); $head = contract_prepare_head($contrat); dol_fiche_head($head, 'info', $langs->trans("Contract"), 0, 'contract'); print '<table width="100%"><tr><td>'; dol_print_object_info($contrat); print '</td></tr></table>'; print '</div>'; $db->close(); llxFooter();
function _header($id, $object_type) { global $db, $langs; $langs->load('interventions'); $langs->load('contracts'); if ($object_type == 'contrat') { $object = new Contrat($db); $object->fetch($id); dol_include_once('/core/lib/contract.lib.php'); $head = contract_prepare_head($object); dol_fiche_head($head, 'dispatchAsset', $langs->trans("Contract"), 0, 'contract'); } else { if ($object_type == 'intervention') { $object = new Fichinter($db); $object->fetch($id); dol_include_once('/core/lib/fichinter.lib.php'); $head = fichinter_prepare_head($object); dol_fiche_head($head, 'dispatchAsset', $langs->trans("InterventionCard"), 0, 'intervention'); } else { if ($object_type == 'ticketsup') { dol_include_once('/ticketsup/class/ticketsup.class.php'); dol_include_once('/ticketsup/lib/ticketsup.lib.php'); $object = new Ticketsup($db); $object->fetch($id); $head = ticketsup_prepare_head($object); dol_fiche_head($head, 'dispatchAsset', $langs->trans("Ticket"), 0, 'ticketsup@ticketsup'); } } } return $object; }
$soc = new Societe($db, $contrat->societe->id); $soc->fetch($contrat->societe->id); if ( $error_msg ) { echo '<div class="error">'.$error_msg.'</div><br>'; } if ($_GET["action"] == 'delete') { $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $result=dol_delete_file($file); //if ($result >= 0) $mesg=$langs->trans("FileWasRemoced"); } $head=contract_prepare_head($contrat, $user); dol_fiche_head($head, 'documents', $langs->trans("Contract"), 0, 'contract'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; foreach($filearray as $key => $file) { $totalsize+=$file['size']; } print '<table class="border" width="100%">';
$langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). $ret = dol_delete_file($file, 0, 0, 0, $object); $_SESSION['dol_message'] = '<div class="ok">' . $langs->trans("FileWasRemoved", GETPOST('urlfile')) . '</div>'; Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } } /* * */ $form = new Form($db); llxHeader(); if ($object->id) { $head = contract_prepare_head($object, $user); dol_fiche_head($head, 'documents', $langs->trans("Contract"), 0, 'contract'); // Construit liste des fichiers $filearray = dol_dir_list($upload_dir, "files", 0, '', '\\.meta$', $sortfield, strtolower($sortorder) == 'desc' ? SORT_DESC : SORT_ASC, 1); $totalsize = 0; foreach ($filearray as $key => $file) { $totalsize += $file['size']; } print '<table class="border" width="100%">'; // Reference print '<tr><td width="30%">' . $langs->trans('Ref') . '</td><td colspan="3">' . $object->ref . '</td></tr>'; // Societe print '<tr><td>' . $langs->trans("Customer") . '</td>'; print '<td colspan="3">' . $object->thirdparty->getNomUrl(1) . '</td></tr>'; print '<tr><td>' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>'; print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';