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

(-)a/C4/XSLT.pm (-4 / +17 lines)
Lines 227-238 sub buildKohaItemsNamespace { Link Here
227
    my ($biblionumber, $hidden_items) = @_;
227
    my ($biblionumber, $hidden_items) = @_;
228
228
229
    my @items = C4::Items::GetItemsInfo($biblionumber);
229
    my @items = C4::Items::GetItemsInfo($biblionumber);
230
230
    if ($hidden_items && @$hidden_items) {
231
    if ($hidden_items && @$hidden_items) {
231
        my %hi = map {$_ => 1} @$hidden_items;
232
        my %hi = map {$_ => 1} @$hidden_items;
232
        @items = grep { !$hi{$_->{itemnumber}} } @items;
233
        @items = grep { !$hi{$_->{itemnumber}} } @items;
233
    }
234
    }
235
236
    my $shelflocations =GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac');
237
234
    my $branches = GetBranches();
238
    my $branches = GetBranches();
235
    my $itemtypes = GetItemTypes();
239
    my $itemtypes = GetItemTypes();
240
    my $location = "";
236
    my $xml = '';
241
    my $xml = '';
237
    for my $item (@items) {
242
    for my $item (@items) {
238
        my $status;
243
        my $status;
Lines 270-281 sub buildKohaItemsNamespace { Link Here
270
        } else {
275
        } else {
271
            $status = "available";
276
            $status = "available";
272
        }
277
        }
278
273
        my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):'';
279
        my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):'';
274
	    my $itemcallnumber = xml_escape($item->{itemcallnumber});
280
281
        if(C4::Context->preference("OpacItemLocation") && defined $item->{'location'}) {
282
            $location = xml_escape($shelflocations->{$item->{location}});
283
        }
284
285
        my $itemcallnumber = xml_escape($item->{itemcallnumber});
286
275
        $xml.= "<item><homebranch>$homebranch</homebranch>".
287
        $xml.= "<item><homebranch>$homebranch</homebranch>".
276
		"<status>$status</status>".
288
	    "<location>$location</location>".
277
		"<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
289
	    "<status>$status</status>".
278
        . "</item>";
290
	    "<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
291
	    . "</item>";
279
292
280
    }
293
    }
281
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
294
    $xml = "<items xmlns=\"http://www.koha-community.org/items\">".$xml."</items>";
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 95-100 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
95
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
98
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacItemLocation',1,'Show the shelving location of items in the opac',NULL,'YesNo');
98
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
99
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
99
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACpatronimages',0,'Enable patron images in the OPAC',NULL,'YesNo');
100
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACpatronimages',0,'Enable patron images in the OPAC',NULL,'YesNo');
100
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
101
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 4358-4363 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4358
    SetVersion ($DBversion);
4358
    SetVersion ($DBversion);
4359
}
4359
}
4360
4360
4361
<<<<<<< HEAD
4361
$DBversion = "3.05.00.003";
4362
$DBversion = "3.05.00.003";
4362
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4363
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4363
    $dbh->do(qq{
4364
    $dbh->do(qq{
Lines 5212-5217 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5212
    SetVersion($DBversion);
5213
    SetVersion($DBversion);
5213
}
5214
}
5214
5215
5216
$DBversion = "3.08.00.XXX";
5217
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5218
    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacItemLocation',1,'Show the shelving location of items in the opac',NULL,'YesNo');");
5219
    print "Upgrade to $DBversion done (Add OpacItemLocation syspref)\n";
5220
    SetVersion ($DBversion);
5221
}
5222
5215
=head1 FUNCTIONS
5223
=head1 FUNCTIONS
5216
5224
5217
=head2 TableExists($table)
5225
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 229-234 OPAC: Link Here
229
                  no: "Don't allow"
229
                  no: "Don't allow"
230
            - patrons to log in to their accounts on the OPAC.
230
            - patrons to log in to their accounts on the OPAC.
231
        -
231
        -
232
            - pref: OpacItemLocation
233
              choices:
234
                  yes: Show
235
                  no: "Don't Show"
236
            - Show the shelving location of items in opac results.
237
        -
232
            - pref: OpacPasswordChange
238
            - pref: OpacPasswordChange
233
              choices:
239
              choices:
234
                  yes: Allow
240
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-18 / +36 lines)
Lines 1011-1027 Link Here
1011
				   </xsl:when>
