-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Shohei Nakajima edited this page Sep 14, 2015
·
4 revisions
ワークフローに関連するプラグイン。
コンテンツのワークフロー関連で使用するコンポーネント。
const STATUS_PUBLISHED = '1'; const STATUS_APPROVED = '2'; const STATUS_IN_DRAFT = '3'; const STATUS_DISAPPROVED = '4';
登録アクションでリクエストパラメータ(request→data)からステータスをパースするメソッド
(例)
if ($this->request->isPost() || $this->request->isPut()) { $data = $this->data; $data['Announcement']['status'] = $this->Workflow->parseStatus(); unset($data['Announcement']['id']);
if ($this->Announcement->saveAnnouncement($data)) { $this->redirect(NetCommonsUrl::backToPageUrl()); return; } $this->NetCommons->handleValidationError($this->Announcement->validationErrors);
} else { if (! $this->request->data = $this->Announcement->getAnnouncement()) { $this->request->data = $this->Announcement->createAll(); } $this->request->data['Frame'] = Current::read('Frame'); }
上記以外は、[Workflow/Controller/Component/WorkflowComponent.php](https://github.com/NetCommons3/Workflow/blob/master/Controller/Component/WorkflowComponent.php)を参照して下さい。