| @@ 62-77 (lines=16) @@ | ||
| 59 | ); |
|
| 60 | } |
|
| 61 | ||
| 62 | public function handleItem() |
|
| 63 | { |
|
| 64 | $id = $this->request->param('ID'); |
|
| 65 | $defn = $this->parent->Definition(); |
|
| 66 | $action = $defn->Actions()->byID($id); |
|
| 67 | ||
| 68 | if (!$action) { |
|
| 69 | $this->httpError(404); |
|
| 70 | } |
|
| 71 | ||
| 72 | if (!$action->canEdit()) { |
|
| 73 | $this->httpError(403); |
|
| 74 | } |
|
| 75 | ||
| 76 | return new WorkflowFieldItemController($this, "item/$id", $action); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function RootField() |
|
| 80 | { |
|
| @@ 57-71 (lines=15) @@ | ||
| 54 | return new WorkflowFieldItemController($this, "new/$parent", $transition); |
|
| 55 | } |
|
| 56 | ||
| 57 | public function handleItem() |
|
| 58 | { |
|
| 59 | $id = $this->request->param('ID'); |
|
| 60 | $trans = WorkflowTransition::get()->byID($id); |
|
| 61 | ||
| 62 | if (!$trans || $trans->Action()->WorkflowDefID != $this->RootField()->Definition()->ID) { |
|
| 63 | $this->httpError(404); |
|
| 64 | } |
|
| 65 | ||
| 66 | if (!$trans->canEdit()) { |
|
| 67 | $this->httpError(403); |
|
| 68 | } |
|
| 69 | ||
| 70 | return new WorkflowFieldItemController($this, "item/$id", $trans); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function RootField() |
|
| 74 | { |
|