C4/Biblio.pm
View file
250 |
|
251 | my ($cn_sort) = |
252 | GetClassSort( $olddata->{'biblioitems.cn_source'}, $olddata->{'cn_class'}, $olddata->{'cn_item'} ); |
280 | cn_suffix => $olddata->{cn_suff}, |
281 | cn_sort => $cn_sort, |
282 | totalissues => $olddata->{totalissues}, |
291 |
|
292 | # update MARC subfield that stores biblioitems.cn_sort |
293 | _koha_marc_update_biblioitem_cn_sort( $record, $olddata, $frameworkcode ); |
294 |
|
463 |
|
464 | # update MARC subfield that stores biblioitems.cn_sort |
465 | _koha_marc_update_biblioitem_cn_sort( $record, $oldbiblio, $frameworkcode ); |
466 |
|
2383 | items.cn_source & biblioitems.cn_source |
2384 | items.cn_sort & biblioitems.cn_sort |
2385 |
|
2406 | my ( $table, $column ) = @_; |
2407 | if ( $column eq "cn_sort" or $column eq "cn_source" ) { |
2408 | return $table . '.' . $column; |
2529 |
|
2530 | =head2 _koha_marc_update_biblioitem_cn_sort |
2531 |
|
2532 | _koha_marc_update_biblioitem_cn_sort($marc, $biblioitem, $frameworkcode); |
2533 |
|
2534 | Given a MARC bib record and the biblioitem hash, update the |
2535 | subfield that contains a copy of the value of biblioitems.cn_sort. |
2536 |
|
2538 |
|
2539 | sub _koha_marc_update_biblioitem_cn_sort { |
2540 | my $marc = shift; |
2543 |
|
2544 | my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.cn_sort" ); |
2545 | return unless $biblioitem_tag; |
2546 |
|
2547 | my ($cn_sort) = GetClassSort( $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, $biblioitem->{'cn_item'} ); |
2548 |
|
2550 | $field->delete_subfield( code => $biblioitem_subfield ); |
2551 | if ( $cn_sort ne '' ) { |
2552 | $field->add_subfields( $biblioitem_subfield => $cn_sort ); |
2553 | } |
2556 | # if we get here, no biblioitem tag is present in the MARC record, so |
2557 | # we'll create it if $cn_sort is not empty -- this would be |
2558 | # an odd combination of events, however |
2559 | if ($cn_sort) { |
2560 | $marc->insert_grouped_field( MARC::Field->new( $biblioitem_tag, ' ', ' ', $biblioitem_subfield => $cn_sort ) ); |
2561 | } |
2623 |
|
2624 | # re-calculate the cn_sort, it may have changed |
2625 | my ($cn_sort) = GetClassSort( $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, $biblioitem->{'cn_item'} ); |
2626 |
|
2653 | cn_suffix = ?, |
2654 | cn_sort = ?, |
2655 | totalissues = ?, |
2667 | $biblioitem->{'lccn'}, $biblioitem->{'url'}, $biblioitem->{'biblioitems.cn_source'}, $biblioitem->{'cn_class'}, |
2668 | $biblioitem->{'cn_item'}, $biblioitem->{'cn_suffix'}, $cn_sort, $biblioitem->{'totalissues'}, |
2669 | $biblioitem->{'ean'}, $biblioitem->{'agerestriction'}, $biblioitem->{'biblioitemnumber'} |
C4/ClassSortRoutine.pm
View file
C4/ClassSortRoutine/Dewey.pm
View file
C4/ClassSortRoutine/Generic.pm
View file
C4/ClassSortRoutine/LCC.pm
View file
C4/ClassSplitRoutine/RegEx.pm
View file
C4/HoldsQueue.pm
View file
C4/Items.pm
View file
175 | $item_values->{cn_source} = delete $item_values->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate |
176 | $item_values->{cn_sort} = delete $item_values->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate |
177 | my $item = Koha::Item->new( $item_values )->store({ skip_record_index => $params->{skip_record_index} }); |
254 | $item->{cn_source} = delete $item->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate |
255 | $item->{cn_sort} = delete $item->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate |
256 |
|
332 | $item->{cn_source} = delete $item->{'items.cn_source'}; # Because of C4::Biblio::_disambiguate |
333 | delete $item->{'items.cn_sort'}; # Because of C4::Biblio::_disambiguate |
334 | $item->{itemnumber} = $itemnumber; |
336 |
|
337 | my $existing_cn_sort = $item_object->cn_sort; # set_or_blank will reset cn_sort to undef as we are not passing it |
338 | # We rely on Koha::Item->store to modify it if itemcallnumber or cn_source is modified |
339 | $item_object = $item_object->set_or_blank($item); |
340 | $item_object->cn_sort($existing_cn_sort); # Resetting to the existing value |
341 |
|
594 | my $select_columns = q{ |
595 | SELECT DISTINCT(items.itemnumber), barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, withdrawn, stocknumber, items.cn_sort, ccode |
596 |
|
618 | if ($minlocation) { |
619 | push @where_strings, 'items.cn_sort >= ?'; |
620 | push @bind_params, $min_cnsort; |
623 | if ($maxlocation) { |
624 | push @where_strings, 'items.cn_sort <= ?'; |
625 | push @bind_params, $max_cnsort; |
670 | my $count_query = $select_count . $query; |
671 | $query .= ' ORDER BY items.cn_sort, itemcallnumber, title'; |
672 | $query .= " LIMIT $offset, $size" if ($offset and $size); |
1240 | ? $params->{sortby} : 'itemnumber'; |
1241 | $sortby = 'cn_sort' if $sortby eq 'itemcallnumber'; |
1242 | my $sortorder = (uc($params->{sortorder}) eq 'ASC') ? 'ASC' : 'DESC'; |
C4/Overdues.pm
View file
C4/ShelfBrowser.pm
View file
116 |
|
117 | my $sth_get_item_details = $dbh->prepare("SELECT cn_sort,homebranch,location,ccode from items where itemnumber=?"); |
118 | $sth_get_item_details->execute($itemnumber); |
120 | die "Unable to find item '$itemnumber' for shelf browser" if (!$sth_get_item_details); |
121 | my $start_cn_sort = $item_details_result->{'cn_sort'}; |
122 |
|
141 | my $prev_query =' |
142 | SELECT itemnumber, biblionumber, cn_sort, itemcallnumber |
143 | FROM items |
144 | WHERE |
145 | ((cn_sort = ? AND itemnumber < ?) OR cn_sort < ?) '; |
146 | my $next_query =' |
147 | SELECT itemnumber, biblionumber, cn_sort, itemcallnumber |
148 | FROM items |
149 | WHERE |
150 | ((cn_sort = ? AND itemnumber >= ?) OR cn_sort > ?) '; |
151 | my @params; |
152 | my $query_cond; |
153 | push @params, ($start_cn_sort, $itemnumber, $start_cn_sort); |
154 | if ($start_homebranch) { |
168 | $dbh->selectall_arrayref( |
169 | $prev_query . $query_cond . ' ORDER BY cn_sort DESC, itemnumber DESC LIMIT ?', |
170 | { Slice => {} }, |
175 | $dbh->selectall_arrayref( |
176 | $next_query . $query_cond . ' ORDER BY cn_sort, itemnumber LIMIT ?', |
177 | { Slice => {} }, |
Koha/Biblioitem.pm
View file
Koha/Biblios.pm
View file
91 | $query =~ |
92 | s/${quotes}${context}\.(age_restriction|cn_class|cn_item|cn_sort|cn_source|cn_suffix|collection_issn|collection_title|collection_volume|ean|edition_statement|illustrations|isbn|issn|item_type|lc_control_number|notes|number|pages|publication_place|publication_year|publisher|material_size|serial_total_issues|url|volume|volume_date|volume_description)${quotes}/${quotes}${context}\.biblioitem\.$1${quotes}/g; |
93 | } else { |
94 | $query =~ |
95 | s/${quotes}(age_restriction|cn_class|cn_item|cn_sort|cn_source|cn_suffix|collection_issn|collection_title|collection_volume|ean|edition_statement|illustrations|isbn|issn|item_type|lc_control_number|notes|number|pages|publication_place|publication_year|publisher|material_size|serial_total_issues|url|volume|volume_date|volume_description)${quotes}/${quotes}biblioitem\.$1${quotes}/g; |
96 | $query =~ # handle ambiguous 'biblionumber' |
Koha/Database/Columns.pm
View file
206 | "ccode" => __("Collection"), |
207 | "cn_sort" => __("Koha normalized classification for sorting"), |
208 | "cn_source" => __("Source of classification or shelving scheme"), |
273 | "cn_item" => __("Item part"), |
274 | "cn_sort" => __("Koha normalized classification for sorting"), |
275 | "cn_source" => __("Source of classification or shelving scheme"), |
Koha/EDI.pm
View file
Koha/Item.pm
View file
135 | { |
136 | my $cn_sort = GetClassSort( $self->cn_source, $self->itemcallnumber, "" ); |
137 | $self->cn_sort($cn_sort); |
138 | } |
192 | { |
193 | my $cn_sort = GetClassSort( $self->cn_source, $self->itemcallnumber, "" ); |
194 | $self->cn_sort($cn_sort); |
195 | } |
1855 | cn_source => 'call_number_source', |
1856 | cn_sort => 'call_number_sort', |
1857 | ccode => 'collection_code', |
Koha/Old/Biblioitem.pm
View file
Koha/Old/Biblios.pm
View file
52 | $query =~ |
53 | s/${quotes}${context}\.(age_restriction|cn_class|cn_item|cn_sort|cn_source|cn_suffix|collection_issn|collection_title|collection_volume|ean|edition_statement|illustrations|isbn|issn|item_type|lc_control_number|notes|number|pages|publication_place|publication_year|publisher|material_size|serial_total_issues|url|volume|volume_date|volume_description)${quotes}/${quotes}${context}\.deletedbiblioitem\.$1${quotes}/g; |
54 | } else { |
55 | $query =~ |
56 | s/${quotes}(age_restriction|cn_class|cn_item|cn_sort|cn_source|cn_suffix|collection_issn|collection_title|collection_volume|ean|edition_statement|illustrations|isbn|issn|item_type|lc_control_number|notes|number|pages|publication_place|publication_year|publisher|material_size|serial_total_issues|url|volume|volume_date|volume_description)${quotes}/${quotes}deletedbiblioitem\.$1${quotes}/g; |
57 | $query =~ # handle ambiguous 'biblionumber' |