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

(-)a/C4/Koha.pm (-56 / +1 lines)
Lines 40-46 BEGIN { Link Here
40
		&GetPrinters &GetPrinter
40
		&GetPrinters &GetPrinter
41
		&GetItemTypes &getitemtypeinfo
41
		&GetItemTypes &getitemtypeinfo
42
                &GetItemTypesCategorized &GetItemTypesByCategory
42
                &GetItemTypesCategorized &GetItemTypesByCategory
43
		&getframeworks &getframeworkinfo
43
		&getframeworkinfo
44
		&getallthemes
44
		&getallthemes
45
		&getFacets
45
		&getFacets
46
		&getnbpages
46
		&getnbpages
Lines 227-287 sub GetItemTypesByCategory { Link Here
227
    return @$tmp;
227
    return @$tmp;
228
}
228
}
229
229
230
=head2 getframework
231
232
  $frameworks = &getframework();
233
234
Returns information about existing frameworks
235
236
build a HTML select with the following code :
237
238
=head3 in PERL SCRIPT
239
240
  my $frameworks = getframeworks();
241
  my @frameworkloop;
242
  foreach my $thisframework (keys %$frameworks) {
243
    my $selected = 1 if $thisframework eq $frameworkcode;
244
    my %row =(
245
                value       => $thisframework,
246
                selected    => $selected,
247
                description => $frameworks->{$thisframework}->{'frameworktext'},
248
            );
249
    push @frameworksloop, \%row;
250
  }
251
  $template->param(frameworkloop => \@frameworksloop);
252
253
=head3 in TEMPLATE
254
255
  <form action="[% script_name %] method=post>
256
    <select name="frameworkcode">
257
        <option value="">Default</option>
258
        [% FOREACH framework IN frameworkloop %]
259
        [% IF ( framework.selected ) %]
260
        <option value="[% framework.value %]" selected="selected">[% framework.description %]</option>
261
        [% ELSE %]
262
        <option value="[% framework.value %]">[% framework.description %]</option>
263
        [% END %]
264
        [% END %]
265
    </select>
266
    <input type=text name=searchfield value="[% searchfield %]">
267
    <input type="submit" value="OK" class="button">
268
  </form>
269
270
=cut
271
272
sub getframeworks {
273
274
    # returns a reference to a hash of references to branches...
275
    my %itemtypes;
276
    my $dbh = C4::Context->dbh;
277
    my $sth = $dbh->prepare("select * from biblio_framework");
278
    $sth->execute;
279
    while ( my $IT = $sth->fetchrow_hashref ) {
280
        $itemtypes{ $IT->{'frameworkcode'} } = $IT;
281
    }
282
    return ( \%itemtypes );
283
}
284
285
=head2 getframeworkinfo
230
=head2 getframeworkinfo
286
231
287
  $frameworkinfo = &getframeworkinfo($frameworkcode);
232
  $frameworkinfo = &getframeworkinfo($frameworkcode);
(-)a/acqui/z3950_search.pl (-15 / +3 lines)
Lines 30-39 use C4::Breeding; Link Here
30
use C4::Koha;
30
use C4::Koha;
31
31
32
use Koha::Acquisition::Bookseller;
32
use Koha::Acquisition::Bookseller;
33
use Koha::BiblioFrameworks;
33
34
34
my $input           = new CGI;
35
my $input           = new CGI;
35
my $biblionumber    = $input->param('biblionumber')||0;
36
my $biblionumber    = $input->param('biblionumber')||0;
36
my $frameworkcode   = $input->param('frameworkcode')||'';
37
my $title           = $input->param('title');
37
my $title           = $input->param('title');
38
my $author          = $input->param('author');
38
my $author          = $input->param('author');
39
my $isbn            = $input->param('isbn');
39
my $isbn            = $input->param('isbn');
Lines 50-67 my $page = $input->param('current_page') || 1; Link Here
50
$page               = $input->param('goto_page') if $input->param('changepage_goto');
50
$page               = $input->param('goto_page') if $input->param('changepage_goto');
51
51
52
# get framework list
52
# get framework list
53
my $frameworks = getframeworks;
53
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
54
my @frameworkcodeloop;
55
foreach my $thisframeworkcode ( keys %$frameworks ) {
56
    my %row = (
57
        value         => $thisframeworkcode,
58
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
59
    );
60
    if ( $row{'value'} eq $frameworkcode){
61
        $row{'active'} = 'true';
62
    }
63
    push @frameworkcodeloop, \%row;
64
}
65
54
66
my $vendor = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
55
my $vendor = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
67
56
Lines 74-81 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
74
    }
