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 34-39 Link Here
34
[% IF op == 'view' %]
34
[% IF op == 'view' %]
35
    <h1>Detail of job #[% job.id | html %]</h1>
35
    <h1>Detail of job #[% job.id | html %]</h1>
36
36
37
    [% PROCESS "background_jobs/${job.type}.inc" %]
38
37
    <fieldset class="rows">
39
    <fieldset class="rows">
38
        <ol>
40
        <ol>
39
            <li><span class="label">Job ID: </span>[% job.id | html %]</li>
41
            <li><span class="label">Job ID: </span>[% job.id | html %]</li>
Lines 44-177 Link Here
44
            <li><label for="job_started_on">started_on: </label>[% job.started_on | html %]</li>
46
            <li><label for="job_started_on">started_on: </label>[% job.started_on | html %]</li>
45
            <li><label for="job_ended_on">ended_on: </label>[% job.ended_on | html %]</li>
47
            <li><label for="job_ended_on">ended_on: </label>[% job.ended_on | html %]</li>
46
            <li><label for="job_data">Report: </label>
48
            <li><label for="job_data">Report: </label>
47
                [% SWITCH job.type %]
49
                [% PROCESS 'report' %]
48
                [% CASE 'batch_biblio_record_modification' %]
49
                    [% SET report = job.report %]
50
                    [% IF report %]
51
                        [% IF report.total_records == report.total_success %]
52
                            <div class="dialog message">
53
                                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>
54
                                [% IF lists.count %]
55
                                    <br />
56
                                    Add modified records to the following list:
57
                                    <select name="add_bibs_to_list" id="add_bibs_to_list">
58
                                        <option value="">Select a list</option>
59
                                        [% FOREACH list IN lists %]
60
                                            <option class="shelf" value="[% list.shelfnumber | html %]">[% list.shelfname | html %]</option>
61
                                        [% END %]
62
                                    </select>
63
                                [% END %]
64
                            </div>
65
                        [% ELSE %]
66
                            <div class="dialog message">
67
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
68
                                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
69
                                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
70
                            </div>
71
                        [% END %]
72
                    [% END %]
73
                [% CASE 'batch_authority_record_modification' %]
74
                    [% SET report = job.report %]
75
                    [% IF report %]
76
                        [% IF report.total_records == report.total_success %]
77
                            <div class="dialog message">
78
                                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>
79
                            </div>
80
                        [% ELSE %]
81
                            <div class="dialog message">
82
                                [% report.total_success | html %] / [% report.total_records | html %] records have successfully been modified. Some errors occurred.
83
                                [% IF job.status == 'cancelled' %]The job has been cancelled before it finished.[% END %]
84
                                <a href="/cgi-bin/koha/tools/batch_record_modification.pl" title="New batch record modification">New batch record modification</a>
85
                            </div>
86
                        [% END %]
87
                    [% END %]
88
                [% CASE 'batch_biblio_record_deletion' %]
89
                    [% SET report = job.report %]
90
                    [% IF report %]
91
                        [% IF report.total_records == report.total_success %]
92
                            <div class="dialog message">
93
                                All records have been deleted successfully!
94
                            </div>
95
                        [% ELSIF report.total_success == 0 %]
96
                            <div class="dialog message">
97
                                No record has been deleted. An error occurred.
98
                            </div>
99
                        [% ELSE %]
100
                            <div class="dialog message">
101
                                [% report.total_success | html %] / [% report.total_records | html %] records have been deleted successfully but some errors occurred.
102
                            </div>
103
                        [% END %]
104
                    [% END %]
105
                [% CASE %]Job type "[% job.type | html %]" not handled in the template
106
                [% END %]
107
            </li>
50
            </li>
108
            <li><label for="job_data">Detailed messages: </label>
51
            <li><label for="job_data">Detailed messages: </label>
109
                [% SWITCH job.type %]
52
                [% PROCESS 'detail' %]
110
                [% CASE 'batch_biblio_record_modification' %]
111
                    [% FOR m IN job.messages %]
112
                        <div class="dialog message">
113
                            [% IF m.type == 'success' %]
114
                                <i class="fa fa-check success"></i>
115
                            [% ELSIF m.type == 'warning' %]
116
                                <i class="fa fa-warning warn"></i>
