public function on_start() { parent::on_start(); $this->addHeaderItem("<script type=\"text/javascript\">\$(function() { \$('.dialog-launch').dialog();});</script>"); $this->categories = WorkflowProgressCategory::getList(); foreach ($this->categories as $cat) { $this->categoryHandles[] = $cat->getWorkflowProgressCategoryHandle(); } }
public function import(\SimpleXMLElement $sx) { if (isset($sx->workflowprogresscategories)) { foreach ($sx->workflowprogresscategories->category as $wpc) { $pkg = static::getPackageObject($wpc['package']); $category = \Concrete\Core\Workflow\Progress\Category::getByHandle((string) $wpc['handle']); if (!is_object($category)) { \Concrete\Core\Workflow\Progress\Category::add((string) $wpc['handle'], $pkg); } } } }
/** * Get the WorkflowRequest object for the current WorkflowProgress object * @return WorkflowRequest */ public function getWorkflowRequestObject() { if ($this->wrID > 0) { $cat = WorkflowProgressCategory::getByID($this->wpCategoryID); $handle = $cat->getWorkflowProgressCategoryHandle(); $class = '\\Concrete\\Core\\Workflow\\Request\\' . Loader::helper('text')->camelcase($handle) . 'Request'; $wr = call_user_func_array(array($class, 'getByID'), array($this->wrID)); if (is_object($wr)) { $wr->setCurrentWorkflowProgressObject($this); return $wr; } } }
public function execute(Batch $batch) { $types = $batch->getObjectCollection('workflow_progress_category'); if (!$types) { return; } foreach ($types->getCategories() as $category) { if (!$category->getPublisherValidator()->skipItem()) { $pkg = null; if ($category->getPackage()) { $pkg = \Package::getByHandle($category->getPackage()); } \Concrete\Core\Workflow\Progress\Category::add($category->getHandle(), $pkg); } } }
/** * Get the WorkflowRequest object for the current WorkflowProgress object. * * @return WorkflowRequest */ public function getWorkflowRequestObject() { if ($this->wrID > 0) { $cat = WorkflowProgressCategory::getByID($this->wpCategoryID); $handle = $cat->getWorkflowProgressCategoryHandle(); $class = '\\Core\\Workflow\\Request\\' . Core::make('helper/text')->camelcase($handle) . 'Request'; $pkHandle = $cat->getPackageHandle(); $class = core_class($class, $pkHandle); $wr = $class::getByID($this->wrID); if (is_object($wr)) { $wr->setCurrentWorkflowProgressObject($this); return $wr; } } }
protected function importWorkflowProgressCategories(\SimpleXMLElement $sx) { if (isset($sx->workflowprogresscategories)) { foreach ($sx->workflowprogresscategories->category as $wpc) { $pkg = static::getPackageObject($wpc['package']); WorkflowProgressCategory::add((string) $wpc['handle'], $pkg); } } }
/** * Returns an array of package items (e.g. blocks, themes) * @return array */ public function getPackageItems() { $items = array(); $items['attribute_categories'] = AttributeKeyCategory::getListByPackage($this); $items['permission_categories'] = PermissionKeyCategory::getListByPackage($this); $items['permission_access_entity_types'] = PermissionAccessEntityType::getListByPackage($this); $items['attribute_keys'] = AttributeKey::getListByPackage($this); $items['attribute_sets'] = AttributeSet::getListByPackage($this); $items['group_sets'] = GroupSet::getListByPackage($this); $items['page_types'] = PageType::getListByPackage($this); $items['page_templates'] = PageTemplate::getListByPackage($this); $items['mail_importers'] = MailImporter::getListByPackage($this); $items['gathering_item_template_types'] = GatheringItemTemplateType::getListByPackage($this); $items['gathering_item_templates'] = GatheringItemTemplate::getListByPackage($this); $items['gathering_data_sources'] = GatheringDataSource::getListByPackage($this); $items['features'] = Feature::getListByPackage($this); $items['feature_categories'] = FeatureCategory::getListByPackage($this); $btl = new BlockTypeList(); $btl->filterByPackage($this); $blocktypes = $btl->get(); $items['block_types'] = $blocktypes; $items['block_type_sets'] = BlockTypeSet::getListByPackage($this); $items['page_themes'] = PageTheme::getListByPackage($this); $items['permissions'] = PermissionKey::getListByPackage($this); $items['single_pages'] = SinglePage::getListByPackage($this); $items['attribute_types'] = AttributeType::getListByPackage($this); $items['captcha_libraries'] = SystemCaptchaLibrary::getListByPackage($this); $items['content_editor_snippets'] = SystemContentEditorSnippet::getListByPackage($this); $items['conversation_editors'] = ConversationEditor::getListByPackage($this); $items['conversation_rating_types'] = ConversationRatingType::getListByPackage($this); $items['page_type_publish_target_types'] = PageTypePublishTargetType::getListByPackage($this); $items['page_type_composer_control_types'] = PageTypeComposerControlType::getListByPackage($this); $items['antispam_libraries'] = SystemAntispamLibrary::getListByPackage($this); $items['community_point_actions'] = UserPointAction::getListByPackage($this); $items['jobs'] = Job::getListByPackage($this); $items['workflow_types'] = WorkflowType::getListByPackage($this); $items['workflow_progress_categories'] = WorkflowProgressCategory::getListByPackage($this); $items['authentication_types'] = AuthenticationType::getListByPackage($this); $items['storage_locations'] = StorageLocation::getListByPackage($this); ksort($items); return $items; }
public function getPackageItems(Package $package) { return Category::getListByPackage($package); }
use Concrete\Core\Workflow\Progress\Category as WorkflowProgressCategory; if ($_REQUEST['task'] == 'save_user_workflow_progress' && Loader::helper("validation/token")->validate('save_user_workflow_progress')) { $wp = UserWorkflowProgress::getByID($_REQUEST['wpID']); if (is_object($wp)) { $wf = $wp->getWorkflowObject(); $form = Loader::helper('form'); $obj->wpID = $wp->getWorkflowProgressID(); if ($wf->canApproveWorkflowProgressObject($wp)) { $task = WorkflowProgress::getRequestedTask(); if ($task) { $r = $wp->runTask($task, $_POST); if ($r instanceof WorkflowProgressResponse && $r->getWorkflowProgressResponseURL() != '') { $obj->redirect = $r->getWorkflowProgressResponseURL(); $obj->message = $r->message; } else { $obj->redirect = BASE_URL . View::url('/dashboard/users/search') . '?uID=' . $_REQUEST['uID']; } $category = WorkflowProgressCategory::getByID($wp->getWorkflowProgressCategoryID()); $list = $category->getPendingWorkflowProgressList(); $items = $list->get(); // start a new buffer ob_start(); Loader::element('workflow/progress/categories/user/table_data', array('items' => $items, 'list' => $list)); $obj->tableData = ob_get_contents(); // flush the bugger & close it ob_end_clean(); } } } } print Loader::helper('json')->encode($obj);
public function skipItem() { $type = \Concrete\Core\Workflow\Progress\Category::getByHandle($this->object->getHandle()); return is_object($type); }
protected function getWorkflowProgressItems() { $categories = Category::getList(); $items = 0; foreach ($categories as $category) { $list = $category->getPendingWorkflowProgressList(); if (is_object($list)) { foreach ($list->get() as $it) { $wp = $it->getWorkflowProgressObject(); $wf = $wp->getWorkflowObject(); if ($wf->canApproveWorkflowProgressObject($wp)) { $items++; } } } } return $items; }