63
    }
75
);
64
);
76
$template->param(
65
$template->param(
77
        frameworkcode => $frameworkcode,
66
        frameworks   => $frameworks,
78
        frameworkcodeloop => \@frameworkcodeloop,
79
        booksellerid => $booksellerid,
67
        booksellerid => $booksellerid,
80
        basketno     => $basketno,
68
        basketno     => $basketno,
81
        name         => $vendor->{'name'},
69
        name         => $vendor->{'name'},
(-)a/admin/fieldmapping.pl (-29 / +13 lines)
Lines 24-33 use C4::Biblio; Link Here
24
use C4::Koha;
24
use C4::Koha;
25
use C4::Output;
25
use C4::Output;
26
26
27
my $query = new CGI;
27
use Koha::BiblioFrameworks;
28
28
29
my $framework = $query->param('framework') || "";
29
my $query = new CGI;
30
30
31
my $frameworkcode = $query->param('framework') || "";
31
my $field         = $query->param('fieldname');
32
my $field         = $query->param('fieldname');
32
my $fieldcode     = $query->param('marcfield');
33
my $fieldcode     = $query->param('marcfield');
33
my $subfieldcode  = $query->param('marcsubfield');
34
my $subfieldcode  = $query->param('marcsubfield');
Lines 43-84 my ($template, $loggedinuser, $cookie) Link Here
43
			     debug => 1,
44
			     debug => 1,
44
			     });
45
			     });
45
46
46
# get framework list
47
my $frameworks = getframeworks();
48
my @frameworkloop;
49
my $selected;
50
my $frameworktext;
51
foreach my $thisframeworkcode (keys %$frameworks) {
52
	 if ($thisframeworkcode eq $framework){
53
		 $selected = 1;
54
		 $frameworktext = $frameworks->{$thisframeworkcode}->{'frameworktext'};
55
     } else {
56
		$selected = 0;
57
     }
58
	my %row =(value => $thisframeworkcode,
59
				selected => $selected,
60
				frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
61
			);
62
	push @frameworkloop, \%row;
63
}
64
65
if($op eq "delete" and $id){
47
if($op eq "delete" and $id){
66
    DeleteFieldMapping($id);
48
    DeleteFieldMapping($id);
67
    print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$framework);
49
    print $query->redirect("/cgi-bin/koha/admin/fieldmapping.pl?framework=".$frameworkcode);
68
    exit;
50
    exit;
69
}
51
}
70
52
71
# insert operation
53
# insert operation
72
if($field and $fieldcode){
54
if($field and $fieldcode){
73
    SetFieldMapping($framework, $field, $fieldcode, $subfieldcode);
55
    SetFieldMapping($frameworkcode, $field, $fieldcode, $subfieldcode);
74
}
56
}
75
57
76
my $fieldloop = GetFieldMapping($framework);
58
my $fieldloop = GetFieldMapping($frameworkcode);
77
59
78
$template->param( frameworkloop => \@frameworkloop, 
60
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
79
                  framework     => $framework,
61
my $framework  = $frameworks->search( { frameworkcode => $frameworkcode } )->next;
80
                  frameworktext => $frameworktext,
62
$template->param(
81
                  fields        => $fieldloop,
63
    frameworks => $frameworks,
82
                );
64
    framework  => $framework,
65
    fields     => $fieldloop,
66
);
83
67
84
output_html_with_http_headers $query, $cookie, $template->output;
68
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/admin/marctagstructure.pl (-12 / +5 lines)
Lines 28-33 use C4::Output; Link Here
28
use C4::Context;
28
use C4::Context;
29
29
30
use Koha::Caches;
30
use Koha::Caches;
31
use Koha::BiblioFrameworks;
31
32
32
# retrieve parameters
33
# retrieve parameters
33
my $input = new CGI;
34
my $input = new CGI;
Lines 58-73 my ($template, $loggedinuser, $cookie) Link Here
58
			     debug => 1,