1011
				   </xsl:when>
1012
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1012
                   <xsl:when test="count(key('item-by-status', 'available'))>0">
1013
                   <span class="available">
1013
                   <span class="available">
1014
                       <b><xsl:text>Copies available for loan: </xsl:text></b>
1014
		     <b>
1015
                       <xsl:variable name="available_items"
1015
		       <xsl:value-of select="count(key('item-by-status', 'available'))"/>
1016
                           select="key('item-by-status', 'available')"/>
1016
		       <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>
1017
                       <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1017
		     </b>
1018
                           <xsl:value-of select="items:homebranch"/>
1018
		     <xsl:variable name="available_items"
1019
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1019
				   select="key('item-by-status', 'available')"/>
1020
                           <xsl:text> (</xsl:text>
1020
		     <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1021
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1021
		       <xsl:value-of select="items:homebranch"/>
1022
                           <xsl:text>)</xsl:text>
1022
		       <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1023
<xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1023
		     </xsl:for-each>
1024
                       </xsl:for-each>
1025
                   </span>
1024
                   </span>
1026
                   </xsl:when>
1025
                   </xsl:when>
1027
				   </xsl:choose>
1026
				   </xsl:choose>
Lines 1035-1049 Link Here
1035
                   <xsl:choose>
1034
                   <xsl:choose>
1036
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1035
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1037
                   <span class="available">
1036
                   <span class="available">
1038
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1037
                       <b>
1039
                       <xsl:variable name="reference_items"
1038
		       <xsl:value-of select="count(key('item-by-status', 'reference'))"/>
1039
		       <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>
1040
		     </b>
1041
		     <xsl:variable name="reference_items"
1040
                           select="key('item-by-status', 'reference')"/>
1042
                           select="key('item-by-status', 'reference')"/>
1041
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1043
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1042
                           <xsl:value-of select="items:homebranch"/>
1044
                           <xsl:value-of select="items:homebranch"/>
1043
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1044
                           <xsl:text> (</xsl:text>
1045
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1046
                           <xsl:text>)</xsl:text>
1047
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1045
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1048
                       </xsl:for-each>
1046
                       </xsl:for-each>
1049
                   </span>
1047
                   </span>
Lines 1094-1099 Link Here
1094
                       <xsl:text>). </xsl:text>                   </span>
1092
                       <xsl:text>). </xsl:text>                   </span>
1095
                   </xsl:if>
1093
                   </xsl:if>
1096
               </span>
1094
               </span>
1095
	       <span class="results_summary" id="location">
1096
		 <span class="label">Location(s): </span>
1097
		 <xsl:variable name="available_items"
1098
			       select="key('item-by-status', 'available')"/>
1099
		 <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1100
		   <xsl:value-of select="concat(items:location,' ')"/>
1101
		   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1102
		   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1103
		 </xsl:for-each>
1104
		 <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>
1105
		 <xsl:variable name="reference_items"
1106
			       select="key('item-by-status', 'reference')"/>
1107
		 <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1108
		   <xsl:value-of select="concat(items:location,' ')"/>
1109
		   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1110
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1111
                       </xsl:for-each>
1112
1113
	       </span>
1114
1115
1097
    </xsl:template>
1116
    </xsl:template>
1098
1117
1099
    <xsl:template name="nameABCDQ">
1118
    <xsl:template name="nameABCDQ">
1100
- 

Return to bug 5079