Ejemplo n.º 1
0
 public function removeAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $child_node_id = $this->_getParam('child_node_id');
     $arrChildNode = explode("_", $child_node_id);
     $child_master_code = $arrChildNode[0];
     $child_master_id = $arrChildNode[1];
     //$parent_node_id=$this->_getParam('parent_node_id');
     //$arrParentNode=explode("_",$parent_node_id);
     //$parent_master_code=$arrParentNode[0];
     //$parent_master_id=$arrParentNode[1];
     if ($child_master_code == "fdAction") {
         $objMap = new Security_Model_SystemMapping();
         $objMap->delete("map_code='fdActionGroupMap' and  map_id1='{$child_master_id}'");
         $objMap->delete("map_code='fdActionSubGroupMap' and map_id1='{$child_master_id}'");
         $objMap->delete("map_code='fdActionRoleMap' and map_id1='{$child_master_id}'");
         $objMap->delete("map_code='fdActionUserMap' and map_id1='{$child_master_id}'");
         $objMaster = new Security_Model_SystemMaster();
         $objMaster->delete("master_code='{$child_master_code}' and master_id='{$child_master_id}'");
     }
     echo $result = Zend_Json::encode(array("status" => true));
 }
Ejemplo n.º 2
0
 public function deleteMenuItemAction()
 {
     $id = $this->_getParam('id');
     $menu = new Base_Security_Menu();
     $pages = $menu->getChildPages($id, 0);
     $arrChild[] = $id;
     for ($i = 0; $i < count($pages); $i++) {
         $arrChild[] = $pages[$i]['menu_id'];
     }
     $strMenuIds = implode(',', $arrChild);
     $model1 = new Security_Model_SystemMaster();
     $model1->setMasterCode("fdMenu");
     $model1->delete("master_id IN ({$strMenuIds}) AND master_code ='" . $model1->getMasterCode() . "'");
     $this->_flashMessenger->addMessage(array('success' => 'Menu item deleted successfully!'));
     $this->_helper->_redirector->gotoUrl($this->view->seoUrl('/security/menu/'));
 }
Ejemplo n.º 3
0
 public function removeAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $child_node_id = $this->_getParam('child_node_id');
     $arrChildNode = explode("_", $child_node_id);
     $child_master_code = $arrChildNode[0];
     $child_master_id = $arrChildNode[1];
     $parent_node_id = $this->_getParam('parent_node_id');
     $arrParentNode = explode("_", $parent_node_id);
     $parent_master_code = $arrParentNode[0];
     $parent_master_id = $arrParentNode[1];
     if ($child_master_code == "fdLegendsVal") {
         //delete role
         $objMap = new Security_Model_SystemMapping();
         $objMap->delete("map_code='fdLegendsLegendsValMap' and map_id1='{$parent_master_id}' and map_id2='{$child_master_id}'");
         $objMaster = new Security_Model_SystemMaster();
         $objMaster->delete("master_code='{$child_master_code}' and master_id='{$child_master_id}'");
     } else {
         if ($child_master_code == "fdLegends") {
             //fetch roles and delete them
             $objMap = new Security_Model_SystemMapping();
             $result = $objMap->fetchAll("map_code='fdLegendsLegendsValMap' and map_id1='{$child_master_id}'");
             if (count($result) > 0) {
                 foreach ($result as $_row) {
                     $objMaster = new Security_Model_SystemMaster();
                     $objMaster->delete("master_code='fdLegendsVal' and master_id='{$_row->getMapId2()}'");
                 }
             }
             $objMap->delete("map_code='fdLegendsLegendsValMap' and map_id1='{$child_master_id}'");
             // now delete sub group from master
             $objMaster = new Security_Model_SystemMaster();
             $objMaster->delete("master_code='{$child_master_code}' and master_id='{$child_master_id}'");
         }
     }
     echo $result = Zend_Json::encode(array("status" => true));
 }
 public function deleteSystemMasterCodeAction()
 {
     $this->view->layout()->disableLayout();
     $masterCode = $this->_getParam("masterCode");
     $model1 = new Security_Model_SystemMaster();
     $model = $model1->delete("master_code='{$masterCode}'");
     if (true == $model || $model > 0) {
         $this->_flashMessenger->addMessage(array('success' => 'System Master information has been deleted successfully!'));
     } else {
         $this->_flashMessenger->addMessage(array('error' => 'Invalid request! Please try again.'));
     }
     $this->_helper->_redirector->gotoUrl($this->view->seoUrl("/security/privilege/list-system-master"));
 }
