function answerClinicAction() { $urlReferer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $request = $this->getRequest(); $catalogGuid = $request->getParam('guid'); $node = $request->getParam('node'); $gen = new Pandamp_Form_Helper_ClinicInputGenerator(); $aRender = $gen->generateFormAnswer($catalogGuid); $this->view->aRenderedAttributes = $aRender; if ($request->isPost()) { $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); $urlReferer = $sessHistory->urlReferer; $aData = $request->getPost(); $aData['username'] = $this->_user->username; $Bpm = new Pandamp_Core_Hol_Catalog(); $id = $Bpm->save($aData); if ($id) { //$message = "Data was successfully saved."; //$this->_helper->getHelper('FlashMessenger')->addMessage($message); //$this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/'.$aData['status'].'/node/'.$node); $queue = Zend_Registry::get(Bootstrap::NAME_ORDERQUEUE); $queue->addJob('Pandamp_Job_Catalog', ['guid' => $id, 'folderGuid' => $node, 'ip' => Pandamp_Lib_Formater::getHttpRealIp(), 'kopel' => $this->_user->kopel, 'lang' => $this->view->getLanguage()], false); $this->_helper->json(['response' => true, 'message' => 'Artikel berhasil disimpan. <a href="' . ROOT_URL . '/' . $this->_lang->getLanguage() . '/dms/clinic/browse/status/' . $aData['status'] . '/node/' . $node . '">Lihat artikel</a>.']); } } $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); $sessHistory->urlReferer = $urlReferer; $this->view->urlReferer = $sessHistory->urlReferer; }
function editAction() { $this->_helper->layout->setLayout('layout-dms-newcatalog'); $r = $this->getRequest(); $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); if (isset($sessHistory->currentNode)) { unset($sessHistory->currentNode); } $sessHistory->currentNode = $this->_getParam('node') ? $this->_getParam('node') : $sessHistory->currentNode; $this->view->currentNode = $sessHistory->currentNode; $urlReferer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $message = ""; $modDir = $this->getFrontController()->getModuleDirectory(); require_once $modDir . '/components/Menu/FolderBreadcrumbs2.php'; $w = new Dms_Menu_FolderBreadcrumbs2($sessHistory->currentNode); $this->view->assign('breadcrumbs', $w); $modelCatalog = App_Model_Show_Catalog::show()->getCatalogByGuid($catalogGuid); $this->view->assign('catalog', $modelCatalog); $this->view->assign('catalogGuid', $catalogGuid); $this->view->profile = $modelCatalog['profileGuid']; if ($modelCatalog['profileGuid'] == "klinik") { $this->_forward('answer.clinic', 'clinic', 'dms', array('guid' => $catalogGuid, 'node' => $sessHistory->currentNode)); } else { $gen = new Pandamp_Form_Helper_CatalogInputGenerator(); $aRender = $gen->generateFormEdit($catalogGuid); $this->view->aRenderedAttributes = $aRender; /*$catalogFolderDb = new App_Model_Db_Table_CatalogFolder(); $rowCategory = $catalogFolderDb->fetchAll("catalogGuid='$catalogGuid'"); $categories = array(); if ($rowCategory) { foreach ($rowCategory as $rc) { $categories[] = $rc->folderGuid; } } $this->view->assign('categories',$categories);*/ } if ($r->isPost()) { $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); $urlReferer = $sessHistory->urlReferer; $aData = $r->getPost(); $aData['username'] = $this->_user->username; $Bpm = new Pandamp_Core_Hol_Catalog(); $id = $Bpm->save($aData); if ($id) { /*$gen = new Pandamp_Form_Helper_CatalogInputGenerator(); $aRender = $gen->generateFormEdit($id); $this->view->aRenderedAttributes = $aRender;*/ //$modelCatalog = App_Model_Show_Catalog::show()->getCatalogByGuid($id); // $message = "Data was successfully saved."; // $this->_helper->getHelper('FlashMessenger') // ->addMessage($message); $queue = Zend_Registry::get(Bootstrap::NAME_ORDERQUEUE); $queue->addJob('Pandamp_Job_Catalog', ['guid' => $id, 'folderGuid' => $sessHistory->currentNode, 'ip' => Pandamp_Lib_Formater::getHttpRealIp(), 'kopel' => $this->_user->kopel, 'lang' => $this->view->getLanguage()], false); $this->_helper->json(['response' => true, 'message' => 'Artikel berhasil disimpan. <a href="' . ROOT_URL . '/' . $this->_lang->getLanguage() . '/dms/explorer/browse/node/' . $sessHistory->currentNode . '">Lihat artikel</a>.']); /*if ($modelCatalog->profileGuid == "klinik") { if ($modelCatalog->status == 99) { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/99/node/lt4b11e8c86c8a4'); } else if ($modelCatalog->status == 2) { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/2/node/lt4b11ecf5408d2'); } else if ($modelCatalog->status == 0) { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/0/node/lt4b11e8fde1e42'); } else if ($modelCatalog->status == 1) { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/1/node/lt4b11ece54d870'); } else { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/clinic/browse/status/'.$modelCatalog['status'].'/node/'.$sessHistory->currentNode); } } else if (!empty($aData['fixedKeywords'])) { if (in_array($modelCatalog->profileGuid,array('article','clinic'))) { $keywords = base64_encode(trim($aData['fixedKeywords'])); $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/catalog/relatedcatalog/guid/'.$id.'/profile/'.$modelCatalog->profileGuid.'/keywords/'.$keywords.'/node/'.$sessHistory->currentNode); } } else { $this->_redirect(ROOT_URL.'/'.$this->_lang->getLanguage().'/dms/explorer/browse/node/'.$sessHistory->currentNode); }*/ } } $this->_helper->layout()->headerTitle = "Catalog Management: Edit Catalog"; $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY'); $sessHistory->urlReferer = $urlReferer; $this->view->urlReferer = $sessHistory->urlReferer; }