Ejemplo n.º 1
0
 public function updateloctreeAction()
 {
     $locTree = json_decode(Zend_Filter::filterStatic($this->getRequest()->getParam('loc_tree'), 'StripTags'), true);
     if (!$locTree) {
         $this->view->error = 'Problem parsing tree';
         Globals::getLog()->err('ADMIN update location tree error: ' . $this->view->error);
         $this->render('error-xhr');
         return false;
     }
     try {
         $db = Globals::getDBConn();
         $db->beginTransaction();
         LocationModel::updateLocTree($locTree);
         $db->commit();
     } catch (Exception $e) {
         $db->rollBack();
         $this->view->error = $e->getMessage();
         Globals::getLog()->err('ADMIN update location tree error: ' . $this->view->error);
         $this->render('error-xhr');
         return false;
     }
     return true;
 }