Esempio n. 1
0
            $tsi->select();
            if ($row_projectPerson["rateUnitID"]) {
                $v = $row_projectPerson["rateUnitID"];
            } else {
                $v = "";
            }
            $tsi->set_value("timeSheetItemDurationUnitID", $v);
            $tsi->set_value("rate", page::money($timeSheet->get_value("currencyTypeID"), $row_projectPerson["rate"], "%mo"));
            $tsi->skip_tsi_status_check = true;
            $tsi->save();
        }
    }
}
if ($_POST["save"] || $_POST["save_and_new"] || $_POST["save_and_returnToList"] || $_POST["save_and_returnToProject"] || $_POST["save_and_MoveForward"] || $_POST["save_and_MoveBack"]) {
    // Saving a record
    $timeSheet->read_globals();
    $timeSheet->read_globals("timeSheet_");
    $projectID = $timeSheet->get_value("projectID");
    if ($projectID != 0) {
        $project = new project();
        $project->set_id($projectID);
        $project->select();
        $projectManagers = $project->get_timeSheetRecipients();
        if (!$timeSheet->get_id()) {
            $timeSheet->set_value("customerBilledDollars", page::money($project->get_value("currencyTypeID"), $project->get_value("customerBilledDollars"), "%mo"));
            $timeSheet->set_value("currencyTypeID", $project->get_value("currencyTypeID"));
        }
    } else {
        $save_error = true;
        $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.";
        alloc_error("Please select a Project and then click the Create Time Sheet button.");