function get_AG($template, $errorMessages) { $accessGroupM = new RowManager_AccessGroupManager(); $multilingualLabelL = new RowManager_MultilingualLabelManager(); $join = new JoinPair($multilingualLabelL->getJoinOnFieldX('label_key'), $accessGroupM->getJoinOnFieldX('accessgroup_key')); $MTM = new MultiTableManager(); $MTM->addRowManager($multilingualLabelL); $MTM->addRowManager($accessGroupM, $join); $MTM->constructSearchCondition('language_id', '=', '1', true); $result = $MTM->find(); if (!isset($result)) { $errorMessages = 'Failed to join database to get label'; } else { $result->setFirst(); $count = 0; while ($resultMLM = $result->getNext($multilingualLabelL)) { $resultAGM = $result->getCurrent($accessGroupM); $agLabel[] = $resultMLM->getLabel(); $agID[] = $resultAGM->getID(); } $template->set('agLabel', $agLabel); $template->set('agID', $agID); } return $errorMessages; }
/** * function __construct * <pre> * Initialize the Class ... * </pre> * @param $accesscategory_id [INTEGER] value used to initialize the list. * @param $sortBy [STRING] the field name to sort list by * @return [void] */ function __construct($accesscategory_id = -1, $sortBy = '') { $searchManager = new RowManager_AccessGroupManager(); // NOTE: if you need to narrow the field of the search then uncommnet // the following and set the proper search criteria. $searchManager->setValueByFieldName("accesscategory_id", $accesscategory_id); //$searchManager->setValueByFieldName('module_isCommonLook', '1' ); $searchManager->setSortOrder($sortBy); $this->resultSet = $searchManager->find(); }
/** * function processData * <pre> * Processes the data for this form. * </pre> * @return [void] */ function processData() { // save the value of the Foriegn Key(s) $this->formValues['accountgroup_id'] = $this->accountgroup_id; /*[RAD_ADMINBOX_FOREIGNKEY]*/ // store values in table manager object. if (!$this->dataManager->isLoaded()) { $this->dataManager->createNewEntry(); } $this->dataManager->loadFromArray($this->formValues); $accessGroupManager = new RowManager_AccessGroupManager(); $allAccessGroupID = $accessGroupManager->getAllAccessGroupID(); // don't need this for CIM stuff - RM // $hrdbGroupID = $accessGroupManager->getHRDBAccessGroupID(); // echo 'hrdbGroupID['.$hrdbGroupID.']<br/>'; //$this->dataManager->setAccountGroup($allAccessGroupID); $viewerAccessGroup = new RowManager_ViewerAccessGroupManager(); //$hrdbGroupID = 34; // $defaultGroups = array($allAccessGroupID, $hrdbGroupID); $defaultGroups = array($allAccessGroupID); for ($i = 0; $i < count($defaultGroups); $i++) { //load values $values = array(); //print($this->dataManager->getID() . "<br>"); //print($allAccessGroupID); $values['viewer_id'] = $this->dataManager->getID(); //$values[ 'accessgroup_id' ] = $allAccessGroupID; $values['accessgroup_id'] = $defaultGroups[$i]; $viewerAccessGroup->loadFromArray($values); //var_export($viewerAccessGroup); // update DB Table $viewerAccessGroup->createNewEntry(); } // Make sure password is set using the dataManager's routines // (for encryption) $pword = $this->formValues['viewer_passWord']; $this->dataManager->setPassWord($pword); $this->dataManager->updateDBTable(); // now make sure all the systemAccessObjects have been updated $moduleManager = new RowManager_siteModuleManager(); $moduleManager->processSystemAccessNewViewer($this->dataManager->getID()); }
/** * function getAccesGroupID * <pre> * Returns a access group id for given label * </pre> * @param $label [STRING] The label of the Group we are searching for. * @return [INTEGER] */ function getAccessGroupID($label) { $accessGroup = new RowManager_AccessGroupManager(); $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY; $pageKey = RowManager_AccessGroupManager::XML_NODE_NAME; $multiLingualContext = new MultilingualManager(1, $seriesKey, $pageKey); $labelBridge = $accessGroup->getRowLabelBridge($multiLingualContext); $labelBridge->constructSearchCondition("label_label", "=", $label, true); $labelBridgeList = $labelBridge->getListIterator(); //var_export($labelBridgeList); $labelBridgeList->setFirst(); $group = $labelBridgeList->getNext(); //var_export($group); if ($group != false) { return $group->getID(); } else { return false; } }
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Uncomment the following line if you want to create a template // tailored for this page: //$path = $this->pathModuleRoot.'templates/'; // Otherwise use the standard Templates for the site: $path = SITE_PATH_TEMPLATES; /* * store the link values */ // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; /* * store any additional link Columns */ // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); /* * Update any label tags ... */ // example: $linkManager = new RowManager_NavBarLinksManager($this->navbarlink_id); $seriesKey = moduleNavBar::MULTILINGUAL_SERIES_KEY; $pageKey = $linkManager->getXMLNodeName(); $groupMultiLingual = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey); $bridgeManager = new RowLabelBridge($linkManager, $groupMultiLingual); $name = $bridgeManager->getLabel(); $this->labels->setLabelTag('[Title]', '[linkName]', $name); // NOTE: this parent method prepares the $this->template with the // common AdminBox data. $this->prepareTemplate($path); // store the statevar id to edit $this->template->set('editEntryID', $this->navlinkaccessgroup_id); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ /* * Insert the date start/end values for the following date fields: */ // example: //$this->template->set( 'startYear_[fieldName]', 2000); //$this->template->set( 'endYear_[fieldName]', 2010); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = $this->dataManager->getXMLNodeName(); $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'navlinkaccessgroup_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. // $this->dataList = new NavLinkAccessGroupList( $this->navbarlink_id, $this->sortBy ); $groupManager = new RowManager_NavLinkAccessGroupManager(); $groupManager->setLinkID($this->navbarlink_id); $this->dataList = $groupManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); /* * Add any additional data required by the template here */ $accountGroupMgr = new RowManager_AccessGroupManager(); $multiLingualContext = new MultilingualManager($this->viewer->getLanguageID()); $rowLabelBridge = $accountGroupMgr->getRowLabelBridge($multiLingualContext); $accountList = $rowLabelBridge->getListIterator(); $this->template->set("list_accessgroup_id", $accountList->getDropListArray()); $templateName = TEMPLATE_ADMIN_BOX; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_LinkGroups.php'; return $this->template->fetch($templateName); }
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Uncomment the following line if you want to create a template // tailored for this page: //$path = $this->pathModuleRoot.'templates/'; // Otherwise use the standard Templates for the site: $path = SITE_PATH_TEMPLATES; $this->template = new Template($path); // store the form action information $this->template->set('formAction', $this->formAction); // store the link values // example: // $this->linkValues[ 'view' ] = 'add/new/href/data/here'; $this->template->set('linkValues', $this->linkValues); // store the link labels $this->linkLabels['edit'] = $this->labels->getLabel('[Edit]'); $this->linkLabels['del'] = $this->labels->getLabel('[Delete]'); $this->linkLabels['cont'] = $this->labels->getLabel('[Continue]'); // $this->linkLabels[ 'view' ] = 'new link label here'; $this->template->set('linkLabels', $this->linkLabels); // store any additional link Columns // example: //$title = $this->labels->getLabel( '[title_groups]'); //$columnLabel = $this->labels->getLabel( '[groups]'); //$link = $this->linkValues[ 'groups' ]; //$fieldName = 'accessgroup_id'; //$this->addLinkColumn( $title, $columnLabel, $link, $fieldName); $this->template->set('linkColumns', $this->linkColumns); // store the statevar id to edit $this->template->set('editEntryID', $this->accessgroup_id); // store the current op type $this->template->set('opType', $this->opType); // store the page labels in XML format... // NOTE: use this location to update any label tags ... // example: $categoryManager = new RowManager_AccessCategoryManager($this->accesscategory_id); $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY; $pageKey = $categoryManager->getXMLNodeName(); $multiLingualManager = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey); $categoryManagerBridge = new RowLabelBridge($categoryManager, $multiLingualManager); $name = $categoryManagerBridge->getLabel(); $this->labels->setLabelTag('[Title]', '[accessCategoryName]', $name); $this->labels->setLabelTag('[Instr]', '[accessCategoryName]', $name); $this->template->setXML('pageLabels', $this->labels->getLabelXML()); // store all the fields to the template $this->setFormFieldsToTemplate(); /* * Form related Template variables: */ // save the list of form fields $this->template->set('formFieldList', $this->formFields); // store the field types being displayed $fieldTypes = explode(',', FormProcessor_AccessGroup::FORM_FIELD_TYPES); $this->template->set('formFieldType', $fieldTypes); /* * List related Template variables : */ // Store the XML Node name for the Data Access Field List $xmlNodeName = $this->dataManager->getXMLNodeName(); $this->template->set('rowManagerXMLNodeName', $xmlNodeName); // store the primary key field name for the data being displayed $this->template->set('primaryKeyFieldName', 'accessgroup_id'); // store data list to the template // NOTE: we initialize it here to make sure we capture any new data // from a recent processData() call. $groupManager = new RowManager_AccessGroupManager(); $groupManager->setAccessCategoryID($this->accesscategory_id); $bridgeManager = new RowLabelBridge($groupManager, $this->bridgeMultiLingualManager); $this->dataList = $bridgeManager->getListIterator(); $this->template->setXML('dataList', $this->dataList->getXML()); // store the field names being displayed $fieldNames = explode(',', FormProcessor_AccessGroup::DISPLAY_FIELDS); $this->template->set('dataFieldList', $fieldNames); /* * Add any additional data required by the template here */ $templateName = 'siteAdminBox.php'; // if you are creating a custom template for this page then // replace $templateName with the following: //$templateName = 'page_AccessGroup.php'; return $this->template->fetch($templateName); }
$link->createNewEntry(); /* * NavLinkAccessGroup Table * * This table joins which nav bar links are displayed for which site access group. * * navlinkaccessgroup_id [INTEGER] Primary Key for this table * navbarlink_id [INTEGER] Foreign Key relating this entry to a link * accessgroup_id [INTEGER] Foreign key relating this link to a site Access Group */ $navLinkAccessGroup = new RowManager_NavLinkAccessGroupManager(); $navLinkAccessGroup->dropTable(); $navLinkAccessGroup->createTable(); // now link the "Site Administration" Access Group to the "Site Administration" link // first we have to flip over backwards to get the account group with the label "Site Administration" $accessGroup = new RowManager_AccessGroupManager(); $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY; $pageKey = RowManager_AccessGroupManager::XML_NODE_NAME; $multiLingualContext = new MultilingualManager(1, $seriesKey, $pageKey); $group = $accessGroup->getRowLabelBridge($multiLingualContext); $group->constructSearchCondition('label_label', OP_EQUAL, 'Site Administration', true); $list = $group->getListIterator(); $list->setFirst(); if ($item = $list->getNext()) { $navLinkAccessGroup->setGroupID($item->getID()); $navLinkAccessGroup->setLinkID($link->getID()); $navLinkAccessGroup->createNewEntry(); } /* * NavLinkViewer Table *
/** * function getHTML * <pre> * This method returns the HTML data generated by this object. * </pre> * @return [STRING] HTML Display data. */ function getHTML() { // Uncomment the following line if you want to create a template // tailored for this page: $path = $this->pathModuleRoot . 'templates/'; $this->template = new Template($path); // store the form action information $this->template->set('formAction', $this->formAction); // store the page labels in XML format... // NOTE: use this location to update any label tags ... // example: $account = new RowManager_ViewerManager($this->viewer_id); $name = $account->getUserID(); $this->labels->setLabelTag('[Title]', '[viewerUserID]', $name); $this->labels->setLabelTag('[Instr]', '[viewerUserID]', $name); $this->template->setXML('pageLabels', $this->labels->getLabelXML()); /* * Form related Template variables: */ // compile list of Access Categories and Related Access Groups $categoryArray = array(); $categoryManager = new RowManager_AccessCategoryManager(); $seriesKey = moduleAccountAdmin::MULTILINGUAL_SERIES_KEY; $pageKey = $categoryManager->getXMLNodeName(); $multilingualContext = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, $pageKey); $bridgeManager = new RowLabelBridge($categoryManager, $multilingualContext); $groupMultiLingualContext = new MultilingualManager($this->viewer->getLanguageID(), $seriesKey, RowManager_AccessGroupManager::XML_NODE_NAME); $accessCategoryList = $bridgeManager->getListIterator(); // $accessCategoryList = new AccessCategoryList(); $accessCategoryList->setFirst(); while ($accessCategory = $accessCategoryList->getNext()) { // $accessGroupList = new AccessGroupList( $accessCategory->getID() ); $name = $accessCategory->getLabel(); $groupManager = new RowManager_AccessGroupManager(); $groupManager->setAccessCategoryID($accessCategory->getID()); $bridgeManager = $groupManager->getRowLabelBridge($groupMultiLingualContext); $accessGroupList = $bridgeManager->getListIterator(); $categoryArray[$name] = $accessGroupList->getDropListArray(); } $this->template->set('accessCategories', $categoryArray); // load the current Groups associated with this account $this->template->set('currentGroups', $this->currentGroupList); $this->template->set('buttonText', $this->labels->getLabel('[Update]')); // return the HTML content for this page $templateName = 'page_AccountAccess.php'; return $this->template->fetch($templateName); }