59
			     debug => 1,
59
			     });
60
			     });
60
61
61
# get framework list
62
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
62
my $frameworks = getframeworks();
63
my @frameworkloop;
64
foreach my $thisframeworkcode (keys %$frameworks) {
65
	push @frameworkloop, {
66
        value => $thisframeworkcode,
67
        selected => ($thisframeworkcode eq $frameworkcode) ? 1 : 0,
68
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
69
    };
70
}
71
63
72
# check that framework is defined in marc_tag_structure
64
# check that framework is defined in marc_tag_structure
73
my $sth=$dbh->prepare("select count(*) from marc_tag_structure where frameworkcode=?");
65
my $sth=$dbh->prepare("select count(*) from marc_tag_structure where frameworkcode=?");
Lines 83-94 unless ($frameworkexist) { Link Here
83
		$op = "framework_create";
75
		$op = "framework_create";
84
	}
76
	}
85
}
77
}
78
86
$template->param(
79
$template->param(
87
    frameworkloop => \@frameworkloop,
80
    frameworks    => $frameworks,
88
    frameworkcode => $frameworkcode,
81
    frameworkcode => $frameworkcode,
89
    frameworktext => $frameworkinfo->{frameworktext},
82
    frameworktext => $frameworkinfo->{frameworktext},
90
    script_name   => $script_name,
83
    script_name   => $script_name,
91
    ($op||'else') => 1,
84
    ( $op || 'else' ) => 1,
92
);
85
);
93
86
94
87
(-)a/catalogue/MARCdetail.pl (-15 / +6 lines)
Lines 59-64 use C4::Acquisition; Link Here
59
use C4::Members; # to use GetMember
59
use C4::Members; # to use GetMember
60
use C4::Serials;    #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber
60
use C4::Serials;    #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber
61
use C4::Search;		# enabled_staff_search_views
61
use C4::Search;		# enabled_staff_search_views
62
use Koha::BiblioFrameworks;
62
63
63
use List::MoreUtils qw( uniq );
64
use List::MoreUtils qw( uniq );
64
65
Lines 115-135 my $itemcount = GetItemsCount($biblionumber); Link Here
115
$template->param( count => $itemcount,
116
$template->param( count => $itemcount,
116
					bibliotitle => $biblio->{title}, );
117
					bibliotitle => $biblio->{title}, );
117
118
118
# Getting the list of all frameworks
119
my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'] } );
119
# get framework list
120
$template->param(
120
my $frameworks = getframeworks;
121
    frameworks    => $frameworks,
121
my @frameworkcodeloop;
122
    frameworkcode => $frameworkcode,
122
foreach my $thisframeworkcode ( keys %$frameworks ) {
123
);
123
    my %row = (
124
        value         => $thisframeworkcode,
125
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
126
    );
127
    if ($frameworkcode eq $thisframeworkcode){
128
        $row{'selected'}= 1;
129
        }
130
    push @frameworkcodeloop, \%row;
131
}
132
$template->param( frameworkcodeloop => \@frameworkcodeloop, );
133
# fill arrays
124
# fill arrays
134
my @loop_data = ();
125
my @loop_data = ();
135
126
(-)a/cataloguing/addbiblio.pl (-3 / +7 lines)
Lines 39-44 use Koha::DateUtils; Link Here
39
39
40
use Koha::Libraries;
40
use Koha::Libraries;
41
41
42
use Koha::BiblioFrameworks;
43
42
use Date::Calc qw(Today);
44
use Date::Calc qw(Today);
43
use MARC::File::USMARC;
45
use MARC::File::USMARC;
44
use MARC::File::XML;
46
use MARC::File::XML;
Lines 743-751 if ($frameworkcode eq 'FA'){ Link Here
743
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
745
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
744
}
746
}
745
747
746
my $frameworkcodeloop = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
748
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
747
$template->param( frameworkcodeloop => $frameworkcodeloop ,
749
$template->param(
748
	breedingid => $breedingid );
750
    frameworks => $frameworks,
751
    breedingid => $breedingid,
752
);
749
753
750
# ++ Global
754
# ++ Global
751
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
755
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
(-)a/cataloguing/addbooks.pl (-12 / +3 lines)
Lines 34-39 use C4::Output; Link Here
34
use C4::Koha;
34
use C4::Koha;
35
use C4::Search;
35
use C4::Search;
36
36
37
use Koha::BiblioFrameworks;
37
use Koha::SearchEngine::Search;
38
use Koha::SearchEngine::Search;
38
use Koha::SearchEngine::QueryBuilder;
39
use Koha::SearchEngine::QueryBuilder;
39
40
Lines 57-73 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
57
    }
