View | Details | Raw Unified | Return to bug 5079
Collapse All | Expand All

(-)a/C4/XSLT.pm (-5 / +11 lines)
Lines 183-190 sub XSLTParse4Display { Link Here
183
sub buildKohaItemsNamespace {
183
sub buildKohaItemsNamespace {
184
    my ($biblionumber) = @_;
184
    my ($biblionumber) = @_;
185
    my @items = C4::Items::GetItemsInfo($biblionumber);
185
    my @items = C4::Items::GetItemsInfo($biblionumber);
186
    my $shelflocations =GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac');
186
    my $branches = GetBranches();
187
    my $branches = GetBranches();
187
    my $itemtypes = GetItemTypes();
188
    my $itemtypes = GetItemTypes();
189
    my $location = "";
188
    my $xml = '';
190
    my $xml = '';
189
    for my $item (@items) {
191
    for my $item (@items) {
190
        my $status;
192
        my $status;
Lines 223-234 sub buildKohaItemsNamespace { Link Here
223
            $status = "available";
225
            $status = "available";
224
        }
226
        }
225
        my $homebranch = xml_escape($branches->{$item->{homebranch}}->{'branchname'});
227
        my $homebranch = xml_escape($branches->{$item->{homebranch}}->{'branchname'});
226
	    my $itemcallnumber = xml_escape($item->{itemcallnumber});
228
	if(C4::Context->preference("OpacItemLocation") && defined $item->{'location'}) {
229
	    $location = xml_escape($shelflocations->{$item->{location}});
230
	}
231
	my $itemcallnumber = xml_escape($item->{itemcallnumber});
227
        $xml.= "<item><homebranch>$homebranch</homebranch>".
232
        $xml.= "<item><homebranch>$homebranch</homebranch>".
228
		"<status>$status</status>".
233
	    "<location>$location</location>".
229
		"<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
234
	    "<status>$status</status>".
230
        . "</item>";
235
	    "<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
231
236
	    . "</item>";
237
	
232
    }
238
    }
233
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
239
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
234
    return $xml;
240
    return $xml;
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (+1 lines)
Lines 92-97 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
92
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
92
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
93
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
93
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
94
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
94
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacItemLocation',1,'Show the shelving location of items in the opac',NULL,'YesNo');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RequestOnOpac',1,'If ON, globally enables patron holds on OPAC',NULL,'YesNo');
98
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RequestOnOpac',1,'If ON, globally enables patron holds on OPAC',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4354-4359 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4354
    SetVersion ($DBversion);
4354
    SetVersion ($DBversion);
4355
}
4355
}
4356
4356
4357
$DBversion = 'XXX';
4358
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4359
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacItemLocation',1,'Show the shelving location of items in the opac',NULL,'YesNo');");
4360
    print "Upgrade to $DBversion done (Add OpacItemLocation syspref)\n";
4361
    SetVersion ($DBversion);
4362
}
4363
4357
=head1 FUNCTIONS
4364
=head1 FUNCTIONS
4358
4365
4359
=head2 DropAllForeignKeys($table)
4366
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 192-197 OPAC: Link Here
192
                  no: "Don't allow"
192
                  no: "Don't allow"
193
            - patrons to log in to their accounts on the OPAC.
193
            - patrons to log in to their accounts on the OPAC.
194
        -
194
        -
195
            - pref: OpacItemLocation
196
              choices:
197
                  yes: Show
198
                  no: "Don't Show"
199
            - Show the shelving location of items in opac results.
200
        -
195
            - pref: OpacPasswordChange
201
            - pref: OpacPasswordChange
196
              choices:
202
              choices:
197
                  yes: Allow
203
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-20 / +38 lines)
Lines 979-1000 Link Here
979
                            </xsl:for-each>
979
                            </xsl:for-each>
980
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
980
                            (<xsl:value-of select="$AlternateHoldingsCount"/>)
981
                            </xsl:when>
981
                            </xsl:when>
982
                            <xsl:otherwise>No copies available</xsl:otherwise>
982
                            <xsl:otherwise>No copies available </xsl:otherwise>
