Commit 2e75012b3b9bde110e44870f903635fbab2a09b6
1 parent
bef60b47
Exists in
master
and in
2 other branches
cleanup
Showing
1 changed file
with
6 additions
and
14 deletions
Show diff stats
src/Controller/SurCategoriesController.php
... | ... | @@ -182,19 +182,16 @@ class SurCategoriesController extends AppController |
182 | 182 | } |
183 | 183 | |
184 | 184 | |
185 | - // used by Materiels view ADD/EDIT (form), on categorie change (javascript) | |
185 | + /* | |
186 | + * (EP 01/02/2019) | |
187 | + * Called only by JAVASCRIPT | |
188 | + * Used by Materiels view ADD/EDIT (form), on categorie change | |
189 | + * Pour tester, entrer cette url : /SurCategories/getFromCategorie | |
190 | + */ | |
186 | 191 | public function getFromCategorie() { |
187 | - //debug($this->request->data); | |
188 | 192 | //$categorie_id = isset($this->request->data['Materiel']['s_categorie_id']) ? $this->request->data['Materiel']['s_categorie_id'] : $this->request->data['Materiel']['categorie_id']; |
189 | 193 | $selected_categorie_id = ($this->request->getData('s_categorie_id') !== null) ? $this->request->getData('s_categorie_id') : $categorie_id = $this->request->getData('categorie_id'); |
190 | 194 | |
191 | - //debug($categorie_id); | |
192 | - //$categorie_id = $this->request->data['Materiel']['categorie_id']; | |
193 | - //$categorie_id = "33"; | |
194 | - //$categ = ClassRegistry::init('Categorie'); | |
195 | - //$categ = TableRegistry::get('Categories')->get($materiel->photo_id)->get('type_doc'); | |
196 | - //$categ = TableRegistry::get('Categories'); | |
197 | - | |
198 | 195 | /* |
199 | 196 | $surcategorie = $categ->find('first', array( |
200 | 197 | 'conditions' => array('Categorie.id' => $categorie_id), |
... | ... | @@ -202,7 +199,6 @@ class SurCategoriesController extends AppController |
202 | 199 | 'recursive' => -1 |
203 | 200 | ))->first(); |
204 | 201 | */ |
205 | - | |
206 | 202 | $selected_categorie = TableRegistry::get('Categories') |
207 | 203 | ->find() |
208 | 204 | ->where([ |
... | ... | @@ -210,13 +206,9 @@ class SurCategoriesController extends AppController |
210 | 206 | //'id' => '5' |
211 | 207 | ]) |
212 | 208 | ->first(); |
213 | - //debug($surcategorie); | |
214 | 209 | //$surcategorie = $surcategorie->sur_categorie_id; |
215 | 210 | $Sur_categ_id = $selected_categorie->sur_categorie_id; |
216 | 211 | //debug($Sur_categ_id); |
217 | - //$this->set('surcategorie',$surcategorie['Categorie']['sur_categorie_id']); | |
218 | - //$this->set('surcategorie',$surcategorie); | |
219 | - //$this->set('surcategorie',"5"); | |
220 | 212 | //$this->set('Sur_categ_id',"5"); |
221 | 213 | $this->set('Sur_categ_id', $Sur_categ_id); |
222 | 214 | //$this->layout = 'ajax'; | ... | ... |