protected function readMetadata(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     unset($this->formRefs);
     $formRefXML = $this->getDefaultMainForm($xmlArr["WEBPAGE"]["FORMREFERENCES"]["REFERENCE"]);
     $this->formRefs = new MetaIterator($formRefXML, "FormReference", $this);
 }
 public function outputAttrs()
 {
     $out = parent::outputAttrs();
     $out['columns'] = $this->columns;
     //print_r($out['columns']);
     return $out;
 }
Example #3
0
 public function allowAccess($access = null)
 {
     if ($this->isNeedInitialize()) {
         Openbiz::$app->getSessionContext()->setVar("_GROUP_INITIALIZE_LASTVIEW", $_SERVER['REQUEST_URI']);
         Openbiz::$app->getClientProxy()->redirectPage(OPENBIZ_APP_INDEX_URL . '/system/initialize_group');
     }
     return parent::allowAccess($access);
 }
Example #4
0
 protected function readMetadata(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $this->formRefs = null;
     $this->formSelector = isset($xmlArr["WEBPAGE"]["ATTRIBUTES"]["FROMSELECOTR"]) ? $xmlArr["WEBPAGE"]["ATTRIBUTES"]["FROMSELECOTR"] : null;
     $formRefXML = $this->getDefaultMainForm($xmlArr["WEBPAGE"]["FORMREFERENCES"]["REFERENCE"]);
     $this->formRefs = new MetaIterator($formRefXML, "FormReference", $this);
 }
 public function render()
 {
     if (isset($_GET['force'])) {
         $this->forceResetPassword = true;
     } else {
         $this->forceResetPassword = false;
     }
     return parent::render();
 }
 public function render()
 {
     if (!extension_loaded('ionCube Loader')) {
         $result = parent::render();
         return $result;
     } else {
         header("Location: " . OPENBIZ_APP_INDEX_URL);
         exit;
     }
 }
Example #7
0
 /**
  * Gather all template variables needed. Should play well with Smarty or \Zend templates
  *
  * @param WebPage $formObj
  * @return array associative array holding all needed VIEW based template variables
  */
 public static function buildTemplateAttributes($formObj)
 {
     // Assocative Array to hold all Template Values
     // Fill with default viewobj attributes
     $tplAttributes = array();
     $tplAttributes['title'] = $formObj->title;
     $tplAttributes['errors'] = $formObj->errors;
     $tplAttributes['notices'] = $formObj->notices;
     $tplAttributes['formname'] = $formObj->objectName;
     $tplAttributes['module'] = $formObj->getModuleName($formObj->objectName);
     // if the $formobj form type is list render table, otherwise render record
     if (strtoupper($formObj->formType) == 'LIST') {
         $recordSet = $formObj->fetchDataSet();
         $tplAttributes['dataPanel'] = $formObj->dataPanel->renderTable($recordSet);
     } else {
         $record = $formObj->fetchData();
         $tplAttributes['dataPanel'] = $formObj->dataPanel->renderRecord($record);
     }
     if (isset($formObj->searchPanel)) {
         $search_record = $formObj->searchPanelValues;
         foreach ($formObj->searchPanel as $elem) {
             if (!$elem->fieldName) {
                 continue;
             }
             $post_value = Openbiz::$app->getClientProxy()->getFormInputs($elem->objectName);
             if ($post_value) {
                 $search_record[$elem->fieldName] = $post_value;
             }
         }
         $tplAttributes['searchPanel'] = $formObj->searchPanel->renderRecord($search_record);
     } else {
         $tplAttributes['searchPanel'] = $formObj->searchPanel->render();
     }
     $tplAttributes['actionPanel'] = $formObj->actionPanel->render();
     $tplAttributes['navPanel'] = $formObj->navPanel->render();
     if (isset($formObj->wizardPanel)) {
         $tplAttributes['wizardPanel'] = $formObj->wizardPanel->render();
     }
     $tplAttributes['form'] = $formObj->outputAttrs();
     return $tplAttributes;
 }
 public function allowAccess()
 {
     $result = parent::allowAccess();
     $do = Openbiz::getObject("myaccount.do.PreferenceDO");
     $rs = $do->fetchOne("[user_id]='0' AND  [section]='Register' AND [name]='find_password'");
     $value = $rs->value;
     if ($value == 0 || $value == null) {
         return 0;
     } else {
         return $result;
     }
 }
 public function render()
 {
     if (isset($_GET['force'])) {
         $this->forceCompeleteProfile = true;
     } else {
         $this->forceCompeleteProfile = false;
     }
     if ($this->isForceCompeleteProfile()) {
         //var_dump($this->formRefs);
         $formRefArr = array("ATTRIBUTES" => array("NAME" => 'myaccount.form.ProfileEditForm'), "VALUE" => null);
         $this->formRefs = new MetaIterator($formRefArr, "FormReference", $this);
     }
     return parent::render();
 }
