Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Commit

Permalink
löst issue #181
Browse files Browse the repository at this point in the history
* fixt Übersetzungsproblem bei 'no_ava_info'
* cleanup des Helpers
  • Loading branch information
Oliver Schihin committed Oct 11, 2013
1 parent 3f1e889 commit b9082f6
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions module/Swissbib/src/Swissbib/View/Helper/AvailabilityInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

/**
* Show availability infos
*
*/
class AvailabilityInfo extends AbstractHelper
{
Expand All @@ -17,42 +16,36 @@ class AvailabilityInfo extends AbstractHelper
const ONLINE_AVAILABLE = "onlineAvailable"; // by now only for ETH, could be enhanced for other library systems (labels for LoanStatus needed!)
const ITEM_LOST = "itemlost"; // vermisst, in Reparatur, abbestellt: Exemplar für Benutzer verloren



/**
* Convert availability info into html string
*
* @param Boolean|Array $availability
* @return String
*/

public function __invoke($availability)
{
{ $escapedTranslation = $this->getView()->plugin('transEsc');

//availability always contains an associative array with only 'one' key (the barcode of the item)
//(this method is called for every single item)
//the barcode references an additional array (derived from json) which contains the so called statusfield
//the value of the statusfield is part of the translation files
/* availability always contains an associative array with only 'one' key (the barcode of the item)
* (this method is called for every single item)
* the barcode references an additional array (derived from json) which contains the so called statusfield
* the value of the statusfield is part of the translation files
*/

if (is_array($availability)) {

$escapedTranslation = $this->getView()->plugin('transEsc');


$statusfield = self::LOOK_ON_SITE;
$borrowinginformation = array();

foreach ($availability as $barcode => $availinfo ) {

$statusfield = $availinfo["statusfield"];

if (isset ($availinfo["borrowingInformation"]) ){

$borrowinginformation = $availinfo["borrowingInformation"];

}
}


switch ($statusfield) {
case self::LENDABLE_AVAILABLE:

Expand Down Expand Up @@ -99,7 +92,7 @@ public function __invoke($availability)
}

} else {
$info = 'no_ava_info';
$info = $escapedTranslation('no_ava_info');
}

return $info;
Expand Down

0 comments on commit b9082f6

Please sign in to comment.