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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-1 / +1 lines)
Lines 40-45 Link Here
40
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
40
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
41
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
41
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
42
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]">Modification log</a> </li>[% END %]
42
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]">Modification log</a> </li>[% END %]
43
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id %]">Rota</a> </li>[% END %]
43
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id | uri %]">Rota</a> </li>[% END %]
44
</ul>
44
</ul>
45
</div>
45
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/stockrotation-toolbar.inc (-2 / +2 lines)
Lines 4-12 Link Here
4
        <a id="addrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota"><i class="fa fa-plus"></i> New rota</a>
4
        <a id="addrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota"><i class="fa fa-plus"></i> New rota</a>
5
    [% END %]
5
    [% END %]
6
    [% IF op == 'manage_stages' %]
6
    [% IF op == 'manage_stages' %]
7
        <a id="editrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota&amp;rota_id=[% rota_id %]"><i class="fa fa-pencil"></i> Edit rota</a>
7
        <a id="editrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-pencil"></i> Edit rota</a>
8
    [% END %]
8
    [% END %]
9
    [% IF op == 'manage_items' %]
9
    [% IF op == 'manage_items' %]
10
        <a id="editrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota&amp;rota_id=[% rota_id %]"><i class="fa fa-pencil"></i> Edit rota</a>
10
        <a id="editrota" class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/stockrotation.pl?op=create_edit_rota&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-pencil"></i> Edit rota</a>
11
    [% END %]
11
    [% END %]
12
</div>
12
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/stockrotation.tt (-16 / +17 lines)
Lines 1-13 Link Here
1
[% USE raw %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE Branches %]
3
[% USE Branches %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Catalog &rsaquo; Stock rotation details for [% biblio.title %]</title>
5
<title>Koha &rsaquo; Catalog &rsaquo; Stock rotation details for [% biblio.title | html %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'browser-strings.inc' %]
7
[% INCLUDE 'browser-strings.inc' %]
7
[% Asset.js("js/browser.js") %]
8
[% Asset.js("js/browser.js") | $raw %]
8
<script type="text/javascript">
9
<script type="text/javascript">
9
//<![CDATA[
10
//<![CDATA[
10
    var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
11
    var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
11
    browser.show();
12
    browser.show();
12
//]]>
13
//]]>
13
</script>
14
</script>
Lines 17-23 Link Here
17
[% INCLUDE 'header.inc' %]
18
[% INCLUDE 'header.inc' %]
18
[% INCLUDE 'cat-search.inc' %]
19
[% INCLUDE 'cat-search.inc' %]
19
20
20
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Stock rotation details for <i>[% biblio.title | html %][% FOREACH subtitle IN biblio.subtitles %][% subtitle.subfield %][% END %]</i></div>
21
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Stock rotation details for <i>[% biblio.title | html %][% FOREACH subtitle IN biblio.subtitles %][% subtitle.subfield | html %][% END %]</i></div>
21
22
22
<div id="doc3" class="yui-t2">
23
<div id="doc3" class="yui-t2">
23
24
Lines 46-55 Link Here
46
                <tbody>
47
                <tbody>
47
                    [% FOREACH item IN items %]
48
                    [% FOREACH item IN items %]
48
                        <tr>
49
                        <tr>
49
                            <td>[% item.bib_item.barcode %]</td>
50
                            <td>[% item.bib_item.barcode | html %]</td>
50
                            <td>[% item.bib_item.itemcallnumber %]</td>
51
                            <td>[% item.bib_item.itemcallnumber | html %]</td>
51
                            <td>
52
                            <td>
52
                                [% item.rota.title %]
53
                                [% item.rota.title | html %]
53
                            </td>
54
                            </td>
54
                            <td>
55
                            <td>
55
                                [% IF item.rota %]
56
                                [% IF item.rota %]
Lines 80-86 Link Here
80
                                    [% ELSE %]
81
                                    [% ELSE %]
81
                                        <span class="stage">
82
                                        <span class="stage">
82
                                    [% END %]
83
                                    [% END %]
83
                                    [% Branches.GetName(this_stage.branchcode_id) %] ([% this_stage.duration %])
84
                                    [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
84
                                    </span>
85
                                    </span>
85
                                    &raquo;
86
                                    &raquo;
86
                                [% END %]
87
                                [% END %]
Lines 98-104 Link Here
98
                                [% IF item.stockrotationitem %]
99
                                [% IF item.stockrotationitem %]
99
                                    [% in_transit = item.bib_item.get_transfer %]
100
                                    [% in_transit = item.bib_item.get_transfer %]
100
                                    [% IF !in_transit && item.stages.size > 1 %]
101
                                    [% IF !in_transit && item.stages.size > 1 %]
101
                                        <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;stage_id=[% item.stockrotationitem.stage.stage_id %]&amp;item_id=[% item.bib_item.id %]&amp;biblionumber=[% biblionumber %]">
102
                                        <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
102
                                    [% ELSE %]
103
                                    [% ELSE %]
103
                                        <a class="btn btn-default btn-xs" disabled>
104
                                        <a class="btn btn-default btn-xs" disabled>
104
                                    [% END %]
105
                                    [% END %]
Lines 106-112 Link Here
106
                                        Move to next stage
107
                                        Move to next stage
107
                                    </a>
108
                                    </a>
108
                                    [% IF !in_transit %]
109
                                    [% IF !in_transit %]
109
                                        <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stockrotationitem.stage.stage_id %]&amp;item_id=[% item.bib_item.id %]&amp;biblionumber=[% biblionumber %]">
110
                                        <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
110
                                    [% ELSE %]
111
                                    [% ELSE %]
111
                                        <a class="btn btn-default btn-xs" disabled>
112
                                        <a class="btn btn-default btn-xs" disabled>
112
                                    [% END %]
113
                                    [% END %]
Lines 118-124 Link Here
118
                                        [% END %]
119
                                        [% END %]
119
                                    </a>
120
                                    </a>
120
                                    [% IF !in_transit %]
121
                                    [% IF !in_transit %]
121
                                        <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stockrotationitem.stage.stage_id %]&amp;item_id=[% item.bib_item.id %]&amp;biblionumber=[% biblionumber %]">
