public function cancel(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
     return $wpr;
 }
 public function cancel(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($c));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     if ($c->getPageTypeHandle() == STACKS_PAGE_TYPE) {
         $c = Stack::getByID($this->getRequestedPageID());
         if ($c->getStackType() == Stack::ST_TYPE_GLOBAL_AREA && $c->isNeutralStack()) {
             $c->cloneVersion(t('Global Area emptied'), true);
         } else {
             $c->delete();
         }
         $wpr = new WorkflowProgressResponse();
         $wpr->setWorkflowProgressResponseURL(URL::to('/dashboard/blocks/stacks', 'stack_deleted'));
         return $wpr;
     }
     $cParentID = $c->getCollectionParentID();
     if (Config::get('concrete.misc.enable_trash_can')) {
         $c->moveToTrash();
     } else {
         $c->delete();
     }
     $wpr = new WorkflowProgressResponse();
     $parent = Page::getByID($cParentID, 'ACTIVE');
     $wpr->setWorkflowProgressResponseURL(\URL::to($parent));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $c->setOverrideTemplatePermissions($this->inheritance);
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($c));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $c->setOverrideTemplatePermissions($this->inheritance);
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $s = Stack::getByID($this->getRequestedPageID());
     $v = CollectionVersion::get($s, $this->cvID);
     $v->approve(false);
     if ($s->getStackName() != $v->getVersionName()) {
         // The stack name has changed so we need to
         // update that for the stack object as well.
         $s->update(array('stackName' => $v->getVersionName()));
     }
     $ev = new \Concrete\Core\Page\Collection\Version\Event($s);
     $ev->setCollectionVersionObject($v);
     Events::dispatch('on_page_version_submit_approve', $ev);
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($s));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     switch ($this->inheritance) {
         case 'PARENT':
             $c->inheritPermissionsFromParent();
             break;
         case 'TEMPLATE':
             $c->inheritPermissionsFromDefaults();
             break;
         default:
             $c->setPermissionsToManualOverride();
             break;
     }
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($c));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     switch ($this->inheritance) {
         case 'PARENT':
             $c->inheritPermissionsFromParent();
             break;
         case 'TEMPLATE':
             $c->inheritPermissionsFromDefaults();
             break;
         default:
             $c->setPermissionsToManualOverride();
             break;
     }
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $dc = Page::getByID($this->targetCID);
     if (is_object($c) && is_object($dc) && !$c->isError() && !$dc->isError()) {
         if ($c->canMoveCopyTo($dc)) {
             if ($this->saveOldPagePath) {
                 // retain old page path.
                 $path = $c->getCollectionPathObject();
                 if (is_object($path)) {
                     $c->addAdditionalPagePath($path->getPagePath());
                 }
             }
             $nc2 = $c->move($dc);
             $wpr = new WorkflowProgressResponse();
             $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
             return $wpr;
         }
     }
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     if ($c->getPageTypeHandle() == STACKS_PAGE_TYPE) {
         $c = Stack::getByID($this->getRequestedPageID());
         $c->delete();
         $wpr = new WorkflowProgressResponse();
         $wpr->setWorkflowProgressResponseURL(URL::to('/dashboard/blocks/stacks', 'stack_deleted'));
         return $wpr;
     }
     $cParentID = $c->getCollectionParentID();
     if (Config::get('concrete.misc.enable_trash_can')) {
         $c->moveToTrash();
     } else {
         $c->delete();
     }
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $cParentID);
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $ps = $this->getPagePermissionSet();
     $assignments = $ps->getPermissionAssignments();
     foreach ($assignments as $pkID => $paID) {
         $pk = PermissionKey::getByID($pkID);
         $pk->setPermissionObject($c);
         $pt = $pk->getPermissionAssignmentObject();
         $pt->clearPermissionAssignment();
         if ($paID > 0) {
             $pa = PermissionAccess::getByID($paID, $pk);
             if (is_object($pa)) {
                 $pt->assignPermissionAccess($pa);
             }
         }
     }
     $c->refreshCache();
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($c));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $v = CollectionVersion::get($c, $this->cvID);
     $v->approve(false);
     $ev = new \Concrete\Core\Page\Collection\Version\Event($c);
     $ev->setCollectionVersionObject($v);
     Events::dispatch('on_page_version_submit_approve', $ev);
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(\URL::to($c));
     return $wpr;
 }
 public function approve(WorkflowProgress $wp)
 {
     $c = Page::getByID($this->getRequestedPageID());
     $v = CollectionVersion::get($c, $this->cvID);
     $v->approve(false);
     $ev = new \Concrete\Core\Page\Collection\Version\Event($c);
     $ev->setCollectionVersionObject($v);
     Events::dispatch('on_page_version_submit_approve', $ev);
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL(BASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $c->getCollectionID());
     return $wpr;
 }
 public function cancel(WorkflowProgress $wp)
 {
     $wpr = new WorkflowProgressResponse();
     $wpr->setWorkflowProgressResponseURL((string) URL::to('/dashboard/users/search/view/', $this->getRequestedUserID(), '/workflow_canceled'));
     return $wpr;
 }