diff --git a/VERSIONS_HOTLINE/68507 b/VERSIONS_HOTLINE/68507 new file mode 100644 index 0000000000000000000000000000000000000000..b1e881a4a33fb1e5a75b0b79f1d3bc774b891d52 --- /dev/null +++ b/VERSIONS_HOTLINE/68507 @@ -0,0 +1 @@ + - ticket #68507 : WebService Koha : Correction du format de la date de naissance dans le formulaire de pré-inscription. \ No newline at end of file diff --git a/application/modules/opac/controllers/AuthController.php b/application/modules/opac/controllers/AuthController.php index 90cd4f88b41b5b398514cc514a4807f36d5cc08f..44a256ac0dee0704368a0ec6c0879f257f1d25f0 100644 --- a/application/modules/opac/controllers/AuthController.php +++ b/application/modules/opac/controllers/AuthController.php @@ -557,11 +557,8 @@ class AuthController extends ZendAfi_Controller_Action { if ('' != $this->_getParam('emailCheck')) return $this->_redirect('/'); - $form = $pre_registration - ->getForm() - ->populate(ZendAfi_Filters_Post::filterStatic($this->_request->getParams())); - - $this->view->form = $form; + $this->view->form = + $form->populate(ZendAfi_Filters_Post::filterStatic($this->_request->getParams())); $data = ZendAfi_Filters_Post::filterStatic($this->_request->getPost()); unset($data['emailCheck']); diff --git a/library/Class/WebService/SIGB/PreRegistration.php b/library/Class/WebService/SIGB/PreRegistration.php index 56164c231a53309f92f6f96460d61a0c60ed737b..cc22c45bed758af28c6110eb196cb033944242c4 100644 --- a/library/Class/WebService/SIGB/PreRegistration.php +++ b/library/Class/WebService/SIGB/PreRegistration.php @@ -172,6 +172,10 @@ class Class_WebService_SIGB_PreRegistrationKoha extends Class_WebService_SIGB_Pr return $this->_pre_registration->addError($this->_('Échec de la préinscription, les informations saisies sont invalides.')); $data['branchcode'] = $this->getBranchCode($data); + + if(isset($data['dateofbirth'])) + $data['dateofbirth'] = Class_Date::humanDate($data['dateofbirth'],'yyyy-MM-dd'); + $response = $int_bib->getSIGBComm()->preRegistration($data); if(!$response['statut']) diff --git a/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php b/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php index 6e1f538461fa7a0f1d51e8f37eee1ca75427d7c2..2171c3acee16ae1d16477ce58cd0c2e05ac054ce 100644 --- a/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php +++ b/tests/application/modules/opac/controllers/AuthControllerPreRegistrationTest.php @@ -136,7 +136,7 @@ class AuthControllerPreRegistrationKohaPostDispatchTest extends AuthControllerPr ['data' => json_encode(['branchcode' => 'GRA', 'surname' => 'Boulard', 'firstname' => 'Thom', - 'dateofbirth' => '15-09-1940', + 'dateofbirth' => '1940-09-15', 'streetnumber' => '10', 'address' => 'rue secret', 'zipcode' => '01630', @@ -156,8 +156,7 @@ class AuthControllerPreRegistrationKohaPostDispatchTest extends AuthControllerPr 'city' => 'Gotham', 'email' => 'thom@mail.com', 'phone' => '0123456789', - 'emailCheck' => ''], - true); + 'emailCheck' => '']); } @@ -213,7 +212,7 @@ class AuthControllerPreRegistrationKohaPostDispatchWithErrorReturnedTest extends ['data' => json_encode(['branchcode' => 'GRA', 'surname' => 'Boulard', 'firstname' => 'Thom', - 'dateofbirth' => '15-09-1940', + 'dateofbirth' => '1940-09-15', 'streetnumber' => '10', 'address' => 'rue secret', 'zipcode' => '01630',