Example #1
0
 public function toJSON()
 {
     $json = array();
     $json['fields'] = array();
     $json['fields']['project'] = array("id" => $this->project->getId());
     $json['fields']['summary'] = $this->summary;
     $json['fields']['issuetype'] = array("id" => $this->issueType->getId());
     $json['fields']['assignee'] = array("name" => $this->assignee->getName());
     $json['fields']['reporter'] = array("name" => $this->reporter->getName());
     $json['fields']['labels'] = $this->labels;
     $json['fields']['description'] = $this->description;
     return $json;
 }
Example #2
0
 public function preloadValues()
 {
     static $preloaded = false;
     if (!$preloaded) {
         $milestones = tables\Milestones::getTable()->getByProjectID($this->getID());
         unset($milestones);
         $issuetypes = IssueType::getAll();
         unset($issuetypes);
         tables\ListTypes::getTable()->populateItemCache();
     }
     $preloaded = true;
 }
Example #3
0
    $o->handleUpdate($r);
    $o->save();
    echo "Action: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'contactMethods'));
$methods = $result['items'];
foreach ($methods as $m) {
    $o = new ContactMethod();
    $o->setName($m);
    $o->save();
    echo "ContactMethod: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'types'));
$types = $result['items'];
foreach ($types as $t) {
    $o = new IssueType();
    $o->setName($t);
    $o->save();
    echo "IssueType: {$o->getName()}\n";
}
$result = $mongo->lookups->findOne(array('name' => 'labels'));
$labels = $result['items'];
foreach ($labels as $l) {
    $o = new Label();
    $o->setName($l);
    $o->save();
    echo "Label: {$o->getName()}\n";
}
$result = $mongo->categoryGroups->find();
foreach ($result as $r) {
    $o = new CategoryGroup();