]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/serial/subscription.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac...
[working/Evergreen.git] / Open-ILS / src / templates / serial / subscription.tt2
1 [% WRAPPER "base.tt2" %]
2 <script>
3     var cap_editor;
4     var cap_importer;
5 </script>
6 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription.js">
7 </script>
8 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/caption_and_pattern.js">
9 </script>
10 <script src="[% ctx.media_prefix %]/js/ui/default/serial/subscription/issuance.js">
11 </script>
12
13 <div dojoType="dijit.layout.ContentPane" layout="top" class="oils-header-panel">
14     <div>Subscription Details</div>
15     <div>
16         <span dojoType="dijit.form.Button" onClick="clone_dialog.show();">
17             Clone Subscription
18         </span>
19         <span dojoType="dijit.form.Button" onClick="open_batch_receive();">
20             Batch Item Receive
21         </span>
22     </div>
23 </div>
24
25 <div dojoType="dijit.layout.TabContainer" jsId="tab_container"
26     class="oils-serial-tab-container">
27
28     <!-- Subscription Summary -->
29     <div dojoType="dijit.layout.ContentPane" title="Summary" selected="true">
30         <script type="dojo/connect" event="onShow">
31             load_sub_grid(sub_id);
32         </script>
33         <table jsId="sub_grid"
34             dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector="20px">
35             <thead>
36                 <tr>
37                     <th field="id">ID</th>
38                     <th field="owning_lib" formatter="format_org_unit">
39                         Owning Library
40                     </th>
41                     <th field="start_date" formatter="format_date">
42                         Start Date
43                     </th>
44                     <th field="end_date" formatter="format_date">
45                         End Date
46                     </th>
47                     <th field="record_entry" width="20em"
48                         formatter="format_bib">
49                         Bibliographic Record
50                     </th>
51                     <th field="expected_date_offset">Expected Date Offset</th>
52                     <th field="num_dist">Number of Distributions</th>
53                 </tr>
54             </thead>
55         </table>
56     </div>
57
58     <!-- Distributions -->
59     <div dojoType="dijit.layout.ContentPane" jsId="distributions_tab"
60         title="Distributions" layoutAlign="client">
61         <script type="dojo/connect" event="onShow">
62             if (!dist_grid._fresh) {
63                 dist_grid.resetStore();
64                 dist_grid.loadAll(
65                     {"order_by": {"sdist": "holding_lib"}},
66                     {"subscription": sub_id}
67                 );
68                 dist_grid._fresh = true;
69             }
70
71             if (!dist_grid.overrideEditWidgets.subscription) {
72                 dist_grid.overrideEditWidgets.subscription =
73                     new dijit.form.TextBox({
74                         "disabled": true, "value": sub_id
75                     });
76             }
77         </script>
78         [% INCLUDE "serial/subscription/distribution.tt2" %]
79     </div>
80
81     <!-- Caption/Pattern -->
82     <div dojoType="dijit.layout.ContentPane"
83         title="Captions and Patterns" layoutAlign="client">
84         <script type="dojo/connect" event="onShow">
85             if (!cap_editor) {
86                 cap_editor = new SCAPEditor(sub_id);
87                 cap_importer = new SCAPImporter(sub);
88             }
89         </script>
90         [% INCLUDE "serial/subscription/caption_and_pattern.tt2" %]
91     </div>
92
93     <!-- Issuances -->
94     <div dojoType="dijit.layout.ContentPane" jsId="issuances_tab"
95         title="Issuances" layoutAlign="client">
96         <script type="dojo/connect" event="onShow">
97             if (!iss_grid._fresh) {
98                 iss_grid.resetStore();
99                 iss_grid.loadAll(
100                     {"order_by": {"siss": "date_published"}},
101                     {"subscription": sub_id}
102                 );
103                 iss_grid._fresh = true;
104             }
105
106             if (!iss_grid.overrideEditWidgets.subscription) {
107                 iss_grid.overrideEditWidgets.subscription =
108                     new dijit.form.TextBox({
109                         "disabled": true, "value": sub_id
110                     });
111
112                 iss_grid.overrideEditWidgets.creator =
113                     new dijit.form.TextBox({"disabled": true});
114                 iss_grid.overrideEditWidgets.creator.shove = {
115                     "create": openils.User.user.id()
116                 };
117
118                 iss_grid.overrideEditWidgets.editor =
119                     new dijit.form.TextBox({
120                         "disabled": true, "value": openils.User.user.id()
121                     });
122
123                 iss_grid.overrideEditWidgets.holding_type =
124                     new dijit.form.TextBox({"disabled": true});
125                 iss_grid.overrideEditWidgets.holding_type.shove = {"create":""};
126
127                 iss_grid.overrideEditWidgets.holding_type =
128                     new dijit.form.TextBox;
129             }
130             fresh_scap_selector(iss_grid);
131         </script>
132         [% INCLUDE "serial/subscription/issuance.tt2" %]
133     </div>
134 </div>
135 <div class="hidden">
136     <div dojoType="openils.widget.ProgressDialog" jsId="progress_dialog"></div>
137     <div dojoType="dijit.Dialog" jsId="clone_dialog" title="Clone Subscription"
138         style="width: 460px;" execute="clone_subscription(arguments[0]);">
139         <div style="margin-bottom: 0.5em;">
140             This feature will clone a subscription and all of its subscription
141             notes, distributions, distribution notes, captions and patterns,
142             streams, and routing list users.</div>
143         <div style="margin-bottom: 0.5em;">
144             Holdings-related objects, like issuances, items, units, and
145             summaries will <em>not</em> be cloned.
146         </div>
147         <div style="margin-bottom: 0.5em;">
148             To what bibliographic record should the new subscription be
149             attached?
150         </div>
151         <table width="100%">
152             <tr>
153                 <td style="padding-right: 0.5em; vertical-align: top;">
154                     <input dojoType="dijit.form.RadioButton"
155                         id="use_ident_no" name="use_ident" value="no"
156                         checked="checked" />
157                 </td>
158                 <td>
159                     <label for="use_ident_no">
160                         Same record as the existing subscription
161                     </label>
162                 </td>
163             </tr>
164             <tr>
165                 <td style="padding-right: 0.5em; vertical-align: top;">
166                     <input dojoType="dijit.form.RadioButton"
167                         onChange="toggle_clone_ident_field(this);"
168                         id="use_ident_yes" name="use_ident" value="yes" />
169                 </td>
170                 <td>
171                     <label for="use_ident_yes">
172                         Record specified by this unique identifier:
173                     </label>
174                     <input dojoType="dijit.form.TextBox" name="ident"
175                         jsId="clone_ident" disabled="true"
176                         style="margin-left: 0.5em; width: 10em;" />
177                 </td>
178             </tr>
179             <tr>
180                 <td colspan="2" align="center">
181                     <span dojoType="dijit.form.Button" type="submit">
182                         Clone!
183                     </span>
184                 </td>
185             </tr>
186         </table>
187     </div>
188 </div>
189 [% END %]