58
    }
58
);
59
);
59
60
60
# get framework list
61
my $frameworks = getframeworks;
62
my @frameworkcodeloop;
63
foreach my $thisframeworkcode ( sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %{$frameworks} ) {
64
    push @frameworkcodeloop, {
65
        value         => $thisframeworkcode,
66
        frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
67
    };
68
}
69
70
71
# Searching the catalog.
61
# Searching the catalog.
72
if ($query) {
62
if ($query) {
73
63
Lines 143-150 for my $resultsbr (@resultsbr) { Link Here
143
    };
133
    };
144
}
134
}
145
135
136
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
146
$template->param(
137
$template->param(
147
    frameworkcodeloop => \@frameworkcodeloop,
138
    frameworks        => $frameworks,
148
    breeding_count    => $countbr,
139
    breeding_count    => $countbr,
149
    breeding_loop     => $breeding_loop,
140
    breeding_loop     => $breeding_loop,
150
    z3950_search_params => C4::Search::z3950_search_args($query),
141
    z3950_search_params => C4::Search::z3950_search_args($query),
(-)a/cataloguing/merge.pl (-12 / +4 lines)
Lines 29-34 use C4::Serials; Link Here
29
use C4::Koha;
29
use C4::Koha;
30
use C4::Reserves qw/MergeHolds/;
30
use C4::Reserves qw/MergeHolds/;
31
use C4::Acquisition qw/ModOrder GetOrdersByBiblionumber/;
31
use C4::Acquisition qw/ModOrder GetOrdersByBiblionumber/;
32
33
use Koha::BiblioFrameworks;
32
use Koha::MetadataRecord;
34
use Koha::MetadataRecord;
33
35
34
my $input = new CGI;
36
my $input = new CGI;
Lines 245-262 if ($merge) { Link Here
245
            records => \@records,
247
            records => \@records,
246
        );
248
        );
247
249
248
        my $frameworks = getframeworks;
250
        my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
249
        my @frameworkselect;
251
        $template->param( frameworks => $frameworks );
250
        foreach my $thisframeworkcode ( keys %$frameworks ) {
251
            my %row = (
252
                value         => $thisframeworkcode,
253
                frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
254
            );
255
            push @frameworkselect, \%row;
256
        }
257
        $template->param(
258
            frameworkselect => \@frameworkselect,
259
        );
260
    }
252
    }
261
}
253
}
262
254
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt (-6 / +2 lines)
Lines 74-85 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
74
             <li><label for="frameworkcode" >Select MARC framework:</label>
74
             <li><label for="frameworkcode" >Select MARC framework:</label>
75
             <select id="frameworkcode" name="frameworkcode" >
75
             <select id="frameworkcode" name="frameworkcode" >
76
             <option value="">Default</option>
76
             <option value="">Default</option>
