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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_authority_record_modification.inc (+39 lines)
Line 0 Link Here
1
[% BLOCK report %]
2
    [% SET report = job.report %]
3
    [% IF report %]
4
        [% IF report.total_records == report.total_success %]
5
            <div class="dialog message">
6
                All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
7
            </div>
8
        [% ELSE %]
9
            <div class="dialog message">
10
                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
11
                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
12
                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
13
            </div>
14
        [% END %]
15
    [% END %]
16
[% END %]
17
18
[% BLOCK detail %]
19
    [% FOR m IN job.messages %]
20
        <div class="dialog message">
21
            [% IF m.type == 'success' %]
22
                <i class="fa fa-check success"></i>
23
            [% ELSIF m.type == 'warning' %]
24
                <i class="fa fa-warning warn"></i>
25
            [% ELSIF m.type == 'error' %]
26
                <i class="fa fa-exclamation error"></i>
27
            [% END %]
28
            [% SWITCH m.code %]
29
            [% CASE 'authority_not_modified' %]
30
                Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has not been modified. An error occurred on modifying it[% IF m.error %] ([% m.error %])[% END %].
31
            [% CASE 'authority_modified' %]
32
                Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified..
33
            [% END %]
34
        </div>
35
    [% END %]
36
[% END %]
37
38
[% BLOCK js %]
39
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_biblio_record_deletion.inc (+49 lines)
Line 0 Link Here
1
[% BLOCK report %]
2
    [% SET report = job.report %]
3
    [% IF report %]
4
        [% IF report.total_records == report.total_success %]
5
            <div class="dialog message">
6
                All records have been deleted successfully!
7
            </div>
8
        [% ELSIF report.total_success == 0 %]
9
            <div class="dialog message">
10
                No record has been deleted. An error occurred.
11
            </div>
12
        [% ELSE %]
13
            <div class="dialog message">
14
                [% report.total_success | html %] / [% report.total_records | html %] records have been deleted successfully but some errors occurred.
15
            </div>
16
        [% END %]
17
    [% END %]
18
[% END %]
19
20
[% BLOCK detail %]
21
    [% FOR m IN job.messages %]
22
        <div class="dialog message">
23
            [% IF m.type == 'success' %]
24
                <i class="fa fa-check success"></i>
25
            [% ELSIF m.type == 'warning' %]
26
                <i class="fa fa-warning warn"></i>
27
            [% ELSIF m.type == 'error' %]
28
                <i class="fa fa-exclamation error"></i>
29
            [% END %]
30
            [% SWITCH m.code %]
31
            [% CASE 'biblio_not_exists' %]
32
                The biblionumber [% m.biblionumber | html %] does not exist in the database.
33
            [% CASE 'item_issued' %]
34
                At least one item is checked out on bibliographic record [% m.biblionumber | html %].
35
            [% CASE 'reserve_not_cancelled' %]
36
                Bibliographic record [% m.biblionumber | html %] was not deleted. A hold could not be canceled (reserve_id [% m.reserve_id | html %]).
37
            [% CASE 'item_not_deleted' %]
38
                The bibliographic record [% m.biblionumber | html %] was not deleted. An error was encountered when deleting an item (itemnumber [% m.itemnumber | html %]).
39
            [% CASE 'biblio_not_deleted' %]
40
                Bibliographic record [% m.biblionumber | html %] was not deleted. An error occurred.
41
            [% CASE 'biblio_deleted' %]
42
                Bibliographic record [% m.biblionumber | html %] has been deleted successfully.
43
            [% END %]
44
        </div>
45
    [% END %]
46
[% END %]
47
48
[% BLOCK js %]
49
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/background_jobs/batch_biblio_record_modification.inc (+64 lines)
Line 0 Link Here
1
[% BLOCK report %]
2
    [% SET report = job.report %]
3
    [% IF report %]
4
        [% IF report.total_records == report.total_success %]
5
            <div class="dialog message">
6
                All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
7
                [% IF lists.count %]
8
                    <br />
9
                    Add modified records to the following list:
10
                    <select name="add_bibs_to_list" id="add_bibs_to_list">
11
                        <option value="">Select a list</option>
12
                        [% FOREACH list IN lists %]
13
                            <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
14
                        [% END %]
15
                    </select>
16
                [% END %]
17
            </div>
18
        [% ELSE %]
19
            <div class="dialog message">
20
                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
21
                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
22
                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
23
            </div>
24
        [% END %]
25
    [% END %]
26
[% END %]
27
28
[% BLOCK detail %]
29
    [% FOR m IN job.messages %]
30
        <div class="dialog message">
31
            [% IF m.type == 'success' %]
32
                <i class="fa fa-check success"></i>