Ejemplo n.º 5
0
 public function removeAction()
 {
     $this->view->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender(true);
     $child_node_id = $this->_getParam('child_node_id');
     //print_r ($child_node_id);
     $arrChildNode = explode("_", $child_node_id);
     $child_master_code = $arrChildNode[0];
     $child_master_id = $arrChildNode[1];
     $parent_node_id = $this->_getParam('parent_node_id');
     $arrParentNode = explode("_", $parent_node_id);
     $parent_master_code = $arrParentNode[0];
     $parent_master_id = $arrParentNode[1];
     if ($child_master_code == "fdAnimalColor") {
         //delete role
         $objMap = new Security_Model_SystemMapping();
         //$objMap->delete("map_code='fdAnimalTypeAnimalColorMap' and map_id1='{$parent_master_id}' and map_id2='{$child_master_id}'");
         $objMap->updateanimal_color('fdAnimalAnimalTypeAnimalColorMap', $arrChildNode[1], $arrChildNode[2], $arrChildNode[3]);
         //$objMaster=new Security_Model_SystemMaster();
         //$objMaster->delete("master_code='{$child_master_code}' and master_id='{$child_master_id}'");
     } else {
         if ($child_master_code == "fdAnimalType") {
             //fetch roles and delete them
             $objMap = new Security_Model_SystemMapping();
             //$objMap->deleteanimal_type('fdAnimalAnimalTypeAnimalColorMap',$arrChildNode[1],$arrChildNode[2]);
             $objMap->delete("map_code='fdAnimalAnimalTypeAnimalColorMap' AND map_id2='{$arrChildNode['1']}' AND map_id1='{$arrChildNode['2']}'");
         } else {
             if ($child_master_code == "fdAnimal") {
                 // fetch sub groups and delete them
                 $objMap = new Security_Model_SystemMapping();
                 $result = $objMap->fetchAll("map_code='fdAnimalAnimalTypeMap' and map_id1='{$child_master_id}'");
                 if (count($result) > 0) {
                     foreach ($result as $_row) {
                         //fetch roles and delete them
                         $objMap1 = new Security_Model_SystemMapping();
                         $result1 = $objMap1->fetchAll("map_code='fdAnimalTypeAnimalColorMap' and map_id1='{$_row->getMapId2()}'");
                         if (count($result1) > 0) {
                             foreach ($result1 as $_row1) {
                                 $objMaster = new Security_Model_SystemMaster();
                                 $objMaster->delete("master_code='fdAnimalColor' and master_id='{$_row1->getMapId2()}'");
                             }
                         }
                         $objMap1->delete("map_code='fdAnimalTypeAnimalColorMap' and map_id1='{$_row->getMapId2()}'");
                         $objMaster = new Security_Model_SystemMaster();
                         $objMaster->delete("master_code='fdAnimalType' and master_id='{$_row->getMapId2()}'");
                     }
                 }
                 $objMap->delete("map_code='fdAnimalAnimalTypeMap' and map_id1='{$child_master_id}'");
                 // now delete group from master
                 $objMaster = new Security_Model_SystemMaster();
                 $objMaster->delete("master_code='{$child_master_code}' and master_id='{$child_master_id}'");
             }
         }
     }
     echo $result = Zend_Json::encode(array("status" => true));
 }