983
                        </xsl:choose>
983
                        </xsl:choose>
984
				   </xsl:when>
984
				   </xsl:when>
985
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
985
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
986
                   <span class="available">
986
                   <span class="available">	
987
                       <b><xsl:text>Copies available for loan: </xsl:text></b>
987
		     <b>
988
                       <xsl:variable name="available_items"
988
		       <xsl:value-of select="count(key('item-by-status', 'available'))"/>
989
                           select="key('item-by-status', 'available')"/>
989
		       <xsl:choose><xsl:when test="count(key('item-by-status', 'available')) = 1"><xsl:text> Copy available for loan at </xsl:text></xsl:when><xsl:otherwise><xsl:text> Copies available for loan at </xsl:text></xsl:otherwise></xsl:choose>
990
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
990
		     </b>
991
                           <xsl:value-of select="items:homebranch"/>
991
		     <xsl:variable name="available_items"
992
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
992
				   select="key('item-by-status', 'available')"/>
993
                           <xsl:text> (</xsl:text>
993
		     <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
994
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
994
		       <xsl:value-of select="items:homebranch"/>
995
                           <xsl:text>)</xsl:text>
995
		       <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
996
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
996
		     </xsl:for-each>
997
                       </xsl:for-each>
998
                   </span>
997
                   </span>
999
                   </xsl:when>
998
                   </xsl:when>
1000
				   </xsl:choose>
999
				   </xsl:choose>
Lines 1002-1016 Link Here
1002
                   <xsl:choose>
1001
                   <xsl:choose>
1003
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1002
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1004
                   <span class="available">
1003
                   <span class="available">
1005
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1004
                       <b>
1006
                       <xsl:variable name="reference_items"
1005
		       <xsl:value-of select="count(key('item-by-status', 'reference'))"/>
1006
		       <xsl:choose><xsl:when test="count(key('item-by-status', 'reference')) = 1"><xsl:text> Copy available for reference at </xsl:text></xsl:when><xsl:otherwise><xsl:text> Copies available for reference at </xsl:text></xsl:otherwise></xsl:choose>
1007
		     </b>
1008
		     <xsl:variable name="reference_items"
1007
                           select="key('item-by-status', 'reference')"/>
1009
                           select="key('item-by-status', 'reference')"/>
1008
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1010
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1009
                           <xsl:value-of select="items:homebranch"/>
1011
                           <xsl:value-of select="items:homebranch"/>
1010
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1011
                           <xsl:text> (</xsl:text>
1012
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1013
                           <xsl:text>)</xsl:text>
1014
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1012
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1015
                       </xsl:for-each>
1013
                       </xsl:for-each>
1016
                   </span>
1014
                   </span>
Lines 1061-1066 Link Here
1061
                       <xsl:text>). </xsl:text>                   </span>
1059
                       <xsl:text>). </xsl:text>                   </span>
1062
                   </xsl:if>
1060
                   </xsl:if>
1063
               </span>
1061
               </span>
1062
	       <span class="results_summary" id="location"> 
1063
		 <span class="label">Location(s): </span>
1064
		 <xsl:variable name="available_items"
1065
			       select="key('item-by-status', 'available')"/>
1066
		 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1067
		   <xsl:value-of select="concat(items:location,' ')"/>
1068
		   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1069
		   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1070
		 </xsl:for-each>
1071
		 <xsl:choose><xsl:when test="count(key('item-by-status', 'available'))>0 and count(key('item-by-status', 'reference'))>0"><xsl:text> | </xsl:text></xsl:when></xsl:choose>		 
1072
		 <xsl:variable name="reference_items"
1073
			       select="key('item-by-status', 'reference')"/>
1074
		 <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1075
		   <xsl:value-of select="concat(items:location,' ')"/>
1076
		   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1077
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1078
                       </xsl:for-each>
1079
1080
	       </span>
1081
1082
1064
    </xsl:template>
1083
    </xsl:template>
1065
1084
1066
    <xsl:template name="nameABCDQ">
1085
    <xsl:template name="nameABCDQ">
1067
- 

Return to bug 5079