122
                                        <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
122
                                    [% ELSE %]
123
                                    [% ELSE %]
123
                                        <a class="btn btn-default btn-xs" disabled>
124
                                        <a class="btn btn-default btn-xs" disabled>
124
                                    [% END %]
125
                                    [% END %]
Lines 129-141 Link Here
129
                                    <form class="rota_select_form" method="post" enctype="multipart/form-data">
130
                                    <form class="rota_select_form" method="post" enctype="multipart/form-data">
130
                                        <select class="item_select_rota" name="rota_id">
131
                                        <select class="item_select_rota" name="rota_id">
131
                                            [% FOREACH rota IN rotas %]
132
                                            [% FOREACH rota IN rotas %]
132
                                                <option value="[% rota.rota_id %]">[% rota.title %]</option>
133
                                                <option value="[% rota.rota_id | uri %]">[% rota.title | html %]</option>
133
                                            [% END %]
134
                                            [% END %]
134
                                        </select>
135
                                        </select>
135
                                        <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-plus"></i> Add to rota</button>
136
                                        <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-plus"></i> Add to rota</button>
136
                                        <input type="hidden" name="op" value="add_item_to_rota"></input>
137
                                        <input type="hidden" name="op" value="add_item_to_rota"></input>
137
                                        <input type="hidden" name="item_id" value="[% item.bib_item.id %]"></input>
138
                                        <input type="hidden" name="item_id" value="[% item.bib_item.id | uri %]"></input>
138
                                        <input type="hidden" name="biblionumber" value="[% biblionumber %]"></input>
139
                                        <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]"></input>
139
                                    </form>
140
                                    </form>
140
                                [% END %]
141
                                [% END %]
141
                            </td>
142
                            </td>
Lines 154-161 Link Here
154
        <div class="dialog alert">
155
        <div class="dialog alert">
155
            <h3>Are you sure you want to remove this item from it's rota?</h3>
156
            <h3>Are you sure you want to remove this item from it's rota?</h3>
156
            <p>
157
            <p>
157
                <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;stage_id=[% stage_id %]&amp;item_id=[% item_id %]&amp;biblionumber=[% biblionumber %]"><i class="fa fa-fw fa-check"></i>Yes</a>
158
                <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;stage_id=[% stage_id | uri %]&amp;item_id=[% item_id | uri %]&amp;biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
158
                <a class="btn btn-default btn-xs deny" href="?biblionumber=[% biblionumber %]"><i class="fa fa-fw fa-remove"></i>No</a>
159
                <a class="btn btn-default btn-xs deny" href="?biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
159
            </p>
160
            </p>
160
        </div>
161
        </div>
161
    [% END %]
