Beispiel #1
0
        }
        alloc_redirect($TPL["url_alloc_project"] . "projectID=" . $project->get_id());
    }
} else {
    if ($_POST["delete"]) {
        $project->read_globals();
        $project->delete();
        alloc_redirect($TPL["url_alloc_projectList"]);
        // If they are creating a new project that is based on an existing one
    } else {
        if ($_POST["copy_project_save"] && $_POST["copy_projectID"] && $_POST["copy_project_name"]) {
            $p = new project();
            $p->set_id($_POST["copy_projectID"]);
            if ($p->select()) {
                $p2 = new project();
                $p2->read_row_record($p->row());
                $p2->set_id("");
                $p2->set_value("projectName", $_POST["copy_project_name"]);
                $p2->set_value("projectShortName", "");
                $p2->save();
                $TPL["message_good"][] = "Project details copied successfully.";
                // Copy project people
                $q = prepare("SELECT * FROM projectPerson WHERE projectID = %d", $p->get_id());
                $db = new db_alloc();
                $db->query($q);
                while ($row = $db->row()) {
                    $projectPerson = new projectPerson();
                    $projectPerson->currency = $p->get_value("currencyTypeID");
                    $projectPerson->read_row_record($row);
                    $projectPerson->set_id("");
                    $projectPerson->set_value("projectID", $p2->get_id());