33
            [% ELSIF m.type == 'warning' %]
34
                <i class="fa fa-warning warn"></i>
35
            [% ELSIF m.type == 'error' %]
36
                <i class="fa fa-exclamation error"></i>
37
            [% END %]
38
            [% SWITCH m.code %]
39
            [% CASE 'biblio_not_modified' %]
40
                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error | html %])[% END %].
41
            [% CASE 'biblio_modified' %]
42
                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
43
            [% END %]
44
        </div>
45
    [% END %]
46
[% END %]
47
48
[% BLOCK js %]
49
    $("#add_bibs_to_list").change(function(){
50
        var selected = $("#add_bibs_to_list").find("option:selected");
51
        if ( selected.attr("class") == "shelf" ){
52
            var shelfnumber = selected.attr("value");
53
            var bibs = new Array();
54
            [% FOREACH message IN job.messages %]
55
                [% IF message.code == 'biblio_modified' %]
56
                    bibs.push("biblionumber="+[% message.biblionumber | html %]);
57
                [% END %]
58
            [% END %]
59
            var bibstring = bibs.join("&");
60
            window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
61
            return false;
62
        }
63
    });
64
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt (-142 / +7 lines)
Lines 57-62 Administration &rsaquo; Koha Link Here
57
[% IF op == 'view' %]
57
[% IF op == 'view' %]
58
    <h1>Detail of job #[% job.id | html %]</h1>
58
    <h1>Detail of job #[% job.id | html %]</h1>
59
59
60
    [% PROCESS "background_jobs/${job.type}.inc" %]
61
60
    <fieldset class="rows">
62
    <fieldset class="rows">
61
        <ol>
63
        <ol>
62
            <li><span class="label">Job ID: </span>[% job.id | html %]</li>
64
            <li><span class="label">Job ID: </span>[% job.id | html %]</li>
Lines 67-200 Administration &rsaquo; Koha Link Here
67
            <li><label for="job_started_on">Started: </label>[% job.started_on | html %]</li>
69
            <li><label for="job_started_on">Started: </label>[% job.started_on | html %]</li>
68
            <li><label for="job_ended_on">Ended: </label>[% job.ended_on | html %]</li>
70
            <li><label for="job_ended_on">Ended: </label>[% job.ended_on | html %]</li>
69
            <li><label for="job_data">Report: </label>
71
            <li><label for="job_data">Report: </label>
70
                [% SWITCH job.type %]
72
                [% PROCESS 'report' %]
71
                [% CASE 'batch_biblio_record_modification' %]
72
                    [% SET report = job.report %]
73
                    [% IF report %]
74
                        [% IF report.total_records == report.total_success %]
75
                            <div class="dialog message">
76
                                All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
77
                                [% IF lists.count %]
78
                                    <br />
79
                                    Add modified records to the following list:
80
                                    <select name="add_bibs_to_list" id="add_bibs_to_list">
81
                                        <option value="">Select a list</option>
82
                                        [% FOREACH list IN lists %]
83
                                            <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
84
                                        [% END %]
85
                                    </select>
86
                                [% END %]
87
                            </div>
88
                        [% ELSE %]
89
                            <div class="dialog message">
90
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
91
                                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
92
                                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
93
                            </div>
94
                        [% END %]
95
                    [% END %]
96
                [% CASE 'batch_authority_record_modification' %]
97
                    [% SET report = job.report %]
98
                    [% IF report %]
99
                        [% IF report.total_records == report.total_success %]
100
                            <div class="dialog message">
101
                                All records have successfully been modified! <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
102
                            </div>
103
                        [% ELSE %]
104
                            <div class="dialog message">
105
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
106
                                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
107
                                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
108
                            </div>
109
                        [% END %]
110
                    [% END %]
111
                [% CASE 'batch_biblio_record_deletion' %]
112
                    [% SET report = job.report %]
113
                    [% IF report %]
114
                        [% IF report.total_records == report.total_success %]
115
                            <div class="dialog message">
116
                                All records have been deleted successfully!
117
                            </div>
118
                        [% ELSIF report.total_success == 0 %]
119
                            <div class="dialog message">
120
                                No record has been deleted. An error occurred.
121
                            </div>
122
                        [% ELSE %]
123
                            <div class="dialog message">
124
                                [% report.total_success | html %] / [% report.total_records | html %] records have been deleted successfully but some errors occurred.
125
                            </div>
126
                        [% END %]
127
                    [% END %]
128
                [% CASE %]Job type "[% job.type | html %]" not handled in the template
129
                [% END %]
130
            </li>
73
            </li>
131
            <li><label for="job_data">Detailed messages: </label>
74
            <li><label for="job_data">Detailed messages: </label>
