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

(-)a/C4/Items.pm (-1 / +2 lines)
Lines 1203-1208 sub GetItemsInfo { Link Here
1203
    my ( $biblionumber ) = @_;
1203
    my ( $biblionumber ) = @_;
1204
    my $dbh   = C4::Context->dbh;
1204
    my $dbh   = C4::Context->dbh;
1205
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1205
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1206
    my $branch = C4::Context->preference("DefaultItemSortOrder") || 'home';
1206
    my $query = "
1207
    my $query = "
1207
    SELECT items.*,
1208
    SELECT items.*,
1208
           biblio.*,
1209
           biblio.*,
Lines 1230-1236 sub GetItemsInfo { Link Here
1230
     LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
1231
     LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
1231
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1232
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1232
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1233
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1233
    $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1234
    $query .= " WHERE items.biblionumber = ? ORDER BY $branch.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1234
    my $sth = $dbh->prepare($query);
1235
    my $sth = $dbh->prepare($query);
1235
    $sth->execute($biblionumber);
1236
    $sth->execute($biblionumber);
1236
    my $i = 0;
1237
    my $i = 0;
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 408-410 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
408
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');
408
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');
409
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');
409
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');
410
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
410
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
411
INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'DefaultItemSortOrder', 'home', 'home|holding', 'Define the default sort order for items.', 'Choice' );
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 6347-6352 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6347
    SetVersion($DBversion);
6347
    SetVersion($DBversion);
6348
}
6348
}
6349
6349
6350
$DBversion = "3.11.00.XXX";
6351
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6352
    $dbh->do(q{
6353
        INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'DefaultItemSortOrder', 'home', 'home|holding', 'Define the default sort order for items.', 'Choice' );
6354
    });
6355
    print "Upgrade to $DBversion done (Bug 9264 - Make getitems default sort to set by a preference instead of hard coded to homebranch.)\n";
6356
    SetVersion ($DBversion);
6357
}
6358
6350
=head1 FUNCTIONS
6359
=head1 FUNCTIONS
6351
6360
6352
=head2 TableExists($table)
6361
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-1 / +8 lines)
Lines 160-162 Searching: Link Here
160
            - pref: FacetLabelTruncationLength
160
            - pref: FacetLabelTruncationLength
161
              class: integer
161
              class: integer
162
            - characters, in OPAC/staff interface.
162
            - characters, in OPAC/staff interface.
163
- 
163
        -
164
            - The default sort order for items should be by the item's
165
            - pref: DefaultItemSortOrder
166
              type: choice
167
              default: home
168
              choices:
169
                  home: home library
170
                  holding: "holding library"

Return to bug 9264