162
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt (-65 / +65 lines)
Lines 1-12 Link Here
1
[% USE raw %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE Branches %]
3
[% USE Branches %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Stock rotation</title>
6
<title>Koha &rsaquo; Stock rotation</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
7
[% Asset.css("css/datatables.css") %]
8
[% Asset.css("css/datatables.css") | $raw %]
8
[% INCLUDE 'datatables.inc' %]
9
[% INCLUDE 'datatables.inc' %]
9
[% Asset.js("js/pages/stockrotation.js") %]
10
[% Asset.js("js/pages/stockrotation.js") | $raw %]
10
<script type="text/javascript">
11
<script type="text/javascript">
11
//<![CDATA[
12
//<![CDATA[
12
    $(document).ready(function() {
13
    $(document).ready(function() {
Lines 23-29 Link Here
23
</script>
24
</script>
24
</head>
25
</head>
25
26
26
<body>
27
<body id="tools_stockrotation" class="tools">
27
[% INCLUDE 'header.inc' %]
28
[% INCLUDE 'header.inc' %]
28
[% INCLUDE 'patron-search.inc' %]
29
[% INCLUDE 'patron-search.inc' %]
29
30
Lines 44-53 Link Here
44
[% ELSIF (op == 'manage_stages') %]
45
[% ELSIF (op == 'manage_stages') %]
45
    &rsaquo; Manage stages
46
    &rsaquo; Manage stages
46
[% ELSIF (op == 'create_edit_stage' && stage.id) %]
47
[% ELSIF (op == 'create_edit_stage' && stage.id) %]
47
    <a href="?op=manage_stages&amp;rota_id=[% rota_id %]">&rsaquo; Manage stages</a>
48
    <a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">&rsaquo; Manage stages</a>
48
    &rsaquo; Edit stage
49
    &rsaquo; Edit stage
49
[% ELSIF (op == 'create_edit_stage' && !stage.id) %]
50
[% ELSIF (op == 'create_edit_stage' && !stage.id) %]
50
    <a href="?op=manage_stages&amp;rota_id=[% rota_id %]">&rsaquo; Manage stages</a>
51
    <a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">&rsaquo; Manage stages</a>
51
    &rsaquo; Create stage
52
    &rsaquo; Create stage
52
[% ELSIF (op == 'manage_items') %]
53
[% ELSIF (op == 'manage_items') %]
53
    &rsaquo; Manage items
54
    &rsaquo; Manage items
Lines 79-91 Link Here
79
                            <tbody>
80
                            <tbody>
80
                                [% FOREACH rota IN existing_rotas %]
81
                                [% FOREACH rota IN existing_rotas %]
81
                                    <tr>
82
                                    <tr>
82
                                        <td>[% rota.title %]</td>
83
                                        <td>[% rota.title | html %]</td>
83
                                        <td>[% rota.cyclical ? 'Yes' : 'No'%]</td>
84
                                        <td>[% rota.cyclical ? 'Yes' : 'No' | html %]</td>
84
                                        <td>[% rota.active ? 'Yes' : 'No'%]</td>
85
                                        <td>[% rota.active ? 'Yes' : 'No' | html %]</td>
85
                                        <td>[% rota.description %]</td>
86
                                        <td>[% rota.description | html %]</td>
86
                                        <td>[% rota.stockrotationitems.count %]</td>
87
                                        <td>[% rota.stockrotationitems.count | html %]</td>
87
                                        <td class="actions">
88
                                        <td class="actions">
88
                                            <a class="btn btn-default btn-xs" href="?op=create_edit_rota&amp;rota_id=[% rota.rota_id %]">
89
                                            <a class="btn btn-default btn-xs" href="?op=create_edit_rota&amp;rota_id=[% rota.rota_id | uri %]">
89
                                                <i class="fa fa-pencil"></i>
90
                                                <i class="fa fa-pencil"></i>
90
                                                Edit
91
                                                Edit
91
                                            </a>
92
                                            </a>
Lines 95-107 Link Here
95
                                                    <i class="fa fa-caret-down"></i>
96
                                                    <i class="fa fa-caret-down"></i>
96
                                                </button>
97
                                                </button>
97
                                                <ul class="dropdown-menu">
98
                                                <ul class="dropdown-menu">
98
                                                    <li><a href="?op=manage_stages&amp;rota_id=[% rota.rota_id %]">Stages</a></li>
99
                                                    <li><a href="?op=manage_stages&amp;rota_id=[% rota.rota_id | uri %]">Stages</a></li>
99
                                                    [% IF CAN_user_stockrotation_manage_rota_items && rota.stockrotationstages.count > 0 %]
100
                                                    [% IF CAN_user_stockrotation_manage_rota_items && rota.stockrotationstages.count > 0 %]
100
                                                    <li><a href="?op=manage_items&amp;rota_id=[% rota.rota_id %]">Items</a></li>
101
                                                    <li><a href="?op=manage_items&amp;rota_id=[% rota.rota_id | uri %]">Items</a></li>
101
                                                    [% END %]
102
                                                    [% END %]
102
                                                </ul>
103
                                                </ul>
103
                                            </div>
104
                                            </div>
104
                                            <a class="btn btn-default btn-xs" href="?op=toggle_rota&amp;rota_id=[% rota.rota_id %]">
105
                                            <a class="btn btn-default btn-xs" href="?op=toggle_rota&amp;rota_id=[% rota.rota_id | uri %]">
105
                                                <i class="fa fa-power-off"></i>
106
                                                <i class="fa fa-power-off"></i>
106
                                                [% IF !rota.active %]
107
                                                [% IF !rota.active %]
107
                                                    Activate
108
                                                    Activate
Lines 119-125 Link Here
119
                [% ELSIF (op == 'create_edit_rota') %]
120
                [% ELSIF (op == 'create_edit_rota') %]
120
121
121
                    [% IF rota.rota_id %]
122
                    [% IF rota.rota_id %]
122
                        <h2>Edit "[% rota.title %]"</h2>
123
                        <h2>Edit "[% rota.title | html %]"</h2>
123
                    [% ELSE %]
124
                    [% ELSE %]
124
                        <h2>Create new rota</h2>
125
                        <h2>Create new rota</h2>
125
                    [% END %]
126
                    [% END %]
Lines 135-141 Link Here
135
                            <ol>
136
                            <ol>
136
                                <li>
137
                                <li>
137
                                    <label class="required" for="title">Name:</label>
138
                                    <label class="required" for="title">Name:</label>
138
                                    <input type="text" id="title" name="title" value="[% rota.title %]" required="required" placeholder="Rota name">
139
                                    <input type="text" id="title" name="title" value="[% rota.title | html %]" required="required" placeholder="Rota name">
139
                                    <span class="required">Required</span>
140
                                    <span class="required">Required</span>
140
                                </li>
141
                                </li>
141
                                <li>
142
                                <li>
Lines 152-158 Link Here
152
                                </li>
153
                                </li>
153
                                <li>
154
                                <li>
154
                                    <label for="description">Description:</label>
155
                                    <label for="description">Description:</label>
155
                                    <textarea id="description" name="description" placeholder="Rota description">[% rota.description %]</textarea>
156
                                    <textarea id="description" name="description" placeholder="Rota description">[% rota.description | html %]</textarea>
156
                                </li>
157
                                </li>
157
                            </ol>
158
                            </ol>
158
                        </fieldset>
159
                        </fieldset>
Lines 161-167 Link Here
161
                            <a href="/cgi-bin/koha/tools/stockrotation.pl" class="cancel">Cancel</a>
162
                            <a href="/cgi-bin/koha/tools/stockrotation.pl" class="cancel">Cancel</a>
162
                        </fieldset>
163
                        </fieldset>
163
                        [% IF rota.rota_id %]
164
                        [% IF rota.rota_id %]
164
                            <input type="hidden" name="id" value="[% rota.rota_id %]">
165
                            <input type="hidden" name="id" value="[% rota.rota_id | html %]">
165
                        [% END %]
166
                        [% END %]
166
                        <input type="hidden" name="op" value="process_rota">
167
                        <input type="hidden" name="op" value="process_rota">
167
                    </form>
168
                    </form>
Lines 176-182 Link Here
176
                    </div>
177
                    </div>
177
                    [% END %]
178
                    [% END %]
178
179
179
                    <h2>Manage [% rota.title %] stages</h2>
180
                    <h2>Manage [% rota.title | html %] stages</h2>
180
                    <div id="ajax_status"
181
                    <div id="ajax_status"
181
                        data-saving-msg="Saving changes..."
182
                        data-saving-msg="Saving changes..."
182
                        data-success-msg=""
183
                        data-success-msg=""
Lines 198-206 Link Here
198
                                    <select name="branchcode" id="branch">
199
                                    <select name="branchcode" id="branch">
199
                                        [% FOREACH branch IN branches %]
200
                                        [% FOREACH branch IN branches %]
200
                                            [% IF branch.branchcode == stage.branchcode_id %]
201
                                            [% IF branch.branchcode == stage.branchcode_id %]
201
                                                <option value="[% branch.branchcode %]" selected>[% Branches.GetName(branch.branchcode) %]</option>
202
                                                <option value="[% branch.branchcode | html %]" selected>[% Branches.GetName(branch.branchcode) | html %]</option>
202
                                            [% ELSE %]
203
                                            [% ELSE %]
203
                                                <option value="[% branch.branchcode %]">[% Branches.GetName(branch.branchcode) %]</option>
204
                                                <option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
204
                                            [% END %]
205
                                            [% END %]
205
                                        [% END %]
206
                                        [% END %]
206
                                    </select>
207
                                    </select>
Lines 208-214 Link Here
208
                                </li>
209
                                </li>
209
                                <li>
210
                                <li>
210
                                    <label class="required" for="duration">Duration:</label>
211
                                    <label class="required" for="duration">Duration:</label>
211
                                    <input type="text" id="duration" name="duration" value="[% stage.duration %]" required="required" placeholder="Duration (days)">
212
                                    <input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
212
                                    <span class="required">Required</span>
213
                                    <span class="required">Required</span>
213
                                </li>
214
                                </li>
214
                            </ol>
215
                            </ol>
Lines 216-223 Link Here
216
                        <fieldset class="action">
217
                        <fieldset class="action">
217
                            <input type="submit" value="Submit">
218
                            <input type="submit" value="Submit">
218
                        </fieldset>
219
                        </fieldset>
219
                        <input type="hidden" name="stage_id" value="[% stage.id %]">
220
                        <input type="hidden" name="stage_id" value="[% stage.id | html %]">
220
                        <input type="hidden" name="rota_id" value="[% rota_id %]">
221
                        <input type="hidden" name="rota_id" value="[% rota_id | html %]">
221
                        <input type="hidden" name="op" value="process_stage">
222
                        <input type="hidden" name="op" value="process_stage">
222
                    </form>
223
                    </form>
223
224
Lines 230-250 Link Here
230
                                <span class="stagename">Library</span>
231
                                <span class="stagename">Library</span>
231
                                <span class="stageduration">Duration (days)</span>
232
                                <span class="stageduration">Duration (days)</span>
232
                            </div>
233
                            </div>
233
                            <ul id="sortable_stages" data-rota-id="[% rota.rota_id %]">
234
                            <ul id="sortable_stages" data-rota-id="[% rota.rota_id | html %]">
234
                                [% FOREACH stage IN existing_stages %]
235
                                [% FOREACH stage IN existing_stages %]
235
                                    <li id="stage_[% stage.stage_id %]">
236
                                    <li id="stage_[% stage.stage_id | html %]">
236
                                        <span data-toggle="tooltip" title="Drag and drop to move this stage to another position" data-placement="right" class="stagename">
237
                                        <span data-toggle="tooltip" title="Drag and drop to move this stage to another position" data-placement="right" class="stagename">
237
                                            [% IF existing_stages.size > 1 %]
238
                                            [% IF existing_stages.size > 1 %]
238
                                                <i class="drag_handle fa fa-lg fa-bars"></i>
239
                                                <i class="drag_handle fa fa-lg fa-bars"></i>
239
                                            [% END %]
240
                                            [% END %]
240
                                            [% Branches.GetName(stage.branchcode_id) %]
241
                                            [% Branches.GetName(stage.branchcode_id) | html %]
241
                                        </span>
242
                                        </span>
242
                                        <span class="stageduration">[% stage.duration %]</span>
243
                                        <span class="stageduration">[% stage.duration | html %]</span>
243
                                        <span class="stageactions">
244
                                        <span class="stageactions">
244
                                            <a class="btn btn-default btn-xs" href="?op=create_edit_stage&amp;stage_id=[% stage.stage_id %]">
245
                                            <a class="btn btn-default btn-xs" href="?op=create_edit_stage&amp;stage_id=[% stage.stage_id | uri %]">
245
                                                <i class="fa fa-pencil"></i> Edit
246
                                                <i class="fa fa-pencil"></i> Edit
246
                                            </a>
247
                                            </a>
247
                                            <a class="btn btn-default btn-xs" href="?op=confirm_delete_stage&amp;stage_id=[% stage.stage_id %]">
248
                                            <a class="btn btn-default btn-xs" href="?op=confirm_delete_stage&amp;stage_id=[% stage.stage_id | uri %]">
248
                                                <i class="fa fa-trash"></i> Delete
249
                                                <i class="fa fa-trash"></i> Delete
249
                                            </a>
250
                                            </a>
250
                                        </span>
251
                                        </span>
Lines 259-265 Link Here
259
                [% ELSIF (op == 'create_edit_stage') %]
260
                [% ELSIF (op == 'create_edit_stage') %]
260
261
261
                    [% IF stage.id %]
262
                    [% IF stage.id %]
262
                        <h2>Edit "[% Branches.GetName(stage.branchcode_id) %]"</h2>
263
                        <h2>Edit "[% Branches.GetName(stage.branchcode_id) | html %]"</h2>
263
                    [% ELSE %]
264
                    [% ELSE %]
264
                        <h2>Create new stage</h2>
265
                        <h2>Create new stage</h2>
265
                    [% END %]
266
                    [% END %]
Lines 278-286 Link Here
278
                                    <select name="branchcode" id="branch">
279
                                    <select name="branchcode" id="branch">
279
                                        [% FOREACH branch IN branches %]
280
                                        [% FOREACH branch IN branches %]
280
                                            [% IF branch.branchcode == stage.branchcode_id %]
281
                                            [% IF branch.branchcode == stage.branchcode_id %]
281
                                                <option value="[% branch.branchcode %]" selected>[% Branches.GetName(branch.branchcode) %]</option>
282
                                                <option value="[% branch.branchcode | html %]" selected>[% Branches.GetName(branch.branchcode) | html %]</option>
282
                                            [% ELSE %]
283
                                            [% ELSE %]
283
                                                <option value="[% branch.branchcode %]">[% Branches.GetName(branch.branchcode) %]</option>
284
                                                <option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
284
                                            [% END %]
285
                                            [% END %]
285
                                        [% END %]
286
                                        [% END %]
286
                                    </select>
287
                                    </select>
Lines 288-304 Link Here
288
                                </li>
289
                                </li>
289
                                <li>
290
                                <li>
290
                                    <label class="required" for="duration">Duration:</label>
291
                                    <label class="required" for="duration">Duration:</label>
291
                                    <input type="text" id="duration" name="duration" value="[% stage.duration %]" required="required" placeholder="Duration (days)">
292
                                    <input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
292
                                    <span class="required">Required</span>
293
                                    <span class="required">Required</span>
293
                                </li>
294
                                </li>
294
                            </ol>
295
                            </ol>
295
                        </fieldset>
296
                        </fieldset>
296
                        <fieldset class="action">
297
                        <fieldset class="action">
297
                            <input type="submit" value="Save">
298
                            <input type="submit" value="Save">
298
                            <a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id %]" class="cancel">Cancel</a>
299
                            <a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id | uri %]" class="cancel">Cancel</a>
299
                        </fieldset>
300
                        </fieldset>
300
                        <input type="hidden" name="stage_id" value="[% stage.id %]">
301
                        <input type="hidden" name="stage_id" value="[% stage.id | html %]">
301
                        <input type="hidden" name="rota_id" value="[% rota_id %]">
302
                        <input type="hidden" name="rota_id" value="[% rota_id | html %]">
302
                        <input type="hidden" name="op" value="process_stage">
303
                        <input type="hidden" name="op" value="process_stage">
303
                    </form>
304
                    </form>
304
                [% ELSIF (op == 'confirm_remove_from_rota') %]
305
                [% ELSIF (op == 'confirm_remove_from_rota') %]
Lines 306-313 Link Here
306
                    <div class="dialog alert">
307
                    <div class="dialog alert">
307
                        <h3>Are you sure you wish to remove this item from it's rota</h3>
308
                        <h3>Are you sure you wish to remove this item from it's rota</h3>
308
                        <p>
309
                        <p>
309
                            <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;item_id=[% item_id %]&amp;stage_id=[% stage_id %]&amp;rota_id=[% rota_id %]"><i class="fa fa-fw fa-check"></i>Yes</a>
310
                            <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;item_id=[% item_id | uri %]&amp;stage_id=[% stage_id | uri %]&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
310
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id %]"><i class="fa fa-fw fa-remove"></i>No</a>
311
                            <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
311
                        </p>
312
                        </p>
312
                    </div>
313
                    </div>
313
                [% ELSIF (op == 'confirm_delete_stage') %]
314
                [% ELSIF (op == 'confirm_delete_stage') %]
Lines 318-330 Link Here
318
                            <p>This stage contains the following item(s):</p>
319
                            <p>This stage contains the following item(s):</p>
319
                            <ul>
320
                            <ul>
320
                                [% FOREACH item IN stage.stockrotationitems %]
321
                                [% FOREACH item IN stage.stockrotationitems %]
321
                                    <li>[% item.itemnumber.biblio.title %] (Barcode: [% item.itemnumber.barcode %])</li>
322
                                    <li>[% item.itemnumber.biblio.title | html %] (Barcode: [% item.itemnumber.barcode | html %])</li>
322
                                [% END %]
323
                                [% END %]
323
                            </ul>
324
                            </ul>
324
                        [% END %]
325
                        [% END %]
325
                        <p>
326
                        <p>
326
                            <a class="btn btn-default btn-xs approve" href="?op=delete_stage&amp;stage_id=[% stage.stage_id %]"><i class="fa fa-fw fa-check"></i>Yes</a>
327
                            <a class="btn btn-default btn-xs approve" href="?op=delete_stage&amp;stage_id=[% stage.stage_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
327
                            <a class="btn btn-default btn-xs deny" href="?op=manage_stages&amp;rota_id=[% stage.rota.rota_id %]"><i class="fa fa-fw fa-remove"></i>No</a>
328
                            <a class="btn btn-default btn-xs deny" href="?op=manage_stages&amp;rota_id=[% stage.rota.rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
328
                        </p>
329
                        </p>
329
                    </div>
330
                    </div>
330
                [% ELSIF (op == 'manage_items') %]
331
                [% ELSIF (op == 'manage_items') %]
Lines 341-352 Link Here
341
                        </div>
342
                        </div>
342
                    [% END %]
343
                    [% END %]
343
344
344
                    <h2>Manage [% rota.title %] items</h2>
345
                    <h2>Manage [% rota.title | html %] items</h2>
345
346
346
                    <div>
347
                    <div>
347
                        <form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated">
348
                        <form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated">
348
                            <fieldset class="rows">
349
                            <fieldset class="rows">
349
                                <legend>Add item to &quot;[% rota.title %]&quot;</legend>
350
                                <legend>Add item to &quot;[% rota.title | html %]&quot;</legend>
350
                                <ol>
351
                                <ol>
351
                                    <li>
352
                                    <li>
352
                                        <label for="barcode">Barcode:</label>
353
                                        <label for="barcode">Barcode:</label>
Lines 366-378 Link Here
366
                            <fieldset class="action">
367
                            <fieldset class="action">
367
                                <input type="submit" value="Save">
368
                                <input type="submit" value="Save">
368
                            </fieldset>
369
                            </fieldset>
369
                            <input type="hidden" name="rota_id" value="[% rota.id %]">
370
                            <input type="hidden" name="rota_id" value="[% rota.id | html %]">
370
                            <input type="hidden" name="op" value="add_items_to_rota">
371
                            <input type="hidden" name="op" value="add_items_to_rota">
371
                        </form>
372
                        </form>
372
                    </div>
373
                    </div>
373
374
374
                    [% IF items.count > 0 %]
375
                    [% IF items.count > 0 %]
375
                        <h3>Manage items assigned to &quot;[% rota.title %]&quot;</h3>
376
                        <h3>Manage items assigned to &quot;[% rota.title | html %]&quot;</h3>
376
                        <table id="sr_manage_items" class="items_table" role="grid">
377
                        <table id="sr_manage_items" class="items_table" role="grid">
377
                            <thead>
378
                            <thead>
378
                                <th>Barcode</th>
379
                                <th>Barcode</th>
Lines 386-396 Link Here
386
                            <tbody>
387
                            <tbody>
387
                                [% FOREACH item IN items %]
388
                                [% FOREACH item IN items %]
388
                                    <tr>
389
                                    <tr>
389
                                        <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.id %]&amp;biblionumber=[% item.itemnumber.biblio.id %]#item[% item.id %]">[% item.itemnumber.barcode %]</a></td>
390
                                        <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.id | uri %]&amp;biblionumber=[% item.itemnumber.biblio.id | uri %]#item[% item.id | uri %]">[% item.itemnumber.barcode | html %]</a></td>
