Bugzilla – Attachment 55689 Details for
Bug 15801
Move the framework related code to Koha::BiblioFramework[s] - part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
Bug-15801-KohaBiblioFrameworks---Remove-C4Kohagetf.patch (text/plain), 27.66 KB, created by
Jonathan Druart
on 2016-09-19 09:11:09 UTC
(
hide
)
Description:
Bug 15801: Koha::BiblioFrameworks - Remove C4::Koha::getframeworks
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-09-19 09:11:09 UTC
Size:
27.66 KB
patch
obsolete
>From 97a417013d8e51258e20f717a3169ab72a3f3dd4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Feb 2016 16:56:01 +0000 >Subject: [PATCH] Bug 15801: Koha::BiblioFrameworks - Remove > C4::Koha::getframeworks > >C4::Koha::getframeworks returned a hashref of biblio frameworks. >It was mainly used to generate the dropdown list of frameworks. >The scripts modified in this patch did not necessary order the element >by description (frameworktext), the displays were not consistent from >one screen to another. >Using the same search method everywhere: > Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >We will know always get the framework in the same order. > >Test plan: >Following the different pages modified by this patch, and make sure the >frameworks are displayed correctly in the dropdown list: >1/ acqui/z3950_search.pl - Create an order from an external source. >2/ admin/fieldmapping.pl - Define some mappings keyword / MARC field >3/ admin/marctagstructure.pl - On the MARC frameworks admin page, select >another framework than the default one and click on the 'Search' button >4/ catalogue/MARCdetail.pl - On the MARC defail page, change the >framework you want to use to display the record >5/ cataloguing/addbiblio.pl - Add or edit a biblio record, change its >framework. When editing, the framework of the record should be selected >by default >6/ cataloguing/addbooks.pl - Go on the cataloguing home page and click >on the "New record" button. You should see all the frameworks >7/ cataloguing/merge.pl - Select 2 biblio records to merge. On the first >step (select the merge reference), you should be allowed to select the >framework to use. >8/ tools/inventory.pl - On the inventory page, the "Item statuses" part >should be populated as before this patch >9/ tools/manage-marc-import.pl - Stage records for import. Before >importing them into the catalog, you should see the framework dropdown >list. > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Works Ok. >No errors >--- > C4/Koha.pm | 57 +--------------------- > acqui/z3950_search.pl | 18 ++----- > admin/fieldmapping.pl | 42 +++++----------- > admin/marctagstructure.pl | 17 ++----- > catalogue/MARCdetail.pl | 21 +++----- > cataloguing/addbiblio.pl | 10 ++-- > cataloguing/addbooks.pl | 15 ++---- > cataloguing/merge.pl | 16 ++---- > .../prog/en/modules/acqui/z3950_search.tt | 8 +-- > .../prog/en/modules/admin/fieldmapping.tt | 26 +++++----- > .../prog/en/modules/admin/marctagstructure.tt | 8 +-- > .../prog/en/modules/catalogue/MARCdetail.tt | 8 ++- > .../prog/en/modules/cataloguing/addbooks.tt | 8 +-- > .../prog/en/modules/cataloguing/merge.tt | 12 +---- > .../prog/en/modules/tools/manage-marc-import.tt | 2 +- > tools/inventory.pl | 9 ++-- > tools/manage-marc-import.pl | 12 ++--- > 17 files changed, 82 insertions(+), 207 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 82c990a..bd4214e 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -40,7 +40,7 @@ BEGIN { > &GetPrinters &GetPrinter > &GetItemTypes &getitemtypeinfo > &GetItemTypesCategorized &GetItemTypesByCategory >- &getframeworks &getframeworkinfo >+ &getframeworkinfo > &getallthemes > &getFacets > &getnbpages >@@ -227,61 +227,6 @@ sub GetItemTypesByCategory { > return @$tmp; > } > >-=head2 getframework >- >- $frameworks = &getframework(); >- >-Returns information about existing frameworks >- >-build a HTML select with the following code : >- >-=head3 in PERL SCRIPT >- >- my $frameworks = getframeworks(); >- my @frameworkloop; >- foreach my $thisframework (keys %$frameworks) { >- my $selected = 1 if $thisframework eq $frameworkcode; >- my %row =( >- value => $thisframework, >- selected => $selected, >- description => $frameworks->{$thisframework}->{'frameworktext'}, >- ); >- push @frameworksloop, \%row; >- } >- $template->param(frameworkloop => \@frameworksloop); >- >-=head3 in TEMPLATE >- >- <form action="[% script_name %] method=post> >- <select name="frameworkcode"> >- <option value="">Default</option> >- [% FOREACH framework IN frameworkloop %] >- [% IF ( framework.selected ) %] >- <option value="[% framework.value %]" selected="selected">[% framework.description %]</option> >- [% ELSE %] >- <option value="[% framework.value %]">[% framework.description %]</option> >- [% END %] >- [% END %] >- </select> >- <input type=text name=searchfield value="[% searchfield %]"> >- <input type="submit" value="OK" class="button"> >- </form> >- >-=cut >- >-sub getframeworks { >- >- # returns a reference to a hash of references to branches... >- my %itemtypes; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("select * from biblio_framework"); >- $sth->execute; >- while ( my $IT = $sth->fetchrow_hashref ) { >- $itemtypes{ $IT->{'frameworkcode'} } = $IT; >- } >- return ( \%itemtypes ); >-} >- > =head2 getframeworkinfo > > $frameworkinfo = &getframeworkinfo($frameworkcode); >diff --git a/acqui/z3950_search.pl b/acqui/z3950_search.pl >index b2b5124..061bd46 100755 >--- a/acqui/z3950_search.pl >+++ b/acqui/z3950_search.pl >@@ -30,10 +30,10 @@ use C4::Breeding; > use C4::Koha; > > use Koha::Acquisition::Bookseller; >+use Koha::BiblioFrameworks; > > my $input = new CGI; > my $biblionumber = $input->param('biblionumber')||0; >-my $frameworkcode = $input->param('frameworkcode')||''; > my $title = $input->param('title'); > my $author = $input->param('author'); > my $isbn = $input->param('isbn'); >@@ -50,18 +50,7 @@ my $page = $input->param('current_page') || 1; > $page = $input->param('goto_page') if $input->param('changepage_goto'); > > # get framework list >-my $frameworks = getframeworks; >-my @frameworkcodeloop; >-foreach my $thisframeworkcode ( keys %$frameworks ) { >- my %row = ( >- value => $thisframeworkcode, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- ); >- if ( $row{'value'} eq $frameworkcode){ >- $row{'active'} = 'true'; >- } >- push @frameworkcodeloop, \%row; >-} >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); > > my $vendor = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); > >@@ -74,8 +63,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > $template->param( >- frameworkcode => $frameworkcode, >- frameworkcodeloop => \@frameworkcodeloop, >+ frameworks => $frameworks, > booksellerid => $booksellerid, > basketno => $basketno, > name => $vendor->{'name'}, >diff --git a/admin/fieldmapping.pl b/admin/fieldmapping.pl >index 05b5202..75fd892 100755 >--- a/admin/fieldmapping.pl >+++ b/admin/fieldmapping.pl >@@ -24,10 +24,11 @@ use C4::Biblio; > use C4::Koha; > use C4::Output; > >-my $query = new CGI; >+use Koha::BiblioFrameworks; > >-my $framework = $query->param('framework') || ""; >+my $query = new CGI; > >+my $frameworkcode = $query->param('framework') || ""; > my $field = $query->param('fieldname'); > my $fieldcode = $query->param('marcfield'); > my $subfieldcode = $query->param('marcsubfield'); >@@ -43,42 +44,25 @@ my ($template, $loggedinuser, $cookie) > debug => 1, > }); > >-# get framework list >-my $frameworks = getframeworks(); >-my @frameworkloop; >-my $selected; >-my $frameworktext; >-foreach my $thisframeworkcode (keys %$frameworks) { >- if ($thisframeworkcode eq $framework){ >- $selected = 1; >- $frameworktext = $frameworks->{$thisframeworkcode}->{'frameworktext'}; >- } else { >- $selected = 0; >- } >- my %row =(value => $thisframeworkcode, >- selected => $selected, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- ); >- push @frameworkloop, \%row; >-} >- > if($op eq "delete" and $id){ > DeleteFieldMapping($id); >- print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$framework); >+ print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$frameworkcode); > exit; > } > > # insert operation > if($field and $fieldcode){ >- SetFieldMapping($framework, $field, $fieldcode, $subfieldcode); >+ SetFieldMapping($frameworkcode, $field, $fieldcode, $subfieldcode); > } > >-my $fieldloop = GetFieldMapping($framework); >+my $fieldloop = GetFieldMapping($frameworkcode); > >-$template->param( frameworkloop => \@frameworkloop, >- framework => $framework, >- frameworktext => $frameworktext, >- fields => $fieldloop, >- ); >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >+my $framework = $frameworks->search( { frameworkcode => $frameworkcode } )->next; >+$template->param( >+ frameworks => $frameworks, >+ framework => $framework, >+ fields => $fieldloop, >+); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl >index 784fb50..5fcb0b1 100755 >--- a/admin/marctagstructure.pl >+++ b/admin/marctagstructure.pl >@@ -28,6 +28,7 @@ use C4::Output; > use C4::Context; > > use Koha::Caches; >+use Koha::BiblioFrameworks; > > # retrieve parameters > my $input = new CGI; >@@ -58,16 +59,7 @@ my ($template, $loggedinuser, $cookie) > debug => 1, > }); > >-# get framework list >-my $frameworks = getframeworks(); >-my @frameworkloop; >-foreach my $thisframeworkcode (keys %$frameworks) { >- push @frameworkloop, { >- value => $thisframeworkcode, >- selected => ($thisframeworkcode eq $frameworkcode) ? 1 : 0, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- }; >-} >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); > > # check that framework is defined in marc_tag_structure > my $sth=$dbh->prepare("select count(*) from marc_tag_structure where frameworkcode=?"); >@@ -83,12 +75,13 @@ unless ($frameworkexist) { > $op = "framework_create"; > } > } >+ > $template->param( >- frameworkloop => \@frameworkloop, >+ frameworks => $frameworks, > frameworkcode => $frameworkcode, > frameworktext => $frameworkinfo->{frameworktext}, > script_name => $script_name, >- ($op||'else') => 1, >+ ( $op || 'else' ) => 1, > ); > > >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index 63b41af..09f9778 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -59,6 +59,7 @@ use C4::Acquisition; > use C4::Members; # to use GetMember > use C4::Serials; #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber > use C4::Search; # enabled_staff_search_views >+use Koha::BiblioFrameworks; > > use List::MoreUtils qw( uniq ); > >@@ -115,21 +116,11 @@ my $itemcount = GetItemsCount($biblionumber); > $template->param( count => $itemcount, > bibliotitle => $biblio->{title}, ); > >-# Getting the list of all frameworks >-# get framework list >-my $frameworks = getframeworks; >-my @frameworkcodeloop; >-foreach my $thisframeworkcode ( keys %$frameworks ) { >- my %row = ( >- value => $thisframeworkcode, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- ); >- if ($frameworkcode eq $thisframeworkcode){ >- $row{'selected'}= 1; >- } >- push @frameworkcodeloop, \%row; >-} >-$template->param( frameworkcodeloop => \@frameworkcodeloop, ); >+my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'] } ); >+$template->param( >+ frameworks => $frameworks, >+ frameworkcode => $frameworkcode, >+); > # fill arrays > my @loop_data = (); > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index a1f7208..6ffa5e0 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -39,6 +39,8 @@ use Koha::DateUtils; > > use Koha::Libraries; > >+use Koha::BiblioFrameworks; >+ > use Date::Calc qw(Today); > use MARC::File::USMARC; > use MARC::File::XML; >@@ -743,9 +745,11 @@ if ($frameworkcode eq 'FA'){ > print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) ); > } > >-my $frameworkcodeloop = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >-$template->param( frameworkcodeloop => $frameworkcodeloop , >- breedingid => $breedingid ); >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >+$template->param( >+ frameworks => $frameworks, >+ breedingid => $breedingid, >+); > > # ++ Global > $tagslib = &GetMarcStructure( 1, $frameworkcode ); >diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl >index 672a070..1d52bb8 100755 >--- a/cataloguing/addbooks.pl >+++ b/cataloguing/addbooks.pl >@@ -34,6 +34,7 @@ use C4::Output; > use C4::Koha; > use C4::Search; > >+use Koha::BiblioFrameworks; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > >@@ -57,17 +58,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-# get framework list >-my $frameworks = getframeworks; >-my @frameworkcodeloop; >-foreach my $thisframeworkcode ( sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %{$frameworks} ) { >- push @frameworkcodeloop, { >- value => $thisframeworkcode, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- }; >-} >- >- > # Searching the catalog. > if ($query) { > >@@ -143,8 +133,9 @@ for my $resultsbr (@resultsbr) { > }; > } > >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); > $template->param( >- frameworkcodeloop => \@frameworkcodeloop, >+ frameworks => $frameworks, > breeding_count => $countbr, > breeding_loop => $breeding_loop, > z3950_search_params => C4::Search::z3950_search_args($query), >diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl >index 09517ed..ee9f1fa 100755 >--- a/cataloguing/merge.pl >+++ b/cataloguing/merge.pl >@@ -29,6 +29,8 @@ use C4::Serials; > use C4::Koha; > use C4::Reserves qw/MergeHolds/; > use C4::Acquisition qw/ModOrder GetOrdersByBiblionumber/; >+ >+use Koha::BiblioFrameworks; > use Koha::MetadataRecord; > > my $input = new CGI; >@@ -245,18 +247,8 @@ if ($merge) { > records => \@records, > ); > >- my $frameworks = getframeworks; >- my @frameworkselect; >- foreach my $thisframeworkcode ( keys %$frameworks ) { >- my %row = ( >- value => $thisframeworkcode, >- frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, >- ); >- push @frameworkselect, \%row; >- } >- $template->param( >- frameworkselect => \@frameworkselect, >- ); >+ my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >+ $template->param( frameworks => $frameworks ); > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >index 61d9e7f..e7e8fff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt >@@ -74,12 +74,8 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : > <li><label for="frameworkcode" >Select MARC framework:</label> > <select id="frameworkcode" name="frameworkcode" > > <option value="">Default</option> >- [% FOREACH frameworkcodeloo IN frameworkcodeloop %] >- [% IF ( frameworkcodeloo.active ) %] >- <option value="[% frameworkcodeloo.value %]" selected="selected" >[% frameworkcodeloo.frameworktext %]</option> >- [% ELSE %] >- <option value="[% frameworkcodeloo.value %]" >[% frameworkcodeloo.frameworktext %]</option> >- [% END %] >+ [% FOREACH framework IN frameworks %] >+ <option value="[% framework.frameworkcode %]" >[% framework.frameworktext %]</option> > [% END %] > </select> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt >index 295299b..fbb2756 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt >@@ -25,26 +25,26 @@ $(document).ready(function() { > <div class="yui-b"> > <h2>Keyword to MARC mapping</h2> > [% UNLESS ( fields ) %] >- <div class="dialog message"><p>There are no mappings for the [% IF ( frameworktext ) %]<em>[% frameworktext %]</em>[% ELSE %]default[% END %] framework. </p></div> >+ <div class="dialog message"><p>There are no mappings for the [% IF framework.frameworktext %]<em>[% framework.frameworktext %]</em>[% ELSE %]default[% END %] framework. </p></div> > [% END %] > <form method="get" action="/cgi-bin/koha/admin/fieldmapping.pl" id="selectframework"> > <label for="framework">Framework:</label> >- <select name="framework" id="framework" style="width:20em;"> >- <option value="">Default</option> >- [% FOREACH frameworkloo IN frameworkloop %] >- [% IF ( frameworkloo.selected ) %] >- <option selected="selected" value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option> >- [% ELSE %] >- <option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option> >- [% END %] >- [% END %] >- </select> >+ <select name="framework" id="framework" style="width:20em;"> >+ <option value="">Default</option> >+ [% FOREACH f IN frameworks %] >+ [% IF f.frameworkcode == framework.frameworkcode %] >+ <option selected="selected" value="[% f.frameworkcode %]">[% f.frameworktext %]</option> >+ [% ELSE %] >+ <option value="[% f.frameworkcode %]">[% f.frameworktext %]</option> >+ [% END %] >+ [% END %] >+ </select> > <input type="submit" value="Go" /> > </form> > > > <form method="post" action="" id="addfield"> >- <input type="hidden" name="framework" value="[% framework %]" /> >+ <input type="hidden" name="framework" value="[% framework.frameworkcode %]" /> > <fieldset class="rows"> > <legend>Add a mapping</legend> > <ol> >@@ -59,7 +59,7 @@ $(document).ready(function() { > </form> > > [% IF ( fields ) %]<table> >- <caption>Mappings for the [% IF ( frameworktext ) %]<em>[% frameworktext %]</em>[% ELSE %]default[% END %] framework</caption> >+ <caption>Mappings for the [% IF framework.frameworktext %]<em>[% framework.frameworktext %]</em>[% ELSE %]default[% END %] framework</caption> > <tr> > <th>Field</th> > <th>MARC field</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >index 67052fe..be536e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >@@ -168,11 +168,11 @@ $(document).ready(function() { > <label for="frameworkcode"><strong>In framework:</strong> </label> > <select id="frameworkcode" name="frameworkcode"> > <option value="">Default</option> >- [% FOREACH frameworkloo IN frameworkloop %] >- [% IF ( frameworkloo.selected ) %] >- <option value="[% frameworkloo.value %]" selected="selected">[% frameworkloo.frameworktext %]</option> >+ [% FOREACH framework IN frameworks %] >+ [% IF framework.frameworkcode == frameworkcode %] >+ <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option> > [% ELSE %] >- <option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option> >+ <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option> > [% END %] > [% END %] > </select> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >index 992bd0a..4950519 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt >@@ -60,8 +60,12 @@ function Changefwk(FwkList) { > > <p><b>With framework : <select name="Frameworks" id="Frameworks" onchange="Changefwk(this);"> > <option value="">Default</option> >- [% FOREACH frameworkcodeloo IN frameworkcodeloop %] >- [% IF ( frameworkcodeloo.selected ) %]<option value="[% frameworkcodeloo.value %]" selected="selected">[% frameworkcodeloo.frameworktext %]</option>[% ELSE %]<option value="[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</option>[% END %] >+ [% FOREACH framework IN frameworks %] >+ [% IF framework.frameworkcode == frameworkcode %] >+ <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option> >+ [% ELSE %] >+ <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option> >+ [% END %] > [% END %] > </select> </b></p> > [% IF ( ocoins ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >index c189583..1313ba1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt >@@ -100,8 +100,8 @@ > <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New record <span class="caret"></span></button> > <ul class="dropdown-menu"> > <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li> >- [% FOREACH frameworkcodeloo IN frameworkcodeloop %] >- <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</a></li> >+ [% FOREACH framework IN frameworks %] >+ <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode %]">[% framework.frameworktext %]</a></li> > [% END %] > </ul> > </div> >@@ -112,8 +112,8 @@ > </button> > <ul class="dropdown-menu"> > <li id="" class="z3950searchFw"><a href="#">Default framework</a></li> >- [% FOREACH frameworkcodeloo IN frameworkcodeloop %] >- <li id="[% frameworkcodeloo.value %]" class="z3950searchFw"><a href="#">[% frameworkcodeloo.frameworktext %]</a></li> >+ [% FOREACH framework IN frameworks %] >+ <li id="[% framework.frameworkcode %]" class="z3950searchFw"><a href="#">[% framework.frameworktext %]</a></li> > [% END %] > </ul> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >index 2805661..d23c34b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt >@@ -219,23 +219,15 @@ $(document).ready(function(){ > </li> > [% END %] > >- [% IF frameworkselect.size %] > <li> > <label for="frameworkcode">Using framework:</label> > <select name="frameworkcode" id="frameworkcode"> > <option value="">Default</option> >- [% FOREACH frameworkcode IN frameworkselect %] >- [% IF ( frameworkcode.selected ) %] >- <option value="[% frameworkcode.value %]" selected="selected"> >- [% ELSE %] >- <option value="[% frameworkcode.value %]"> >- [% END %] >- [% frameworkcode.frameworktext %] >- </option> >+ [% FOREACH framework IN frameworks %] >+ <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option> > [% END %] > </select> > </li> >- [% END %] > </ol> > > [% FOREACH record IN records %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index f89ec73..32796f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >@@ -361,7 +361,7 @@ $(document).ready(function(){ > <select name="framework" id="frameworks"> > <option value="">Default</option> > [% FOREACH framework IN frameworks %] >- <option value="[% framework.value %]">[% framework.label %]</option> >+ <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option> > [% END %] > </select> > [% END %] >diff --git a/tools/inventory.pl b/tools/inventory.pl >index 74069e5..5627320 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -36,6 +36,7 @@ use C4::Circulation; > use C4::Reports::Guided; #_get_column_defs > use C4::Charset; > use Koha::DateUtils; >+use Koha::BiblioFrameworks; > use List::MoreUtils qw( none ); > > >@@ -66,11 +67,11 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my @authorised_value_list; > my $authorisedvalue_categories = ''; > >-my $frameworks = getframeworks(); >-$frameworks->{''} = {frameworkcode => ''}; # Add the default framework >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] })->unblessed; >+unshift @$frameworks, { frameworkcode => '' }; > >-for my $fwk (keys %$frameworks){ >- my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'}; >+for my $fwk ( @$frameworks ){ >+ my $fwkcode = $fwk->{frameworkcode}; > my $authcode = GetAuthValCode('items.location', $fwkcode); > if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){ > $authorisedvalue_categories.="$authcode "; >diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl >index 83abc91..249cabe 100755 >--- a/tools/manage-marc-import.pl >+++ b/tools/manage-marc-import.pl >@@ -36,6 +36,7 @@ use C4::ImportBatch; > use C4::Matcher; > use C4::BackgroundJob; > use C4::Labels::Batch; >+use Koha::BiblioFrameworks; > > my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl"; > >@@ -62,15 +63,8 @@ my %cookies = parse CGI::Cookie($cookie); > our $sessionID = $cookies{'CGISESSID'}->value; > our $dbh = C4::Context->dbh; > >-# Frameworks selection loop >-{ >- my $frameworks = getframeworks; >- my $arrayref = []; >- while ( my ($key, $value) = each %$frameworks ) { >- push @$arrayref, { value => $key, label => $value->{frameworktext} }; >- } >- $template->param( frameworks => $arrayref ); >-} >+my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] }); >+$template->param( frameworks => $frameworks ); > > if ($op eq "create_labels") { > #create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list. >-- >2.8.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 15801
:
47923
|
47924
|
47925
|
48938
|
48939
|
48940
|
50259
|
51385
|
51386
|
51387
|
51426
|
51427
|
51432
|
51433
|
51434
|
51435
|
54348
|
54349
|
54350
|
54351
|
55688
|
55689
|
55690
|
55691
|
56452
|
56453
|
56454
|
56455
|
56766
|
56767
|
56768
|
56769