Example #10
0
 /**
  * Ask if the $this tab object is the current tab
  *
  * @param TabView $tabView
  * @param WebPage $curViewObj current View Object
  * @param string $curViewName name of the current view
  * @return boolean TRUE if on the current tab, otherwise FALSE
  */
 public function isCurrentTab($tabView, $curViewObj, $curViewName)
 {
     //--jmmz
     $currentTab = false;
     //this variable save 'true' if is the current tab and 'false' in otherwise --jmmz
     if ($this->currentTab) {
         $currentTab = $this->currentTab == $tabView->objectName || $this->currentTab == $tabView->tab ? TRUE : FALSE;
     } elseif ($tabView->viewSet) {
         if ($curViewObj) {
             // check if current view's viewset == tview->viewSet
             $currentTab = $curViewObj->getViewSet() == $tabView->viewSet ? true : false;
         }
     } else {
         $currentTab = $curViewName == $tabView->view || $curViewObj->tab == $tabView->objectName ? true : false;
     }
     return $currentTab;
 }
Example #11
0
 protected function readMetadata(&$xmlArr)
 {
     parent::readMetaData($xmlArr);
     $formRefXML = $this->getFormReferences();
     $this->formRefs = new MetaIterator($formRefXML, "FormReference", $this);
 }
Example #12
0
 /**
  * Initialize DynaView with xml array
  *
  * @param array $xmlArr
  * @return void
  */
 public function __construct(&$xmlArr)
 {
     parent::__construct($xmlArr);
     $this->processURL();
 }
Example #13
0
 /**
  * Render smarty template for view object
  *
  * @param WebPage $webpage
  * @param string $tplFile
  * @return string result of rendering process
  */
 protected static function renderSmarty($webpage, $tplAttributes = array())
 {
     $smarty = TemplateHelper::getSmartyTemplate();
     $viewOutput = $webpage->outputAttrs();
     foreach ($viewOutput as $k => $v) {
         $smarty->assign($k, $v);
     }
     // render the formobj attributes
     $smarty->assign("view", $viewOutput);
     //Translate Array of template variables to \Zend template object
     foreach ($tplAttributes as $key => $value) {
         $smarty->assign($key, $value);
     }
     //echo __METHOD__ . __LINE__. ' - ' . $webpage->templateFile . '<br />';
     //echo __METHOD__ . __LINE__. ' - ' . TemplateHelper::getTplFileWithPath($webpage->templateFile, $webpage->package) . '<br />';
     //if ($viewObj->consoleOutput) {
     $smarty->display(TemplateHelper::getTplFileWithPath($webpage->templateFile, $webpage->package));
     //} else {
     //    return $smarty->fetch(TemplateHelper::getTplFileWithPath($viewObj->templateFile, $viewObj->package));
     //}
 }
 /**
  * Get output attributs
  *
  * @return array
  * @todo need to raname to getOutputAttributs() or getAttributes
  */
 public function outputAttrs()
 {
     $out = parent::outputAttrs();
     $out['step'] = $this->currentStep;
     $out['forms'] = $this->formRefs;
     return $out;
 }