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

(-)a/C4/Koha.pm (-56 / +1 lines)
Lines 42-48 BEGIN { Link Here
42
		&GetItemTypes &getitemtypeinfo
42
		&GetItemTypes &getitemtypeinfo
43
                &GetItemTypesCategorized &GetItemTypesByCategory
43
                &GetItemTypesCategorized &GetItemTypesByCategory
44
		&GetSupportName &GetSupportList
44
		&GetSupportName &GetSupportList
45
		&getframeworks &getframeworkinfo
45
		&getframeworkinfo
46
		&getallthemes
46
		&getallthemes
47
		&getFacets
47
		&getFacets
48
		&getnbpages
48
		&getnbpages
Lines 302-362 sub GetItemTypesByCategory { Link Here
302
    return @$tmp;
302
    return @$tmp;
303
}
303
}
304
304
305
=head2 getframework
306
307
  $frameworks = &getframework();
308
309
Returns information about existing frameworks
310
311
build a HTML select with the following code :
312
313
=head3 in PERL SCRIPT
314
315
  my $frameworks = getframeworks();
316
  my @frameworkloop;
317
  foreach my $thisframework (keys %$frameworks) {
318
    my $selected = 1 if $thisframework eq $frameworkcode;
319
    my %row =(
320
                value       => $thisframework,
321
                selected    => $selected,
322
                description => $frameworks->{$thisframework}->{'frameworktext'},
323
            );
324
    push @frameworksloop, \%row;
325
  }
326
  $template->param(frameworkloop => \@frameworksloop);
327
328
=head3 in TEMPLATE
329
330
  <form action="[% script_name %] method=post>
331
    <select name="frameworkcode">
332
        <option value="">Default</option>
333
        [% FOREACH framework IN frameworkloop %]
334
        [% IF ( framework.selected ) %]
335
        <option value="[% framework.value %]" selected="selected">[% framework.description %]</option>
336
        [% ELSE %]
337
        <option value="[% framework.value %]">[% framework.description %]</option>
338
        [% END %]
339
        [% END %]
340
    </select>
341
    <input type=text name=searchfield value="[% searchfield %]">
342
    <input type="submit" value="OK" class="button">
343
  </form>
344
345
=cut
346
347
sub getframeworks {
348
349
    # returns a reference to a hash of references to branches...
350
    my %itemtypes;
351
    my $dbh = C4::Context->dbh;
352
    my $sth = $dbh->prepare("select * from biblio_framework");
353
    $sth->execute;
354
    while ( my $IT = $sth->fetchrow_hashref ) {
355
        $itemtypes{ $IT->{'frameworkcode'} } = $IT;
356
    }
357
    return ( \%itemtypes );
358
}
359
360
=head2 getframeworkinfo
305
=head2 getframeworkinfo
361
306
362
  $frameworkinfo = &getframeworkinfo($frameworkcode);
307
  $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::Cache;
30
use Koha::Cache;
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 37-42 use C4::ImportBatch; Link Here
37
use C4::Charset;
37
use C4::Charset;
38
use Koha::BiblioFrameworks;
38
use Koha::BiblioFrameworks;
39
39
40
use Koha::BiblioFrameworks;
41
40
use Date::Calc qw(Today);
42
use Date::Calc qw(Today);
41
use MARC::File::USMARC;
43
use MARC::File::USMARC;
42
use MARC::File::XML;
44
use MARC::File::XML;
Lines 746-754 if ($frameworkcode eq 'FA'){ Link Here
746
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
748
    print $input->redirect( '/cgi-bin/koha/cataloguing/editor.pl' . ( $biblionumber ? ( '#catalog/' . $biblionumber ) : '' ) );
747
}
749
}
748
750
749
my $frameworkcodeloop = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
751
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
750
$template->param( frameworkcodeloop => $frameworkcodeloop ,
752
$template->param(
751
	breedingid => $breedingid );
753
    frameworks => $frameworks,
754
    breedingid => $breedingid,
755
);
752
756
753
# ++ Global
757
# ++ Global
754
$tagslib         = &GetMarcStructure( 1, $frameworkcode );
758
$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 163-173 $(document).ready(function() { Link Here
163
<label for="frameworkcode"><strong>In framework:</strong> </label>
163
<label for="frameworkcode"><strong>In framework:</strong> </label>
164
        <select id="frameworkcode" name="frameworkcode">
164
        <select id="frameworkcode" name="frameworkcode">
165
            <option value="">Default</option>
165
            <option value="">Default</option>
166
            [% FOREACH frameworkloo IN frameworkloop %]
166
            [% FOREACH framework IN frameworks %]
167
            [% IF ( frameworkloo.selected ) %]
167
            [% IF framework.frameworkcode == frameworkcode %]
168
                <option value="[% frameworkloo.value %]" selected="selected">[% frameworkloo.frameworktext %]</option>
168
                <option value="[% framework.frameworkcode %]" selected="selected">[% framework.frameworktext %]</option>
169
                [% ELSE %]
169
                [% ELSE %]
170
                <option value="[% frameworkloo.value %]">[% frameworkloo.frameworktext %]</option>
170
                <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
171
                [% END %]
171
                [% END %]
172
            [% END %]
172
            [% END %]
173
        </select>
173
        </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 352-358 $(document).ready(function(){ Link Here
352
    <select name="framework" id="frameworks">
352
    <select name="framework" id="frameworks">
353
      <option value="">Default</option>
353
      <option value="">Default</option>
354
      [% FOREACH framework IN frameworks %]
354
      [% FOREACH framework IN frameworks %]
355
          <option value="[% framework.value %]">[% framework.label %]</option>
355
          <option value="[% framework.frameworkcode %]">[% framework.frameworktext %]</option>
356
      [% END %]
356
      [% END %]
357
    </select>
357
    </select>
358
    [% END %]
358
    [% END %]
(-)a/tools/inventory.pl (-4 / +5 lines)
Lines 37-42 use C4::Circulation; Link Here
37
use C4::Reports::Guided;    #_get_column_defs
37
use C4::Reports::Guided;    #_get_column_defs
38
use C4::Charset;
38
use C4::Charset;
39
use Koha::DateUtils;
39
use Koha::DateUtils;
40
use Koha::BiblioFrameworks;
40
use List::MoreUtils qw( none );
41
use List::MoreUtils qw( none );
41
42
42
43
Lines 77-87 for my $branch_hash (keys %$branches) { Link Here
77
my @authorised_value_list;
78
my @authorised_value_list;
78
my $authorisedvalue_categories = '';
79
my $authorisedvalue_categories = '';
79
80
80
my $frameworks = getframeworks();
81
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] })->unblessed;
81
$frameworks->{''} = {frameworkcode => ''}; # Add the default framework
82
unshift @$frameworks, { frameworkcode => '' };
82
83
83
for my $fwk (keys %$frameworks){
84
for my $fwk ( @$frameworks ){
84
  my $fwkcode = $frameworks->{$fwk}->{'frameworkcode'};
85
  my $fwkcode = $fwk->{frameworkcode};
85
  my $authcode = GetAuthValCode('items.location', $fwkcode);
86
  my $authcode = GetAuthValCode('items.location', $fwkcode);
86
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
87
    if ($authcode && $authorisedvalue_categories!~/\b$authcode\W/){
87
      $authorisedvalue_categories.="$authcode ";
88
      $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