117
                            [% ELSIF m.type == 'error' %]
118
                                <i class="fa fa-exclamation error"></i>
119
                            [% END %]
120
                            [% SWITCH m.code %]
121
                            [% CASE 'biblio_not_modified' %]
122
                                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 %])[% END %].
123
                            [% CASE 'biblio_modified' %]
124
                                Bibliographic record <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% m.biblionumber | uri %]">[% m.biblionumber | html %]</a> has successfully been modified.
125
                            [% END %]
126
                        </div>
127
                    [% END %]
128
                [% CASE 'batch_authority_record_modification' %]
129
                    [% FOR m IN job.messages %]
130
                        <div class="dialog message">
131
                            [% IF m.type == 'success' %]
132
                                <i class="fa fa-check success"></i>
133
                            [% ELSIF m.type == 'warning' %]
134
                                <i class="fa fa-warning warn"></i>
135
                            [% ELSIF m.type == 'error' %]
136
                                <i class="fa fa-exclamation error"></i>
137
                            [% END %]
138
                            [% SWITCH m.code %]
139
                            [% CASE 'authority_not_modified' %]
140
                                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 %].
141
                            [% CASE 'authority_modified' %]
142
                                Authority record <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% m.authid | uri %]">[% m.authid | html %]</a> has successfully been modified..
143
                            [% END %]
144
                        </div>
145
                    [% END %]
146
                [% CASE 'batch_biblio_record_deletion' %]
147
                    [% FOR m IN job.messages %]
148
                        <div class="dialog message">
149
                            [% IF m.type == 'success' %]
150
                                <i class="fa fa-check success"></i>
151
                            [% ELSIF m.type == 'warning' %]
152
                                <i class="fa fa-warning warn"></i>
153
                            [% ELSIF m.type == 'error' %]
154
                                <i class="fa fa-exclamation error"></i>
155
                            [% END %]
156
                            [% SWITCH m.code %]
157
                            [% CASE 'biblio_not_exists' %]
158
                                The biblionumber [% m.biblionumber | html %] does not exist in the database.
159
                            [% CASE 'item_issued' %]
160
                                At least one item is checked out on bibliographic record [% m.biblionumber | html %].
161
                            [% CASE 'reserve_not_cancelled' %]
162
                                Bibliographic record [% m.biblionumber | html %] was not deleted. A hold could not be canceled (reserve_id [% m.reserve_id | html %]).
163
                            [% CASE 'item_not_deleted' %]
164
                                The bibliographic record [% m.biblionumber | html %] was not deleted. An error was encountered when deleting an item (itemnumber [% m.itemnumber | html %]).
165
                            [% CASE 'biblio_not_deleted' %]
166
                                Bibliographic record [% m.biblionumber | html %] was not deleted. An error occurred.
167
                            [% CASE 'biblio_deleted' %]
168
                                Bibliographic record [% m.biblionumber | html %] has been deleted successfully.
169
                            [% END %]
170
                        </div>
171
                    [% END %]
172
173
                [% CASE %]Job type "[% job.type | html %]" not handled in the template
174
                [% END %]
175
            </li>
53
            </li>
176
        </ol>
54
        </ol>
177
    </fieldset>
55
    </fieldset>
Lines 264-284 Link Here
264
                "sPaginationType": "full_numbers"
142
                "sPaginationType": "full_numbers"
265
            }));
143
            }));
266
144
267
            $("#add_bibs_to_list").change(function(){
145
            [% IF op == 'view' %]
268
                var selected = $("#add_bibs_to_list").find("option:selected");
146
                [% PROCESS 'js' %]
269
                if ( selected.attr("class") == "shelf" ){
147
            [% END %]
270
                    var shelfnumber = selected.attr("value");
271
                    var bibs = new Array();
272
                    [% FOREACH message IN job.messages %]
273
                        [% IF message.code == 'biblio_modified' %]
274
                            bibs.push("biblionumber="+[% message.biblionumber | html %]);
275
                        [% END %]
276
                    [% END %]
277
                    var bibstring = bibs.join("&");
278
                    window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&'+bibstring, 'popup', 'width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
279
                    return false;
280
                }
281
            });
282
        });
148
        });
283
    </script>
149
    </script>
284
[% END %]
150
[% END %]
285
- 

Return to bug 26080