132
                [% SWITCH job.type %]
75
                [% PROCESS 'detail' %]
133
                [% CASE 'batch_biblio_record_modification' %]
134
                    [% FOR m IN job.messages %]
135
                        <div class="dialog message">
136
                            [% IF m.type == 'success' %]
137
                                <i class="fa fa-check success"></i>
138
                            [% ELSIF m.type == 'warning' %]
139
                                <i class="fa fa-warning warn"></i>
140
                            [% ELSIF m.type == 'error' %]
141
                                <i class="fa fa-exclamation error"></i>
142
                            [% END %]
143
                            [% SWITCH m.code %]
144
                            [% CASE 'biblio_not_modified' %]
145
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has not been modified. An error occurred on modifying it.[% IF m.error %] ([% m.error | html %])[% END %].
146
                            [% CASE 'biblio_modified' %]
147
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
148
                            [% END %]
149
                        </div>
150
                    [% END %]
151
                [% CASE 'batch_authority_record_modification' %]
152
                    [% FOR m IN job.messages %]
153
                        <div class="dialog message">
154
                            [% IF m.type == 'success' %]
155
                                <i class="fa fa-check success"></i>
156
                            [% ELSIF m.type == 'warning' %]
157
                                <i class="fa fa-warning warn"></i>
158
                            [% ELSIF m.type == 'error' %]
159
                                <i class="fa fa-exclamation error"></i>
160
                            [% END %]
161
                            [% SWITCH m.code %]
162
                            [% CASE 'authority_not_modified' %]
163
                                Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has not been modified. An error occurred on modifying it[% IF m.error %] ([% m.error | html %])[% END %].
164
                            [% CASE 'authority_modified' %]
165
                                Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified.
166
                            [% END %]
167
                        </div>
168
                    [% END %]
169
                [% CASE 'batch_biblio_record_deletion' %]
170
                    [% FOR m IN job.messages %]
171
                        <div class="dialog message">
172
                            [% IF m.type == 'success' %]
173
                                <i class="fa fa-check success"></i>
174
                            [% ELSIF m.type == 'warning' %]
175
                                <i class="fa fa-warning warn"></i>
176
                            [% ELSIF m.type == 'error' %]
177
                                <i class="fa fa-exclamation error"></i>
178
                            [% END %]
179
                            [% SWITCH m.code %]
180
                            [% CASE 'biblio_not_exists' %]
181
                                The biblionumber [% m.biblionumber | html %] does not exist in the database.
182
                            [% CASE 'item_issued' %]
183
                                At least one item is checked out on bibliographic record [% m.biblionumber | html %].
184
                            [% CASE 'reserve_not_cancelled' %]
185
                                Bibliographic record [% m.biblionumber | html %] was not deleted. A hold could not be canceled (reserve_id [% m.reserve_id | html %]).
186
                            [% CASE 'item_not_deleted' %]
187
                                The bibliographic record [% m.biblionumber | html %] was not deleted. An error was encountered when deleting an item (itemnumber [% m.itemnumber | html %]).
188
                            [% CASE 'biblio_not_deleted' %]
189
                                Bibliographic record [% m.biblionumber | html %] was not deleted. An error occurred.
190
                            [% CASE 'biblio_deleted' %]
191
                                Bibliographic record [% m.biblionumber | html %] has been deleted successfully.
192
                            [% END %]
193
                        </div>
194
                    [% END %]
195
196
                [% CASE %]Job type "[% job.type | html %]" not handled in the template
197
                [% END %]
198
            </li>
76
            </li>
199
        </ol>
77
        </ol>
200
    </fieldset>
78
    </fieldset>
Lines 279-299 Administration &rsaquo; Koha Link Here
279
                "sPaginationType": "full_numbers"
157
                "sPaginationType": "full_numbers"
280
            }));
158
            }));
281
159
282
            $("#add_bibs_to_list").change(function(){
160
            [% IF op == 'view' %]
283
                var selected = $("#add_bibs_to_list").find("option:selected");
161
                [% PROCESS 'js' %]
284
                if ( selected.attr("class") == "shelf" ){
162
            [% END %]
285
                    var shelfnumber = selected.attr("value");
286
                    var bibs = new Array();
287
                    [% FOREACH message IN job.messages %]
288
                        [% IF message.code == 'biblio_modified' %]
289
                            bibs.push("biblionumber="+[% message.biblionumber | html %]);
290
                        [% END %]
291
                    [% END %]
292
                    var bibstring = bibs.join("&");
293
                    window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizable=yes');
294
                    return false;
295
                }
296
            });
297
        });
163
        });
298
    </script>
164
    </script>
299
[% END %]
165
[% END %]
300
- 

Return to bug 26080