390
                                        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.itemnumber.biblio.id %]">[% item.itemnumber.biblio.title %]</a></td>
391
                                        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.itemnumber.biblio.id | uri %]">[% item.itemnumber.biblio.title | html %]</a></td>
391
                                        <td>[% item.itemnumber.biblio.author %]</td>
392
                                        <td>[% item.itemnumber.biblio.author | html %]</td>
392
                                        <td>[% item.itemnumber.itemcallnumber %]</td>
393
                                        <td>[% item.itemnumber.itemcallnumber | html %]</td>
393
                                        <td>[% item.itemnumber.get_transfer ? 'Yes' : 'No' %]</td>
394
                                        <td>[% item.itemnumber.get_transfer ? 'Yes' : 'No' | html %]</td>
394
                                        <td>
395
                                        <td>
395
                                            [% FOREACH this_stage IN stages %]
396
                                            [% FOREACH this_stage IN stages %]
396
                                                [% IF this_stage.stage_id == item.stage.stage_id %]
397
                                                [% IF this_stage.stage_id == item.stage.stage_id %]
Lines 398-415 Link Here
398
                                                [% ELSE %]
399
                                                [% ELSE %]
399
                                                    <span class="stage">
400
                                                    <span class="stage">
400
                                                [% END %]
401
                                                [% END %]
