Skip to content
Snippets Groups Projects
Commit 135243a5 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #13319 fix datetime format in koha/GetRecordsResponseReader + refacto

parent a2b56efc
6 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!103Master,!100Master,!93Master,!92Hotline 6.42,!89Hotline#13319 Fix Datetime Format In Loans Table
......@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_SIGB_Koha_GetRecordsResponseReader {
use Class_WebService_SIGB_Koha_TraitFormat;
protected $_xml_parser;
protected $_notice;
protected $inderdire_resa_doc_dispo=false;
......@@ -95,7 +97,7 @@ class Class_WebService_SIGB_Koha_GetRecordsResponseReader {
if (!$this->_xml_parser->inParents('item'))
return;
$date = implode('/', array_reverse(explode('-', $data)));
$date = $this->formatDate($data);
$this->_current_exemplaire->setDateRetour($date);
if (('' != $date) || ($this->allowAvailableDocumentReservation())) {
......
......@@ -20,6 +20,8 @@
*/
class Class_WebService_SIGB_Koha_PatronInfoReader extends Class_WebService_SIGB_AbstractILSDIPatronInfoReader {
use Class_WebService_SIGB_Koha_TraitFormat;
protected $_current_exemplaire_operation;
public static function newInstance() {
......@@ -32,10 +34,7 @@ class Class_WebService_SIGB_Koha_PatronInfoReader extends Class_WebService_SIGB_
public function endDate_Due($data) {
$data = explode(' ', $data);
$data = $data[0];
$date = implode('/', array_reverse(explode('-', $data)));
$this->_current_operation->getExemplaire()->setDateRetour($date);
$this->_current_operation->getExemplaire()->setDateRetour($this->formatDate($data));
}
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
trait Class_WebService_SIGB_Koha_TraitFormat {
public function formatDate($datetime) {
$data = explode(' ', trim($datetime));
return implode('/', array_reverse(explode('-', $data[0])));
}
}
?>
\ No newline at end of file
......@@ -337,7 +337,7 @@ class KohaFixtures {
<itemnumber>33028</itemnumber>
<ccode>ROMJEUN</ccode>
<itemcallnumber>JR ROW h</itemcallnumber>
<date_due>2011-05-30</date_due>
<date_due>2011-05-30 23:59:00</date_due>
<barcode>2661690090</barcode>
<itemlost>0</itemlost>
<datelastseen>2011-02-18</datelastseen>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment