Commit ea68d96b authored by Patrick Barroca's avatar Patrick Barroca 🐧

hotline #89745 : fix item on hold filtering

parent f2db33eb
- ticket #89745 : SIGB Koha : Correction de la prise en compte de l'information "réservé par d'autres" lorsque plus d'une réservation est en cours
\ No newline at end of file
......@@ -171,13 +171,20 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOper
if ('end_issue_date' == $key)
return $this->_isBeforeDate($this->getIssueDate(), $value);
if (!'onhold' == $key)
if ('onhold' != $key)
return true;
if ('all' == $value)
return true;
return $this->getOnhold() == (('yes' == $value) ? 1 : 0);
return ('yes' == $value)
? $this->isOnHold()
: !$this->isOnHold();
}
public function isOnHold() {
return 0 != $this->getOnHold();
}
......
......@@ -431,8 +431,8 @@ class ChamberyKohaFixtures {
}
public static function getPatronInfoChambelleWithOnhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
public static function getPatronInfoChambelleWithOnhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
......@@ -557,11 +557,11 @@ class ChamberyKohaFixtures {
<B_phone></B_phone>
</GetPatronInfo>
';
}
}
public static function getPatronInfoChambelleWithItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
public static function getPatronInfoChambelleWithItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
......@@ -686,5 +686,133 @@ class ChamberyKohaFixtures {
<B_phone></B_phone>
</GetPatronInfo>
';
}
}
\ No newline at end of file
}
public static function getPatronInfoChambelleWithManyItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
<B_address2></B_address2>
<altcontactfirstname></altcontactfirstname>
<sort2></sort2>
<borrowernumber>6871</borrowernumber>
<altcontactphone></altcontactphone>
<title></title>
<dateexpiry>2019-06-30</dateexpiry>
<mobile>06 01 02 03 04</mobile>
<cardnumber>90519000053165</cardnumber>
<B_streetnumber></B_streetnumber>
<dateenrolled>2014-04-29</dateenrolled>
<altcontactzipcode></altcontactzipcode>
<streettype></streettype>
<sort1>12</sort1>
<email>xxx@xxx.fr</email>
<contactfirstname></contactfirstname>
<B_country></B_country>
<B_email></B_email>
<phone>01 02 03 04 05</phone>
<B_address></B_address>
<branchcode>PUKA</branchcode>
<guarantorid>0</guarantorid>
<emailpro></emailpro>
<phonepro></phonepro>
<B_city></B_city>
<gonenoaddress>0</gonenoaddress>
<privacy_guarantor_checkouts>0</privacy_guarantor_checkouts>
<categorycode>J14</categorycode>
<dateofbirth>2004-11-10</dateofbirth>
<lost>0</lost>
<zipcode>1123</zipcode>
<lang>default</lang>
<altcontactaddress3></altcontactaddress3>
<checkprevcheckout>inherit</checkprevcheckout>
<fax>01 02 03 04 05</fax>
<streetnumber></streetnumber>
<altcontactaddress1></altcontactaddress1>
<address2></address2>
<updated_on>2017-03-23 13:22:49</updated_on>
<loans>
<loan>
<replacementpricedate>2009-10-01</replacementpricedate>
<issuedate>2016-05-24 00:00</issuedate>
<issues>3</issues>
<issue_id>272</issue_id>
<author>René Gouichoux, Pronto</author>
<permanent_location>Romans enfant</permanent_location>
<itemlost>0</itemlost>
<overdue>1</overdue>
<publishercode>F. Nathan</publishercode>
<surname>Aguetant</surname>
<biblioitemnumber>4107</biblioitemnumber>
<firstname>Agathe</firstname>
<notforloan>0</notforloan>
<holdingbranch>PUKA</holdingbranch>
<itemnumber>5111</itemnumber>
<auto_renew>0</auto_renew>
<frameworkcode></frameworkcode>
<barcode>00519000083096</barcode>
<itemonhold>3</itemonhold>
<renewals>28</renewals>
<publicationyear>2004</publicationyear>
<location>Romans enfant</location>
<withdrawn>0</withdrawn>
<date_due>2017-06-14 00:00</date_due>
<dateaccessioned>2014-06-26</dateaccessioned>
<itemtype>LIVR</itemtype>
<damaged>0</damaged>
<homebranch>PUKA</homebranch>
<more_subfields_xml>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;collection
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd&quot;
xmlns=&quot;http://www.loc.gov/MARC21/slim&quot;&gt;
&lt;record&gt;
&lt;leader&gt; a &lt;/leader&gt;
&lt;datafield tag=&quot;999&quot; ind1=&quot; &quot; ind2=&quot; &quot;&gt;
&lt;subfield code=&quot;h&quot;&gt;8309&lt;/subfield&gt;
&lt;subfield code=&quot;j&quot;&gt;Librairie jeunesse au pays ble&lt;/subfield&gt;
&lt;subfield code=&quot;q&quot;&gt;Jeunes&lt;/subfield&gt;
&lt;subfield code=&quot;p&quot;&gt;5,35&lt;/subfield&gt;
&lt;subfield code=&quot;s&quot;&gt;24/04/2004&lt;/subfield&gt;
&lt;/datafield&gt;
&lt;/record&gt;
&lt;/collection&gt;</more_subfields_xml>
<itemcallnumber>E GOU</itemcallnumber>
<itype>LIVR</itype>
<branchcode>PUKA</branchcode>
<date_due_sql>2017-06-14 00:00:00</date_due_sql>
<biblionumber>4107</biblionumber>
<onloan>2016-06-14</onloan>
<datecreated>2014-06-26</datecreated>
<cardnumber>90519000053165</cardnumber>
<datelastborrowed>2016-05-24</datelastborrowed>
<timestamp>2017-03-23 13:24:14</timestamp>
<title>Quel bazar, Léonard !</title>
<borrowernumber>6871</borrowernumber>
<datelastseen>2016-05-24</datelastseen>
<isbn>2092502611</isbn>
<onsite_checkout>0</onsite_checkout>
<cn_sort>E_GOU</cn_sort>
</loan>
</loans>
<firstname>Agathe</firstname>
<B_zipcode></B_zipcode>
<sex></sex>
<othernames></othernames>
<privacy>1</privacy>
<surname>Aguetant</surname>
<B_streettype></B_streettype>
<altcontactsurname></altcontactsurname>
<login_attempts>0</login_attempts>
<initials></initials>
<branchname>Pukapuka</branchname>
<contactname></contactname>
<address>6871 rue de Agathe</address>
<B_phone></B_phone>
</GetPatronInfo>
';
}
}
......@@ -272,4 +272,15 @@ class HandleOnholdWithItemOnHoldTest extends HandleOnholdDispatchTestCase {
->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1')
->answers(ChamberyKohaFixtures::getPatronInfoChambelleWithItemonhold());
}
}
class HandleOnholdWithManyItemOnHoldTest extends HandleOnholdDispatchTestCase {
protected function _addCallToWebClient() {
$this->_mock_web_client
->whenCalled('open_url')
->with($this->_ilsdi . '?service=GetPatronInfo&patron_id=18&show_contact=1&show_loans=1&show_holds=1')
->answers(ChamberyKohaFixtures::getPatronInfoChambelleWithManyItemonhold());
}
}
\ No newline at end of file
Markdown is supported
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