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 (+2 lines)
Lines 388-390 INSERT INTO systempreferences (variable, value, options, explanation, type) VALU Link Here
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
391
INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'DefaultItemSortOrder', 'home', 'home|holding', 'Define the default sort order for items.', 'Choice' );    
392
        
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 6134-6139 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6134
    SetVersion ($DBversion);
6134
    SetVersion ($DBversion);
6135
}
6135
}
6136
6136
6137
$DBversion = "3.11.00.XXX";
6138
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6139
    $dbh->do(q{
6140
        INSERT INTO systempreferences ( variable, value, options, explanation, type ) VALUES ( 'DefaultItemSortOrder', 'home', 'home|holding', 'Define the default sort order for items.', 'Choice' );
6141
    });
6142
    print "Upgrade to $DBversion done (Bug 9167: Update the virtualshelves.sortfield column with 'copyrightdate' if needed)\n";
6143
    SetVersion ($DBversion);
6144
}
6145
6137
=head1 FUNCTIONS
6146
=head1 FUNCTIONS
6138
6147
6139
=head2 TableExists($table)
6148
=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