"flesh_fields" => {
"ahr" => ["usr", "current_copy"],
"au" => ["card"],
- "acp" => ["location", "call_number"],
+ "acp" => ["location", "call_number", "parts"],
"acn" => ["record","prefix","suffix"]
}
}
$$
[%- USE date -%]
<style>
- table { border-collapse: collapse; }
- td { padding: 5px; border-bottom: 1px solid #888; }
+ table { border-collapse: collapse; }
+ td { padding: 5px; border-bottom: 1px solid #888; }
th { font-weight: bold; }
</style>
-[%
+[%
# Sort the holds into copy-location buckets
# In the main print loop, sort each bucket by callnumber before printing
SET holds_list = [];
<th>Author</th>
<th>Shelving Location</th>
<th>Call Number</th>
- <th>Barcode</th>
+ <th>Barcode/Part</th>
<th>Patron</th>
</tr>
</thead>
<tbody>
[% FOR loc_data IN holds_list %]
[% FOR hold_data IN loc_data.sort('callnumber') %]
- [%
+ [%
SET hold = hold_data.hold;
SET copy_data = helpers.get_copy_bib_basics(hold.current_copy.id);
%]
<td>[% copy_data.author | truncate %]</td>
<td>[% hold.current_copy.location.name %]</td>
<td>[% hold.current_copy.call_number.label %]</td>
- <td>[% hold.current_copy.barcode %]</td>
+ <td>[% hold.current_copy.barcode %]
+ [% FOR part IN hold.current_copy.parts %]
+ [% part.part.label %]
+ [% END %]
+ </td>
<td>[% hold.usr.card.barcode %]</td>
</tr>
[% END %]
(35, 'current_copy.location'),
(35, 'current_copy.call_number'),
(35, 'usr.card'),
- (35, 'pickup_lib')
+ (35, 'pickup_lib'),
+ (35, 'current_copy.parts'),
+ (35, 'current_copy.parts.part')
;
-- 0386.data.org-setting-patron-clone-copy-addr.sql
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('xxxx');
+
+UPDATE action_trigger.event_definition SET template =
+$$
+[%- USE date -%]
+<style>
+ table { border-collapse: collapse; }
+ td { padding: 5px; border-bottom: 1px solid #888; }
+ th { font-weight: bold; }
+</style>
+[%
+ # Sort the holds into copy-location buckets
+ # In the main print loop, sort each bucket by callnumber before printing
+ SET holds_list = [];
+ SET loc_data = [];
+ SET current_location = target.0.current_copy.location.id;
+ FOR hold IN target;
+ IF current_location != hold.current_copy.location.id;
+ SET current_location = hold.current_copy.location.id;
+ holds_list.push(loc_data);
+ SET loc_data = [];
+ END;
+ SET hold_data = {
+ 'hold' => hold,
+ 'callnumber' => hold.current_copy.call_number.label
+ };
+ loc_data.push(hold_data);
+ END;
+ holds_list.push(loc_data)
+%]
+<table>
+ <thead>
+ <tr>
+ <th>Title</th>
+ <th>Author</th>
+ <th>Shelving Location</th>
+ <th>Call Number</th>
+ <th>Barcode/Part</th>
+ <th>Patron</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOR loc_data IN holds_list %]
+ [% FOR hold_data IN loc_data.sort('callnumber') %]
+ [%
+ SET hold = hold_data.hold;
+ SET copy_data = helpers.get_copy_bib_basics(hold.current_copy.id);
+ %]
+ <tr>
+ <td>[% copy_data.title | truncate %]</td>
+ <td>[% copy_data.author | truncate %]</td>
+ <td>[% hold.current_copy.location.name %]</td>
+ <td>[% hold.current_copy.call_number.label %]</td>
+ <td>[% hold.current_copy.barcode %]
+ [% FOR part IN hold.current_copy.parts %]
+ [% part.part.label %]
+ [% END %]
+ </td>
+ <td>[% hold.usr.card.barcode %]</td>
+ </tr>
+ [% END %]
+ [% END %]
+ <tbody>
+</table>
+$$
+ WHERE id = 35;
+
+INSERT INTO action_trigger.environment (
+ event_def,
+ path
+ ) VALUES
+ (35, 'current_copy.parts'),
+ (35, 'current_copy.parts.part')
+;
+
+COMMIT;
+
<th>Author</th>
<th>Shelving Location</th>
<th>Call Number</th>
- <th>Barcode</th>
+ <th>Barcode/Part</th>
</tr>
</thead>
<tbody id='target'>
<td type='opac/slot-data' query='datafield[tag^=1]' limit='1'> </td>
<td>${current_copy.location.name}</td>
<td>${current_copy.call_number.prefix.label} ${current_copy.call_number.label} ${current_copy.call_number.suffix.label}</td>
- <td>${current_copy.barcode}</td>
+ <td>${current_copy.barcode} ${current_copy.parts_stringified}</td>
</tr>
</tbody>
</table>
hold.current_copy.call_number.record = hold_fm.current_copy().call_number().record().toHash(true);
hold.current_copy.call_number.prefix = hold_fm.current_copy().call_number().prefix().toHash(true);
hold.current_copy.call_number.suffix = hold_fm.current_copy().call_number().suffix().toHash(true);
+ hold.current_copy.parts_stringified = '';
+ dojo.forEach( hold_fm.current_copy().parts(), function(part) {
+ hold.current_copy.parts_stringified += ' ' + part.label();
+ });
+
// clone the template's html
var tr = dojo.clone(