77
                 [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
77
                 [% FOREACH framework IN frameworks %]
78
                    [% IF ( frameworkcodeloo.active ) %]
78
                    <option value="[% framework.frameworkcode %]" >[% framework.frameworktext %]</option>
79
                        <option value="[% frameworkcodeloo.value %]" selected="selected" >[% frameworkcodeloo.frameworktext %]</option>
80
                    [% ELSE %]
81
                        <option value="[% frameworkcodeloo.value %]" >[% frameworkcodeloo.frameworktext %]</option>
82
                    [% END %]
83
                 [% END %]
79
                 [% END %]
84
              </select>
80
              </select>
85
              </li>
81
              </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/fieldmapping.tt (-13 / +13 lines)
Lines 25-50 $(document).ready(function() { Link Here
25
		<div class="yui-b">
25
		<div class="yui-b">
26
            <h2>Keyword to MARC mapping</h2>
26
            <h2>Keyword to MARC mapping</h2>
27
			[% UNLESS ( fields ) %]
27
			[% UNLESS ( fields ) %]
28
			<div class="dialog message"><p>There are no mappings for the [% IF ( frameworktext ) %]<em>[% frameworktext %]</em>[% ELSE %]default[% END %] framework. </p></div>
28
            <div class="dialog message"><p>There are no mappings for the [% IF framework.frameworktext %]<em>[% framework.frameworktext %]</em>[% ELSE %]default[% END %] framework. </p></div>
29
			[% END %]
29
			[% END %]
30
			<form method="get" action="/cgi-bin/koha/admin/fieldmapping.pl" id="selectframework">
30
			<form method="get" action="/cgi-bin/koha/admin/fieldmapping.pl" id="selectframework">
31
				<label for="framework">Framework:</label>
31
				<label for="framework">Framework:</label>
32
				<select name="framework" id="framework" style="width:20em;">
32
                <select name="framework" id="framework" style="width:20em;">
33
					<option value="">Default</option>
33
                    <option value="">Default</option>
34
				[% FOREACH frameworkloo IN frameworkloop %]
34
                [% FOREACH f IN frameworks %]
35
					[% IF ( frameworkloo.selected ) %]
35
                    [% IF f.frameworkcode == framework.frameworkcode %]
36
					<option selected="selected" value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option>
36
                    <option selected="selected" value="[% f.frameworkcode %]">[% f.frameworktext %]</option>
37
					[% ELSE %]
37
                    [% ELSE %]
38
					<option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option>
38
                    <option value="[% f.frameworkcode %]">[% f.frameworktext %]</option>
39
					[% END %]
39
                    [% END %]
40
				[% END %]
40
                [% END %]
41
				</select>
41
                </select>
42
			<input type="submit" value="Go" />
42
			<input type="submit" value="Go" />
43
			</form>
43
			</form>
44
44
45
45
46
			<form method="post" action="" id="addfield">
46
			<form method="post" action="" id="addfield">
47
				<input type="hidden" name="framework" value="[% framework %]" />
47
                <input type="hidden" name="framework" value="[% framework.frameworkcode %]" />
48
				<fieldset class="rows">
48
				<fieldset class="rows">
49
				<legend>Add a mapping</legend>
49
				<legend>Add a mapping</legend>
50
				<ol>
50
				<ol>
Lines 59-65 $(document).ready(function() { Link Here
59
			</form>
59
			</form>
60
60
61
				[% IF ( fields ) %]<table>
61
				[% IF ( fields ) %]<table>
62
								<caption>Mappings for the [% IF ( frameworktext ) %]<em>[% frameworktext %]</em>[% ELSE %]default[% END %] framework</caption>
62
                    <caption>Mappings for the [% IF framework.frameworktext %]<em>[% framework.frameworktext %]</em>[% ELSE %]default[% END %] framework</caption>
63
									<tr>
63
									<tr>
64
										<th>Field</th>
64
										<th>Field</th>
65
                                        <th>MARC field</th>
65
                                        <th>MARC field</th>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt (-4 / +4 lines)
Lines 168-178 $(document).ready(function() { Link Here
168
<label for="frameworkcode"><strong>In framework:</strong> </label>
168
<label for="frameworkcode"><strong>In framework:</strong> </label>
169
        <select id="frameworkcode" name="frameworkcode">
169
        <select id="frameworkcode" name="frameworkcode">
170
            <option value="">Default</option>
170
            <option value="">Default</option>
171
            [% FOREACH frameworkloo IN frameworkloop %]
171
            [% FOREACH framework IN frameworks %]
172
            [% IF ( frameworkloo.selected ) %]
172
            [% IF framework.frameworkcode == frameworkcode %]
173
                <option value="[% frameworkloo.value %]" selected="selected">[% frameworkloo.frameworktext %]</option>
173
                <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option>
174
                [% ELSE %]
174
                [% ELSE %]
175
                <option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option>
175
                <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
176
                [% END %]
176
                [% END %]
177
            [% END %]
177
            [% END %]
178
        </select>
178
        </select>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (-2 / +6 lines)
Lines 60-67 function Changefwk(FwkList) { Link Here
60
60
61
    <p><b>With framework : <select name="Frameworks" id="Frameworks" onchange="Changefwk(this);">
61
    <p><b>With framework : <select name="Frameworks" id="Frameworks" onchange="Changefwk(this);">
62
                            <option value="">Default</option>
62
                            <option value="">Default</option>
63
                            [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
63
                            [% FOREACH framework IN frameworks %]
64
                            [% IF ( frameworkcodeloo.selected ) %]<option value="[% frameworkcodeloo.value %]" selected="selected">[% frameworkcodeloo.frameworktext %]</option>[% ELSE %]<option value="[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</option>[% END %]
64
                                [% IF framework.frameworkcode == frameworkcode %]
65
                                    <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option>
66
                                [% ELSE %]
67
                                    <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
68
                                [% END %]
65
                            [% END %]
69
                            [% END %]
66
            </select> </b></p>
70
            </select> </b></p>
67
[% IF ( ocoins ) %]
71
[% IF ( ocoins ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-4 / +4 lines)
Lines 100-107 Link Here
100
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New record <span class="caret"></span></button>
100
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> New record <span class="caret"></span></button>
101
            <ul class="dropdown-menu">
101
            <ul class="dropdown-menu">
102
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
102
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
103
                [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
103
                [% FOREACH framework IN frameworks %]
104
                <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</a></li>
104
                    <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% framework.frameworkcode %]">[% framework.frameworktext %]</a></li>
105
                [% END %]
105
                [% END %]
106
            </ul>
106
            </ul>
107
        </div>
107
        </div>
Lines 112-119 Link Here
112
            </button>
112
            </button>
113
            <ul class="dropdown-menu">
113
            <ul class="dropdown-menu">
114
                <li id="" class="z3950searchFw"><a href="#">Default framework</a></li>
114
                <li id="" class="z3950searchFw"><a href="#">Default framework</a></li>
115
                [% FOREACH frameworkcodeloo IN frameworkcodeloop %]
115
                [% FOREACH framework IN frameworks %]
116
                <li id="[% frameworkcodeloo.value %]" class="z3950searchFw"><a href="#">[% frameworkcodeloo.frameworktext %]</a></li>
116
                <li id="[% framework.frameworkcode %]" class="z3950searchFw"><a href="#">[% framework.frameworktext %]</a></li>
117
                [% END %]
117
                [% END %]
118
            </ul>
118
            </ul>
119
        </div>
119
        </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt (-10 / +2 lines)
Lines 219-241 $(document).ready(function(){ Link Here
219
            </li>
219
            </li>
220
        [% END %]
220
        [% END %]
221
221
222
        [% IF frameworkselect.size %]
223
            <li>
222
            <li>
224
                <label for="frameworkcode">Using framework:</label>
223
                <label for="frameworkcode">Using framework:</label>
225
                <select name="frameworkcode" id="frameworkcode">
224
                <select name="frameworkcode" id="frameworkcode">
226
                    <option value="">Default</option>
225
                    <option value="">Default</option>
227
                    [% FOREACH frameworkcode IN frameworkselect %]
226
                    [% FOREACH framework IN frameworks %]
228
                        [% IF ( frameworkcode.selected ) %]
227
                        <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
229
                            <option value="[% frameworkcode.value %]" selected="selected">
230
                        [% ELSE %]
231
                            <option value="[% frameworkcode.value %]">
232
                        [% END %]
233
                            [% frameworkcode.frameworktext %]
234
                        </option>
235
                    [% END %]
228
                    [% END %]
236
                </select>
229
                </select>
237
            </li>
230
            </li>
238
        [% END %]
239
    </ol>
231
    </ol>
240
232
241
    [% FOREACH record IN records %]
233
    [% FOREACH record IN records %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (-1 / +1 lines)
Lines 361-367 $(document).ready(function(){ Link Here
361
    <select name="framework" id="frameworks">
361
    <select name="framework" id="frameworks">
362
      <option value="">Default</option>
362
      <option value="">Default</option>
363
      [% FOREACH framework IN frameworks %]
363
      [% FOREACH framework IN frameworks %]
364
          <option value="[% framework.value %]">[% framework.label %]</option>
364
          <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
365
      [% END %]
365
      [% END %]
366
    </select>
366
    </select>
367
    [% END %]
367
    [% END %]
(-)a/tools/inventory.pl (-4 / +5 lines)
Lines 36-41 use C4::Circulation; Link Here
36
use C4::Reports::Guided;    #_get_column_defs
36
use C4::Reports::Guided;    #_get_column_defs
37
use C4::Charset;
37
use C4::Charset;
38
use Koha::DateUtils;
38
use Koha::DateUtils;
39
use Koha::BiblioFrameworks;
39
use List::MoreUtils qw( none );
40
use List::MoreUtils qw( none );
40
41
41
42
Lines 66-76 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
66
my @authorised_value_list;
67
my @authorised_value_list;
67
my $authorisedvalue_categories = '';
68
my $authorisedvalue_categories = '';
68
69
69
my $frameworks = getframeworks();
70
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] })->unblessed;
70
$frameworks->{''} = {frameworkcode => ''}; # Add the default framework
71
unshift @$frameworks, { frameworkcode => '' };
71
72
72
for my $fwk (keys %$frameworks){
73
for my $fwk ( @$frameworks ){
73
  my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
74
  my $fwkcode = $fwk->{frameworkcode};
74
  my $authcode = GetAuthValCode('items.location', $fwkcode);
75
  my $authcode = GetAuthValCode('items.location', $fwkcode);
75
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
76
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
76
      $authorisedvalue_categories.="$authcode ";
77
      $authorisedvalue_categories.="$authcode ";
(-)a/tools/manage-marc-import.pl (-10 / +3 lines)
Lines 36-41 use C4::ImportBatch; Link Here
36
use C4::Matcher;
36
use C4::Matcher;
37
use C4::BackgroundJob;
37
use C4::BackgroundJob;
38
use C4::Labels::Batch;
38
use C4::Labels::Batch;
39
use Koha::BiblioFrameworks;
39
40
40
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
41
my $script_name = "/cgi-bin/koha/tools/manage-marc-import.pl";
41
42
Lines 62-76 my %cookies = parse CGI::Cookie($cookie); Link Here
62
our $sessionID = $cookies{'CGISESSID'}->value;
63
our $sessionID = $cookies{'CGISESSID'}->value;
63
our $dbh = C4::Context->dbh;
64
our $dbh = C4::Context->dbh;
64
65
65
# Frameworks selection loop
66
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
66
{
67
$template->param( frameworks => $frameworks );
67
    my $frameworks = getframeworks;
68
    my $arrayref = [];
69
    while ( my ($key, $value) = each %$frameworks ) {
70
        push @$arrayref, { value => $key, label => $value->{frameworktext} };
71
    }
72
    $template->param( frameworks => $arrayref );
73
}
74
68
75
if ($op eq "create_labels") {
69
if ($op eq "create_labels") {
76
	#create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
70
	#create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
77
- 

Return to bug 15801