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

(-)a/C4/XSLT.pm (-2 / +12 lines)
Lines 188-194 sub XSLTParse4Display { Link Here
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
188
                              UseAuthoritiesForTracings TraceSubjectSubdivisions
189
                              Display856uAsImage OPACDisplay856uAsImage 
189
                              Display856uAsImage OPACDisplay856uAsImage 
190
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
190
                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
191
                              singleBranchMode
191
                              singleBranchMode OPACItemLocation
192
                              AlternateHoldingsField AlternateHoldingsSeparator / )
192
                              AlternateHoldingsField AlternateHoldingsSeparator / )
193
    {
193
    {
194
        my $sp = C4::Context->preference( $syspref );
194
        my $sp = C4::Context->preference( $syspref );
Lines 232-239 sub buildKohaItemsNamespace { Link Here
232
        my %hi = map {$_ => 1} @$hidden_items;
232
        my %hi = map {$_ => 1} @$hidden_items;
233
        @items = grep { !$hi{$_->{itemnumber}} } @items;
233
        @items = grep { !$hi{$_->{itemnumber}} } @items;
234
    }
234
    }
235
236
    my $shelflocations = GetKohaAuthorisedValues('items.location',GetFrameworkCode($biblionumber), 'opac');
237
    my $ccodes         = GetKohaAuthorisedValues('items.ccode',GetFrameworkCode($biblionumber), 'opac');
238
235
    my $branches = GetBranches();
239
    my $branches = GetBranches();
236
    my $itemtypes = GetItemTypes();
240
    my $itemtypes = GetItemTypes();
241
    my $location = "";
242
    my $ccode = "";
237
    my $xml = '';
243
    my $xml = '';
238
    for my $item (@items) {
244
    for my $item (@items) {
239
        my $status;
245
        my $status;
Lines 272-279 sub buildKohaItemsNamespace { Link Here
272
            $status = "available";
278
            $status = "available";
273
        }
279
        }
274
        my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):'';
280
        my $homebranch = $item->{homebranch}? xml_escape($branches->{$item->{homebranch}}->{'branchname'}):'';
275
	    my $itemcallnumber = xml_escape($item->{itemcallnumber});
281
        $location = xml_escape($shelflocations->{$item->{location}});
282
        $ccode = xml_escape($ccodes->{$item->{ccode}});
283
        my $itemcallnumber = xml_escape($item->{itemcallnumber});
276
        $xml.= "<item><homebranch>$homebranch</homebranch>".
284
        $xml.= "<item><homebranch>$homebranch</homebranch>".
285
                "<location>$location</location>".
286
                "<ccode>$ccode</ccode>".
277
		"<status>$status</status>".
287
		"<status>$status</status>".
278
		"<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
288
		"<itemcallnumber>".$itemcallnumber."</itemcallnumber>"
279
        . "</item>";
289
        . "</item>";
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 406-408 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
406
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
407
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
408
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
409
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 6339-6344 if ( CheckVersion($DBversion) ) { Link Here
6339
   SetVersion ($DBversion);
6339
   SetVersion ($DBversion);
6340
}
6340
}
6341
6341
6342
$DBversion = "3.11.00.XXX";
6343
if ( CheckVersion($DBversion) ) {
6344
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacItemLocation','callnum','Show the shelving location of items in the opac','callnum|ccode|location','Choice');");
6345
    print "Upgrade to $DBversion done (Bug 5079: Add OpacItemLocation syspref)\n";
6346
    SetVersion ($DBversion);
6347
}
6348
6342
=head1 FUNCTIONS
6349
=head1 FUNCTIONS
6343
6350
6344
=head2 TableExists($table)
6351
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+8 lines)
Lines 278-283 OPAC: Link Here
278
                  no: "Don't allow"
278
                  no: "Don't allow"
279
            - patrons to log in to their accounts on the OPAC.
279
            - patrons to log in to their accounts on the OPAC.
280
        -
280
        -
281
            - Show
282
            - pref: OpacItemLocation
283
              choices:
284
                  location: location
285
                  ccode: "collection code"
286
                  callnum: "call number only"
287
            - for items on the OPAC search results.
288
        -
281
            - pref: OpacPasswordChange
289
            - pref: OpacPasswordChange
282
              choices:
290
              choices:
283
                  yes: Allow
291
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl (-20 / +37 lines)
Lines 27-32 Link Here
27
    <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
27
    <xsl:variable name="AlternateHoldingsField" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 1, 3)"/>
28
    <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
28
    <xsl:variable name="AlternateHoldingsSubfields" select="substring(marc:sysprefs/marc:syspref[@name='AlternateHoldingsField'], 4)"/>
29
    <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
29
    <xsl:variable name="AlternateHoldingsSeparator" select="marc:sysprefs/marc:syspref[@name='AlternateHoldingsSeparator']"/>
30
    <xsl:variable name="OPACItemLocation" select="marc:sysprefs/marc:syspref[@name='OPACItemLocation']"/>
