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

(-)a/Koha/BiblioFramework.pm (+20 lines)
Lines 41-44 sub _type { Link Here
41
    return 'BiblioFramework';
41
    return 'BiblioFramework';
42
}
42
}
43
43
44
=head2 GetFrameworkSources
45
46
   my $sources = GetFrameworkSources();
47
48
   Returns reference to hash of references to
49
   the framework sources, keyed on frameworkcode.
50
51
=cut
52
53
sub GetFrameworkSources {
54
   my %framework_sources = ();
55
   my $dbh = C4::Context->dbh;
56
   my $sth = $dbh->prepare("SELECT * FROM `biblio_framework`");
57
   $sth->execute();
58
   while (my $source = $sth->fetchrow_hashref) {
59
      $framework_sources{ $source->{'frameworkcode'} } = $source;
60
   }
61
   return \%framework_sources;
62
 }
63
44
1;
64
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'}->{'frameworktext'} = 'Default';
99
100
                $options{'choices'} = { map { $_ => $sources->{$_}->{'frameworktext'} } 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 module','FrameworkSources');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 134-139 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
134
('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'),
134
('decreaseLoanHighHoldsDuration',NULL,'','Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds','Integer'),
135
('decreaseLoanHighHoldsIgnoreStatuses', '', 'damaged|itemlost|notforloan|withdrawn', "Ignore items with these statuses for dynamic high holds checking", 'Choice'),
135
('decreaseLoanHighHoldsIgnoreStatuses', '', 'damaged|itemlost|notforloan|withdrawn', "Ignore items with these statuses for dynamic high holds checking", 'Choice'),
136
('decreaseLoanHighHoldsValue',NULL,'','Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)','Integer'),
136
('decreaseLoanHighHoldsValue',NULL,'','Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)','Integer'),
137
('DefaultBibliographicFramework','Default',NULL,'Default bibliographic framework used by the Cataloging module','FrameworkSources'),
137
('DefaultClassificationSource','ddc',NULL,'Default classification scheme used by the collection. E.g., Dewey, LCC, etc.','ClassSources'),
138
('DefaultClassificationSource','ddc',NULL,'Default classification scheme used by the collection. E.g., Dewey, LCC, etc.','ClassSources'),
138
('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 of MARC21 - Place of publication, production, or execution. See <a href=\"http://www.loc.gov/marc/countries/countries_code.html\">MARC Code List for Countries</a>','Free'),
139
('DefaultCountryField008','','','Fill in the default country code for field 008 Range 15-17 of MARC21 - Place of publication, production, or execution. See <a href=\"http://www.loc.gov/marc/countries/countries_code.html\">MARC Code List for Countries</a>','Free'),
139
('DefaultLanguageField008','','','Fill in the default language for field 008 Range 35-37 of MARC21 records (e.g. eng, nor, ger, see <a href=\"http://www.loc.gov/marc/languages/language_code.html\">MARC Code List for Languages</a>)','Free'),
140
('DefaultLanguageField008','','','Fill in the default language for field 008 Range 35-37 of MARC21 records (e.g. eng, nor, ger, see <a href=\"http://www.loc.gov/marc/languages/language_code.html\">MARC Code List for Languages</a>)','Free'),
(-)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 (-3 / +11 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 216-225 Link Here
216
                                        [% IF ( record_type != 'auth' ) %]
217
                                        [% IF ( record_type != 'auth' ) %]
217
                                            Add new bibliographic records into this framework:
218
                                            Add new bibliographic records into this framework:
218
                                            <select name="framework" id="frameworks">
219
                                            <select name="framework" id="frameworks">
219
                                                <option value="">Default</option>
220
220
                                                [% FOREACH framework IN frameworks %]
221
                                            [% IF defaultframework %]
222
                                                <option value="[% defaultframework.frameworkcode | html %]" selected="selected">[% defaultframework.frameworktext | html %]</option>
223
                                            [% ELSE %]
224
                                                <option value="" selected="selected">Default</option>
225
                                            [% END %]
226
                                            [% FOREACH framework IN frameworks %]
227
                                                [% IF defaultframework.frameworkcode != framework.frameworkcode %]
221
                                                    <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
228
                                                    <option value="[% framework.frameworkcode | html %]">[% framework.frameworktext | html %]</option>
222
                                                [% END %]
229
                                                [% END %]
230
                                            [% END %]
223
                                            </select>
231
                                            </select>
224
                                        [% END %]
232
                                        [% END %]
225
                                        <br />
233
                                        <br />
Lines 576-579 Link Here
576
            [% END %]
584
            [% END %]
577
        </ul>
585
        </ul>
578
    </nav>
586
    </nav>
579
[% END %]
587
[% END %]
(-)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