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

(-)a/Koha/BiblioFramework.pm (+18 lines)
Lines 41-44 sub _type { Link Here
41
    return 'BiblioFramework';
41
    return 'BiblioFramework';
42
}
42
}
43
43
44
=head2 GetFrameworkSources
45
   my $sources = GetFrameworkSources();
46
47
   Returns reference to hash of references to
48
   the framework sources, keyed on frameworkcode.
49
=cut
50
51
sub GetFrameworkSources {
52
   my %framework_sources = ();
53
   my $dbh = C4::Context->dbh;
54
   my $sth = $dbh->prepare("SELECT * FROM `biblio_framework`");
55
   $sth->execute();
56
   while (my $source = $sth->fetchrow_hashref) {
57
      $framework_sources{ $source->{'frameworkcode'} } = $source;
58
   }
59
   return \%framework_sources;
60
 }
61
44
1;
62
1;
(-)a/admin/preferences.pl (+9 lines)
Lines 29-34 use C4::Log; Link Here
29
use C4::Output;
29
use C4::Output;
30
use C4::Templates;
30
use C4::Templates;
31
use Koha::Acquisition::Currencies;
31
use Koha::Acquisition::Currencies;
32
use Koha::BiblioFramework;
32
use File::Spec;
33
use File::Spec;
33
use IO::File;
34
use IO::File;
34
use YAML::Syck qw();
35
use YAML::Syck qw();
Lines 89-94 sub _get_chunk { Link Here
89
            if ( $options{'choices'} eq 'class-sources' ) {
90
            if ( $options{'choices'} eq 'class-sources' ) {
90
                my $sources = GetClassSources();
91
                my $sources = GetClassSources();
91
                $options{'choices'} = { map { $_ => $sources->{$_}->{'description'} } keys %$sources };
92
                $options{'choices'} = { map { $_ => $sources->{$_}->{'description'} } keys %$sources };
93
            } elsif ( $options{'choices'} eq 'framework-sources' ) {
94
                my $sources = Koha::BiblioFramework::GetFrameworkSources();
95
96
                #Add framework to syspref dropdown with a frameworkcode of 'Default' so users can choose to not use
97
                #custom bibliographic frameworks as default bib framework
98
                $sources->{'Default'}->{'frameworkcode'} = 'Default';
99
100
                $options{'choices'} = { map { $_ => $sources->{$_}->{'frameworkcode'} } keys %$sources };
92
            } elsif ( $options{'choices'} eq 'opac-templates' ) {
101
            } elsif ( $options{'choices'} eq 'opac-templates' ) {
93
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
102
                $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) }
94
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
103
            } elsif ( $options{'choices'} eq 'staff-templates' ) {
(-)a/cataloguing/addbiblio.pl (-1 / +7 lines)
Lines 35-40 use C4::ClassSource; Link Here
35
use C4::ImportBatch;
35
use C4::ImportBatch;
36
use C4::Charset;
36
use C4::Charset;
37
use Koha::BiblioFrameworks;
37
use Koha::BiblioFrameworks;
38
use Koha::BiblioFramework;
38
use Koha::DateUtils;
39
use Koha::DateUtils;
39
40
40
use Koha::ItemTypes;
41
use Koha::ItemTypes;
Lines 709-715 if ($frameworkcode eq 'FA'){ Link Here
709
    $userflags = 'fast_cataloging';
710
    $userflags = 'fast_cataloging';
710
}
711
}
711
712
712
$frameworkcode = '' if ( $frameworkcode eq 'Default' );
713
if (( C4::Context->preference("DefaultBibliographicFramework") && C4::Context->preference("DefaultBibliographicFramework") ne 'Default' )) {
714
    $frameworkcode = C4::Context->preference("DefaultBibliographicFramework");
715
} else {
716
    $frameworkcode = '' if ( $frameworkcode eq 'Default' );
717
}
718
713
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
719
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
714
    {
720
    {
715
        template_name   => "cataloguing/addbiblio.tt",
721
        template_name   => "cataloguing/addbiblio.tt",
(-)a/installer/data/mysql/atomicupdate/wr290627_set_default_bibliographic_framework.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('DefaultBibliographicFramework','Default',NULL,'Default bibliographic framework used by the Cataloging framework','FrameworkSources');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+5 lines)
Lines 7-12 Cataloging: Link Here
7
              choices: class-sources
7
              choices: class-sources
8
            - as the default classification source.
8
            - as the default classification source.
9
        -
9
        -
10
            - Use
11
            - pref: DefaultBibliographicFramework
12
              choices: framework-sources
13
            - as the default bibliographic framework to be used by cataloging module.
14
        -
10
            - pref: advancedMARCeditor
15
            - pref: advancedMARCeditor
11
              choices:
16
              choices:
12
                  yes: "Don't display"
17
                  yes: "Don't display"
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (-7 / +17 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
6
<title>Koha &rsaquo; Tools &rsaquo; Manage staged MARC records
Lines 203-217 Link Here
203
    <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
204
    <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
204
    <fieldset class="action">
205
    <fieldset class="action">
205
    [% IF ( record_type != 'auth' ) %]
206
    [% IF ( record_type != 'auth' ) %]
206
    Add new bibliographic records into this framework:
207
        Add new bibliographic records into this framework:
207
    <select name="framework" id="frameworks">
208
        <select name="framework" id="frameworks">
208
      <option value="">Default</option>
209
209
      [% FOREACH framework IN frameworks %]
210
        [% IF defaultframework %]
210
          <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
211
            <option value="[% defaultframework.frameworkcode | html %]" selected="selected">[% defaultframework.frameworktext | html %]</option>
211
      [% END %]
212
        [% ELSE %]
212
    </select>
213
            <option value="" selected="selected">Default</option>
214
        [% END %]
215
216
        [% FOREACH framework IN frameworks %]
217
            [% IF defaultframework.frameworkcode != framework.frameworkcode %]
218
                <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
219
            [% END %]
220
        [% END %]
221
        </select>
213
    [% END %]
222
    [% END %]
214
    <br/>
223
    <br/>
224
215
    <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" />
225
    <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" />
216
    </fieldset>
226
    </fieldset>
217
  </form>
227
  </form>
(-)a/tools/manage-marc-import.pl (-1 / +6 lines)
Lines 63-69 our $sessionID = $cookies{'CGISESSID'}->value; Link Here
63
our $dbh = C4::Context->dbh;
63
our $dbh = C4::Context->dbh;
64
64
65
my $frameworks = Koha::BiblioFrameworks->search({ tagfield => { 'not' => undef } }, { join => 'marc_tag_structure', distinct => 'frameworkcode', order_by => ['frameworktext'] });
65
my $frameworks = Koha::BiblioFrameworks->search({ tagfield => { 'not' => undef } }, { join => 'marc_tag_structure', distinct => 'frameworkcode', order_by => ['frameworktext'] });
66
66
$template->param( frameworks => $frameworks );
67
$template->param( frameworks => $frameworks );
68
if ( (C4::Context->preference('DefaultBibliographicFramework') && C4::Context->preference('DefaultBibliographicFramework') ne 'Default')) {
69
    my $frameworkcode = C4::Context->preference('DefaultBibliographicFramework');
70
    my $defaultframework = Koha::BiblioFrameworks->find($frameworkcode);
71
    $template->param( defaultframework => $defaultframework );
72
}
67
73
68
if ($op eq "create_labels") {
74
if ($op eq "create_labels") {
69
	#create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
75
	#create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
70
- 

Return to bug 23111