コード例 #1
0
ファイル: card.php プロジェクト: TAASA/Dolibarr-ERP-3.8.1
// fetch optionals attributes lines and labels
$extrafieldsline = new ExtraFields($db);
$extralabelslines = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$permissionnote = $user->rights->contrat->creer;
// Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->contrat->creer;
// Used by the include of actions_dellink.inc.php
/*
 * Actions
 */
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';
// Must be include, not includ_once
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
// Must be include, not include_once
if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat->activer) {
    $result = $object->active_line($user, GETPOST('ligne'), GETPOST('date'), GETPOST('dateend'), GETPOST('comment'));
    if ($result > 0) {
        header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
        exit;
    } else {
        setEventMessage($object->error, 'errors');
    }
} else {
    if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->contrat->activer) {
        if (!GETPOST('dateend')) {
            $error++;
            setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), 'errors');
        }
        if (!$error) {
            $result = $object->close_line($user, GETPOST('ligne'), GETPOST('dateend'), urldecode(GETPOST('comment')));
            if ($result > 0) {
コード例 #2
0
ファイル: fiche.php プロジェクト: remyyounes/dolibarr
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'contrat',$contratid,'contrat');

$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;

$object = new Contrat($db);


/*
 * Actions
 */

if ($action == 'confirm_active' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
{
    $object->fetch($_GET["id"]);
    $result = $object->active_line($user, $_GET["ligne"], $_GET["date"], $_GET["dateend"], $_GET["comment"]);

    if ($result > 0)
    {
        Header("Location: fiche.php?id=".$object->id);
        exit;
    }
    else {
        $mesg=$object->error;
    }
}

if ($action == 'confirm_closeline' && $_REQUEST["confirm"] == 'yes' && $user->rights->contrat->activer)
{
    $object->fetch($_GET["id"]);
    $result = $object->close_line($user, $_GET["ligne"], $_GET["dateend"], urldecode($_GET["comment"]));