401
                                                [% Branches.GetName(this_stage.branchcode_id) %] ([% this_stage.duration %])
402
                                                [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
402
                                                </span>
403
                                                </span>
403
                                                &raquo;
404
                                                &raquo;
404
                                            [% END %]
405
                                            [% END %]
405
                                            [% IF stages.size > 0 %]
406
                                            [% IF stages.size > 0 %]
406
                                                <span class="stage">[% rota.cyclical ? 'START' : 'END' %]</span>
407
                                                <span class="stage">[% rota.cyclical ? 'START' : 'END' | html %]</span>
407
                                            [% END %]
408
                                            [% END %]
408
                                        </td>
409
                                        </td>
409
                                        <td class="actions">
410
                                        <td class="actions">
410
                                            [% in_transit = item.itemnumber.get_transfer %]
411
                                            [% in_transit = item.itemnumber.get_transfer %]
411
                                            [% IF !in_transit && stages.size > 1 %]
412
                                            [% IF !in_transit && stages.size > 1 %]
412
                                                <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id %]&amp;item_id=[% item.id %]&amp;stage_id=[% item.stage.stage_id %]">
413
                                                <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% item.id | uri %]&amp;stage_id=[% item.stage.stage_id | uri %]">
413
                                            [% ELSE %]
414
                                            [% ELSE %]
