continue; } if ($pInfK === "api_access") { continue; } if ($pInfK === "enable_notify") { $pInfV = (int) $pInfV; } $iC->loadInfos('nom', $pInfK); $iC->setInfo('value', $pInfV); $iC->save('id', 'this', false, false); } } else { $i = new Infos('t_' . $type); $i->loadInfos('id', $item['id']); $i->setAllInfos($item); $i->save('id', 'this', false, false); } $data['error'] = "OK"; $data['message'] = "OK! '{$type}' " . $LANG['Updated']; } if ($action === 'deleteSetting') { if (!isset($type)) { throw new Exception("Missing the type of setting to delete (labels, devs, projectInfo?)"); } $i = new Infos('t_' . $type); $i->loadInfos('id', $itemID); $i->delete(); $data['error'] = "OK"; $data['message'] = $LANG['Item_remove_OK'] . " {$type}."; }
/** * Add a new comment to the bug * @param STRING $text Comment message */ public function addComment($text) { if (strlen($text) < 3) { throw new Exception("Bug::addComment() : comment text is too short!"); } $iC = new Infos('t_comments'); $commInfos = array('date' => date('Y-m-d H:i:s'), 'message' => $text, 'FK_dev_ID' => -1, 'FK_bug_ID' => (int) $this->bugData['id']); $iC->setAllInfos($commInfos); $iC->save('id', 'this', false, false); $newCommID = $iC->getInfos('id'); $commList = json_decode($this->bugData['FK_comment_ID']); $commList[] = $newCommID; $this->bugData['FK_comment_ID'] = json_encode($commList); $this->bugInfos->setInfo('FK_comment_ID', $this->bugData['FK_comment_ID']); $this->save(); $iC->loadInfos('id', $newCommID); return $iC->getInfos(); }