30
    <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
31
    <xsl:variable name="singleBranchMode" select="marc:sysprefs/marc:syspref[@name='singleBranchMode']"/>
31
        <xsl:variable name="leader" select="marc:leader"/>
32
        <xsl:variable name="leader" select="marc:leader"/>
32
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
33
        <xsl:variable name="leader6" select="substring($leader,7,1)"/>
Lines 1039-1045 Link Here
1039
               <xsl:otherwise>
1040
               <xsl:otherwise>
1040
                   <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1041
                   <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1041
                               <xsl:value-of select="items:homebranch"/>
1042
                               <xsl:value-of select="items:homebranch"/>
1042
                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1043
                   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber and $OPACItemLocation='callnum'"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1043
                               <xsl:text> (</xsl:text>
1044
                               <xsl:text> (</xsl:text>
1044
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1045
                               <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1045
                               <xsl:text>)</xsl:text>
1046
                               <xsl:text>)</xsl:text>
Lines 1058-1081 Link Here
1058
                       </xsl:when></xsl:choose>
1059
                       </xsl:when></xsl:choose>
1059
                   </xsl:when> </xsl:choose>
1060
                   </xsl:when> </xsl:choose>
1060
1061
1061
                   <xsl:choose>
1062
                   <xsl:when test="count(key('item-by-status', 'reference'))>0">
1063
                   <span class="available">
1064
                       <b><xsl:text>Copies available for reference: </xsl:text></b>
1065
                       <xsl:variable name="reference_items"
1066
                           select="key('item-by-status', 'reference')"/>
1067
                       <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1068
                           <xsl:value-of select="items:homebranch"/>
1069
						   <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> [<xsl:value-of select="items:itemcallnumber"/>]</xsl:if>
1070
                           <xsl:text> (</xsl:text>
1071
                           <xsl:value-of select="count(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch)))"/>
1072
                           <xsl:text>)</xsl:text>
1073
                   <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1074
                       </xsl:for-each>
1075
                   </span>
1076
                   </xsl:when>
1077
                   </xsl:choose>
1078
1079
                   <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
1062
                   <xsl:if test="count(key('item-by-status', 'Checked out'))>0">
1080
                   <span class="unavailable">
1063
                   <span class="unavailable">
1081
                       <xsl:text>Checked out (</xsl:text>
1064
                       <xsl:text>Checked out (</xsl:text>
Lines 1120-1125 Link Here
1120
                       <xsl:text>). </xsl:text>                   </span>
1103
                       <xsl:text>). </xsl:text>                   </span>
1121
                   </xsl:if>
1104
                   </xsl:if>
1122
               </span>
1105
               </span>
1106
    <xsl:choose>
1107
        <xsl:when test="($OPACItemLocation='location' or $OPACItemLocation='ccode') and (count(key('item-by-status', 'available'))!=0 or count(key('item-by-status', 'reference'))!=0)">
1108
            <span class="results_summary" id="location">
1109
                <span class="label">Location(s): </span>
1110
                <xsl:choose>
1111
                <xsl:when test="count(key('item-by-status', 'available'))>0">
1112
                    <span class="available">
1113
                        <xsl:variable name="available_items" select="key('item-by-status', 'available')"/>
1114
                        <xsl:for-each select="$available_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1115
                            <xsl:choose>
1116
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1117
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1118
                            </xsl:choose>
1119
                            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1120
                            <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1121
                        </xsl:for-each>
1122
                    </span>
1123
                </xsl:when>
1124
                <xsl:when test="count(key('item-by-status', 'reference'))>0">
1125
                    <span class="available">
1126
                        <xsl:variable name="reference_items" select="key('item-by-status', 'reference')"/>
1127
                        <xsl:for-each select="$reference_items[generate-id() = generate-id(key('item-by-status-and-branch', concat(items:status, ' ', items:homebranch))[1])]">
1128
                            <xsl:choose>
1129
                                <xsl:when test="$OPACItemLocation='location'"><b><xsl:value-of select="concat(items:location,' ')"/></b></xsl:when>
1130
                                <xsl:when test="$OPACItemLocation='ccode'"><b><xsl:value-of select="concat(items:ccode,' ')"/></b></xsl:when>
1131
                            </xsl:choose>
1132
                            <xsl:if test="items:itemcallnumber != '' and items:itemcallnumber"> <xsl:value-of select="items:itemcallnumber"/></xsl:if>
1133
                            <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose>
1134
                        </xsl:for-each>
1135
                    </span>
1136
                </xsl:when>
1137
                </xsl:choose>
1138
            </span>
1139
        </xsl:when>
1140
       </xsl:choose>
1123
    </xsl:template>
1141
    </xsl:template>
1124
1142
1125
    <xsl:template name="nameABCDQ">
1143
    <xsl:template name="nameABCDQ">
1126
- 

Return to bug 5079