diff --git a/VERSIONS_WIP/49315 b/VERSIONS_WIP/49315 new file mode 100644 index 0000000000000000000000000000000000000000..1e552ef69627a18d4d9f6abd0b924f09030b140a --- /dev/null +++ b/VERSIONS_WIP/49315 @@ -0,0 +1,2 @@ + - ticket #49315 : AFI Multimedia : correction de l'enregistrement des notes de postes. + \ No newline at end of file diff --git a/library/Class/Multimedia/Device.php b/library/Class/Multimedia/Device.php index 74ec7d7e90203042f73e69f80387006a0a615004..b75e14af415dbf0db0539d24951dea7664976a3b 100644 --- a/library/Class/Multimedia/Device.php +++ b/library/Class/Multimedia/Device.php @@ -28,8 +28,8 @@ class Multimedia_DeviceLoader extends Storm_Model_Loader { public function fromJsonModelWithGroup($json_model, $device_group) { if (!$model = $this->findByIdOrigineAndLocation($json_model->id, $device_group->getLocation())) $model = $this->newInstance()->setIdOrigine($this->getIdOrigineWithLocation($json_model->id, $device_group->getLocation())); - $note = isset($json_model->note) - ? $json_model->note + $note = isset($json_model->notes) + ? $json_model->notes : ''; $model diff --git a/tests/application/modules/push/controllers/MultimediaControllerTest.php b/tests/application/modules/push/controllers/MultimediaControllerTest.php index 852157882a681d6a0329fd2cdbec15f749be7bef..36384892c1b1bb0aebff0f89a89ef85a7ea1fa1f 100644 --- a/tests/application/modules/push/controllers/MultimediaControllerTest.php +++ b/tests/application/modules/push/controllers/MultimediaControllerTest.php @@ -115,7 +115,7 @@ l66WXceACmsgGWEdHMB7ZPUd4HqR5bdE1Xnr1Q0Z9IIku6Naxt/yy0P5Gv+ZlW7U $this->fixture('Class_Multimedia_Device', ['id' => 34, 'id_origine' => '1-34']); $this->fixture('Class_Multimedia_DeviceGroup', ['id' => 1, 'id_origine' => '1-64', 'libelle'=>'groupe Y']); - $datas = '[{"libelle":"Groupe 1", "id":2, "site":{"id":1,"libelle":"Site 1","admin_url":"192.168.2.92"}, "postes":[{"id":1, "libelle":"Poste 1", "os":"Windows XP", "maintenance":"1", "note":"Le clavier a perdu des touches."}, {"id":2, "libelle":"Poste 2", "os":"Ubuntu Lucid Lynx", "maintenance":"0"}]}]'; + $datas = '[{"libelle":"Groupe 1", "id":2, "site":{"id":1,"libelle":"Site 1","admin_url":"192.168.2.92"}, "postes":[{"id":1, "libelle":"Poste 1", "os":"Windows XP", "maintenance":"1", "notes":"Le clavier a perdu des touches."}, {"id":2, "libelle":"Poste 2", "os":"Ubuntu Lucid Lynx", "maintenance":"0"}]}]'; $this->postDispatch( '/push/multimedia/config',