Debug name
This commit is contained in:
parent
486007e5c1
commit
353da52a47
@ -18,18 +18,18 @@ class ProfilController extends Zend_Controller_Action
|
||||
$id = $request->getParam('id', null);
|
||||
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$data = new Enrichissement();
|
||||
$data = new Enrichissement();
|
||||
if ( $id != null ) {
|
||||
$profilM = new Application_Model_Profil();
|
||||
$profilM = new Application_Model_Profil();
|
||||
$profil = $profilM->find($id);
|
||||
$criteres = json_decode($profil->current()->criteres, true);
|
||||
$tmp = array();
|
||||
foreach ($criteres as $critere) {
|
||||
$tmp[] = $data->getDicoLib($critere);
|
||||
}
|
||||
}
|
||||
$this->view->assign('profil', $tmp);
|
||||
$this->view->assign('reference', $profil->current()->reference);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -46,16 +46,18 @@ class ProfilController extends Zend_Controller_Action
|
||||
$profil = $profilM->find($id);
|
||||
$criteres = json_decode($profil->current()->criteres, true);
|
||||
$tmp = array();
|
||||
foreach ($criteres as $critere) {
|
||||
foreach ($criteres as $critere) {
|
||||
$values = false;
|
||||
if (preg_match('/(.*)\((.*)\)/', $critere, $matches))
|
||||
{
|
||||
$values = $matches[2];
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($critere);
|
||||
|
||||
$tmp[$critere] = array(
|
||||
'lib' => $data->getDicoLib($critere),
|
||||
'values' => $values,
|
||||
'values' => $values,
|
||||
);
|
||||
}
|
||||
$this->view->assign('criteres', $tmp);
|
||||
@ -63,38 +65,38 @@ class ProfilController extends Zend_Controller_Action
|
||||
}
|
||||
$this->view->assign('id', $id);
|
||||
$this->view->assign('edit', true);
|
||||
$this->view->assign('elements', $data->getDico());
|
||||
$this->view->assign('elements', $data->getDico());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$request = $this->getRequest();
|
||||
$reference = $request->getParam('reference');
|
||||
$criteres = $request->getParam('criteres');
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
$profilM = new Application_Model_Profil($db);
|
||||
$db = Zend_Registry::get('db');
|
||||
$profilM = new Application_Model_Profil($db);
|
||||
$data = array(
|
||||
'reference' => $reference,
|
||||
'criteres' => json_encode($criteres),
|
||||
);
|
||||
);
|
||||
|
||||
$id = $request->getParam('id', null);
|
||||
if ( $id != null ) {
|
||||
if ( $id != null ) {
|
||||
if ( $profilM->update($data, 'id='.$id) ){
|
||||
echo '';
|
||||
} else {
|
||||
echo 'Erreur';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( $profilM->insert($data) ){
|
||||
echo '';
|
||||
echo '';
|
||||
} else {
|
||||
echo 'Erreur';
|
||||
echo 'Erreur';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user