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

(-)a/admin/biblio_framework.pl (-114 / +88 lines)
Lines 1-10 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
# NOTE: 4-character tabs
3
4
#written 20/02/2002 by paul.poulain@free.fr
5
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
6
2
7
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
4
# Copyright 2002 Paul Poulain
8
#
5
#
9
# This file is part of Koha.
6
# This file is part of Koha.
10
#
7
#
Lines 21-151 Link Here
21
# You should have received a copy of the GNU General Public License
18
# You should have received a copy of the GNU General Public License
22
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
23
20
24
use strict;
21
use Modern::Perl;
25
use warnings;
26
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
27
use C4::Context;
23
use C4::Context;
28
use C4::Auth;
24
use C4::Auth;
29
use C4::Output;
25
use C4::Output;
26
use Koha::Biblios;
27
use Koha::BiblioFramework;
28
use Koha::BiblioFrameworks;
30
use Koha::Cache;
29
use Koha::Cache;
31
30
32
sub StringSearch  {
31
my $input         = new CGI;
33
	my $dbh = C4::Context->dbh;
32
my $frameworkcode = $input->param('frameworkcode') || q||;
34
	my $sth=$dbh->prepare("Select * from biblio_framework where (frameworkcode like ?) order by frameworktext");
33
my $op            = $input->param('op') || q|list|;
35
	$sth->execute((shift || '') . '%');
36
    return $sth->fetchall_arrayref({});
37
}
38
39
my $input = new CGI;
40
my $script_name   = "/cgi-bin/koha/admin/biblio_framework.pl";
41
my $frameworkcode = $input->param('frameworkcode') || '';
42
my $offset        = $input->param('offset') || 0;
43
my $op            = $input->param('op') || '';
44
my $pagesize      = 20;
45
my $cache         = Koha::Cache->get_instance();
34
my $cache         = Koha::Cache->get_instance();
35
my @messages;
46
36
47
my ($template, $borrowernumber, $cookie)
37
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
48
    = get_template_and_user({template_name => "admin/biblio_framework.tt",
38
    {   template_name   => "admin/biblio_framework.tt",
49
			     query => $input,
39
        query           => $input,
50
			     type => "intranet",
40
        type            => "intranet",
51
			     authnotrequired => 0,
41
        authnotrequired => 0,
52
                 flagsrequired => {parameters => 'parameters_remaining_permissions'},
42
        flagsrequired   => { parameters => 'parameters_remaining_permissions' },
53
			     debug => 1,
43
        debug           => 1,
54
			     });
44
    }