414
                                                <a class="btn btn-default btn-xs" disabled>
415
                                                <a class="btn btn-default btn-xs" disabled>
415
                                            [% END %]
416
                                            [% END %]
Lines 417-431 Link Here
417
                                                Move to next stage
418
                                                Move to next stage
418
                                            </a>
419
                                            </a>
419
                                            [% IF !in_transit %]
420
                                            [% IF !in_transit %]
420
                                                <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stage.stage_id %]&amp;item_id=[% item.id %]&amp;rota_id=[% rota.id %]">
421
                                                <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stage.stage_id | uri %]&amp;item_id=[% item.id | uri %]&amp;rota_id=[% rota.id | uri %]">
421
                                            [% ELSE %]
422
                                            [% ELSE %]
422
                                                <a class="btn btn-default btn-xs" disabled>
423
                                                <a class="btn btn-default btn-xs" disabled>
423
                                            [% END %]
424
                                            [% END %]
424
                                                <i class="fa fa-fire"></i>
425
                                                <i class="fa fa-fire"></i>
425
                                                [% item.indemand ? 'Remove &quot;In demand&quot;' : 'Add &quot;In demand&quot;' %]
426
                                                [% item.indemand ? 'Remove &quot;In demand&quot;' : 'Add &quot;In demand&quot;' | html %]
