From 2e75012b3b9bde110e44870f903635fbab2a09b6 Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Fri, 1 Feb 2019 12:23:37 +0100 Subject: [PATCH] cleanup --- src/Controller/SurCategoriesController.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Controller/SurCategoriesController.php b/src/Controller/SurCategoriesController.php index 6fd026f..7ddb987 100755 --- a/src/Controller/SurCategoriesController.php +++ b/src/Controller/SurCategoriesController.php @@ -182,19 +182,16 @@ class SurCategoriesController extends AppController } - // used by Materiels view ADD/EDIT (form), on categorie change (javascript) + /* + * (EP 01/02/2019) + * Called only by JAVASCRIPT + * Used by Materiels view ADD/EDIT (form), on categorie change + * Pour tester, entrer cette url : /SurCategories/getFromCategorie + */ public function getFromCategorie() { - //debug($this->request->data); //$categorie_id = isset($this->request->data['Materiel']['s_categorie_id']) ? $this->request->data['Materiel']['s_categorie_id'] : $this->request->data['Materiel']['categorie_id']; $selected_categorie_id = ($this->request->getData('s_categorie_id') !== null) ? $this->request->getData('s_categorie_id') : $categorie_id = $this->request->getData('categorie_id'); - //debug($categorie_id); - //$categorie_id = $this->request->data['Materiel']['categorie_id']; - //$categorie_id = "33"; - //$categ = ClassRegistry::init('Categorie'); - //$categ = TableRegistry::get('Categories')->get($materiel->photo_id)->get('type_doc'); - //$categ = TableRegistry::get('Categories'); - /* $surcategorie = $categ->find('first', array( 'conditions' => array('Categorie.id' => $categorie_id), @@ -202,7 +199,6 @@ class SurCategoriesController extends AppController 'recursive' => -1 ))->first(); */ - $selected_categorie = TableRegistry::get('Categories') ->find() ->where([ @@ -210,13 +206,9 @@ class SurCategoriesController extends AppController //'id' => '5' ]) ->first(); - //debug($surcategorie); //$surcategorie = $surcategorie->sur_categorie_id; $Sur_categ_id = $selected_categorie->sur_categorie_id; //debug($Sur_categ_id); - //$this->set('surcategorie',$surcategorie['Categorie']['sur_categorie_id']); - //$this->set('surcategorie',$surcategorie); - //$this->set('surcategorie',"5"); //$this->set('Sur_categ_id',"5"); $this->set('Sur_categ_id', $Sur_categ_id); //$this->layout = 'ajax'; -- libgit2 0.21.2