Exemplo n.º 1
0
    $ownerID = $own['uID'];
    $posted_data = array("bug_severity" => $sever, "bug_status" => $status, "package" => $projectID, "owner" => $ownerID, "title" => $title, "private" => $priv, "descr" => $descr);
    // print_r( $posted_data );
    $b->getAllByPK($bugid);
    $row = $b->getNext();
    // print_r( $row ); // searched bug
    /*
     --> $row should look like:
       ** NOTE: IGNORE THE [n] ETC! THEY ARE STUPID IF YOU DON'T QUERY FUR THEM **
    Array (
    	[bID] =>              1                        <-- PK, bug ID
    	[bug_status] => 1                              <-- FK, status table by ID
    	[bug_severity] => 1                            <-- FK, severity table by ID
    	[package] => 1                                 <-- FK, project table by pID
    	[reporter] => 1                                <-- FK, user table by uID
    	[owner] => 0                                   <-- FK, user table by uID
    	[title] => Whube is not done yet               <-- Title
    	[descr] => Whube is not done yet, of course!   <-- Description
    )
    */
    $b->updateByPK($bugid, $posted_data);
    // /*
    $_SESSION['msg'] = "Bug #{$bugid} updated!";
    header("Location: " . $SITE_PREFIX . "t/bug/" . $bugid);
    exit(0);
    // */
} else {
    $_SESSION['msg'] = "Wtf, really";
    header("Location: " . $SITE_PREFIX . "t/bug-list/" . $bugid);
    exit(0);
}
Exemplo n.º 2
0
     // f**k you, user
 }
 if (isset($meta['email']) && isset($meta['project']) && isset($meta['title']) && isset($meta['body'])) {
     $o->getByCol("email", $meta['email']);
     $submitter = $o->getNext();
     if (isset($submitter['uID'])) {
         // OK to insert
         $fields = array("reporter" => $submitter['uID'], "owner" => $submitter['uID'], "title" => $meta['title'], "descr" => $meta['body']);
         $id = $b->createNew($fields);
         $d['errors'] = false;
         $d['message'] = "New bug with ID '" + $id + ";";
         if (isset($meta['assign'])) {
             $o->getByCol("username", $meta['assign']);
             $row = $o->getNext();
             if (isset($row['uID'])) {
                 $b->updateByPK($id, array("owner" => $row['uID']));
                 $d['message'] .= "\nAssigning this bug to " . $row['real_name'];
             } else {
                 $d['message'] .= "\nCould not find user '" . $meta['assign'] . "' in this DB.";
             }
         }
         if (isset($meta['project'])) {
             $p->getByCol("project_name", $meta['project']);
             $row = $p->getNext();
             if (isset($row['pID'])) {
                 $b->updateByPK($id, array("package" => $row['pID']));
                 $d['message'] .= "\nAssigning this bug to project " . $row['project_name'];
             } else {
                 $d['message'] .= "\nCould not find project '" . $meta['project'] . "' in this DB.";
             }
         }