public function delrelAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $request = $this->getRequest(); $itemGuid = $request->getParam('itemGuid'); $relatedGuid = $request->getParam('relatedGuid'); $relateAs = $request->getParam('relateAs'); $result = 'RESULT_ERROR'; if ($request->isPost()) { /*$catalogDb = new App_Model_Db_Table_Catalog(); $catalogDb->update([ 'deletedDate' => new Zend_Db_Expr('NOW()'), 'deletedBy' => Zend_Auth::getInstance()->getIdentity()->username, 'status' => -1 ], "guid='".$itemGuid."'");*/ $tblRelatedItem = new Pandamp_Core_Hol_Relation(); $tblRelatedItem->delete($itemGuid, $relatedGuid, $relateAs); $result = 'RESULT_OK'; } try { $indexingEngine = Pandamp_Search::manager(); $indexingEngine->deleteCatalogFromIndex($itemGuid); $queue = Zend_Registry::get(Bootstrap::NAME_ORDERQUEUE); $queue->addJob('Pandamp_Job_Catalog', ['guid' => $itemGuid], false); /*$this->view->addHitsBySolr(json_encode([[ "delete" => $itemGuid ]]));*/ } catch (Zend_Exception $e) { Zend_Registry::get('Zend_Log')->err($e->__toString()); } $this->getResponse()->setBody($result); }
public function __construct($catalogGuid, $folderGuid) { $this->view = new Zend_View(); $this->view->setScriptPath(dirname(__FILE__)); $this->catalogGuid = $catalogGuid; $this->view->addHelperPath(ROOT_DIR . '/library/Pandamp/Controller/Action/Helper', 'Pandamp_Controller_Action_Helper'); $bpm = new Pandamp_Core_Hol_Relation(); $this->view->rowsetRegulation = $bpm->getImplementRegulation($catalogGuid); $this->view->catalogGuid = $catalogGuid; $this->view->folderGuid = $folderGuid; }
function deleteAction() { $req = $this->getRequest(); $itemGuid = $req->getParam('itemGuid') ? $req->getParam('itemGuid') : 'XXX'; $relatedGuid = $req->getParam('relatedGuid') ? $req->getParam('relatedGuid') : 'XXX'; $relateAs = $req->getParam('relateAs') ? $req->getParam('relateAs') : 'XXX'; $hol = new Pandamp_Core_Hol_Relation(); if ($hol->delete($itemGuid, $relatedGuid, $relateAs)) { $aResult['isError'] = false; $aResult['msg'] = 'Relation Removed'; } else { $aResult['isError'] = true; $aResult['msg'] = 'No Relation Removed'; } echo Zend_Json::encode($aResult); }
public function getChildHistory($guid, $parent) { $helper = new Pandamp_Core_Hol_Relation(); $tblRelatedItem = new App_Model_Db_Table_RelatedItem(); $h1 = $tblRelatedItem->fetchAll("relatedGuid='{$guid}' AND relateAs IN ('ISROOT','AMEND','REPEAL','ESTABLISH')"); if (count($h1) > 0) { $data1 = array(); $content1 = 0; foreach ($h1 as $h1story) { $data1[$content1]['itemGuid'] = $h1story->itemGuid; $data1[$content1]['relatedGuid'] = $h1story->relatedGuid; $data1[$content1]['relateAs'] = $h1story->relateAs; $data1[$content1]['parent'] = $parent; $content1++; } } $h2 = $tblRelatedItem->fetchAll("itemGuid='{$guid}' AND relateAs IN ('ISROOT','AMEND','REPEAL','ESTABLISH')"); if (count($h2) > 0) { $data2 = array(); $content2 = 0; foreach ($h2 as $h) { $data2[$content2]['itemGuid'] = $h->relatedGuid; $data2[$content2]['relatedGuid'] = $h->relatedGuid; $data2[$content2]['relateAs'] = $h->relateAs; $data2[$content2]['parent'] = $parent; $content2++; } if (count($h1) > 0) { $merge = array_merge($data1, $data2); $merge = $helper->findperaturanyear($merge, $parent); return $merge; } return $helper->findperaturanyear($data2, $parent); } if (isset($data1)) { return $helper->findperaturanyear($data1, $parent); } }
public function getHistoryNew($catalogGuid) { $bpm = new Pandamp_Core_Hol_Relation(); $history = $bpm->getHistory2($catalogGuid); return $history; }