예제 #1
0
파일: card.php 프로젝트: Albertopf/prueba
    // Other attributes
    $parameters = array('colspan' => ' colspan="2"');
    $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
    // Note that $action and $object may have been modified by hook
    print '</table>';
    print '<br><div class="center">';
    print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
    print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
    print '</div>';
    print '</form>';
} else {
    if ($id) {
        $result = $object->fetch($id);
        if ($result > 0) {
            $head = trip_prepare_head($object);
            dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip');
            if ($action == 'edit' && $user->rights->deplacement->creer) {
                //WYSIWYG Editor
                require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
                $soc = new Societe($db);
                if ($object->socid) {
                    $soc->fetch($object->socid);
                }
                print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
                print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
                print '<input type="hidden" name="action" value="update">';
                print '<input type="hidden" name="id" value="' . $id . '">';
                print '<table class="border" width="100%">';
                // Ref
                print "<tr>";
$object = new Deplacement($db);
$object->fetch($id, $ref);
$upload_dir = $conf->deplacement->dir_output . '/' . dol_sanitizeFileName($object->ref);
$modulepart = 'trip';
/*
 * Actions
 */
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_pre_headers.tpl.php';
/*
 * View
 */
$form = new Form($db);
llxHeader("", "", $langs->trans("TripCard"));
if ($object->id) {
    $object->fetch_thirdparty();
    $head = trip_prepare_head($object, $user);
    dol_fiche_head($head, 'documents', $langs->trans("TripCard"), 0, 'trip');
    // Construit liste des fichiers
    $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\\.meta|_preview\\.png)$', $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%">';
    $linkback = '<a href="' . DOL_URL_ROOT . '/compta/deplacement/list.php' . (!empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
    // Ref
    print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td>';
    print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
    print '</td></tr>';
    // Societe
    //print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";