Ejemplo n.º 1
0
if ($sub_action == "update") {
    // Update the modification
    if (isset($_POST['save'])) {
        $act2 = new Follow_Up($cn);
        $act2->fromArray($_POST);
        if ($g_user->can_write_action($act2->ag_id) == false) {
            echo '<div class="redcontent">';
            echo '<h2 class="error">' . _('Cette action ne vous est pas autorisée Contactez votre responsable') . '</h2>';
            echo '</div>';
            return;
        }
        $sub_action = "detail";
        put_global(array(array('key' => "sa", "value" => "detail")));
        try {
            $act2->verify();
            $act2->Update();
        } catch (Exception $e) {
            echo '<span class="notice">';
            echo _("Erreur") . " " . $e->getMessage();
            echo '</span>';
            $sub_action = "detail";
            $correction = 1;
            $act = clone $act2;
            $act->get();
            $act->fromArray($_POST);
            $error_id = $e->getCode();
        }
    }
    //----------------------------------------------------------------------
    // Add a related action
    //----------------------------------------------------------------------