コード例 #1
0
ファイル: custom_fields.php プロジェクト: dasklney/traq
 public function action_index()
 {
     View::set('custom_fields', CustomField::select()->where('project_id', $this->project->id)->exec()->fetch_all());
 }
コード例 #2
0
ファイル: CustomFields.php プロジェクト: nirix/traq
 /**
  * Delete field.
  */
 public function destroyAction($id)
 {
     $field = CustomField::select()->where('id = ?')->andWhere('project_id = ?')->setParameter(0, $id)->setParameter(1, $this->currentProject['id'])->fetch();
     $field->delete();
     return $this->respondTo(function ($format) use($field) {
         if ($format == "html") {
             return $this->redirectTo('project_settings_custom_fields');
         } elseif ($format == "json") {
             return $this->jsonResponse(['deleted' => true, 'field' => $field->toArray()]);
         }
     });
 }