예제 #1
0
 public function edit($id = 0, $parent_id = '')
 {
     parent::edit($id, $parent_id);
     // find all groups of params by category of product
     $product = $this->Product->findById($this->parent_id);
     $cat_id = $product['Product']['parent_id'];
     $conditions = array('parent_id' => $cat_id, 'featured' => 1);
     $order = 'sorting';
     $aParamGroups = $this->ParamGroup->find('all', compact('conditions', 'order'));
     $aParamGroups = Hash::combine($aParamGroups, '{n}.ParamGroup.id', '{n}');
     $this->set('aFormGroups', $aParamGroups);
     // find all params by groups
     $conditions = array('object_type' => 'PMFormField', 'parent_id' => array_keys($aParamGroups));
     $order = 'sorting';
     $aParams = $this->PMFormField->find('all', compact('conditions', 'order'));
     if ($aParams) {
         $ids = Hash::extract($aParams, '{n}.PMFormField.id');
         $aParams = Hash::combine($aParams, '{n}.PMFormField.id', '{n}', '{n}.PMFormField.parent_id');
     }
     $this->set('aForms', $aParams);
     // get all values of params
     $aValues = array();
     if ($this->request->is(array('put', 'post'))) {
         $aValues = $this->request->data('PMFormValue');
     } elseif ($id) {
         $aValues = $this->PMFormValue->getValues('ProductPackParam', $id);
     }
     $this->set('aValues', $aValues);
 }
예제 #2
0
 public function edit($id = 0, $parent_id = '')
 {
     parent::edit($id, $parent_id);
     $order = $this->Order->getOrder($id);
     $this->set('orderData', $order);
     $aServices = $this->Service->getOptions(true);
     $this->set('aServices', $aServices);
 }
예제 #3
0
 public function beforeRender()
 {
     parent::beforeRender();
     // $this->set('objectType', 'Param');
     $this->set('aFieldTypes', FieldTypes::getTypes());
     $category = $this->Category->findById($this->parentArticle['ParamGroup']['parent_id']);
     $this->set('category', $category);
 }
예제 #4
0
 public function edit($id = 0, $parent_id = '')
 {
     parent::edit($id, $parent_id);
     $this->set('aFormatOptions', $this->Song->getFormatOptions());
 }