예제 #1
0
            $TPL["message_help"] = "Begin a Time Sheet by selecting a Project and clicking the Create Time Sheet button. A manager must add you to the project before you can create time sheets for it.";
        }
    }
}
// THAT'S THE END OF THE BIG SAVE.
$person = $timeSheet->get_foreign_object("person");
$TPL["timeSheet_personName"] = $person->get_name();
$timeSheet->set_values("timeSheet_");
if (!$timeSheetID) {
    $timeSheet->set_value("personID", $current_user->get_id());
}
if ($_POST["create_transactions_default"] && $timeSheet->have_perm(PERM_TIME_INVOICE_TIMESHEETS)) {
    $msg .= $timeSheet->createTransactions();
} else {
    if ($_POST["delete_all_transactions"] && $timeSheet->have_perm(PERM_TIME_INVOICE_TIMESHEETS)) {
        $msg .= $timeSheet->destroyTransactions();
    }
}
// Take care of saving transactions
if (($_POST["p_button"] || $_POST["a_button"] || $_POST["r_button"]) && $timeSheet->have_perm(PERM_TIME_INVOICE_TIMESHEETS)) {
    if ($_POST["p_button"]) {
        $status = "pending";
    } else {
        if ($_POST["a_button"]) {
            $status = "approved";
        } else {
            if ($_POST["r_button"]) {
                $status = "rejected";
            }
        }
    }