55
45
);
56
$template->param( script_name  => $script_name);
57
$template->param(($op||'else') => 1);
58
46
59
my $dbh = C4::Context->dbh;
47
my $dbh = C4::Context->dbh;
60
################## ADD_FORM ##################################
48
if ( $op eq 'add_form' ) {
61
# called by default. Used to create form to add or  modify a record
49
    my $framework;
62
if ($op eq 'add_form') {
50
    if ($frameworkcode) {
63
	#start the page and read in includes
51
        $framework = Koha::BiblioFrameworks->find($frameworkcode);
64
	#---- if primkey exists, it's a modify action, so read values to modify...
52
    }
65
	my $data;
53
    $template->param( framework => $framework );
66
	if ($frameworkcode) {
54
} elsif ( $op eq 'add_validate' ) {
67
		my $sth=$dbh->prepare("select * from biblio_framework where frameworkcode=?");
55
    my $frameworkcode = $input->param('frameworkcode');
68
		$sth->execute($frameworkcode);
56
    my $frameworktext = $input->param('frameworktext');
69
		$data=$sth->fetchrow_hashref;
57
70
	}
58
    my $framework = Koha::BiblioFrameworks->find($frameworkcode);
71
	$template->param(
59
    if ($framework) {
72
        frameworkcode => $frameworkcode,
60
        $framework->frameworktext($frameworktext);
73
        frameworktext => $data->{'frameworktext'},
61
        eval { $framework->store; };
74
    );
62
        if ($@) {
75
													# END $OP eq ADD_FORM
63
            push @messages, { type => 'error', code => 'error_on_update' };
76
################## ADD_VALIDATE ##################################
77
# called by add_form, used to insert/modify data in DB
78
} elsif ($op eq 'add_validate') {
79
    my $dbh = C4::Context->dbh;
80
    if ( $input->param('frameworktext') and $frameworkcode ) {
81
        if ($input->param('modif')) {
82
            my $sth=$dbh->prepare("UPDATE biblio_framework SET frameworktext=? WHERE frameworkcode=?");
83
            $sth->execute( $input->param('frameworktext'), $frameworkcode );
84
        } else {
64
        } else {
85
            my $sth=$dbh->prepare("INSERT into biblio_framework (frameworkcode,frameworktext) values (?,?)");
65
            push @messages, { type => 'message', code => 'success_on_update' };
86
            $sth->execute( $frameworkcode, $input->param('frameworktext') );
87
        }
66
        }
88
        $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
67
    } else {
89
        $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
68
        $framework = Koha::BiblioFramework->new(
90
	}
69
            {   frameworkcode => $frameworkcode,
91
	print $input->redirect($script_name);   # FIXME: unnecessary redirect
70
                frameworktext => $frameworktext,
92
	exit;
71
            }
93
													# END $OP eq ADD_VALIDATE
72
        );
94
################## DELETE_CONFIRM ##################################
73
        eval { $framework->store; };
95
# called by default form, used to confirm deletion of data in DB
74
        if ($@) {
96
} elsif ($op eq 'delete_confirm') {
75
            push @messages, { type => 'error', code => 'error_on_insert' };
97
	# Check both categoryitem and biblioitems, see Bug 199
76
        } else {
98
    my $sth = $dbh->prepare("select count(*) as total from biblio where frameworkcode=?");
77
            push @messages, { type => 'message', code => 'success_on_insert' };
99
    $sth->execute($frameworkcode);
78
        }
100
    my $total = $sth->fetchrow_hashref->{total};
79
    }
101
80
    $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
102
	$sth = $dbh->prepare("select * from biblio_framework where frameworkcode=?");
81
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
103
	$sth->execute($frameworkcode);
82
    $op = 'list';
104
	my $data = $sth->fetchrow_hashref;
83
} elsif ( $op eq 'delete_confirm' ) {
84
    my $framework = Koha::BiblioFrameworks->find($frameworkcode);
85
    my $count = Koha::Biblios->search( { frameworkcode => $frameworkcode, } )->count;
105
86
106
	$template->param(
87
    $template->param(
107
        frameworkcode => $frameworkcode,
88
        framework                  => $framework,
108
        frameworktext => $data->{'frameworktext'},
89
        biblios_use_this_framework => $count,
109
        total => $total
110
    );
90
    );
111
													# END $OP eq DELETE_CONFIRM
91
} elsif ( $op eq 'delete_confirmed' ) {
112
################## DELETE_CONFIRMED ##################################
92
    my $framework = Koha::BiblioFrameworks->find($frameworkcode);
113
# called by delete_confirm, used to effectively confirm deletion of data in DB
93
    my $deleted = eval { $framework->delete; };
114
} elsif ($op eq 'delete_confirmed') {
94
115
    if ($frameworkcode) { 
95
    if ( $@ or not $deleted ) {
116
		my $sth=$dbh->prepare("delete from marc_tag_structure where frameworkcode=?");
96
        push @messages, { type => 'error', code => 'error_on_delete' };
117
		$sth->execute($frameworkcode);
97
    } else {
118
		$sth=$dbh->prepare("delete from marc_subfield_structure where frameworkcode=?");
98
        eval {
119
		$sth->execute($frameworkcode);
99
            my $dbh = C4::Context->dbh;
120
		$sth=$dbh->prepare("delete from biblio_framework where frameworkcode=?");
100
            $dbh->do( q|DELETE FROM marc_tag_structure WHERE frameworkcode=?|,      undef, $frameworkcode );
121
		$sth->execute($frameworkcode);
101
            $dbh->do( q|DELETE FROM marc_subfield_structure WHERE frameworkcode=?|, undef, $frameworkcode );
122
        $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
123
        $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
124
	}
125
	print $input->redirect($script_name);   # FIXME: unnecessary redirect
126
	exit;
127
													# END $OP eq DELETE_CONFIRMED
128
################## DEFAULT ##################################
129
} else { # DEFAULT
130
	my $results = StringSearch($frameworkcode);
131
    my $count = scalar(@$results);
132
	my @loop_data;
133
	for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
134
		push @loop_data, {
135
            frameworkcode => $results->[$i]{'frameworkcode'},
136
            frameworktext => $results->[$i]{'frameworktext'},
137
        };
102
        };
138
	}
103
        if ($@) {
139
	$template->param(loop => \@loop_data);
104
            push @messages, { type => 'error', code => 'error_on_delete_fk' };
140
	if ($offset>0) {
105
        } else {
141
		my $prevpage = $offset-$pagesize;
106
            push @messages, { type => 'message', code => 'success_on_delete' };
142
		$template->param(previous => "$script_name?offset=".$prevpage);
107
        }
143
	}
108
    }
144
	if ($offset+$pagesize<$count) {
109
    $cache->clear_from_cache("MarcStructure-0-$frameworkcode");
145
		my $nextpage =$offset+$pagesize;
110
    $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
146
		$template->param(next => "$script_name?offset=".$nextpage);
111
    $op = 'list';
147
	}
112
}
148
} #---- END $OP eq DEFAULT
113
114
if ( $op eq 'list' ) {
115
    my $frameworks = Koha::BiblioFrameworks->search( {}, { order_by => ['frameworktext'], } );
116
    $template->param( frameworks => $frameworks, );
117
}
118
119
$template->param(
120
    messages => \@messages,
121
    op       => $op,
122
);
149
123
150
output_html_with_http_headers $input, $cookie, $template->output;
124
output_html_with_http_headers $input, $cookie, $template->output;
151
125
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt (-70 / +114 lines)
Lines 1-18 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Administration &rsaquo; MARC frameworks
2
<title>Koha &rsaquo; Administration &rsaquo; MARC frameworks
3
[% IF ( add_form ) %]
3
[% IF op == 'add_form' %]
4
&rsaquo; [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
4
&rsaquo; [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]
5
[% ELSIF ( delete_confirm ) %]
5
[% ELSIF op == 'delete_confirm' %]
6
&rsaquo; Delete framework for [% frameworktext %] ([% frameworkcode %])?
6
&rsaquo; Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?
7
[% END %]
7
[% END %]
8
</title>
8
</title>
9
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
10
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11
[% INCLUDE 'datatables.inc' %]
10
<script type="text/javascript">
12
<script type="text/javascript">
11
/* Import/Export from/to spreadsheet */
13
/* Import/Export from/to spreadsheet */
12
14
13
    var importing = false;
15
    var importing = false;
14
16
15
    $(document).ready(function() {
17
    $(document).ready(function() {
18
        $("#table_biblio_frameworks").dataTable($.extend(true, {}, dataTablesDefaults, {
19
            "aoColumnDefs": [
20
                { "aTargets": [ -1, -2, -3, -4, -5 ], "bSortable": false, "bSearchable": false },
21
                { "aTargets": [ 0, 1 ], "sType": "natural" },
22
            ],
23
            "bSort": false,
24
            "sPaginationType": "four_button"
25
        }));
26
16
        $("body").css("cursor", "auto");
27
        $("body").css("cursor", "auto");
17
        $('.import_export_options').hide();
28
        $('.import_export_options').hide();
18
        $('a.import_export_fw').click(function() {
29
        $('a.import_export_fw').click(function() {
Lines 87-96 Link Here
87
        <a href="/cgi-bin/koha/mainpage.pl">Home</a>
98
        <a href="/cgi-bin/koha/mainpage.pl">Home</a>
88
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
99
&rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
89
&rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
100
&rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
90
[% IF ( add_form ) %]
101
[% IF op == 'add_form' %]
91
&rsaquo; [% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]
102
&rsaquo; [% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]
92
[% ELSIF ( delete_confirm ) %]
103
[% ELSIF op == 'delete_confirm' %]
93
&rsaquo; Delete framework for [% frameworktext %] ([% frameworkcode %])?
104
&rsaquo; Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?
94
[% END %]
105
[% END %]
95
</div>
106
</div>
96
107
Lines 99-154 Link Here
99
    <div id="yui-main">
110
    <div id="yui-main">
100
      <div class="yui-b">
111
      <div class="yui-b">
101
112
102
[% IF ( else ) %]
113
[% FOR m IN messages %]
103
<div id="toolbar" class="btn-toolbar">
114
    <div class="dialog [% m.type %]">
104
    <a class="btn btn-small" id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form"><i class="fa fa-plus"></i> New framework</a>
115
        [% SWITCH m.code %]
105
</div>
116
        [% CASE 'error_on_update' %]
117
            An error occurred when updating this framework. Perhaps it already exists.
118
        [% CASE 'error_on_insert' %]
119
            An error occurred when inserting this framework. The framework might already exist.
120
        [% CASE 'error_on_delete' %]
121
            An error occurred when deleting this framework. Check the logs.
122
        [% CASE 'success_on_update' %]
123
            Framework updated successfully.
124
        [% CASE 'success_on_insert' %]
125
            Framework inserted successfully.
126
        [% CASE 'success_on_delete' %]
127
            Framework deleted successfully.
128
        [% CASE 'already_exists' %]
129
            This framework code already exists.
130
        [% CASE %]
131
            [% m.code %]
132
        [% END %]
133
    </div>
134
[% END %]
135
136
137
138
[% IF op == 'list'%]
139
    <div id="toolbar" class="btn-toolbar">
140
        <a class="btn btn-small" id="newframework" href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form"><i class="fa fa-plus"></i> New framework</a>
141
    </div>
106
[% END %]
142
[% END %]
107
143
108
[% IF ( add_form ) %]
144
[% IF op == 'add_form' %]
109
    <h1>[% IF ( frameworkcode ) %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
145
    <h1>[% IF framework %]Modify framework text[% ELSE %]Add framework[% END %]</h1>
110
    <form action="[% script_name %]" name="Aform" method="post" class="validated">
146
    <form action="/cgi-bin/koha/admin/biblio_framework.pl" name="Aform" method="post" class="validated">
111
        <input type="hidden" name="op" value="add_validate" />
147
        <input type="hidden" name="op" value="add_validate" />
112
    <fieldset class="rows">
148
        <fieldset class="rows">
113
    <ol>
149
            <ol>
114
	[% IF ( frameworkcode ) %]
150
                [% IF framework %]
115
        <li><span class="label">Framework code: </span><input type="hidden" id="frameworkcode" name="frameworkcode" value="[% frameworkcode %]" />[% frameworkcode %]
151
                    <li>
116
            <input type="hidden" name="modif" value="1" />
152
                        <span class="label">Framework code: </span>
117
        </li>
153
                        <input type="hidden" id="frameworkcode" name="frameworkcode" value="[% framework.frameworkcode %]" />[% framework.frameworkcode %]
118
	[% ELSE %]
154
                    </li>
119
        <li>
155
                [% ELSE %]
120
            <label for="frameworkcode" class="required">Framework code: </label>
156
                    <li>
121
            <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" required="required" class="required" />
157
                        <label for="frameworkcode" class="required">Framework code: </label>
122
            <span class="required">Required</span>
158
                        <input type="text" id="frameworkcode" name="frameworkcode" size="4" maxlength="4" onblur="toUC(this)" required="required" class="required" />
123
    </li>
159
                        <span class="required">Required</span>
124
	[% END %]
160
                    </li>
125
        <li>
161
                [% END %]
126
            <label for="description" class="required">Description: </label>
162
                <li>
127
            <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% frameworktext |html %]" required="required" class="required" />
163
                    <label for="description" class="required">Description: </label>
128
            <span class="required">Required</span>
164
                    <input type="text" name="frameworktext" id="description" size="40" maxlength="80" value="[% framework.frameworktext |html %]" required="required" class="required" />
129
        </li>
165
                    <span class="required">Required</span>
130
    </ol>
166
                </li>
131
    </fieldset>
167
            </ol>
132
    <fieldset class="action"><input type="submit" value="Submit" class="submit" /></fieldset>
168
        </fieldset>
169
        <fieldset class="action">
170
            <input type="submit" value="Submit" class="submit" />
171
        </fieldset>
133
    </form>
172
    </form>
134
[% END %]
173
[% END %]
135
174
136
[% IF ( delete_confirm ) %]
175
[% IF op == 'delete_confirm' %]
137
<div class="dialog alert">
176
    <div class="dialog alert">
138
    <h3>Delete framework for [% frameworktext %] ([% frameworkcode %])?</h3>
177
        <h3>Delete framework for [% framework.frameworktext %] ([% framework.frameworkcode %])?</h3>
139
    [% IF ( total ) %]
178
        [% IF biblios_use_this_framework %]
140
       <p><strong>This framework is used [% total %] times</strong>.</p>
179
           <p><strong>This framework is used [% biblios_use_this_framework %] times</strong>.</p>
141
    [% END %]
180
        [% END %]
142
    <form class="inline" action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /><input type="submit" class="approve" value="Yes, delete this framework!" />
181
        <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="post">
143
    </form>
182
            <input type="hidden" name="op" value="delete_confirmed" />
144
    <form class="inline" action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete!" /></form>
183
            <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode %]" />
145
</div>
184
            <input type="submit" class="approve" value="Yes, delete this framework!" />
185
        </form>
186
        <form class="inline" action="/cgi-bin/koha/admin/biblio_framework.pl" method="get">
187
            <input type="submit" class="deny" value="No, do not delete!" />
188
        </form>
189
    </div>
146
[% END %]
190
[% END %]
147
191
148
[% IF ( else ) %]
192
[% IF op == 'list' %]
149
<h1>MARC frameworks</h1>
193
<h1>MARC frameworks</h1>
150
<p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
194
<p>Framework name, then go to MARC biblio to set MARC editor parameters</p>
151
<table>
195
<table id="table_biblio_frameworks">
196
    <thead>
152
    <tr>
197
    <tr>
153
        <th>Code</th>
198
        <th>Code</th>
154
        <th>Description</th>
199
        <th>Description</th>
Lines 158-186 Link Here
158
        <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
203
        <th title="Export framework structure (fields, subfields) to a spreadsheet file (.csv, .xml, .ods)">Export</th>
159
        <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
204
        <th title="Import framework structure (fields, subfields) from a spreadsheet file (.csv, .xml, .ods)">Import</th>
160
    </tr>
205
    </tr>
206
    </thead>
207
    <tbody>
161
    <tr>
208
    <tr>
162
        <td>&nbsp;</td>
209
        <td>&nbsp;</td>
163
        <td>Default framework</td>
210
        <td>Default framework</td>
164
        <td><a href="marctagstructure.pl?frameworkcode=[% frameworkcode %]">MARC structure</a></td>
211
        <td><a href="marctagstructure.pl?frameworkcode=">MARC structure</a></td>
165
        <td>&nbsp;</td>
212
        <td>&nbsp;</td>
166
        <td>&nbsp;</td>
213
        <td>&nbsp;</td>
167
        <td>
214
        <td>
168
215
169
            <!-- Button to trigger modal -->
216
            <!-- Button to trigger modal -->
170
            <a href="#" data-toggle="modal" data-target="#exportModal_[% frameworkcode %]">Export</a>
217
            <a href="#" data-toggle="modal" data-target="#exportModal_default">Export</a>
171
            <!-- Modal -->
218
            <!-- Modal -->
172
            <div class="modal hide" id="exportModal_[% frameworkcode %]" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_[% frameworkcode %]" aria-hidden="true">
219
            <div class="modal hide" id="exportModal_default" tabindex="-1" role="dialog" aria-labelledby="exportLabelexportModal_default" aria-hidden="true">
173
                <div class="modal-header">
220
                <div class="modal-header">
174
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
221
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
175
                    <h3 id="exportLabelexportModal_[% frameworkcode %]">Export default framework</h3>
222
                    <h3 id="exportLabelexportModal_default">Export default framework</h3>
176
                </div>
223
                </div>
177
                <form action="import_export_framework.pl" name="form_[% frameworkcode %]" method="get" target="_blank"  class="form_export">
224
                <form action="import_export_framework.pl" name="form_defaul" method="get" target="_blank"  class="form_export">
178
                    <div class="modal-body">
225
                    <div class="modal-body">
179
                        <fieldset>
226
                        <fieldset>
180
                            <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
227
                            <input type="hidden" name="frameworkcode" value="" />
181
                            <p><label for="csv_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="csv" id="csv_type_export_[% frameworkcode %]" checked="checked" /> Export to CSV spreadsheet</label></p>
228
                            <p><label for="csv_type_export_default"><input type="radio" name="type_export_defaul" value="csv" id="csv_type_export_default" checked="checked" /> Export to CSV spreadsheet</label></p>
182
                            <p><label for="xml_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="excel" id="xml_type_export_[% frameworkcode %]" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
229
                            <p><label for="xml_type_export_default"><input type="radio" name="type_export_default" value="excel" id="xml_type_export_default" /> Export to Excel with XML format, compatible with OpenOffice/LibreOffice as well</label></p>
183
                            <p><label for="ods_type_export_[% frameworkcode %]"><input type="radio" name="type_export_[% frameworkcode %]" value="ods" id="ods_type_export_[% frameworkcode %]" /> Export to OpenDocument spreadsheet format</label></p>
230
                            <p><label for="ods_type_export_default"><input type="radio" name="type_export_default" value="ods" id="ods_type_export_default" /> Export to OpenDocument spreadsheet format</label></p>
184
231
185
                        </fieldset>
232
                        </fieldset>
186
                    </div>
233
                    </div>
Lines 195-213 Link Here
195
        <td>
242
        <td>
196
243
197
            <!-- Button to trigger modal -->
244
            <!-- Button to trigger modal -->
198
            <a href="#" data-toggle="modal" data-target="#importModal_[% frameworkcode %][% loop.count %]">Import</a>
245
            <a href="#" data-toggle="modal" data-target="#importModal_[% framework.frameworkcode %][% frameworks.count %]">Import</a>
199
            <!-- Modal -->
246
            <!-- Modal -->
200
            <div class="modal hide" id="importModal_[% frameworkcode %][% loop.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_[% frameworkcode %][% loop.count %]" aria-hidden="true">
247
            <div class="modal hide" id="importModal_[% framework.frameworkcode %][% frameworks.count %]" tabindex="-1" role="dialog" aria-labelledby="importLabelexportModal_default[% frameworks.count %]" aria-hidden="true">
201
                <div class="modal-header">
248
                <div class="modal-header">
202
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
249
                    <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
203
                    <h3 id="importLabelexportModal_[% frameworkcode %][% loop.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
250
                    <h3 id="importLabelexportModal_[% framework.frameworkcode %][% frameworks.count %]">Import default framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods)</h3>
204
                </div>
251
                </div>
205
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_[% frameworkcode %]" id="form_i_[% frameworkcode %]" method="post" enctype="multipart/form-data" class="form_import">
252
                <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import">
206
                    <div class="modal-body">
253
                    <div class="modal-body">
207
                            <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
254
                            <input type="hidden" name="frameworkcode" value="default" />
208
                            <input type="hidden" name="action" value="import" />
255
                            <input type="hidden" name="action" value="import" />
209
                            <p><label for="file_import_[% frameworkcode %]">Upload file:</label> <input type="file" name="file_import_[% frameworkcode %]" id="file_import_[% frameworkcode %]" class="input_import" /></p>
256
                            <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
210
                            <div id="importing_[% frameworkcode %]" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
257
                            <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>
211
                    </div>
258
                    </div>
212
                    <div class="modal-footer">
259
                    <div class="modal-footer">
213
                        <button type="submit" class="btn">Import</button>
260
                        <button type="submit" class="btn">Import</button>
Lines 219-231 Link Here
219
        </td>
266
        </td>
220
    </tr>
267
    </tr>
221
    <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
268
    <!-- note highlight assignment appears backwards because we already have a normal row for Default -->
222
    [% FOREACH loo IN loop %]
269
    [% FOREACH loo IN frameworks %]
223
        <tr>
270
        <tr>
224
            <td>[% loo.frameworkcode %]</td>
271
            <td>[% loo.frameworkcode %]</td>
225
            <td>[% loo.frameworktext %]</td>
272
            <td>[% loo.frameworktext %]</td>
226
            <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
273
            <td><a href="marctagstructure.pl?frameworkcode=[% loo.frameworkcode %]" >MARC structure</a></td>
227
            <td><a href="[% loo.script_name %]?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
274
            <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=add_form&amp;frameworkcode=[% loo.frameworkcode |html %]">Edit</a></td>
228
            <td><a href="[% loo.script_name %]?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
275
            <td><a href="/cgi-bin/koha/admin/biblio_framework.pl?op=delete_confirm&amp;frameworkcode=[% loo.frameworkcode |html %]">Delete</a></td>
229
            <td>
276
            <td>
230
277
231
                <!-- Button to trigger modal -->
278
                <!-- Button to trigger modal -->
Lines 280-287 Link Here
280
        </tr>
327
        </tr>
281
    [% END %]
328
    [% END %]
282
</table>
329
</table>
283
    [% IF ( previous ) %]<a href="[% previous %]">&lt;&lt; Previous</a>[% END %]
284
    [% IF ( next ) %]<a href="[% next %]">Next &gt;&gt;</a>[% END %]
285
330
286
[% END %]
331
[% END %]
287
    </div>
332
    </div>
288
- 

Return to bug 14889