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();
     }
 }
Example #2
0
 /** 
  * 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 = Loader::helper("text")->camelcase($handle) . 'WorkflowRequest';
         $wr = call_user_func_array(array($class, 'getByID'), array($this->wrID));
         if (is_object($wr)) {
             $wr->setCurrentWorkflowProgressObject($this);
             return $wr;
         }
     }
 }
Example #3
0
 protected function installPermissionsAndWorkflow()
 {
     $sx = simplexml_load_file(DIR_BASE_CORE . '/config/install/base/permissions.xml');
     foreach ($sx->permissioncategories->category as $pkc) {
         $handle = (string) $pkc['handle'];
         $pkca = PermissionKeyCategory::getByHandle($handle);
         if (!is_object($pkca)) {
             $pkx = PermissionKeyCategory::add((string) $pkc['handle']);
         }
     }
     foreach ($sx->workflowprogresscategories->category as $pkc) {
         $handle = (string) $pkc['handle'];
         $pkca = WorkflowProgressCategory::getByHandle($handle);
         if (!is_object($pkca)) {
             $pkx = WorkflowProgressCategory::add((string) $pkc['handle']);
         }
     }
     foreach ($sx->workflowtypes->workflowtype as $wt) {
         $handle = (string) $wt['handle'];
         $name = (string) $wt['name'];
         $wtt = WorkflowType::getByHandle($handle);
         if (!is_object($wtt)) {
             $pkx = WorkflowType::add($handle, $name);
         }
     }
     if (isset($sx->permissionaccessentitytypes)) {
         foreach ($sx->permissionaccessentitytypes->permissionaccessentitytype as $pt) {
             $name = $pt['name'];
             if (!$name) {
                 $name = Loader::helper('text')->unhandle($pt['handle']);
             }
             $handle = (string) $pt['handle'];
             $patt = PermissionAccessEntityType::getByHandle($handle);
             if (!is_object($patt)) {
                 $type = PermissionAccessEntityType::add((string) $pt['handle'], $name);
                 if (isset($pt->categories)) {
                     foreach ($pt->categories->children() as $cat) {
                         $catobj = PermissionKeyCategory::getByHandle((string) $cat['handle']);
                         $catobj->associateAccessEntityType($type);
                     }
                 }
             }
         }
     }
     $txt = Loader::helper('text');
     foreach ($sx->permissionkeys->permissionkey as $pk) {
         $pkc = PermissionKeyCategory::getByHandle((string) $pk['category']);
         $className = $txt->camelcase($pkc->getPermissionKeyCategoryHandle());
         $c1 = $className . 'PermissionKey';
         $handle = (string) $pk['handle'];
         $pka = PermissionKey::getByHandle($handle);
         if (!is_object($pka)) {
             $pkx = call_user_func(array($c1, 'import'), $pk);
         }
     }
 }
Example #4
0
 public static function add($wpCategoryHandle, $pkg = false)
 {
     $db = Loader::db();
     if (is_object($pkg)) {
         $pkgID = $pkg->getPackageID();
     }
     $db->Execute('insert into WorkflowProgressCategories (wpCategoryHandle, pkgID) values (?, ?)', array($wpCategoryHandle, $pkgID));
     $id = $db->Insert_ID();
     return WorkflowProgressCategory::getByID($id);
 }
Example #5
0
	protected function importWorkflowProgressCategories(SimpleXMLElement $sx) {
		if (isset($sx->workflowprogresscategories)) {
			foreach($sx->workflowprogresscategories->category as $wpc) {
				$pkg = ContentImporter::getPackageObject($wpc['package']);
				$wkx = WorkflowProgressCategory::add((string) $wpc['handle'], $pkg);
			}
		}
	}