426
                                            </a>
427
                                            </a>
427
                                            [% IF !in_transit %]
428
                                            [% IF !in_transit %]
428
                                                <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stage.stage_id %]&amp;item_id=[% item.id %]&amp;rota_id=[% rota.id %]">
429
                                                <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stage.stage_id | uri %]&amp;item_id=[% item.id | uri %]&amp;rota_id=[% rota.id | uri %]">
429
                                            [% ELSE %]
430
                                            [% ELSE %]
430
                                                <a class="btn btn-default btn-xs" disabled>
431
                                                <a class="btn btn-default btn-xs" disabled>
431
                                            [% END %]
432
                                            [% END %]
Lines 452-458 Link Here
452
                            <h4>Items added to rota:</h4>
453
                            <h4>Items added to rota:</h4>
453
                            <ul>
454
                            <ul>
454
                                [% FOREACH item_ok IN barcode_status.ok %]
455
                                [% FOREACH item_ok IN barcode_status.ok %]
455
                                    <li>[% item_ok.biblio.title %]</li>
456
                                    <li>[% item_ok.biblio.title | html %]</li>
456
                                [% END %]
457
                                [% END %]
457
                            </ul>
458
                            </ul>
458
                        [% END %]
459
                        [% END %]
Lines 460-466 Link Here
460
                            <h4>Items already on this rota:</h4>
