function updateAction() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $value = $this->_getParam('value') ? $this->_getParam('value') : ''; $field = $this->_getParam('field') ? $this->_getParam('field') : ''; $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $where2 = "catalogGuid='{$catalogGuid}' AND attributeGuid='{$field}'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if ($rowCatalogAttribute) { try { $rowCatalogAttribute->value = $value; $rowCatalogAttribute->save(); $response['success'] = true; $response['message'] = "Update successfully"; } catch (Exception $e) { $response['error'] = true; $response['message'] = $e->getMessage(); } } echo Zend_Json::encode($response); }
function _getNodes($node) { $a = array(); $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $where = "relatedGuid='{$node}' AND relateAs='RELATED_HISTORY'"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->itemGuid; $aTmp2['nodeLeft'] = $row->itemGuid; $aTmp2['nodeRight'] = $node; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } $where = "itemGuid='{$node}' AND relateAs='RELATED_HISTORY' AND relatedItemType >= 1"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->relatedGuid; $aTmp2['nodeLeft'] = $node; $aTmp2['nodeRight'] = $row->relatedGuid; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } return $a; }