Bugzilla – Attachment 88755 Details for
Bug 20447
Add support for MARC holdings records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20447: Use blessed objects and fix issues found during review
Bug-20447-Use-blessed-objects-and-fix-issues-found.patch (text/plain), 58.99 KB, created by
Ere Maijala
on 2019-04-25 11:41:30 UTC
(
hide
)
Description:
Bug 20447: Use blessed objects and fix issues found during review
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2019-04-25 11:41:30 UTC
Size:
58.99 KB
patch
obsolete
>From 695957a2c62c8fb448aa94037878e103db43661d Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Thu, 25 Apr 2019 11:31:02 +0300 >Subject: [PATCH] Bug 20447: Use blessed objects and fix issues found during > review > >--- > C4/Biblio.pm | 1 - > C4/Items.pm | 2 +- > C4/Search.pm | 2 +- > Koha/Holding.pm | 39 +- > Koha/Template/Plugin/Holdings.pm | 42 +- > catalogue/detail.pl | 2 +- > .../prog/en/includes/cat-toolbar.inc | 2 +- > .../prog/en/modules/catalogue/detail.tt | 10 +- > .../prog/en/modules/cataloguing/addholding.tt | 760 +++++++++--------- > .../marc21_field_008_holdings.tt | 39 +- > .../value_builder/marc21_leader_holdings.tt | 32 +- > opac/opac-detail.pl | 2 +- > t/db_dependent/Koha/Holding.t | 8 +- > t/db_dependent/Koha/Holdings.t | 2 - > 14 files changed, 480 insertions(+), 463 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index baa4d6c2d5..c0939df774 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2831,7 +2831,6 @@ sub EmbedItemsInMarcBiblio { > $itemnumbers = [] unless defined $itemnumbers; > > if ( !$skip_holdings && C4::Context->preference('SummaryHoldings') && !@$itemnumbers ) { >- require Koha::Holdings; > my $holdings_fields = Koha::Holdings->get_embeddable_marc_fields({ biblionumber => $biblionumber }); > $marc->append_fields(@$holdings_fields) if ( @$holdings_fields ); > } >diff --git a/C4/Items.pm b/C4/Items.pm >index 141dbd873e..a42b882194 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1694,7 +1694,7 @@ sub MoveItemFromBiblio { > |, undef, $tobiblioitem, $tobiblio, $itemnumber, $frombiblio ); > if ($return == 1) { > # Check if the moved item is attached to a holdings record >- my $item = my $item = Koha::Items->find($itemnumber); >+ my $item = Koha::Items->find($itemnumber); > if ($item->holding_id()) { > my $oldHolding = Koha::Holdings->find($item->holding_id()); > if ($oldHolding) { >diff --git a/C4/Search.pm b/C4/Search.pm >index bbffc055dc..0446e6475d 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -2259,7 +2259,7 @@ sub searchResults { > > # Fetch summary holdings > if (C4::Context->preference('SummaryHoldings')) { >- $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef })->unblessed; >+ $summary_holdings = Koha::Holdings->search({ biblionumber => $oldbiblio->{biblionumber}, deleted_on => undef }); > } > > # XSLT processing of some stuff >diff --git a/Koha/Holding.pm b/Koha/Holding.pm >index c0053610c4..a58c39f8fc 100644 >--- a/Koha/Holding.pm >+++ b/Koha/Holding.pm >@@ -28,6 +28,7 @@ use C4::Log; > use Koha::Database; > use Koha::DateUtils qw(dt_from_string); > use Koha::Holdings::Metadatas; >+use Koha::Items; > > use base qw(Koha::Object); > >@@ -41,6 +42,21 @@ Koha::Holding - Koha Holding Object class > > =cut > >+=head3 holding_branch >+ >+my $branch = $hold->holding_branch(); >+ >+Returns the holding branch for this record. >+ >+=cut >+ >+sub holding_branch { >+ my ($self) = @_; >+ >+ my $branch = $self->_result->holdingbranch(); >+ return Koha::Library->_new_from_dbic($branch); >+} >+ > =head3 metadata > > my $metadata = $holding->metadata(); >@@ -52,9 +68,9 @@ Returns a Koha::Holding::Metadata object > sub metadata { > my ($self) = @_; > >- $self->{_metadata} ||= Koha::Holdings::Metadatas->find({ holding_id => $self->id }); >- >- return $self->{_metadata}; >+ my $metadata = $self->_result()->metadata(); >+ return unless $metadata; >+ return Koha::Holdings::Metadata->_new_from_dbic($metadata); > } > > =head3 set_marc >@@ -92,7 +108,15 @@ sub set_marc { > $self->{_marcxml} = $record->as_xml_record($encoding); > my $fields = $self->marc_to_koha_fields({ record => $record }); > delete $fields->{holding_id}; >- $self->set($fields); >+ # Filter the columns since we have e.g. public_note that's not stored in the database >+ my $columns = [$self->_result()->result_source()->columns()]; >+ my $db_fields = {}; >+ foreach my $key (keys %{$fields}) { >+ if (grep {/^$key$/} @{$columns}) { >+ $db_fields->{$key} = $fields->{$key}; >+ } >+ } >+ $self->set($db_fields); > > return $self; > } >@@ -110,9 +134,12 @@ or list of Koha::Item objects in list context. > sub items { > my ($self) = @_; > >- $self->{_items} ||= Koha::Items->search( { holding_id => $self->holding_id() } ); >+ my $items_rs = $self->_result->items; > >- return wantarray ? $self->{_items}->as_list : $self->{_items}; >+ return >+ wantarray >+ ? Koha::Items->_new_from_dbic($items_rs)->as_list >+ : Koha::Items->_new_from_dbic($items_rs); > } > > =head3 store >diff --git a/Koha/Template/Plugin/Holdings.pm b/Koha/Template/Plugin/Holdings.pm >index 6370630eb1..d4948b2f36 100644 >--- a/Koha/Template/Plugin/Holdings.pm >+++ b/Koha/Template/Plugin/Holdings.pm >@@ -56,8 +56,8 @@ sub GetLocation { > return ''; > } > >- if (ref($holding) ne 'HASH') { >- $holding = Koha::Holdings->find($holding)->unblessed; >+ if (ref($holding) ne 'Koha::Holding') { >+ $holding = Koha::Holdings->find($holding); > if (!$holding) { > return ''; > } >@@ -66,27 +66,22 @@ sub GetLocation { > my @parts; > > if ($opac) { >- if ($holding->{'holdingbranch'}) { >- my $query = "SELECT branchname FROM branches WHERE branchcode = ?"; >- my $sth = C4::Context->dbh->prepare($query); >- $sth->execute($holding->{'holdingbranch'}); >- my $b = $sth->fetchrow_hashref(); >- push @parts, $b->{'branchname'} if $b; >- $sth->finish(); >+ if (my $branch = $holding->holding_branch()) { >+ push @parts, $branch->branchname(); > } >- if ($holding->{'location'}) { >- my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->{'location'} }); >- push @parts, $av->next->opac_description if $av->count; >+ if ($holding->location()) { >+ my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $holding->location() }); >+ push @parts, $av->next()->opac_description() if $av->count; > } >- push @parts, $holding->{'callnumber'} if $holding->{'callnumber'}; >+ push @parts, $holding->callnumber() if $holding->callnumber(); > return join(' - ', @parts); > } > >- push @parts, $holding->{'holding_id'}; >- push @parts, $holding->{'holdingbranch'} if $holding->{'holdingbranch'}; >- push @parts, $holding->{'location'} if $holding->{'location'}; >- push @parts, $holding->{'ccode'} if $holding->{'ccode'}; >- push @parts, $holding->{'callnumber'} if $holding->{'callnumber'}; >+ push @parts, $holding->holding_id(); >+ push @parts, $holding->holdingbranch() if $holding->holdingbranch(); >+ push @parts, $holding->location() if $holding->location(); >+ push @parts, $holding->ccode() if $holding->ccode(); >+ push @parts, $holding->callnumber() if $holding->callnumber(); > return join(' ', @parts); > } > >@@ -106,13 +101,16 @@ sub GetDetails { > return ''; > } > >- if (ref($holding) eq 'HASH') { >- $holding = $holding->{'holding_id'}; >+ if (ref($holding) ne 'Koha::Holding') { >+ $holding = Koha::Holdings->find($holding); >+ if (!$holding) { >+ return ''; >+ } > } > >- my $holding_marc = Koha::Holdings->find($holding)->metadata()->record(); >+ my $holding_marc = $holding->metadata()->record(); > >- return Koha::Holding::marc_to_koha_fields({ record => $holding_marc }); >+ return Koha::Holding->marc_to_koha_fields({ record => $holding_marc }); > } > > 1; >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index f5485160a0..cd7b6c90ef 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -195,7 +195,7 @@ foreach my $subscription (@subscriptions) { > # Summary holdings > my $summary_holdings; > if (C4::Context->preference('SummaryHoldings')) { >- $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->unblessed; >+ $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef }); > } > > # Get acquisition details >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 0415d4ba7f..7e5adc308d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -11,7 +11,7 @@ CAN_user_serials_create_subscription ) %] > [% END %] > > [% IF ( show_summary_holdings && CAN_user_editcatalogue_edit_items ) %] >- <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber %]#addholding">New holdings record</a></li> >+ <li><a id="newholding" href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | uri %]#addholding">New holdings record</a></li> > [% END %] > > [% IF ( CAN_user_editcatalogue_edit_items ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 4e55a694d0..39841fb7b7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -145,7 +145,7 @@ > > <ul> > [% IF (show_summary_holdings) %] >- <li><a href="#summaryholdings">Holdings ([% summary_holdings.size() || 0 | html %])</a></li> >+ <li><a href="#summaryholdings">Holdings ([% summary_holdings.count() || 0 | html %])</a></li> > [% END %] > [% IF (SeparateHoldings) %] > <li> >@@ -197,7 +197,7 @@ > [% FOREACH holding IN summary_holdings %] > <tr> > <td class="branch">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( holding.holdingbranch ) | html %] [% END %]</td> >- <td class="location"><span class="shelvingloc">[% holding.location | html %][% IF ( holding.sub_location ) %] ([% holding.sub_location | html %])[% END %]</span> >+ <td class="location"><span class="shelvingloc">[% holding.location | html %]</span> > <td class="collection">[% holding.ccode | html %]</span> > <td class="itemcallnumber">[% IF ( holding.callnumber ) %] [% holding.callnumber | html %][% END %]</td> > <td class="status"> >@@ -207,9 +207,9 @@ > </td> > [% IF CAN_user_editcatalogue_edit_items %] > <td class="actions"> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#editholding"><i class="fa fa-pencil"></i> Edit</a> >- <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]"><i class="fa fa-eraser"></i> Delete</a> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber %]&holding_id=[% holding.holding_id %]#additema"><i class="fa fa-plus"></i> Add item</a> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/addholding.pl?op=edit&biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]#editholding"><i class="fa fa-pencil"></i> Edit</a> >+ <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/cataloguing/addholding.pl?op=delete&biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]"><i class="fa fa-eraser"></i> Delete</a> >+ <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% holding.biblionumber | uri %]&holding_id=[% holding.holding_id | uri %]#additema"><i class="fa fa-plus"></i> Add item</a> > <a class="btn btn-default btn-xs previewMARC" href="/cgi-bin/koha/catalogue/showmarc.pl?holding_id=[% holding.holding_id | uri %]&viewas=html" title="MARC">Show MARC</a> > </td> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt >index d8477efd5f..c441aa9473 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addholding.tt >@@ -8,117 +8,399 @@ > [% Asset.js("js/cataloging.js") | $raw %] > [% INCLUDE 'browser-strings.inc' %] > [% Asset.js("js/browser.js") | $raw %] >-<script type="text/javascript"> >-//<![CDATA[ >- var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >- browser.show(); >+[% Asset.css("css/addholding.css") | $raw %] >+[% INCLUDE 'select2.inc' %] >+[% IF ( bidi ) %] >+ [% Asset.css("css/right-to-left.css") | $raw %] >+[% END %] >+</head> >+<body id="cat_addholding" class="cat"> > >- $(window).load(function() { >- $("#loading").hide(); >- }); >- var Sticky; >- $(document).ready(function() { >- $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) { >- $("#"+ui.panel.id+" input:eq(0)").focus(); >- }); >+ <div id="loading"> >+ <div>Loading, please wait...</div> >+ </div> > >- [% IF tab %] >- $('#addholdingtabs').selectTabByID("#[% tab | html %]"); >- [% END %] >+[% INCLUDE 'header.inc' %] > >- Sticky = $("#toolbar"); >- Sticky.hcSticky({ >- stickTo: ".main", >- stickyClass: "floating" >- }); >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> >+ › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | uri %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a> >+ › <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | uri %]">Holdings</a> >+</div> > >- /* check cookie to hide/show marcdocs*/ >- if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >- toggleMARCdocLinks(false); >- } else { >- toggleMARCdocLinks(true); >- } >+<div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-md-10 col-md-offset-1"> > >- $("#marcDocsSelect").click(function(){ >- if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >- toggleMARCdocLinks(true); >- } else { >- toggleMARCdocLinks(false); >- } >- }); >+<h1> >+[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %] >+[% ELSE %]Add holdings record >+[% END %] >+</h1> > >- /* check cookie to hide/show marc tags*/ >- var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]"); >- if (marctags_cookie == 'hide'){ >- toggleMARCTagLinks(false); >- } else if( marctags_cookie == 'show'){ >- toggleMARCTagLinks(true) >- } else { >- [% UNLESS Koha.Preference("hide_marc") %] >- toggleMARCTagLinks(true) >- [% ELSE %] >- toggleMARCTagLinks(false); >- [% END %] >- } >+[% IF ( error_items_exist ) %]<div class="dialog alert"><strong>This holdings record has items attached.</strong> Please delete them first.</div>[% END %] >+[% IF ( error_delete_failed ) %]<div class="dialog alert"><strong>Error deleting the record.</strong></div>[% END %] > >- $("#marcTagsSelect").click(function(){ >- if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){ >- toggleMARCTagLinks(true) >- } else { >- toggleMARCTagLinks(false); >- } >- }); >+[% IF ( done ) %] >+ <script> >+ opener.document.forms['f'].holding_id.value=[% holding_id | html %]; >+ window.close(); >+ </script> >+[% ELSE %] >+ <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();"> >+ <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" /> >+ <input type="hidden" value="" id="current_tab" name="current_tab" /> >+[% END %] > >- $("#saverecord").click(function(){ >- $(".btn-group").removeClass("open"); >- onOption(); >- return false; >- }); >+<div id="toolbar" class="btn-toolbar"> >+ [% IF CAN_user_editcatalogue_edit_items %] >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >+ <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu"> >+ <li><a id="saveandview" href="#">Save and view record</a></li> >+ <li><a id="saveanditems" href="#">Save and edit items</a></li> >+ <li><a id="saveandcontinue" href="#">Save and continue editing</a></li> >+ </ul> >+ </div> >+ [% END %] > >- $("#saveandview").click(function(){ >- $(".btn-group").removeClass("open"); >- redirect("view"); >- return false; >- }); >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button> >+ <ul id="settings-menu" class="dropdown-menu"> >+ [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %] >+ [% # disabled until supported <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> %] >+ [% END %] >+ [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] >+ <li> >+ <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a> >+ <li> >+ <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a> >+ </li> >+ [% END %] >+ <li class="divider"></li> >+ <li class="nav-header">Change framework</li> >+ <li> >+ <a href="#" class="change-framework" data-frameworkcode=""> >+ [% IF ( frameworkcode ) %] >+ <i class="fa fa-fw"> </i> >+ [% ELSE %] >+ <i class="fa fa-fw fa-check"></i> >+ [% END %] >+ Default >+ </a> >+ </li> >+ [% FOREACH framework IN frameworks%] >+ <li> >+ <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]"> >+ [% IF framework.frameworkcode == frameworkcode %] >+ <i class="fa fa-fw fa-check"></i> >+ [% ELSE %] >+ <i class="fa fa-fw"> </i> >+ [% END %] >+ [% framework.frameworktext | html %] >+ </a> >+ </li> >+ [% END %] >+ </ul> >+ </div> >+ <div class="btn-group"> >+ <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a> >+ </div> >+</div> > >- $("#saveanditems").click(function(){ >- $(".btn-group").removeClass("open"); >- redirect("items"); >- return false; >- }); >- $("#saveandcontinue").click(function(){ >- $(".btn-group").removeClass("open"); >- var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href'); >- tab = tab.replace('#', ''); >- $("#current_tab").val(tab); >- redirect("just_save", tab); >- return false; >- }); >+[% IF ( popup ) %] >+ <input type="hidden" name="mode" value="popup" /> >+[% END %] >+ <input type="hidden" name="op" value="add" /> >+ <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >+ <input type="hidden" name="holding_id" value="[% holding_id | html %]" /> >+ <input type="hidden" name="changed_framework" value="" /> > >- $( '#switcheditor' ).click( function() { >+<div id="addholdingtabs" class="toptabs numbered"> >+ <ul> >+ [% FOREACH BIG_LOO IN BIG_LOOP %] >+ <li><a href="#tab[% BIG_LOO.number | uri %]XX">[% BIG_LOO.number | html %]</a></li> >+ [% END %] >+ </ul> > >- if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false; >+[% FOREACH BIG_LOO IN BIG_LOOP %] >+ <div id="tab[% BIG_LOO.number | html %]XX"> > >- $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } ); >+ [% FOREACH innerloo IN BIG_LOO.innerloop %] >+ [% IF ( innerloo.tag ) %] >+ <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >+ [% IF advancedMARCEditor %] >+ <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag | html %]</a> >+ [% ELSE %] >+ <span class="tagnum" title="[% innerloo.tag_lib | html %]">[% innerloo.tag | html %]</span> >+ [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a>[% END %] >+ [% END %] >+ [% IF ( innerloo.fixedfield ) %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ style="display:none;" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% ELSE %] >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator1 | html %]" /> >+ <input type="text" >+ tabindex="1" >+ class="indicator flat" >+ name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >+ size="1" >+ maxlength="1" >+ value="[% innerloo.indicator2 | html %]" /> >+ [% END %] - > >- var holding_id = [% holding_id || "''" | html %]; >- window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id; >+ [% UNLESS advancedMARCEditor %] >+ <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >+ [% END %] >+ <span class="field_controls"> >+ [% IF ( innerloo.repeatable ) %] >+ <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >+ </a> >+ [% END %] >+ <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >+ </a> >+ </span> > >- return false; >- } ); >- $(".change-framework").on("click", function(){ >- var frameworkcode = $(this).data("frameworkcode"); >- $("#frameworkcode").val( frameworkcode ); >- Changefwk(); >- }); >- }); >+ </div> > >-function redirect(dest){ >- $("#redirect").attr("value",dest); >- return Check(); >-} >+ [% FOREACH subfield_loo IN innerloo.subfield_loop %] >+ <!-- One line on the marc editor --> >+ <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> > >-[% IF ( CAN_user_editcatalogue_edit_items ) %] >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >+ [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >+ [% END %] >+ [% END %] >+ >+ <span class="subfieldcode"> >+ [% IF ( subfield_loo.fixedfield ) %] >+ <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% ELSE %] >+ <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >+ [% END %] >+ <input type="text" >+ title="[% subfield_loo.marc_lib | html %]" >+ style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >+ name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >+ value="[% subfield_loo.subfield | html %]" >+ size="1" >+ maxlength="1" >+ class="flat" >+ tabindex="0" /> >+ </span> >+ >+ [% UNLESS advancedMARCEditor %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >+ [% subfield_loo.marc_lib | html %] >+ [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >+ </span> >+ </label> >+ [% END %] >+ >+ [% SET mv = subfield_loo.marc_value %] >+ [% IF ( mv.type == 'text' ) %] >+ [% IF ( mv.readonly == 1 ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" /> >+ [% ELSE %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ [% END %] >+ [% IF ( mv.authtype ) %] >+ <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span> >+ [% END %] >+ [% ELSIF ( mv.type == 'text_complex' ) %] >+ <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >+ <span class="subfield_controls"> >+ [% IF mv.noclick %] >+ <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a> >+ [% ELSE %] >+ <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a> >+ [% END %] >+ </span> >+ [% mv.javascript | $raw %] >+ [% ELSIF ( mv.type == 'hidden' ) %] >+ <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >+ [% ELSIF ( mv.type == 'textarea' ) %] >+ <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value | html -%]</textarea> >+ [% ELSIF ( mv.type == 'select' ) %] >+ <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >+ [% FOREACH aval IN mv.values %] >+ [% IF aval == mv.default %] >+ <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >+ [% ELSE %] >+ <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >+ [% END %] >+ [% END %] >+ </select> >+ [% END %] >+ >+ <span class="subfield_controls"> >+ [% IF ( subfield_loo.repeatable ) %] >+ <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >+ </a> >+ <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >+ <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >+ </a> >+ [% END %] >+ </span> >+ >+ </div> >+ <!-- End of the line --> >+ [% END %] >+ >+ </div> >+ [% END %]<!-- if innerloo.tag --> >+ [% END %]<!-- BIG_LOO.innerloop --> >+ </div> >+[% END %]<!-- BIG_LOOP --> >+ >+</div><!-- tabs --> >+ >+</form> >+ >+</div> >+</div> >+</div> >+ >+<script> >+ var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10)); >+ browser.show(); >+ >+ $(window).load(function() { >+ $("#loading").hide(); >+ }); >+ var Sticky; >+ $(document).ready(function() { >+ $('#addholdingtabs').tabs().bind('show.ui-tabs', function(e, ui) { >+ $("#"+ui.panel.id+" input:eq(0)").focus(); >+ }); >+ >+ [% IF tab %] >+ $('#addholdingtabs').selectTabByID("#[% tab | html %]"); >+ [% END %] >+ >+ Sticky = $("#toolbar"); >+ Sticky.hcSticky({ >+ stickTo: ".main", >+ stickyClass: "floating" >+ }); >+ >+ /* check cookie to hide/show marcdocs*/ >+ if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCdocLinks(false); >+ } else { >+ toggleMARCdocLinks(true); >+ } >+ >+ $("#marcDocsSelect").click(function(){ >+ if($.cookie("marcdocs_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCdocLinks(true); >+ } else { >+ toggleMARCdocLinks(false); >+ } >+ }); >+ >+ /* check cookie to hide/show marc tags*/ >+ var marctags_cookie = $.cookie("marctags_[% borrowernumber | html %]"); >+ if (marctags_cookie == 'hide'){ >+ toggleMARCTagLinks(false); >+ } else if( marctags_cookie == 'show'){ >+ toggleMARCTagLinks(true) >+ } else { >+ [% UNLESS Koha.Preference("hide_marc") %] >+ toggleMARCTagLinks(true) >+ [% ELSE %] >+ toggleMARCTagLinks(false); >+ [% END %] >+ } >+ >+ $("#marcTagsSelect").click(function(){ >+ if( $.cookie("marctags_[% borrowernumber | html %]") == 'hide'){ >+ toggleMARCTagLinks(true) >+ } else { >+ toggleMARCTagLinks(false); >+ } >+ }); >+ >+ $("#saverecord").click(function(){ >+ $(".btn-group").removeClass("open"); >+ onOption(); >+ return false; >+ }); >+ >+ $("#saveandview").click(function(){ >+ $(".btn-group").removeClass("open"); >+ redirect("view"); >+ return false; >+ }); >+ >+ $("#saveanditems").click(function(){ >+ $(".btn-group").removeClass("open"); >+ redirect("items"); >+ return false; >+ }); >+ $("#saveandcontinue").click(function(){ >+ $(".btn-group").removeClass("open"); >+ var tab = $("#addholdingtabs li.ui-tabs-active:first a").attr('href'); >+ tab = tab.replace('#', ''); >+ $("#current_tab").val(tab); >+ redirect("just_save", tab); >+ return false; >+ }); >+ >+ $( '#switcheditor' ).click( function() { >+ >+ if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return false; >+ >+ $.cookie( 'catalogue_editor_[% USER_INFO.borrowernumber | html %]', 'advanced', { expires: 365, path: '/' } ); >+ >+ var holding_id = [% holding_id || "''" | html %]; >+ window.location = '/cgi-bin/koha/cataloguing/editor.pl#catalog/' + biblionumber + '/holdings/' + holding_id; >+ >+ return false; >+ } ); >+ $(".change-framework").on("click", function(){ >+ var frameworkcode = $(this).data("frameworkcode"); >+ $("#frameworkcode").val( frameworkcode ); >+ Changefwk(); >+ }); >+ }); >+ >+function redirect(dest){ >+ $("#redirect").attr("value",dest); >+ return Check(); >+} >+ >+[% IF ( CAN_user_editcatalogue_edit_items ) %] > var onOption = function () { > return Check(); > } >@@ -329,296 +611,10 @@ function Changefwk() { > f.submit(); > } > >-//]]> >-</script> >-[% Asset.css("css/addholding.css") | $raw %] >- >-[% INCLUDE 'select2.inc' %] >-<script> >- $(document).ready(function() { >+$(document).ready(function() { > $('.subfield_line select').select2(); >- }); >+}); > </script> > >-[% IF ( bidi ) %] >- [% Asset.css("css/right-to-left.css") | $raw %] >-[% END %] >-</head> >-<body id="cat_addholding" class="cat"> >- >- <div id="loading"> >- <div>Loading, please wait...</div> >- </div> >- >-[% INCLUDE 'header.inc' %] >- >-<div id="breadcrumbs"> >- <a href="/cgi-bin/koha/mainpage.pl">Home</a> >- › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> >- › Edit <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">[% title | html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber | html %])</a> >- › <a href="/cgi-bin/koha/cataloguing/addholding.pl?biblionumber=[% biblionumber | html %]">Holdings</a> >-</div> >- >-<div class="main container-fluid"> >- <div class="row"> >- <div class="col-md-10 col-md-offset-1"> >- >-<h1> >-[% IF ( holding_id ) %]Editing holdings record number [% holding_id | html %] >-[% ELSE %]Add holdings record >-[% END %] >-</h1> >- >-[% IF ( error_items_exist ) %]<div class="dialog alert"><strong>This holdings record has items attached.</strong> Please delete them first.</div>[% END %] >-[% IF ( error_delete_failed ) %]<div class="dialog alert"><strong>Error deleting the record.</strong></div>[% END %] >- >-[% IF ( done ) %] >- <script type="text/javascript"> >- opener.document.forms['f'].holding_id.value=[% holding_id | html %]; >- window.close(); >- </script> >-[% ELSE %] >- <form method="post" name="f" id="f" action="/cgi-bin/koha/cataloguing/addholding.pl" onsubmit="return Check();"> >- <input type="hidden" value="[% IF ( holding_id ) %]view[% ELSE %]holdings[% END %]" id="redirect" name="redirect" /> >- <input type="hidden" value="" id="current_tab" name="current_tab" /> >-[% END %] >- >-<div id="toolbar" class="btn-toolbar"> >- [% IF CAN_user_editcatalogue_edit_items %] >- <div class="btn-group"> >- <button class="btn btn-default btn-sm" id="saverecord"><i class="fa fa-save"></i> Save</button> >- <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >- <span class="caret"></span> >- </button> >- <ul class="dropdown-menu"> >- <li><a id="saveandview" href="#">Save and view record</a></li> >- <li><a id="saveanditems" href="#">Save and edit items</a></li> >- <li><a id="saveandcontinue" href="#">Save and continue editing</a></li> >- </ul> >- </div> >- [% END %] >- >- <div class="btn-group"> >- <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-cog"></i> Settings <span class="caret"></span></button> >- <ul id="settings-menu" class="dropdown-menu"> >- [% IF Koha.Preference( 'EnableAdvancedCatalogingEditor' ) == 1 %] >- [% # disabled until supported <li><a href="#" id="switcheditor">Switch to advanced editor</a></li> %] >- [% END %] >- [% IF marcflavour != 'NORMARC' AND NOT advancedMARCEditor %] >- <li> >- <a href="#" id="marcDocsSelect"><i class="fa fa-check-square-o"></i> Show MARC tag documentation links</a> >- <li> >- <a href="#" id="marcTagsSelect"><i class="fa fa-check-square-o"></i> Show tags</a> >- </li> >- [% END %] >- <li class="divider"></li> >- <li class="nav-header">Change framework</li> >- <li> >- <a href="#" class="change-framework" data-frameworkcode=""> >- [% IF ( frameworkcode ) %] >- <i class="fa fa-fw"> </i> >- [% ELSE %] >- <i class="fa fa-fw fa-check"></i> >- [% END %] >- Default >- </a> >- </li> >- [% FOREACH framework IN frameworks%] >- <li> >- <a href="#" class="change-framework" data-frameworkcode="[% framework.frameworkcode | html %]"> >- [% IF framework.frameworkcode == frameworkcode %] >- <i class="fa fa-fw fa-check"></i> >- [% ELSE %] >- <i class="fa fa-fw"> </i> >- [% END %] >- [% framework.frameworktext | html %] >- </a> >- </li> >- [% END %] >- </ul> >- </div> >- <div class="btn-group"> >- <a class="btn btn-default btn-sm" id="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a> >- </div> >-</div> >- >-[% IF ( popup ) %] >- <input type="hidden" name="mode" value="popup" /> >-[% END %] >- <input type="hidden" name="op" value="add" /> >- <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode | html %]" /> >- <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" /> >- <input type="hidden" name="holding_id" value="[% holding_id | html %]" /> >- <input type="hidden" name="changed_framework" value="" /> >- >-<div id="addholdingtabs" class="toptabs numbered"> >- <ul> >- [% FOREACH BIG_LOO IN BIG_LOOP %] >- <li><a href="#tab[% BIG_LOO.number | html %]XX">[% BIG_LOO.number | html %]</a></li> >- [% END %] >- </ul> >- >-[% FOREACH BIG_LOO IN BIG_LOOP %] >- <div id="tab[% BIG_LOO.number | html %]XX"> >- >- [% FOREACH innerloo IN BIG_LOO.innerloop %] >- [% IF ( innerloo.tag ) %] >- <div class="tag" id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- <div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]"> >- [% IF advancedMARCEditor %] >- <a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to Expand this Tag" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;">[% innerloo.tag %]</a> >- [% ELSE %] >- <span class="tagnum" title="[% innerloo.tag_lib %]">[% innerloo.tag | html %]</span> >- [% IF marcflavour != 'NORMARC' %]<a href="#" class="marcdocs" onclick="PopupMARCFieldDoc('[% innerloo.tag | html %]'); return false;"> ?</a>[% END %] >- [% END %] >- [% IF ( innerloo.fixedfield ) %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- style="display:none;" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% ELSE %] >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator1_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator1 | html %]" /> >- <input type="text" >- tabindex="1" >- class="indicator flat" >- name="tag_[% innerloo.tag | html %]_indicator2_[% innerloo.index | html %][% innerloo.random | html %]" >- size="1" >- maxlength="1" >- value="[% innerloo.indicator2 | html %]" /> >- [% END %] - >- >- [% UNLESS advancedMARCEditor %] >- <a href="#" tabindex="1" class="expandfield" onclick="ExpandField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Click to Expand this Tag">[% innerloo.tag_lib | html %]</a> >- [% END %] >- <span class="field_controls"> >- [% IF ( innerloo.repeatable ) %] >- <a href="#" tabindex="1" class="buttonPlus" onclick="CloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]','0','[% advancedMARCEditor | html %]'); return false;" title="Repeat this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/repeat-tag.png" alt="Repeat this Tag" /> >- </a> >- [% END %] >- <a href="#" tabindex="1" class="buttonMinus" onclick="UnCloneField('tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'); return false;" title="Delete this Tag"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-tag.png" alt="Delete this Tag" /> >- </a> >- </span> >- >- </div> >- >- [% FOREACH subfield_loo IN innerloo.subfield_loop %] >- <!-- One line on the marc editor --> >- <div class="subfield_line" style="[% subfield_loo.visibility | html %]" id="subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]"> >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.fixedfield ) %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" style="display:none;" class="labelsubfield"> >- [% ELSE %]<label for="tag_[% subfield_loo.tag | html %]_subfield_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" class="labelsubfield"> >- [% END %] >- [% END %] >- >- <span class="subfieldcode"> >- [% IF ( subfield_loo.fixedfield ) %] >- <img class="buttonUp" style="display:none;" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% ELSE %] >- <img class="buttonUp" src="[% interface | html %]/[% theme | html %]/img/up.png" onclick="upSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]')" alt="Move Up" title="Move Up" /> >- [% END %] >- <input type="text" >- title="[% subfield_loo.marc_lib | html %]" >- style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;" >- name="tag_[% subfield_loo.tag | html %]_code_[% subfield_loo.subfield | html %]_[% subfield_loo.index | html %]_[% subfield_loo.index_subfield | html %]" >- value="[% subfield_loo.subfield | html %]" >- size="1" >- maxlength="1" >- class="flat" >- tabindex="0" /> >- </span> >- >- [% UNLESS advancedMARCEditor %] >- [% IF ( subfield_loo.mandatory ) %]<span class="subfield subfield_mandatory">[% ELSE %]<span class="subfield">[% END %] >- [% subfield_loo.marc_lib %] >- [% IF ( subfield_loo.mandatory ) %]<span class="mandatory_marker" title="This field is mandatory">*</span>[% END %] >- </span> >- </label> >- [% END %] >- >- [% SET mv = subfield_loo.marc_value %] >- [% IF ( mv.type == 'text' ) %] >- [% IF ( mv.readonly == 1 ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor readonly" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" readonly="readonly" /> >- [% ELSE %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >- [% END %] >- [% IF ( mv.authtype ) %] >- <span class="subfield_controls"><a href="#" class="buttonDot tag_editor" onclick="openAuth(this.parentNode.parentNode.getElementsByTagName('input')[1].id,'[%- mv.authtype | html -%]','holding'); return false;" tabindex="1" title="Tag editor">Tag editor</a></span> >- [% END %] >- [% ELSIF ( mv.type == 'text_complex' ) %] >- <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor framework_plugin" tabindex="1" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" /> >- <span class="subfield_controls"> >- [% IF mv.noclick %] >- <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup"></a> >- [% ELSE %] >- <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" tabindex="1" title="Tag editor">Tag editor</a> >- [% END %] >- </span> >- [% mv.javascript %] >- [% ELSIF ( mv.type == 'hidden' ) %] >- <input tabindex="1" type="hidden" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" size="[%- mv.size | html -%]" maxlength="[%- mv.maxlength | html -%]" value="[%- mv.value | html -%]" /> >- [% ELSIF ( mv.type == 'textarea' ) %] >- <textarea cols="70" rows="4" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" class="input_marceditor" tabindex="1">[%- mv.value -%]</textarea> >- [% ELSIF ( mv.type == 'select' ) %] >- <select name="[%- mv.name | html -%]" tabindex="1" size="1" class="input_marceditor" id="[%- mv.id | html -%]"> >- [% FOREACH aval IN mv.values %] >- [% IF aval == mv.default %] >- <option value="[%- aval | html -%]" selected="selected">[%- mv.labels.$aval | html -%]</option> >- [% ELSE %] >- <option value="[%- aval | html -%]">[%- mv.labels.$aval | html -%]</option> >- [% END %] >- [% END %] >- </select> >- [% END %] >- >- <span class="subfield_controls"> >- [% IF ( subfield_loo.repeatable ) %] >- <a href="#" class="buttonPlus" tabindex="1" onclick="CloneSubfield('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]','[% advancedMARCEditor | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/clone-subfield.png" alt="Clone" title="Clone this subfield" /> >- </a> >- <a href="#" class="buttonMinus" tabindex="1" onclick="UnCloneField('subfield[% subfield_loo.tag | html %][% subfield_loo.subfield | html %][% subfield_loo.random | html %]'); return false;"> >- <img src="[% interface | html %]/[% theme | html %]/img/delete-subfield.png" alt="Delete" title="Delete this subfield" /> >- </a> >- [% END %] >- </span> >- >- </div> >- <!-- End of the line --> >- [% END %] >- >- </div> >- [% END %]<!-- if innerloo.tag --> >- [% END %]<!-- BIG_LOO.innerloop --> >- </div> >-[% END %]<!-- BIG_LOOP --> >- >-</div><!-- tabs --> >- >-</form> >- >-</div> >-</div> >-</div> > > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt >index 4644402919..3e6f0c59aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008_holdings.tt >@@ -164,31 +164,30 @@ > </table> > <fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript">//<![CDATA[ >+<script> > function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index | html %]"); >+ var doc = opener.document; >+ var field = doc.getElementById("[% index | html %]"); > >- field.value = >- document.f_pop.f1.value+ >- document.f_pop.f6.value+ >- document.f_pop.f7.value+ >- (document.f_pop.f8.value + ' ').substr(0, 4)+ >- document.f_pop.f12.value+ >- document.f_pop.f13.value+ >- document.f_pop.f14.value+ >- document.f_pop.f15.value+ >- document.f_pop.f16.value+ >- (document.f_pop.f17.value + ' ').substr(0, 3)+ >- document.f_pop.f20.value+ >- document.f_pop.f21.value+ >- (document.f_pop.f22.value + ' ').substr(0, 3)+ >- document.f_pop.f25.value+ >- document.f_pop.f26.value; >+ field.value = >+ document.f_pop.f1.value+ >+ document.f_pop.f6.value+ >+ document.f_pop.f7.value+ >+ (document.f_pop.f8.value + ' ').substr(0, 4)+ >+ document.f_pop.f12.value+ >+ document.f_pop.f13.value+ >+ document.f_pop.f14.value+ >+ document.f_pop.f15.value+ >+ document.f_pop.f16.value+ >+ (document.f_pop.f17.value + ' ').substr(0, 3)+ >+ document.f_pop.f20.value+ >+ document.f_pop.f21.value+ >+ (document.f_pop.f22.value + ' ').substr(0, 3)+ >+ document.f_pop.f25.value+ >+ document.f_pop.f26.value; > self.close(); > return false; > } >- //]]> > </script> > > [% INCLUDE 'popup-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt >index 7ef2a43663..526bc848b0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_holdings.tt >@@ -80,26 +80,24 @@ > </table> > <fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset> > </form> >-<script type="text/javascript"> >-//<![CDATA[ >-function report() { >- var doc = opener.document; >- var field = doc.getElementById("[% index | html %]"); >+<script> >+ function report() { >+ var doc = opener.document; >+ var field = doc.getElementById("[% index | html %]"); > >- field.value = >- ' '+ >- document.f_pop.f5.value+ >- document.f_pop.f6.value+ >- ' '+ >- 'a'+ // MARC21 UNICODE flag - must be 'a' for Koha >- '22 '+ >- document.f_pop.f17.value+ >- document.f_pop.f18.value+ >- ' '+ >- '4500'; >+ field.value = >+ ' '+ >+ document.f_pop.f5.value+ >+ document.f_pop.f6.value+ >+ ' '+ >+ 'a'+ // MARC21 UNICODE flag - must be 'a' for Koha >+ '22 '+ >+ document.f_pop.f17.value+ >+ document.f_pop.f18.value+ >+ ' '+ >+ '4500'; > self.close(); > return false; > } >- //]]> > </script> > [% INCLUDE 'popup-bottom.inc' %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 5288aaf373..33e4289ddc 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -750,7 +750,7 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { > > # Fetch summary holdings > if (C4::Context->preference('SummaryHoldings')) { >- my $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef })->unblessed; >+ my $summary_holdings = Koha::Holdings->search({ biblionumber => $biblionumber, deleted_on => undef }); > $template->param( summary_holdings => $summary_holdings ); > } > >diff --git a/t/db_dependent/Koha/Holding.t b/t/db_dependent/Koha/Holding.t >index 1149c3392e..fd099345d8 100644 >--- a/t/db_dependent/Koha/Holding.t >+++ b/t/db_dependent/Koha/Holding.t >@@ -23,12 +23,10 @@ use t::lib::TestBuilder; > > use C4::Biblio; > >-use Koha::BiblioFramework; > use Koha::BiblioFrameworks; > use Koha::Database; > use Koha::Libraries; > use Koha::Library; >-use Koha::MarcSubfieldStructure; > use Koha::MarcSubfieldStructures; > > BEGIN { >@@ -40,7 +38,7 @@ my $schema = Koha::Database->new->schema; > > subtest 'Koha::Holding tests' => sub { > >- plan tests => 17; >+ plan tests => 19; > > $schema->storage->txn_begin; > >@@ -109,6 +107,10 @@ subtest 'Koha::Holding tests' => sub { > is($holding->frameworkcode(), $frameworkcode, 'Framework code correct in Koha::Holding object'); > is($holding->holdingbranch(), 'ABC', 'Location correct in Koha::Holding object'); > >+ my $branch = $holding->holding_branch(); >+ is(ref $branch, 'Koha::Library', 'holding_branch() returns a Koha::Library object'); >+ is($branch->branchname(), 'Abc', 'holding_branch() returns correct library'); >+ > my $metadata = $holding->metadata; > is( ref $metadata, 'Koha::Holdings::Metadata', 'Method metadata() returned a Koha::Holdings::Metadata object'); > >diff --git a/t/db_dependent/Koha/Holdings.t b/t/db_dependent/Koha/Holdings.t >index 36d73f876c..df53befdf5 100644 >--- a/t/db_dependent/Koha/Holdings.t >+++ b/t/db_dependent/Koha/Holdings.t >@@ -23,10 +23,8 @@ use t::lib::TestBuilder; > > use C4::Biblio; > >-use Koha::BiblioFramework; > use Koha::BiblioFrameworks; > use Koha::Database; >-use Koha::MarcSubfieldStructure; > use Koha::MarcSubfieldStructures; > > BEGIN { >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20447
:
73703
|
73704
|
76485
|
76542
|
76670
|
76671
|
76672
|
76735
|
76736
|
78178
|
78179
|
78180
|
78738
|
78739
|
78740
|
78907
|
79403
|
79413
|
79565
|
79566
|
79567
|
79568
|
79569
|
79570
|
79812
|
79813
|
79814
|
79815
|
79816
|
79819
|
80320
|
80321
|
80322
|
80323
|
80324
|
80823
|
80824
|
80825
|
80826
|
80827
|
81264
|
81265
|
81266
|
81267
|
81268
|
82669
|
82670
|
82671
|
82672
|
82673
|
83550
|
83551
|
83552
|
83553
|
83554
|
83555
|
83556
|
83557
|
83558
|
83559
|
85364
|
85368
|
85369
|
85370
|
85371
|
85416
|
85417
|
85418
|
85419
|
85906
|
85907
|
85908
|
85909
|
85994
|
85995
|
85996
|
85997
|
86088
|
86089
|
86090
|
86091
|
87307
|
87308
|
87309
|
87310
|
87346
|
87347
|
87348
|
87349
|
88751
|
88752
|
88753
|
88754
|
88755
|
91743
|
91744
|
91745
|
91746
|
91747
|
94539
|
94540
|
94541
|
94542
|
97796
|
97797
|
97798
|
97799
|
97800
|
97843
|
97844
|
97845
|
97846
|
99143
|
99144
|
99145
|
99146
|
99176
|
99177
|
99178
|
99179
|
99235
|
99236
|
99237
|
99238
|
99239
|
105068
|
105069
|
105070
|
105071
|
105072
|
105259
|
105260
|
105261
|
105262
|
105263
|
106147
|
106148
|
106149
|
106150
|
106151
|
108250
|
108251
|
108252
|
108253
|
108254
|
108255
|
108336
|
108337
|
108338
|
108339
|
108340
|
108341
|
108789
|
108790
|
108791
|
108792
|
108793
|
108794
|
109695
|
109696
|
109697
|
109698
|
109699
|
109700
|
109703
|
109704
|
109705
|
109706
|
109707
|
109708
|
109711
|
109712
|
109713
|
109714
|
109715
|
109717
|
109718
|
109719
|
109720
|
109721
|
109722
|
109741
|
109742
|
109743
|
109744
|
109745
|
109746
|
109765
|
109766
|
109767
|
109768
|
109769
|
109770
|
109873
|
109874
|
109875
|
109877
|
109878
|
109879
|
110115
|
110174
|
110313
|
110314
|
110315
|
110316
|
110317
|
110318
|
110319
|
110320
|
110467
|
110468
|
110469
|
110471
|
110472
|
110473
|
110474
|
110475
|
112176
|
112177
|
112179
|
112180
|
112181
|
112182
|
112189
|
112190
|
112191
|
112192
|
112193
|
112194
|
112570
|
112571
|
112572
|
112573
|
112574
|
112575
|
113943
|
113944
|
113945
|
113946
|
113947
|
113948
|
113952
|
113953
|
113954
|
113955
|
113956
|
113957
|
113958
|
113959
|
115239
|
115240
|
115241
|
115242
|
115243
|
115244
|
115245
|
115654
|
115655
|
115656
|
115657
|
115658
|
115659
|
115660
|
115722
|
115723
|
115724
|
115725
|
115726
|
115727
|
115728
|
115729
|
116797
|
116798
|
116799
|
116800
|
116801
|
116802
|
116803
|
116804
|
116805
|
116806
|
116807
|
116808
|
116809
|
116810
|
116811
|
116812
|
118382
|
118383
|
118385
|
118386
|
118387
|
118388
|
118389
|
118390
|
118397
|
118398
|
118399
|
118400
|
118401
|
118402
|
118403
|
118404
|
118405
|
118406
|
118407
|
118408
|
118409
|
118410
|
118411
|
118412
|
118429
|
118430
|
118431
|
118432
|
118433
|
118434
|
118435
|
118436
|
118527
|
118528
|
118529
|
118530
|
118531
|
118532
|
118533
|
118534
|
118535
|
118536
|
119265
|
119266
|
119267
|
119268
|
119269
|
119270
|
119271
|
119272
|
119273
|
119274
|
119514
|
119515
|
119516
|
119517
|
119518
|
119519
|
119520
|
119521
|
119522
|
119523
|
119570
|
119571
|
121216
|
121217
|
121220
|
121221
|
121222
|
121223
|
121226
|
121227
|
121228
|
121229
|
121230
|
121231
|
121379
|
121380
|
121381
|
121382
|
121383
|
121406
|
121407
|
121408
|
121409
|
121410
|
122501
|
122502
|
122503
|
122504
|
122505
|
122851
|
122852
|
122853
|
122854
|
122855
|
122856
|
122891
|
122892
|
122893
|
122894
|
122895
|
122896
|
122897
|
123047
|
123048
|
123049
|
123050
|
123051
|
123052
|
123053
|
123054
|
123055
|
123056
|
123057
|
123058
|
123059
|
123060
|
123061
|
124012
|
124013
|
124014
|
124015
|
124016
|
124017
|
124018
|
124944
|
124945
|
124946
|
124947
|
124948
|
124949
|
124950
|
126204
|
126205
|
126206
|
126207
|
126208
|
126209
|
126210
|
126211
|
126212
|
126296
|
126391
|
126392
|
126394
|
126395
|
126396
|
126397
|
126398
|
126399
|
126400
|
126401
|
126402
|
126403
|
126404
|
126405
|
126932
|
126933
|
126934
|
126935
|
126936
|
126937
|
126938
|
126939
|
126940
|
126941
|
126942
|
126943
|
127040
|
128079
|
128131
|
128134
|
130776
|
130777
|
130778
|
130779
|
130780
|
130781
|
130782
|
130783
|
130784
|
130785
|
130786
|
130787
|
130788
|
130789
|
130790
|
130791
|
130792
|
130793
|
130794
|
130795
|
130796
|
130797
|
130798
|
130799
|
130800
|
130801
|
130802
|
130803
|
130804
|
130805
|
130806
|
130807
|
131458
|
131459
|
131460
|
131461
|
131462
|
131463
|
131464
|
131465
|
131466
|
131467
|
131468
|
131469
|
131470
|
131471
|
131472
|
131473
|
131474
|
131475
|
131476
|
131477
|
131478
|
131479
|
131480
|
131481
|
131482
|
139865
|
139866
|
139867
|
139868
|
139869
|
139870
|
139871
|
139872
|
139873
|
139874
|
139875
|
139876
|
139877
|
139878
|
139879
|
139880
|
139881
|
139882
|
139883
|
139884
|
139885
|
139886
|
139887
|
139888
|
139889
|
139890
|
139891
|
139892
|
139893
|
139894
|
139895
|
139896
|
157492
|
157493