461
                            <h4>Items already on this rota:</h4>
461
                            <ul>
462
                            <ul>
462
                                [% FOREACH item_on_this IN barcode_status.on_this %]
463
                                [% FOREACH item_on_this IN barcode_status.on_this %]
463
                                    <li>[% item_on_this.biblio.title %]</li>
464
                                    <li>[% item_on_this.biblio.title | html %]</li>
464
                                [% END %]
465
                                [% END %]
465
                            </ul>
466
                            </ul>
466
                        [% END %]
467
                        [% END %]
Lines 468-474 Link Here
468
                            <h4>Barcodes not found:</h4>
469
                            <h4>Barcodes not found:</h4>
469
                            <ul>
470
                            <ul>
470
                                [% FOREACH barcode_not_found IN barcode_status.not_found %]
471
                                [% FOREACH barcode_not_found IN barcode_status.not_found %]
471
                                    <li>[% barcode_not_found %]</li>
472
                                    <li>[% barcode_not_found | html %]</li>
472
                                [% END %]
473
                                [% END %]
473
                            </ul>
474
                            </ul>
474
                        [% END %]
475
                        [% END %]
Lines 476-482 Link Here
476
                            <h4>Items found on other rotas:</h4>
477
                            <h4>Items found on other rotas:</h4>
477
                            <ul>
478
                            <ul>
478
                                [% FOREACH item_on_other IN barcode_status.on_other %]
479
                                [% FOREACH item_on_other IN barcode_status.on_other %]
479
                                    <li>[% item_on_other.biblio.title %]</li>
480
                                    <li>[% item_on_other.biblio.title | html %]</li>
480
                                [% END %]
481
                                [% END %]
481
                            </ul>
482
                            </ul>
482
                        [% END %]
483
                        [% END %]
Lines 486-503 Link Here
486
                            <fieldset>
487
                            <fieldset>
487
                                <legend>Select items to move to this rota:</legend>
488
                                <legend>Select items to move to this rota:</legend>
488
                                [% FOREACH item_on_other IN barcode_status.on_other %]
489
                                [% FOREACH item_on_other IN barcode_status.on_other %]
489
                                    <li><input type="checkbox" name="move_item" value="[% item_on_other.itemnumber %]"> [% item_on_other.biblio.title %] (Currently on &quot;[% item_on_other.stockrotationitem.stage.rota.title %]&quot;)</li>
490
                                    <li><input type="checkbox" name="move_item" value="[% item_on_other.itemnumber | html %]"> [% item_on_other.biblio.title | html %] (Currently on &quot;[% item_on_other.stockrotationitem.stage.rota.title | html %]&quot;)</li>
490
                                [% END %]
491
                                [% END %]
491
492
492
                            </fieldset>
493
                            </fieldset>
493
                            <fieldset class="action">
494
                            <fieldset class="action">
494
                                <input type="submit" value="Save">
495
                                <input type="submit" value="Save">
495
                            </fieldset>
496
                            </fieldset>
496
                            <input type="hidden" name="rota_id" value="[% rota_id %]">
497
                            <input type="hidden" name="rota_id" value="[% rota_id | html %]">
497
                            <input type="hidden" name="op" value="move_items_to_rota">
498
                            <input type="hidden" name="op" value="move_items_to_rota">
498
                        </form>
499
                        </form>
499
                    [% END %]
500
                    [% END %]
500
                    <p><a href="?op=manage_items&amp;rota_id=[% rota_id %]">Return to rota</a></p>
501
                    <p><a href="?op=manage_items&amp;rota_id=[% rota_id | uri %]">Return to rota</a></p>
501
502
502
                [% END %]
503
                [% END %]
503
            </div>
504
            </div>
504
- 

Return to bug 11897