예제 #1
0
 public function executeUpdate()
 {
     $i18n = new sfI18N();
     $i18n->initialize($this->getContext());
     $i18n->setCulture($this->getUser()->getCulture());
     $action_i18n = $i18n->globalMessageFormat->format('save as new');
     $action_type = $this->getRequestParameter('action_type');
     $col_item_param = $this->getRequestParameter('col_item');
     #if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
     #	$col_item = new ColItem();
     #}
     #else {
     #$col_item = ColItemPeer::retrieveByPk($this->getRequestParameter('id'));
     #$this->forward404Unless($col_item);
     #}
     #$catalog = CatalogPeer::retrieveByPk($this->getRequestParameter('id'));
     #$this->forward404Unless($catalog);
     $col_item = new ColItem();
     $col_item->setCatalogId($this->getRequestParameter('id'));
     $col_item->setColStatusId($col_item_param['COL_STATUS_ID']);
     $col_item->setColConditionId($col_item_param['col_item_ID']);
     $col_item->setCallNo($this->getRequestParameter('call_no'));
     $col_item->setIndexNo($this->getRequestParameter('index_no'));
     $col_item->setColLocationId($col_item_param['COL_LOCATION_ID']);
     $col_item->setColSourceId($col_item_param['COL_SOURCE_ID']);
     $col_item->setColSourceDesc($col_item_param['COL_SOURCE_DESC']);
     $col_item->setYearAdded($col_item_param['YEAR_ADDED']);
     $col_item->save();
     return $this->redirect('col_item/list?catalog_id=' . $this->getRequestParameter('id'));
 }