]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP1913604: Course materials module should remember original circ_lib
[Evergreen.git] / Open-ILS / examples / fm_IDL.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3
4 Copyright (C) 2006-2008 Georgia Public Library Service
5 Copyright (C) 2008 Equinox Software, Inc
6 Author: Mike Rylander <miker@esilibrary.com>
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
21
22 ############################
23           TEMPLATE
24 ############################
25
26     <class
27         id=""
28         controller="open-ils.cstore open-ils.pcrud"
29         oils_obj:fieldmapper=""
30         oils_persist:tablename=""
31         reporter:label=""
32         oils_persist:field_safe=""
33         oils_persist:virtual=""
34         oils_persist:readonly=""
35         reporter:core=""
36     >
37
38         <oils_persist:source_definition><![CDATA[
39             SELECT * FROM foo
40         ]]></oils_persist:source_definition>
41
42         <fields oils_persist:primary="" oils_persist:sequence="">
43             <field reporter:label="ID" name="id" reporter:datatype="id"/>
44                         <field reporter:label="" name="" reporter:datatype="org_unit"/>
45             <field reporter:label="" name="" reporter:datatype="text"/>
46             <field reporter:label="" name="" reporter:datatype="link"/>
47             <field reporter:label="" name="" reporter:datatype="timestamp"/>
48             <field reporter:label="" name="" reporter:datatype="money"/>
49             <field reporter:label="" name="" reporter:datatype="bool"/>
50             <field reporter:label="" name="" reporter:datatype="int" oils_obj:required="true"/>
51             <field reporter:label="" name="" reporter:datatype="int" oils_persist:virtual="true"/>
52         </fields>
53
54         <links>
55             <link field="" reltype="has_a" key="" map="" class=""/>
56         </links>
57
58         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
59             <actions>
60                 <create permission="" gloabl_required="true"/>
61                 <retrieve/>
62                 <update permission="" context_field=""/>
63                 <delete permission="">
64                     <context link="" field=""/>
65                 </delete>
66             </actions>
67         </permacrud>
68
69     </class>
70
71
72 -->
73
74 <IDL xmlns="http://opensrf.org/spec/IDL/base/v1" xmlns:idl="http://opensrf.org/spec/IDL/base/v1" xmlns:oils_persist="http://open-ils.org/spec/opensrf/IDL/persistence/v1" xmlns:oils_obj="http://open-ils.org/spec/opensrf/IDL/objects/v1" xmlns:reporter="http://open-ils.org/spec/opensrf/IDL/reporter/v1" xmlns:sr="http://open-ils.org/spec/opensrf/IDL/simple-reporter/v1" xmlns:permacrud="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
75
76         <!-- Virtual classes -->
77
78         <class id="oaib" controller="open-ils.cstore" oils_obj:fieldmapper="oai::biblio"
79                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
80                    oils_persist:tablename="oai.biblio">
81                 <fields oils_persist:primary="rec_id">
82                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
83                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
84                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
85                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
86                 </fields>
87         </class>
88         <class id="oaia" controller="open-ils.cstore" oils_obj:fieldmapper="oai::authority"
89                    oils_persist:readonly="true" reporter:core="false" reporter:label="OAI2 record list"
90                    oils_persist:tablename="oai.authority">
91                 <fields oils_persist:primary="rec_id">
92                         <field reporter:label="Record ID\OAI identifier postfix" name="rec_id" reporter:datatype="id"/>
93                         <field reporter:label="Last edit date\OAI datestamp" name="datestamp" reporter:datatype="timestamp"/>
94                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
95                         <field reporter:label="Setspec" name="set_spec" oils_persist:virtual="true"/>
96                 </fields>
97         </class>
98
99         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
100                 <fields>
101                         <field name="usr" oils_persist:virtual="true" />
102                         <field name="forgive_payment" oils_persist:virtual="true" />
103                         <field name="work_payment" oils_persist:virtual="true" />
104                         <field name="credit_payment" oils_persist:virtual="true" />
105                         <field name="goods_payment" oils_persist:virtual="true" />
106                         <field name="account_adjustment" oils_persist:virtual="true" />
107                 </fields>
108                 <links>
109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
110                 </links>
111         </class>
112
113         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
114                 <fields>
115                         <field name="workstation" oils_persist:virtual="true" />
116                         <field name="cash_payment" oils_persist:virtual="true" />
117                         <field name="check_payment" oils_persist:virtual="true" />
118                         <field name="credit_card_payment" oils_persist:virtual="true" />
119                         <field name="debit_card_payment" oils_persist:virtual="true" />
120                 </fields>
121                 <links>
122                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
123                 </links>
124         </class>
125
126         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
127                 <fields>
128                         <field name="id" oils_persist:virtual="true" />
129                         <field name="children" oils_persist:virtual="true" />
130                         <field name="owner_doc" oils_persist:virtual="true" />
131                         <field name="intra_doc_id" oils_persist:virtual="true" />
132                         <field name="parent_node" oils_persist:virtual="true" />
133                         <field name="node_type" oils_persist:virtual="true" />
134                         <field name="namespace_uri" oils_persist:virtual="true" />
135                         <field name="name" oils_persist:virtual="true" />
136                         <field name="value" oils_persist:virtual="true" />
137                 </fields>
138         </class>
139
140         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
141                 <fields>
142                         <field name="title" oils_persist:virtual="true" />
143                         <field name="author" oils_persist:virtual="true" />
144                         <field name="doc_id" oils_persist:virtual="true" />
145                         <field name="doc_type" oils_persist:virtual="true" />
146                         <field name="pubdate" oils_persist:virtual="true" />
147                         <field name="isbn" oils_persist:virtual="true" />
148                         <field name="publisher" oils_persist:virtual="true" />
149                         <field name="tcn" oils_persist:virtual="true" />
150                         <field name="subject" oils_persist:virtual="true" />
151                         <field name="types_of_resource" oils_persist:virtual="true" />
152                         <field name="call_numbers" oils_persist:virtual="true" />
153                         <field name="edition" oils_persist:virtual="true" />
154                         <field name="online_loc" oils_persist:virtual="true" />
155                         <field name="synopsis" oils_persist:virtual="true" />
156                         <field name="physical_description" oils_persist:virtual="true" />
157                         <field name="toc" oils_persist:virtual="true" />
158                         <field name="copy_count" oils_persist:virtual="true" />
159                         <field name="series" oils_persist:virtual="true" />
160                         <field name="serials" oils_persist:virtual="true" />
161                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
162                 </fields>
163         </class>
164
165         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
166                 <fields>
167                         <field name="err_msg" oils_persist:virtual="true" />
168                         <field name="type" oils_persist:virtual="true" />
169                 </fields>
170         </class>
171
172         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
173                 <fields>
174                         <field name="err_msg" oils_persist:virtual="true" />
175                         <field name="type" oils_persist:virtual="true" />
176                 </fields>
177         </class>
178
179         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
180                 <fields oils_persist:primary="matchpoint">
181                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
182                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
183                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
184                 </fields>
185                 <links>
186                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
187                 </links>
188         </class>
189
190         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
191         <!-- when the time is right, turn me into a view.  -->
192                 <fields>
193             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
194             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
195             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
196             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
197             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
198             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
199             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
200             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
201             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
202             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
203                 </fields>
204         </class>
205
206         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
207                 <fields>
208                         <field name="public_name" oils_persist:virtual="true" />
209                         <field name="target_url" oils_persist:virtual="true" />
210                         <field name="target_coverage" oils_persist:virtual="true" />
211                         <field name="target_embargo" oils_persist:virtual="true" />
212                 </fields>
213         </class>
214
215         <!-- Actually in the DB -->
216         <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
217                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
218                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
219                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
220                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
221                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
222                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
223                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
224                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
225                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
226                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
227                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
228                 </fields>
229                 <links>
230                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
231                 </links>
232                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
233                         <actions>
234                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
235                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
236                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
237                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
238                         </actions>
239                 </permacrud>
240         </class>
241
242         <class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
243                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
244                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
245                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
246                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
247                 </fields>
248                 <links>
249                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
250                 </links>
251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
252                         <actions>
253                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
254                     <context link="grp" field="owner"/>
255                 </create>
256                                 <retrieve/>
257                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
258                     <context link="grp" field="owner"/>
259                 </update>
260                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
261                     <context link="grp" field="owner"/>
262                 </delete>
263                         </actions>
264                 </permacrud>
265         </class>
266
267         <class  id="rrbs" 
268             controller="open-ils.cstore open-ils.pcrud" 
269             oils_obj:fieldmapper="rating::record_badge_score" 
270             oils_persist:tablename="rating.record_badge_score" 
271             reporter:label="Statistical Popularity Badge">
272                 <fields oils_persist:primary="id" 
273                 oils_persist:sequence="rating.record_badge_score_id_seq">
274                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
275                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
276                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
277                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
278                 </fields>
279         <links>
280             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
281             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
282         </links>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <retrieve/>
286                         </actions>
287                 </permacrud>
288         </class>
289
290         <class  id="rp" 
291             controller="open-ils.cstore open-ils.pcrud" 
292             oils_obj:fieldmapper="rating::popularity_parameter" 
293             oils_persist:tablename="rating.popularity_parameter" 
294             reporter:label="Statistical Popularity Parameter">
295                 <fields oils_persist:primary="id" 
296                 oils_persist:sequence="rating.popularity_parameter_id_seq">
297                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
298                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
299                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
300                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
301                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
302                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
303                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
304                 </fields>
305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
306                         <actions>
307                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
308                                 <retrieve/>
309                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
310                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
311                         </actions>
312                 </permacrud>
313         </class>
314
315         <class  id="rb" 
316             controller="open-ils.cstore open-ils.pcrud" 
317             oils_obj:fieldmapper="rating::badge" 
318             oils_persist:tablename="rating.badge" 
319             reporter:label="Statistical Popularity Badge">
320                 <fields oils_persist:primary="id" 
321                 oils_persist:sequence="rating.badge_id_seq">
322                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
323                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
325                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
326                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
327                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
328                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
329                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
330                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
331                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
332                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
333                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
334                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
335                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
336                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
337                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
338                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
339                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
340                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
341                 </fields>
342                 <links>
343                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
344                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
345                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
346                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
347                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
348                 </links>
349                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
350                         <actions>
351                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
352                                 <retrieve/>
353                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
354                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
355                         </actions>
356                 </permacrud>
357         </class>
358
359         <class  id="vibtg" 
360             controller="open-ils.cstore open-ils.pcrud" 
361             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
362             oils_persist:tablename="vandelay.import_bib_trash_group" 
363             reporter:label="Import/Overlay Field Groups for Removal">
364                 <fields oils_persist:primary="id" 
365                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
366                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
367                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
368                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
369                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
370                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
371                 </fields>
372                 <links>
373                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
374                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
375                 </links>
376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
377                         <actions>
378                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
379                                 <retrieve/>
380                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
381                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
382                         </actions>
383                 </permacrud>
384         </class>
385
386
387         <class id="vii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item" oils_persist:tablename="vandelay.import_item" reporter:label="Import Item">
388                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
389                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
390                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
391                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
392                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
393                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
394                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
395                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
396                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
397                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
398                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
399                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
400                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
401                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
402                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
403                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
404                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
405                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
406                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
407                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
408                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
409                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
410                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
411                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
412                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
413                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
414                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
415                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
416                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
417                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
418                 </fields>
419                 <links>
420                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
421                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
422                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
423                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
424                 </links>
425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
426                         <actions>
427                                 <create permission="CREATE_IMPORT_ITEM">
428                     <context link="definition" field="owner"/>
429                                 </create>
430                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
431                     <context link="definition" field="owner"/>
432                                 </retrieve>
433                                 <update permission="UPDATE_IMPORT_ITEM">
434                     <context link="definition" field="owner"/>
435                                 </update>
436                                 <delete permission="DELETE_IMPORT_ITEM">
437                     <context link="definition" field="owner"/>
438                                 </delete>
439                         </actions>
440                 </permacrud>
441         </class>
442
443         <class id="viiad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_item_attr_definition" oils_persist:tablename="vandelay.import_item_attr_definition" reporter:label="Import Item Attribute Definition">
444                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
445                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
446                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
448                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
449                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
450                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
451                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
452                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
453                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
454                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
455                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
456                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
457                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
458                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
459                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
460                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
462                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
463                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
464                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
465                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
466                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
467                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
468                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
469                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
470                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
471                 </fields>
472                 <links>
473                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
474                 </links>
475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
476                         <actions>
477                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
478                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
479                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
480                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
481                         </actions>
482                 </permacrud>
483         </class>
484
485         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
486                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
487                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
488                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
489                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
490                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
491                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
492                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
493                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
494                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
495                 </fields>
496                 <links>
497                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
498                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
499                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
500                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
501                 </links>
502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
503                         <actions>
504                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
505                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
506                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
507                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
508                         </actions>
509                 </permacrud>
510         </class>
511
512         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
513                 <fields oils_persist:primary="code">
514                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
515                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
516                 </fields>
517                 <links>
518                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
519                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
520                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
521                 </links>
522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
523                         <actions>
524                                 <retrieve/>
525                         </actions>
526                 </permacrud>
527         </class>
528
529         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
530                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
531                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
532                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
533                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
534                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
535                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
536                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
537                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
538                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
539                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
540                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
541                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
542                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
543                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
544                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
545                 </fields>
546                 <links>
547                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
548                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
549                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
550                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
551             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
552             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
553             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
554                 </links>
555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
556                         <actions>
557                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
558                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
559                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
560                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
561                         </actions>
562                 </permacrud>
563         </class>
564
565         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
566                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
567                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
568                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
569                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
570                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
571                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
572                 </fields>
573                 <links/>
574                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
575                         <actions>
576                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
577                 <retrieve/>
578                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
579                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
580                         </actions>
581                 </permacrud>
582         </class>
583
584         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
585                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
586                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
587                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
588                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
589                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
594                 </links>
595                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
596                         <actions>
597                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
598                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
599                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
600                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
601                         </actions>
602                 </permacrud>
603         </class>
604
605         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
607                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
608                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
609                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
610                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
611                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
612                 </fields>
613                 <links>
614                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
615                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
616                 </links>
617                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
618                         <actions>
619                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
620                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
621                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
622                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
623                         </actions>
624                 </permacrud>
625         </class>
626
627         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
628                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
629                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
630                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
631                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
632                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
633                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
634                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
635                 </fields>
636                 <links>
637                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
638                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
639                 </links>
640                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
641                         <actions>
642                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
643                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
644                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
645                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
646                         </actions>
647                 </permacrud>
648         </class>
649
650         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
651                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
652                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
653                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
654                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
655                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
656                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
657                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
658                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
659                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
660                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
661                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
662                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
663                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
664                 </fields>
665                 <links>
666                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
667                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
668                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
669             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
670             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
671                 </links>
672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
673                         <actions>
674                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
675                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
676                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
677                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
678                         </actions>
679                 </permacrud>
680         </class>
681
682         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
683                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
684                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
685                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
686                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
687                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
688                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
689                 </fields>
690                 <links/>
691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
692                         <actions>
693                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
694                 <retrieve/>
695                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
696                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
697                         </actions>
698                 </permacrud>
699         </class>
700
701         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
702                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
703                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
704                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
705                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
706                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
711                 </links>
712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
713                         <actions>
714                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
716                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
717                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
718                         </actions>
719                 </permacrud>
720         </class>
721
722         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
724                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
725                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
726                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
727                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
728                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
729                 </fields>
730                 <links>
731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
732                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
733                 </links>
734                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
735                         <actions>
736                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
737                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
738                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
739                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
740                         </actions>
741                 </permacrud>
742         </class>
743
744         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
745                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
746                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
747                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
748                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
749                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
750                 </fields>
751                 <links>
752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
753                 </links>
754                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
755                         <actions>
756                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
757                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
758                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
759                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
760                         </actions>
761                 </permacrud>
762         </class>
763
764         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
765                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
766                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
767                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
768                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
769                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
770                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
771                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
772                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
773             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
774                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
775                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
776                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
777                 </fields>
778                 <links>
779                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
780                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
781                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
782                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
783                 </links>
784                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
785                         <actions>
786                                 <create permission="ADMIN_IMPORT_MATCH_SET">
787                     <context link="match_set" field="owner"/>
788                                 </create>
789                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
790                     <context link="match_set" field="owner"/>
791                                 </retrieve>
792                                 <update permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </update>
795                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </delete>
798                         </actions>
799                 </permacrud>
800         </class>
801
802         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
803                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
804                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
805                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
806                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
807                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
808                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
809                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
810                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
811                 </fields>
812                 <links>
813                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
814                 </links>
815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
816                         <actions>
817                                 <create permission="ADMIN_IMPORT_MATCH_SET">
818                     <context link="match_set" field="owner"/>
819                                 </create>
820                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
821                     <context link="match_set" field="owner"/>
822                                 </retrieve>
823                                 <update permission="ADMIN_IMPORT_MATCH_SET">
824                     <context link="match_set" field="owner"/>
825                                 </update>
826                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
827                     <context link="match_set" field="owner"/>
828                                 </delete>
829                         </actions>
830                 </permacrud>
831         </class>
832
833         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
834                 oils_obj:fieldmapper="vandelay::session_tracker" 
835                 oils_persist:tablename="vandelay.session_tracker" 
836                 reporter:label="Vandelay Session Tracker">
837                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
838                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
839                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
840                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
841                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
842                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
843                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
844                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
845                                          queue or an auth queue and there's no IDL class for vandelay.queue .
846                                          parent table.
847                         -->
848                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
849                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
850                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
851                         <field reporter:label="State" name="state" reporter:datatype="text"/>
852                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
853                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
854                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
855                 </fields>
856                 <links>
857                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
858                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
859                 </links>
860                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
861                         <actions>
862                                 <!-- created by the API -->
863                                 <retrieve global_required="true"
864                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
865                                 <update global_required="true"
866                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
867                                         <context link="workstation" field="owning_lib"/>
868                                 </update>
869                                 <delete 
870                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
871                                         <context link="workstation" field="owning_lib"/>
872                                 </delete>
873                         </actions>
874                 </permacrud>
875         </class>
876
877         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
878                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
879                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
880                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
881                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
882                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
883                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
884                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
885                 </fields>
886                 <links>
887                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
888                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
889                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
890                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
891                 </links>
892         </class>
893
894     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
895         <fields oils_persist:primary="name">
896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
897             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
898             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
899             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
900         </fields>
901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
902             <actions>
903                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
904                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
905                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
906                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
907             </actions>
908         </permacrud>
909     </class>
910
911     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
912         <fields oils_persist:primary="id">
913             <field reporter:label="ID" name="id" reporter:datatype="id"/>
914             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
915             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
916             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
917             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
918         </fields>
919         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
920             <actions>
921                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
922                 <retrieve/>
923                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
924                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
925             </actions>
926         </permacrud>
927     </class>
928
929         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
932                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
933                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
934                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
935                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
936                 </fields>
937                 <links>
938                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
939                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
940                 </links>
941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
942             <actions>
943                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
944                 <retrieve/>
945                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
946                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
947             </actions>
948         </permacrud>
949         </class>
950
951         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
952                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
953                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
954                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
955                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
956         </fields>
957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
958             <actions>
959                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
960                 <retrieve/>
961                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
962                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
963             </actions>
964         </permacrud>
965         </class>
966
967         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
968                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
969                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
970                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
971                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
972                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
973                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
974                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
975                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
976                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
977                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
978                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
979                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
980         </fields>
981                 <links>
982                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
983                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
984         </links>
985         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
986             <actions>
987                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
988                 <retrieve/>
989                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
990                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
991             </actions>
992         </permacrud>
993         </class>
994
995         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:field_safe="true">
996                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
997                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
998                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
999                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
1000                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
1001                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
1002                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1003                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
1004                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
1005                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
1006                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
1007         </fields>
1008                 <links>
1009                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
1010                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1011         </links>
1012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1013             <actions>
1014                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
1015                 <retrieve/>
1016                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
1017                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
1018             </actions>
1019         </permacrud>
1020         </class>
1021
1022         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
1023                 <fields oils_persist:primary="name">
1024                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1025                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1026                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1027                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1028                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1029                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1030                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1031                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1032                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1033                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1034                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1035                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1036                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1037                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1038                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1039                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1040                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1041                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1042                 </fields>
1043                 <links>
1044                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1045                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1046                 </links>
1047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1048             <actions>
1049                 <create permission="ADMIN_SVF" global_required="true"/>
1050                 <retrieve/>
1051                 <update permission="ADMIN_SVF" global_required="true"/>
1052                 <delete permission="ADMIN_SVF" global_required="true"/>
1053             </actions>
1054         </permacrud>
1055         </class>
1056
1057         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
1058                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1060                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1061                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1062             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1063                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1064                 </fields>
1065                 <links/>
1066         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1067             <actions>
1068                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1069                 <retrieve/>
1070                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1071                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1077                 <fields oils_persist:primary="coded_value">
1078                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1087                 <retrieve/>
1088                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1089                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1090             </actions>
1091         </permacrud>
1092         </class>
1093
1094         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1095                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1096                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1097                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1098                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1099                 </fields>
1100                 <links>
1101                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1102                 </links>
1103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1104             <actions>
1105                 <retrieve/>
1106             </actions>
1107         </permacrud>
1108         </class>
1109
1110
1111         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1112                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1113                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1114                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1115                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1116                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1117                 </fields>
1118                 <links>
1119                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1120                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1121                 </links>
1122         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1123             <actions>
1124                 <retrieve/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129
1130         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1131                 <fields oils_persist:primary="source">
1132                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1133                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1134                 </fields>
1135                 <links>
1136                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1137                 </links>
1138         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1139             <actions>
1140                 <retrieve/>
1141             </actions>
1142         </permacrud>
1143         </class>
1144
1145         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1146                 <fields>
1147                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1148                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1149                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1150                 </fields>
1151                 <links>
1152                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1153                 </links>
1154         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1155             <actions>
1156                 <retrieve/>
1157             </actions>
1158         </permacrud>
1159         </class>
1160
1161         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1162                 <fields oils_persist:primary="id">
1163                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1164                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1165                 </fields>
1166                 <links>
1167                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1168                 </links>
1169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1170             <actions>
1171                 <retrieve/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1179                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1180                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1181                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1182                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1183                 </fields>
1184                 <links>
1185                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1186                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1187                 </links>
1188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1189             <actions>
1190                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1191                 <retrieve/>
1192                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1193                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1194             </actions>
1195         </permacrud>
1196         </class>
1197
1198         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1199                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1200                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1201                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1202                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1203                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1204                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1205                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1206                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1207             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1208             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1209             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1210                 </fields>
1211                 <links>
1212                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1213                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1214                 </links>
1215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1216             <actions>
1217                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1218                 <retrieve/>
1219                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1220                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1221             </actions>
1222         </permacrud>
1223         </class>
1224
1225         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1226                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1227                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1228                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1229                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1230                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1231                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1232                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1233                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1234                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1235                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1236                 </fields>
1237                 <links>
1238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1239                 </links>
1240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1241             <actions>
1242                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1243                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1244                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1245                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1246             </actions>
1247         </permacrud>
1248         </class>
1249
1250     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1251         <fields oils_persist:primary="name">
1252             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1253             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1254             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1255             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1256             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1257             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1258             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1259             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1260             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1261             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1262         </fields>
1263         <links>
1264             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1265             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1266         </links>
1267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1268             <actions>
1269                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1270                 <retrieve/>
1271                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1272                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273             </actions>
1274         </permacrud>
1275     </class>
1276
1277     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1278         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1279             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1280             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1281             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1282             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1283             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1284             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1285             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1286         </fields>
1287         <links>
1288             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1289         </links>
1290         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1291             <actions>
1292                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1293                 <retrieve/>
1294                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1295                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1296             </actions>
1297         </permacrud>
1298     </class>
1299
1300     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1301                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1302                         oils_persist:tablename="config.z3950_index_field_map" 
1303                         reporter:label="Z39.50 Index Field Map">
1304         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1305             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1306             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1307             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1308             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1309             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1310             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1311         </fields>
1312         <links>
1313             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1314             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1315             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1316         </links>
1317         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1318             <actions>
1319                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1320                 <retrieve/>
1321                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1322                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1323             </actions>
1324         </permacrud>
1325     </class>
1326
1327
1328         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1329                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1330                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1331                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1332                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1333                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1334                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1335                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1336             <field reporter:label="Output Locale" name="locale" reporter:datatype="text"/>
1337                 </fields>
1338                 <links>
1339             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1340             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1341                 </links>
1342                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1343                         <actions>
1344                                 <retrieve/>
1345                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1346                         </actions>
1347                 </permacrud>
1348         </class>
1349
1350         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1351                 <fields oils_persist:primary="key">
1352                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1353                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1354                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1355                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1356                 </fields>
1357                 <links/>
1358                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1359                         <actions>
1360                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1361                                 <retrieve/>
1362                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1363                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1364                         </actions>
1365                 </permacrud>
1366         </class>
1367
1368         <class id="atcol" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1369                 <fields oils_persist:primary="module">
1370                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1371                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1372                 </fields>
1373                 <links/>
1374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1375                         <actions>
1376                                 <retrieve/>
1377                         </actions>
1378                 </permacrud>
1379         </class>
1380
1381         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1382                 <fields oils_persist:primary="module">
1383                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1384                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1385                 </fields>
1386                 <links/>
1387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1388                         <actions>
1389                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1390                                 <retrieve/>
1391                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1392                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1393                         </actions>
1394                 </permacrud>
1395         </class>
1396
1397         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1398                 <fields oils_persist:primary="module">
1399                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1400                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1401                 </fields>
1402                 <links/>
1403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1404                         <actions>
1405                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1406                                 <retrieve/>
1407                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1408                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1409                         </actions>
1410                 </permacrud>
1411         </class>
1412
1413         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1414                 <fields oils_persist:primary="module">
1415                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1416                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1417                 </fields>
1418                 <links/>
1419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1420                         <actions>
1421                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1422                                 <retrieve/>
1423                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1424                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1425                         </actions>
1426                 </permacrud>
1427         </class>
1428
1429         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1430                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1431                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1432                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1433                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1434                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1435                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1436                 </fields>
1437                 <links>
1438                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1439                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1440                 </links>
1441                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1442                         <actions>
1443                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1444                     <context link="event_def" field="owner"/>
1445                 </create>
1446                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1447                     <context link="event_def" field="owner"/>
1448                 </retrieve>
1449                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1450                     <context link="event_def" field="owner"/>
1451                 </update>
1452                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1453                     <context link="event_def" field="owner"/>
1454                 </delete>
1455                         </actions>
1456                 </permacrud>
1457         </class>
1458
1459         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1460                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1461                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1462                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1463                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1464                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1465                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1466                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1467                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1468                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1469                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1470                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1471                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1472                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1473                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1474                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1475                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1476                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1477                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1478                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1479                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1480                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1481                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1482                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1483                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1484                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1485                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1486                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1487                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1488                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1489                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1490                 </fields>
1491                 <links>
1492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1493                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1494                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1495                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1496                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1497                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1498                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1499                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1500                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1501                 </links>
1502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1503                         <actions>
1504                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1505                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                         </actions>
1509                 </permacrud>
1510         </class>
1511
1512     <class id="atevalt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::alternate_template" oils_persist:tablename="action_trigger.alternate_template" reporter:label="Alternate Action Trigger Templates">
1513         <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.alternate_template_id_seq">
1514             <field reporter:label="Alternate Template ID" name="id" reporter:datatype="id"/>
1515             <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1516             <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1517             <field reporter:label="Template Locale" name="locale" reporter:datatype="link" oils_obj:required="true"/>
1518             <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1519             <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1520             <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1521         </fields>
1522         <links>
1523             <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1524             <link field="locale" relteype="has_a" key="code" map="" class="i18n_l"/>
1525          </links>
1526          <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1527              <actions>
1528                  <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1529                      <context link="event_def" field="owner"/>
1530                  </create>
1531                  <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1532                      <context link="event_def" field="owner"/>
1533                  </retrieve>
1534                  <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1535                      <context link="event_def" field="owner"/>
1536                  </update>
1537                  <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1538                      <context link="event_def" field="owner"/>
1539                  </delete>
1540             </actions>
1541         </permacrud>
1542     </class>
1543
1544
1545         <class id="atevdefg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group" oils_persist:tablename="action_trigger.event_def_group" reporter:label="Trigger Event Definition Group" oils_persist:restrict_primary="100">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1547                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1549                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1550                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1551                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1552                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1553                 </fields>
1554                 <links>
1555                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1556                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1557                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1558                 </links>
1559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1560                         <actions>
1561                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1562                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1563                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1564                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1565                         </actions>
1566                 </permacrud>
1567         </class>
1568
1569         <class id="atevdefgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_def_group_member" oils_persist:tablename="action_trigger.event_def_group_member" reporter:label="Trigger Event Definition Group Member">
1570                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1571                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1572                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1573                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1574                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1575                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1576                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1577                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1578                 </fields>
1579                 <links>
1580                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1581                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1582                 </links>
1583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1584                         <actions>
1585                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1586                     <context link="grp" field="owner"/>
1587                 </create>
1588                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1589                     <context link="grp" field="owner"/>
1590                 </retrieve>
1591                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1592                     <context link="grp" field="owner"/>
1593                 </update>
1594                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1595                     <context link="grp" field="owner"/>
1596                 </delete>
1597                         </actions>
1598                 </permacrud>
1599         </class>
1600
1601         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1602                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1603                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1604                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1605                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1606                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1607                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1608                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1609                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1610                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1611                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1612                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1613                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1614                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1615                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1616                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1617                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1618                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1619                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1620                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1621                 </fields>
1622                 <links>
1623                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1624                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1625                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1626                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1627                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1628                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1629                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1630                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1631                 </links>
1632         </class>
1633
1634         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1635                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1636                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1637                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1638                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1639                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1640                 </fields>
1641                 <links>
1642                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1643                 </links>
1644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1645                         <actions>
1646                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1647                     <context link="event_def" field="owner"/>
1648                 </create>
1649                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1650                     <context link="event_def" field="owner"/>
1651                 </retrieve>
1652                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1653                     <context link="event_def" field="owner"/>
1654                 </update>
1655                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1656                     <context link="event_def" field="owner"/>
1657                 </delete>
1658                         </actions>
1659                 </permacrud>
1660         </class>
1661
1662         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1663                 <oils_persist:source_definition><![CDATA[
1664                 SELECT  atevdef.hook,
1665                         atevdef.name,
1666                         atevdef.reactor,
1667                         atev.id,
1668                         atev.event_def,
1669                         atev.add_time,
1670                         atev.run_time,
1671                         atev.start_time,
1672                         atev.update_time,
1673                         atev.complete_time,
1674                         atev.update_process,
1675                         atev.state,
1676                         atev.user_data,
1677                         atev.template_output,
1678                         atev.error_output,
1679                         atev.async_output,
1680                         targ_circ.id AS target_circ,
1681                         targ_ahr.id AS target_hold,
1682                         COALESCE(
1683                                 targ_circ.circ_lib,
1684                                 targ_ahr.pickup_lib
1685                         ) AS perm_lib
1686                 FROM action_trigger.event atev
1687                 JOIN action_trigger.event_definition atevdef ON
1688                         (atevdef.id = atev.event_def)
1689                 JOIN action_trigger.hook ath ON
1690                         (ath.key = atevdef.hook)
1691                 LEFT JOIN action.circulation targ_circ ON
1692                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1693                 LEFT JOIN action.hold_request targ_ahr ON
1694                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1695                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1696                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1697                                 'circ.staff.max_visible_event_age',
1698                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1699                         ) UNION
1700                         SELECT '1000 YEARS'::INTERVAL AS value
1701                 ) ous)
1702                 ]]></oils_persist:source_definition>
1703                 <fields oils_persist:primary="id">
1704                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1705                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1706                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1707                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1708                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1709                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1710                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1711                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1712                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1713                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1714                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1715                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1716                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1717                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1718                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1719                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1720                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1721                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1722                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1723                 </fields>
1724                 <links>
1725                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1726                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1727                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1728                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1729                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1730                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1731                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1732                 </links>
1733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1734                         <actions>
1735                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1736                         </actions>
1737                 </permacrud>
1738         </class>
1739
1740         <class id="atoul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::optimized_user_log" reporter:label="Action Trigger Optimized User Log" oils_persist:readonly="true">
1741                 <oils_persist:source_definition><![CDATA[
1742                 SELECT  atevdef.hook,
1743                         atevdef.name,
1744                         atevdef.reactor,
1745                         atev.id,
1746                         atev.event_def,
1747                         atev.add_time,
1748                         atev.run_time,
1749                         atev.start_time,
1750                         atev.update_time,
1751                         atev.complete_time,
1752                         atev.update_process,
1753                         atev.state,
1754                         atev.user_data,
1755                         atev.template_output,
1756                         atev.error_output,
1757                         atev.async_output,
1758             atev.target,
1759                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1760                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1761             atev.context_user,
1762                         atev.context_library,
1763             atev.context_bib,
1764             atev.context_item,
1765             rssr.title,
1766             rssr.author
1767                 FROM action_trigger.event atev
1768                 JOIN action_trigger.event_definition atevdef ON
1769                         (atevdef.id = atev.event_def)
1770                 JOIN action_trigger.hook ath ON
1771                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1772         LEFT JOIN reporter.super_simple_record rssr ON
1773             (atev.context_bib = rssr.id)
1774                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1775                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1776                                 'circ.staff.max_visible_event_age',
1777                                 atev.context_library
1778                         ) UNION
1779                         SELECT '1000 YEARS'::INTERVAL AS value
1780                 ) ous)
1781                 ]]></oils_persist:source_definition>
1782                 <fields oils_persist:primary="id">
1783                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1784                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1785                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1786                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1787                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1788                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1789                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1790                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1791                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1792                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1793                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1794                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1795                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1796                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1797                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1798                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1799                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1800                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1801                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1802                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1803                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1804                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1805                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1806                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1807                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1808                 </fields>
1809                 <links>
1810                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1811                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1812                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1813                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1814                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1815                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1816                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1817                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1818                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1819                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1820                 </links>
1821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1822                         <actions>
1823                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1824                         </actions>
1825                 </permacrud>
1826         </class>
1827
1828         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1829                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1830                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1831                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1832                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1833                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1834                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1835                 </fields>
1836                 <links>
1837                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1838                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1839                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1840                 </links>
1841                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1842                         <actions>
1843                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1844                         </actions>
1845                 </permacrud>
1846         </class>
1847
1848         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1849                 <fields oils_persist:primary="code">
1850                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1851                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1852                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1853                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1854                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1855                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1856                 </fields>
1857                 <links/>
1858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1859             <actions>
1860                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1861                 <retrieve/>
1862                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1863                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1864             </actions>
1865         </permacrud>
1866         </class>
1867
1868         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1869                 <fields oils_persist:primary="code">
1870                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1871                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1872                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1873                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1874                 </fields>
1875                 <links/>
1876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1877             <actions>
1878                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1879                 <retrieve/>
1880                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1881                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1882             </actions>
1883         </permacrud>
1884         </class>
1885
1886         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1887                 <fields oils_persist:primary="code">
1888                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1889                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1890                 </fields>
1891                 <links/>
1892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1893             <actions>
1894                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1895                 <retrieve/>
1896                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1897                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1898             </actions>
1899         </permacrud>
1900         </class>
1901
1902         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1903                 <fields oils_persist:primary="code">
1904                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1905                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1906                 </fields>
1907                 <links/>
1908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1909             <actions>
1910                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1913                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1914             </actions>
1915         </permacrud>
1916         </class>
1917
1918         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1919                 <fields oils_persist:primary="code">
1920                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1921                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1922                 </fields>
1923                 <links/>
1924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1925             <actions>
1926                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1927                 <retrieve/>
1928                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1929                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1930             </actions>
1931         </permacrud>
1932         </class>
1933
1934         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1935                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1936                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1937                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1938                 </fields>
1939                 <links/>
1940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1941             <actions>
1942                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1943                 <retrieve/>
1944                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1945                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1946             </actions>
1947         </permacrud>
1948         </class>
1949
1950         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1951                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1952                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1953                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1954                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1955                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1956                 </fields>
1957         <links>
1958             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1959             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1960             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1961         </links>
1962         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1963             <actions>
1964                 <create permission="UPDATE_COPY">
1965                     <context link="target_copy" field="circ_lib"/>
1966                 </create>
1967                 <retrieve/>
1968                 <update permission="UPDATE_COPY">
1969                     <context link="target_copy" field="circ_lib"/>
1970                 </update>
1971                 <delete permission="UPDATE_COPY">
1972                     <context link="target_copy" field="circ_lib"/>
1973                 </delete>
1974             </actions>
1975         </permacrud>
1976         </class>
1977
1978         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1979                 <fields oils_persist:primary="code">
1980                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1981                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1982                 </fields>
1983                 <links/>
1984         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1985             <actions>
1986                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1987                 <retrieve/>
1988                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1989                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1990             </actions>
1991         </permacrud>
1992         </class>
1993
1994         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1995                 <fields oils_persist:primary="code">
1996                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1997                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1998                 </fields>
1999                 <links/>
2000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2001             <actions>
2002                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
2003                 <retrieve/>
2004                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
2005                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
2006             </actions>
2007         </permacrud>
2008         </class>
2009
2010         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
2011                 <fields oils_persist:primary="code">
2012                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
2013                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2014                 </fields>
2015                 <links/>
2016         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2017             <actions>
2018                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2019                 <retrieve/>
2020                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2021                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2022             </actions>
2023         </permacrud>
2024         </class>
2025
2026     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
2027         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
2028             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2029             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2030             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
2031             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
2032             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
2033             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
2034             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
2035             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
2036             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
2037             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
2038             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
2039             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
2040             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
2041             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
2042             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
2043             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2044             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2045         </fields>
2046         <links/>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2050                 <retrieve/>
2051                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2052                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
2058         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2059             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2060             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2061             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2062             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2063             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2064             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2065             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2066             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2067             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2068             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2069             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2070             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2071             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2072             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2073             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2074             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2075             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2076             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2077             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2078         </fields>
2079         <links/>
2080         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2081             <actions>
2082                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2083                 <retrieve/>
2084                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2085                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2086             </actions>
2087         </permacrud>
2088     </class>
2089
2090     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
2091         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2092             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2093             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2094             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2095             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2096             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2097         </fields>
2098         <links>
2099             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2100             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2101             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2102         </links>
2103         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2104             <actions>
2105                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2106                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2107                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2108                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2109             </actions>
2110         </permacrud>
2111     </class>
2112
2113         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
2114                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2115                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2116                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2117                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2118                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2120                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2121                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2122                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2123                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2124                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2125                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2127                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2128                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2129                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2130                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2131             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2132                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2133                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2134                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2135                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2136                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2137                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2138                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2139                 </fields>
2140                 <links>
2141                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2142                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2143                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2144                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2147                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2148                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2149                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2150                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2151                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2152                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2153                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2154             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2155                 </links>
2156         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2157             <actions>
2158                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2159                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2160                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2161                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2162             </actions>
2163         </permacrud>
2164         </class>
2165
2166         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
2167                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2168                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2169                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2170                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2171                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2172                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2173                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2174                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2175                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2176                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2177                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2178                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2179                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2180                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2181                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2182                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2183             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2184                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2185                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2186             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2187                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2188                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2189                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2190                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2191             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2192             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2193             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2194                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2195                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2196                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2197                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2198                 </fields>
2199                 <links>
2200                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2201                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2202                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2203                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2204                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2205                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2206                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2207                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2208                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2209                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2210                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2211                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2212                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2213                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2214             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2215                 </links>
2216         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217             <actions>
2218                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2219                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2220                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2221                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2222             </actions>
2223         </permacrud>
2224         </class>
2225
2226     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
2227         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2228             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2229             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2230             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2231         </fields>
2232         <links/>
2233         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2234             <actions>
2235                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2236                 <retrieve/>
2237                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2238                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2239             </actions>
2240         </permacrud>
2241     </class>
2242
2243     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
2244         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2245             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2246             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2247             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2248             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2249             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2250             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2251             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2252         </fields>
2253         <links>
2254             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2255         </links>
2256         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2257             <actions>
2258                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2259                 <retrieve/>
2260                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2261                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2262             </actions>
2263         </permacrud>
2264     </class>
2265
2266     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2267         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2268             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2269             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2270             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2271             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2272             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2273         </fields>
2274         <links>
2275             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2276             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2277         </links>
2278         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2279             <actions>
2280                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2281                     <context link="matchpoint" field="org_unit"/>
2282                 </create>
2283                 <retrieve/>
2284                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2285                     <context link="matchpoint" field="org_unit"/>
2286                 </update>
2287                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2288                     <context link="matchpoint" field="org_unit"/>
2289                 </delete>
2290             </actions>
2291         </permacrud>
2292     </class>
2293
2294     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2295         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2296             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2297             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2298             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2299         </fields>
2300         <links>
2301             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2302             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2303         </links>
2304         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2305             <actions>
2306                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2307                     <context link="limit_set" field="owning_lib"/>
2308                 </create>
2309                 <retrieve/>
2310                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2311                     <context link="limit_set" field="owning_lib"/>
2312                 </update>
2313                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2314                     <context link="limit_set" field="owning_lib"/>
2315                 </delete>
2316             </actions>
2317         </permacrud>
2318     </class>
2319     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2320         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2321             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2322             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2323             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2324         </fields>
2325         <links>
2326             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2327             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2328         </links>
2329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2330             <actions>
2331                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2332                     <context link="limit_set" field="owning_lib"/>
2333                 </create>
2334                 <retrieve/>
2335                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2336                     <context link="limit_set" field="owning_lib"/>
2337                 </update>
2338                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2339                     <context link="limit_set" field="owning_lib"/>
2340                 </delete>
2341             </actions>
2342         </permacrud>
2343     </class>
2344
2345     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2346         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2347             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2348             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2349             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2350             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2351         </fields>
2352         <links>
2353             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2354             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2355         </links>
2356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2357             <actions>
2358                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2359                     <context link="limit_set" field="owning_lib"/>
2360                 </create>
2361                 <retrieve/>
2362                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2363                     <context link="limit_set" field="owning_lib"/>
2364                 </update>
2365                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2366                     <context link="limit_set" field="owning_lib"/>
2367                 </delete>
2368             </actions>
2369         </permacrud>
2370     </class>
2371
2372         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2373                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2374                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2375                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2376                 </fields>
2377                 <links/>
2378         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2379             <actions>
2380                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2381                 <retrieve/>
2382                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2383                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387
2388         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2389                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2390                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2391                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2392                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2394                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2395                 </fields>
2396                 <links>
2397                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2398                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2399                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2400                 </links>
2401         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2402             <actions>
2403                 <create permission="ADMIN_SURVEY">
2404                     <context link="survey" field="owner"/>
2405                 </create>
2406                 <retrieve/>
2407                 <update permission="ADMIN_SURVEY">
2408                     <context link="survey" field="owner"/>
2409                 </update>
2410                 <delete permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </delete>
2413             </actions>
2414         </permacrud>
2415         </class>
2416         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2417                 <fields oils_persist:primary="id" oils_persist:sequence="">
2418                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2419                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2420                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2421                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2422                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2423                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2424                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2425                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2426                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2427                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2428                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2429                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2430                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2431                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2432                 </fields>
2433                 <links>
2434                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2435                 </links>
2436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2437                         <actions>
2438                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2439                                         <context link="usr" field="home_ou" />
2440                                 </retrieve>
2441                         </actions>
2442                 </permacrud>
2443         </class>
2444         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2445                 <fields oils_persist:primary="id" oils_persist:sequence="">
2446                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2447                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2448                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2449                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2450                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2451                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2452                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2453                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2454                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2455                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2456                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2457                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2458                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2459                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2460                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2461                 </fields>
2462                 <links>
2463                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2464                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2465                 </links>
2466         </class>
2467         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2468                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2469                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2470                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2471                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2472                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2473                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2474                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2475                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2476                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2477                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2478                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2479                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2480                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2481                 </fields>
2482                 <links>
2483                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2484                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2485                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2486                 </links>
2487                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2488                         <actions> <!-- created magically, so no create action -->
2489                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2490                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2491                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2492                         </actions>
2493                 </permacrud>
2494         </class>
2495         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2496                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2497                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2498                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2499                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2500                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2501                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2502                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2503                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2504                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2505                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2506                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2507                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2508                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2509                 </fields>
2510                 <links>
2511                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2512                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2513                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2514                 </links>
2515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2516                         <actions> <!-- created magically, so no create action -->
2517                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2518                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2519                         </actions>
2520                 </permacrud>
2521         </class>
2522         <class id="aump" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_penalty" oils_persist:tablename="actor.usr_message_penalty" reporter:label="User Message Penalty">
2523         <fields oils_persist:primary="id">
2524                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2525                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2526                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2527                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2528                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2529                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2530                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2531                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2532                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2533                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2534                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2535                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2536                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2537                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2538                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2539                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2540                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2541                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2542                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2543                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2544                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2545                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2546                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2547                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2548                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2549                 </fields>
2550                 <links>
2551                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2552                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2553                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2554                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2555                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2556                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2557                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2558                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2559                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2560                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2561                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2562                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2563                 </links>
2564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2565                         <actions> <!-- created magically, so no create action -->
2566                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2567                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2568                         </actions>
2569                 </permacrud>
2570         </class>
2571
2572         <class id="aupw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_privacy_waiver" oils_persist:tablename="actor.usr_privacy_waiver" reporter:label="Privacy Waiver">
2573                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2574                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2575                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2576                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2577                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2578                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2579                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2580                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2581                 </fields>
2582                 <links>
2583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2584                 </links>
2585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2586                         <actions>
2587                                 <create permission="UPDATE_USER">
2588                                         <context link="usr" field="home_ou"/>
2589                                 </create>
2590                                 <retrieve permission="VIEW_USER">
2591                                         <context link="usr" field="home_ou"/>
2592                                 </retrieve>
2593                                 <update permission="UPDATE_USER">
2594                                         <context link="usr" field="home_ou"/>
2595                                 </update>
2596                                 <delete permission="UPDATE_USER">
2597                                         <context link="usr" field="home_ou"/>
2598                                 </delete>
2599                         </actions>
2600                 </permacrud>
2601         </class>
2602         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2603                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2604                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2605                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2606                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2607                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2608                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2609                 </fields>
2610                 <links>
2611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2612                 </links>
2613         </class>
2614         <class id="aus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2615                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2616                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2617                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2618                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2619                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2620                 </fields>
2621                 <links>
2622                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2623                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <retrieve permission="VIEW_USER">
2628                                         <context link="usr" field="home_ou" />
2629                                 </retrieve>
2630                         </actions>
2631                 </permacrud>
2632         </class>
2633         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2634                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2635                         <field name="field" reporter:datatype="link"/>
2636                         <field name="id" reporter:datatype="id" />
2637                         <field name="source" reporter:datatype="link"/>
2638                         <field name="value" reporter:datatype="text"/>
2639                 </fields>
2640                 <links>
2641                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2642                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2643                 </links>
2644         </class>
2645         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2647                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2648                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2649                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2650                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2651                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2652                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2653                 </fields>
2654                 <links>
2655                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2656                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2657                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2658                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2659                 </links>
2660                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2661                         <actions>
2662                                 <retrieve/>
2663                         </actions>
2664                 </permacrud>
2665         </class>
2666         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2667                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2668                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2669                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2670                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2671                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2672                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2673                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2674                 </fields>
2675                 <links>
2676                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2677                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2678                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2679                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2680                 </links>
2681                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2682                         <actions>
2683                                 <retrieve/>
2684                         </actions>
2685                 </permacrud>
2686         </class>
2687         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2688                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2689                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2690                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2691                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2692                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2693                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2694                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2695                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2696                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2697                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2698                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2699                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2700                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2701                 </fields>
2702                 <links>
2703                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2704                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2705                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2706                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2707                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2708                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2709                 </links>
2710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2711             <actions>
2712                 <create permission="TRANSIT_COPY" context_field="owner">
2713                     <context link="target_copy" field="circ_lib"/>
2714                 </create>
2715                 <retrieve/>
2716                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2717                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <class id="asvr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_response" oils_persist:tablename="action.survey_response" reporter:label="Survey Response">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2723                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2724                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2725                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2726                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2727                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2728                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2729                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2730                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2731                 </fields>
2732                 <links>
2733                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2734                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2735                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2736                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2737                 </links>
2738         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2739             <actions>
2740                 <create permission="ADMIN_SURVEY">
2741                     <context link="survey" field="owner"/>
2742                 </create>
2743                 <retrieve permission="VIEW_USER">
2744                     <context link="usr" field="home_ou"/>
2745                 </retrieve>
2746                 <update permission="ADMIN_SURVEY">
2747                     <context link="survey" field="owner"/>
2748                 </update>
2749                 <delete permission="ADMIN_SURVEY">
2750                     <context link="survey" field="owner"/>
2751                 </delete>
2752             </actions>
2753         </permacrud>
2754         </class>
2755         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2756                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2757                         <field name="bucket" reporter:datatype="link"/>
2758                         <field name="id" reporter:datatype="id" />
2759                         <field name="target_copy" reporter:datatype="link"/>
2760                         <field name="create_time" reporter:datatype="timestamp" />
2761                         <field name="pos" reporter:datatype="int" />
2762                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2763                 </fields>
2764                 <links>
2765                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2766                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2767             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2768                 </links>
2769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2770                         <actions>
2771                                 <retrieve permission="ADMIN_COPY_BUCKET">
2772                     <context link="bucket" field="owning_lib"/>
2773                 </retrieve>
2774             </actions>
2775         </permacrud>
2776         </class>
2777         <class id="ccbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item_note" oils_persist:tablename="container.copy_bucket_item_note" reporter:label="Copy Bucket Item Note">
2778                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2779                         <field name="id" reporter:datatype="id" />
2780                         <field name="item" reporter:datatype="link"/>
2781                         <field name="note" reporter:datatype="text" />
2782                 </fields>
2783                 <links>
2784                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2785                 </links>
2786         </class>
2787
2788         <class id="acs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set" oils_persist:tablename="authority.control_set" reporter:label="Authority Control Set" oils_persist:field_safe="true">
2789                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2790                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2791                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2792                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2793                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2794                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2795                 </fields>
2796                 <links>
2797                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2798                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2799                 </links>
2800                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2801                         <actions>
2802                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2803                                 <retrieve/>
2804                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2805                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                         </actions>
2807                 </permacrud>
2808         </class>
2809
2810         <class id="acsaf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_authority_field" oils_persist:tablename="authority.control_set_authority_field" reporter:label="Authority Control Set Authority Field" oils_persist:field_safe="true">
2811                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2812                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2813                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2814                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2815                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2816                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2817                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2818                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2819                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2820                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2821                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2822                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2823                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2824                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2825                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2826                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2827                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2828                 </fields>
2829                 <links>
2830                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2831                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2832                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2833                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2834                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2835                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2836                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2837                 </links>
2838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2839                         <actions>
2840                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2841                                 <retrieve/>
2842                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2843                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2844                         </actions>
2845                 </permacrud>
2846         </class>
2847
2848         <class id="acsbf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field" oils_persist:tablename="authority.control_set_bib_field" reporter:label="Authority Control Set Bib Field" oils_persist:field_safe="true">
2849                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2850                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2851                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2852                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2853                 </fields>
2854                 <links>
2855                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2856                 </links>
2857                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2858                         <actions>
2859                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2860                                 <retrieve/>
2861                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2862                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2863                         </actions>
2864                 </permacrud>
2865         </class>
2866
2867         <class id="acsbfmfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::control_set_bib_field_metabib_field_map" oils_persist:tablename="authority.control_set_bib_field_metabib_field_map" reporter:label="Authority Control Set Bib Field to Metabib Field Map" oils_persist:field_safe="true">
2868                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2869                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2870                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2871                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2872                 </fields>
2873                 <links>
2874                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2875                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2880                                 <retrieve/>
2881                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2882                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886
2887         <class id="at" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::thesaurus" oils_persist:tablename="authority.thesaurus" reporter:label="Authority Thesaurus" oils_persist:field_safe="true">
2888                 <fields oils_persist:primary="code">
2889                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2890                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2891                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2892                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2893                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2894                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2895                 </fields>
2896                 <links>
2897                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2898                 </links>
2899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2900                         <actions>
2901                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2902                                 <retrieve/>
2903                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2904                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2905                         </actions>
2906                 </permacrud>
2907         </class>
2908
2909         <class id="aba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis" oils_persist:tablename="authority.browse_axis" reporter:label="Authority Browse Axis" oils_persist:field_safe="true">
2910                 <fields oils_persist:primary="code">
2911                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2912                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2913                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2914                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2915                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2916                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2917                 </fields>
2918                 <links>
2919                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2920                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2921                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2922                 </links>
2923                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2924                         <actions>
2925                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2926                                 <retrieve/>
2927                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2928                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2929                         </actions>
2930                 </permacrud>
2931         </class>
2932
2933     <class id="abaafm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::browse_axis_authority_field_map" oils_persist:tablename="authority.browse_axis_authority_field_map" reporter:label="Authority Browse Axis Field Map" oils_persist:field_safe="true">
2934         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2935             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2936             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2937             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2938         </fields>
2939         <links>
2940             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2941             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2942         </links>
2943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2944             <actions>
2945                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2946                 <retrieve/>
2947                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2948                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2949             </actions>
2950         </permacrud>
2951     </class>
2952
2953         <class id="are" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_entry" oils_persist:tablename="authority.record_entry" reporter:label="Authority Record Entry">
2954                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2955                         <field name="active" reporter:datatype="bool"/>
2956                         <field name="create_date" reporter:datatype="timestamp"/>
2957                         <field name="creator" />
2958                         <field name="deleted" reporter:datatype="bool"/>
2959                         <field name="edit_date" reporter:datatype="timestamp"/>
2960                         <field name="editor" />
2961                         <field name="id" reporter:datatype="id" />
2962                         <field name="last_xact_id" />
2963                         <field name="marc" />
2964                         <field name="source" />
2965                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2966                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2967                         <field name="heading" />
2968                         <field name="simple_heading" />
2969                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2970                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2971                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2972                 </fields>
2973                 <links>
2974                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2975                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2976                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2977                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2978                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2979                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2980                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2981                 </links>
2982                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2983                         <actions>
2984                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2985                                 <retrieve/>
2986                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2987                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2988                         </actions>
2989                 </permacrud>
2990         </class>
2991         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2992                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2993                         <field name="char_encoding" />
2994                         <field name="id" />
2995                         <field name="record" />
2996                         <field name="record_status" />
2997                         <field name="thesaurus" />
2998                 </fields>
2999                 <links>
3000                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3001                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
3002                 </links>
3003         </class>
3004         <class id="abl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
3005                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
3006                         <field name="id" reporter:datatype="id" />
3007                         <field name="bib" reporter:datatype="link" />
3008                         <field name="authority" reporter:datatype="link" />
3009                 </fields>
3010                 <links>
3011                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
3012                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
3013                 </links>
3014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3015                         <actions>
3016                                 <retrieve/>
3017                         </actions>
3018                 </permacrud>
3019         </class>
3020         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
3021                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
3022                         <field name="id" reporter:datatype="id" />
3023                         <field name="record" reporter:datatype="link" />
3024                         <field name="atag" reporter:datatype="link" />
3025                         <field name="value" reporter:datatype="text" />
3026                         <field name="thesaurus" reporter:datatype="text" />
3027                 </fields>
3028                 <links>
3029                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
3030                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
3031                 </links>
3032         </class>
3033
3034         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
3035                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
3036                         <field name="id" reporter:datatype="id" reporter:selector="label" />
3037                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
3038                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
3039                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
3040                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
3041                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
3042                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
3043                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
3044                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
3045                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
3046                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
3047                 </fields>
3048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3049                         <actions>
3050                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3051                                 <retrieve/>
3052                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3053                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
3054                         </actions>
3055                 </permacrud>
3056         </class>
3057
3058         <class id="clm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::language_map" oils_persist:tablename="config.language_map" reporter:label="Language Map" oils_persist:field_safe="true">
3059                 <fields oils_persist:primary="code" oils_persist:sequence="">
3060                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3061                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3062                 </fields>
3063                 <links/>
3064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3065             <actions>
3066                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3067                 <retrieve/>
3068                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3069                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3070             </actions>
3071         </permacrud>
3072         </class>
3073         <class id="mccp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_card_payment" oils_persist:tablename="money.credit_card_payment" reporter:label="Credit Card Payment">
3074                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3075                         <field name="accepting_usr" />
3076                         <field name="amount" reporter:datatype="money" />
3077                         <field name="amount_collected" reporter:datatype="money" />
3078                         <field name="approval_code" reporter:datatype="text"/>
3079                         <field name="cash_drawer" reporter:datatype="link"/>
3080                         <field name="cc_number" reporter:datatype="text"/>
3081                         <field name="cc_order_number" reporter:datatype="text"/>
3082                         <field name="cc_processor" reporter:datatype="text"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="note" reporter:datatype="text"/>
3085                         <field name="payment_ts" reporter:datatype="timestamp"/>
3086                         <field name="xact" reporter:datatype="link"/>
3087                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3088                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3089                 </fields>
3090                 <links>
3091                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3092                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3093                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3094                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3095                 </links>
3096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3097             <actions>
3098                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3099                     <context link="xact" jump="usr" field="home_ou"/>
3100                 </retrieve>
3101                         </actions>
3102                 </permacrud>
3103         </class>
3104         <class id="cxt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::xml_transform" oils_persist:tablename="config.xml_transform" reporter:label="XML/XSLT Transform Definition" oils_persist:field_safe="true">
3105                 <fields oils_persist:primary="name">
3106                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3107                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3108                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3109                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3110                 </fields>
3111                 <links/>
3112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3113             <actions>
3114                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3115                 <retrieve/>
3116                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3117                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3118             </actions>
3119         </permacrud>
3120         </class>
3121
3122         <class id="cmsa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_search_alias" oils_persist:tablename="config.metabib_search_alias" reporter:label="Metabib Search Alias" oils_persist:field_safe="true">
3123                 <fields oils_persist:primary="alias">
3124                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3125                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3126                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3127                 </fields>
3128                 <links>
3129                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3130                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3131                 </links>
3132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3133             <actions>
3134                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3135                 <retrieve/>
3136                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3137                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3138             </actions>
3139         </permacrud>
3140         </class>
3141
3142         <class id="cmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class" oils_persist:tablename="config.metabib_class" reporter:label="Metabib Class" oils_persist:field_safe="true">
3143                 <fields oils_persist:primary="name">
3144                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3145                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3146                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3147                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3148                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3149                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3150                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3151                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3152                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3153                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3154                 </fields>
3155                 <links>
3156                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3157                 </links>
3158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3159             <actions>
3160                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3161                 <retrieve/>
3162                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3163                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3164             </actions>
3165         </permacrud>
3166         </class>
3167
3168         <class id="cmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field" oils_persist:tablename="config.metabib_field" reporter:label="Metabib Field" oils_persist:field_safe="true">
3169                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3171                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3172                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3173                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3174                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3175                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3176                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3177                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3178                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3179                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3180                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3181                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3182                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3183                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3184                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3185                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3186                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3187                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3188                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3189                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3190                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3191                 </fields>
3192                 <links>
3193                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3194                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3195                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3196                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3197                 </links>
3198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3199             <actions>
3200                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3201                 <retrieve/>
3202                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3203                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3204             </actions>
3205         </permacrud>
3206         </class>
3207
3208         <class id="cmfvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_virtual_map" oils_persist:tablename="config.metabib_field_virtual_map" reporter:label="Metabib Field Virtual Map" oils_persist:field_safe="true">
3209                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3210                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3211                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3212                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3213                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3214                 </fields>
3215                 <links>
3216                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3217                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3218                 </links>
3219         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3220             <actions>
3221                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3222                 <retrieve/>
3223                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3224                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3225             </actions>
3226         </permacrud>
3227         </class>
3228
3229         <class id="cbho" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::best_hold_order" oils_persist:tablename="config.best_hold_order" reporter:label="Best-Hold Sort Order">
3230                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3231                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3232                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3233                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3234                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3235                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3236                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3237                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3238                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3239                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3240                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3241                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3242                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3243                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3244                 </fields>
3245                 <links>
3246                 </links>
3247                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3248                         <actions>
3249                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3250                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3251                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3252                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3253                         </actions>
3254                 </permacrud>
3255         </class>
3256         <class id="cbfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::biblio_fingerprint" oils_persist:tablename="config.biblio_fingerprint" reporter:label="Fingerprint Definition">
3257                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3258                         <field name="id" reporter:datatype="id" />
3259                         <field name="name" reporter:datatype="text"/>
3260                         <field name="xpath" reporter:datatype="text"/>
3261                         <field name="format" reporter:datatype="link"/>
3262                         <field name="first_word" reporter:datatype="bool" />
3263                 </fields>
3264                 <links/>
3265         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3266             <actions>
3267                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3268                 <retrieve/>
3269                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3270                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3271             </actions>
3272         </permacrud>
3273         </class>
3274         <class id="cam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::audience_map" oils_persist:tablename="config.audience_map" reporter:label="Audience Map" oils_persist:field_safe="true">
3275                 <fields oils_persist:primary="code" oils_persist:sequence="">
3276                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3277                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3278                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3279                 </fields>
3280                 <links/>
3281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3282             <actions>
3283                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3284                 <retrieve/>
3285                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3286                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3287             </actions>
3288         </permacrud>
3289         </class>
3290         <class id="cifm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_form_map" oils_persist:tablename="config.item_form_map" reporter:label="Item Form Map" oils_persist:field_safe="true">
3291                 <fields oils_persist:primary="code" oils_persist:sequence="">
3292                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3293                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3294                 </fields>
3295                 <links/>
3296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3297             <actions>
3298                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3299                 <retrieve/>
3300                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3301                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3302             </actions>
3303         </permacrud>
3304         </class>
3305     <class id="acmc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course" oils_persist:tablename="asset.course_module_course" reporter:label="Course">
3306         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3307             <field reporter:label="ID" name="id" reporter:datatype="id" />
3308             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3309             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3310             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3311             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3312             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3313             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3314             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3315                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3316         </fields>
3317         <links>
3318             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3319             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3320             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3321                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3322         </links>
3323         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3324             <actions>
3325                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3326                 <retrieve/>
3327                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3328                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3329             </actions>
3330         </permacrud>
3331     </class>
3332     <class id="acmcu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_users" oils_persist:tablename="asset.course_module_course_users" reporter:label="Course Users">
3333         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3334             <field reporter:label="ID" name="id" reporter:datatype="id" />
3335             <field reporter:label="Course" name="course" reporter:datatype="link" />
3336             <field reporter:label="User" name="usr" reporter:datatype="link" />
3337             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3338         </fields>
3339         <links>
3340             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3341             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3342             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3343         </links>
3344         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3345             <actions>
3346                 <create permission="MANAGE_RESERVES">
3347                                         <context link="course" field="owning_lib" />
3348                 </create>
3349                 <retrieve/>
3350                 <update permission="MANAGE_RESERVES">
3351                                         <context link="course" field="owning_lib" />
3352                 </update>
3353                 <delete permission="MANAGE_RESERVES">
3354                                         <context link="course" field="owning_lib" />
3355                 </delete>
3356             </actions>
3357         </permacrud>
3358     </class>
3359     <class id="acmcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_course_materials" oils_persist:tablename="asset.course_module_course_materials" reporter:label="Course Materials" oils_persist:field_safe="true">
3360         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3361             <field reporter:label="ID" name="id" reporter:datatype="id" />
3362             <field reporter:label="Course" name="course" reporter:datatype="link" />
3363             <field reporter:label="Item" name="item" reporter:datatype="link" />
3364             <field reporter:label="Record" name="record" reporter:datatype="link" />
3365             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3366             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3367             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3368             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3369             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3370             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3371             <field reporter:label="Original Circulating Library" name="original_circ_lib" reporter:datatype="link" />
3372         </fields>
3373         <links>
3374             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3375             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3376             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3377             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3378             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3379             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3380             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3381             <link field="original_circ_lib" reltype="has_a" key="id" map="" class="aou" />
3382         </links>
3383         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3384             <actions>
3385                 <create permission="MANAGE_RESERVES">
3386                                         <context link="course" field="owning_lib" />
3387                 </create>
3388                 <retrieve/>
3389                 <update permission="MANAGE_RESERVES">
3390                                         <context link="course" field="owning_lib" />
3391                 </update>
3392                 <delete permission="MANAGE_RESERVES">
3393                                         <context link="course" field="owning_lib" />
3394                 </delete>
3395             </actions>
3396         </permacrud>
3397     </class>
3398         <class id="acmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term" oils_persist:tablename="asset.course_module_term" reporter:label="Term" oils_persist:field_safe="true">
3399                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3400                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3401                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3402             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3403                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3404                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3405                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3406                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3407                 </fields>
3408                 <links>
3409             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3410                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3411                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3412                 </links>
3413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3414                         <actions>
3415                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3416                                 <retrieve/>
3417                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3418                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3419                         </actions>
3420                 </permacrud>
3421         </class>
3422     <class id="acmtcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_term_course_map" oils_persist:tablename="asset.course_module_term_course_map" reporter:label="Course Term Map" oils_persist:field_safe="true">
3423         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3424             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3425             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3426             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3427         </fields>
3428         <links>
3429             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3430             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3431         </links>
3432         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3433             <actions>
3434                 <create permission="MANAGE_RESERVES">
3435                                         <context link="course" field="owning_lib" />
3436                 </create>
3437                 <retrieve/>
3438                 <update permission="MANAGE_RESERVES">
3439                                         <context link="course" field="owning_lib" />
3440                 </update>
3441                 <delete permission="MANAGE_RESERVES">
3442                                         <context link="course" field="owning_lib" />
3443                 </delete>
3444             </actions>
3445         </permacrud>
3446     </class>
3447         <class id="acmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::course_module_role" oils_persist:tablename="asset.course_module_role" reporter:label="Course Role" oils_persist:field_safe="true">
3448                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3449                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3450                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3451             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3452                 </fields>
3453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3454                         <actions>
3455                                 <create permission="MANAGE_RESERVES" global_required="true" />
3456                                 <retrieve/>
3457                                 <update permission="MANAGE_RESERVES" global_required="true" />
3458                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3459                         </actions>
3460                 </permacrud>
3461         </class>
3462         
3463     <class id="acnc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_class" oils_persist:tablename="asset.call_number_class" reporter:label="Call number classification scheme">
3464         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3465             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3466             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3467             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3468             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3469         </fields>
3470         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3471             <actions>
3472                 <retrieve/>
3473             </actions>
3474         </permacrud>
3475     </class>
3476         <class id="acns" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_suffix" oils_persist:tablename="asset.call_number_suffix" reporter:label="Call Number/Volume Suffix">
3477                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3478                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3479                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3480                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3481                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3482                 </fields>
3483                 <links>
3484                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3485                 </links>
3486         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3487             <actions>
3488                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3489                 <retrieve/>
3490                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3491                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3492             </actions>
3493         </permacrud>
3494         </class>
3495         <class id="acnp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_prefix" oils_persist:tablename="asset.call_number_prefix" reporter:label="Call Number/Volume Prefix">
3496                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3497                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3498                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3499                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3500                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3501                 </fields>
3502                 <links>
3503                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3504                 </links>
3505         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3506             <actions>
3507                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3508                 <retrieve/>
3509                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3510                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3511             </actions>
3512         </permacrud>
3513         </class>
3514         <class id="acn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number" oils_persist:tablename="asset.call_number" reporter:label="Call Number/Volume">
3515                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3516                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3517                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3518                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3519                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3520                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3521                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3522                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3523                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3524                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3525                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3526                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3527                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3528                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3529                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3530                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3531                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3532                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3533                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3534                 </fields>
3535                 <links>
3536                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3537                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3538                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3539                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3540                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3541                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3542                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3543                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3544                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3545                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3546                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3547                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3548                 </links>
3549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3550             <actions>
3551                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3552                 <retrieve/>
3553                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3554                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3555             </actions>
3556         </permacrud>
3557         </class>
3558         <class id="racnd" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="reporter::asset_call_number_dewey" oils_persist:tablename="reporter.asset_call_number_dewey" reporter:label="Dewey Classification">
3559                 <fields oils_persist:primary="call_number">
3560                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3561                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3562                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3563                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3564                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3565                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3566                 </fields>
3567                 <links>
3568                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3569                 </links>
3570         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3571             <actions>
3572                 <retrieve/>
3573             </actions>
3574         </permacrud>
3575         </class>
3576         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3577                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3578                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3579                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3580                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3581                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3582                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3583                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3584                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3585                 </fields>
3586                 <links>
3587                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3588                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3589         </links>
3590         </class>
3591         <class id="auricnm" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri_call_number_map" oils_persist:tablename="asset.uri_call_number_map" reporter:label="Electronic Access URI to Call Number Map">
3592                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3593                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3594                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3595                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3596                 </fields>
3597                 <links>
3598                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3599                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3600                 </links>
3601         </class>
3602         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3603                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3604                         <field name="id" reporter:datatype="id" />
3605                         <field name="value" oils_persist:i18n="true" />
3606                 </fields>
3607                 <links/>
3608         </class>
3609         <class id="mous" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_user_summary" oils_persist:tablename="money.open_usr_summary" reporter:label="Open User Summary">
3610                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3611                         <field name="balance_owed" reporter:datatype="money" />
3612                         <field name="total_owed" reporter:datatype="money" />
3613                         <field name="total_paid" reporter:datatype="money" />
3614                         <field name="usr" reporter:datatype="link"/>
3615                 </fields>
3616                 <links>
3617                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3618         </links>
3619         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3620             <actions>
3621                 <retrieve permission="VIEW_USER">
3622                     <context link="usr" field="home_ou"/>
3623                 </retrieve>
3624             </actions>
3625         </permacrud>
3626         </class>
3627         <class id="mowbus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_with_balance_user_summary" oils_persist:tablename="money.open_with_balance_usr_summary" reporter:label="Open User Summary for transactions with balances">
3628                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3629                         <field name="balance_owed" reporter:datatype="money" />
3630                         <field name="total_owed" reporter:datatype="money" />
3631                         <field name="total_paid" reporter:datatype="money" />
3632                         <field name="usr" reporter:datatype="link"/>
3633                 </fields>
3634                 <links>
3635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3636         </links>
3637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3638             <actions>
3639                 <retrieve permission="VIEW_USER">
3640                     <context link="usr" field="home_ou"/>
3641                 </retrieve>
3642             </actions>
3643         </permacrud>
3644         </class>
3645         <class id="mct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::collections_tracker" oils_persist:tablename="money.collections_tracker" reporter:label="Collections Tracker">
3646                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3647                         <field name="collector" />
3648                         <field name="enter_time" reporter:datatype="timestamp"/>
3649                         <field name="id" reporter:datatype="id" />
3650                         <field name="location" reporter:datatype="link"/>
3651                         <field name="usr" reporter:datatype="link"/>
3652                 </fields>
3653                 <links>
3654                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3655                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3656                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3657                 </links>
3658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3659             <actions>
3660                 <create permission="money.collections_tracker.create" context_field="location"/>
3661                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3662                 <delete permission="money.collections_tracker.create" context_field="location"/>
3663             </actions>
3664         </permacrud>
3665         </class>
3666         <class id="bre" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_entry" oils_persist:tablename="biblio.record_entry" reporter:core="true" reporter:label="Bibliographic Record">
3667                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3668                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3669                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3670                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3671                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3672                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3673                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3674                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3675                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3676                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3677                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3678                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3679                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3680                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3681                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3682                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3683                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3684                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3685                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3686                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3687                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3688                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3689                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3690                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3691                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3692                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3693                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3694                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3695                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3696                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3697                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3698                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3699                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3700                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3701                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3702                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3703                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3704                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3705                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3706                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3707                 </fields>
3708                 <links>
3709                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3710                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3711                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3712                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3713                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3714                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3715                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3716                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3717                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3718                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3719                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3720                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3721                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3722                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3723                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3724                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3725                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3726                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3727                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3728                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3729                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3730                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3731                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3732                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3733                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3734                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3735                 </links>
3736         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3737             <actions>
3738                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3739                 <retrieve/>
3740                 <update permission="UPDATE_MARC" global_required="true"/>
3741                 <!-- WARNING: Deleting records via PCRUD does NOT check that any prerequisite conditions have been handled first. It is your responsibility to check for those conditions before deleting bib records. -->
3742                 <delete permission="DELETE_RECORD" global_required="true"/>
3743             </actions>
3744         </permacrud>
3745         </class>
3746         <class id="aouhoo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::hours_of_operation" oils_persist:tablename="actor.hours_of_operation" reporter:label="Hours of Operation">
3747                 <fields oils_persist:primary="id">
3748                         <field name="dow_0_close" />
3749                         <field name="dow_0_open" />
3750                         <field name="dow_1_close" />
3751                         <field name="dow_1_open" />
3752                         <field name="dow_2_close" />
3753                         <field name="dow_2_open" />
3754                         <field name="dow_3_close" />
3755                         <field name="dow_3_open" />
3756                         <field name="dow_4_close" />
3757                         <field name="dow_4_open" />
3758                         <field name="dow_5_close" />
3759                         <field name="dow_5_open" />
3760                         <field name="dow_6_close" />
3761                         <field name="dow_6_open" />
3762                         <field name="id" reporter:datatype="id" />
3763                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3764                 </fields>
3765                 <links>
3766                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3767                 </links>
3768         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3769             <actions>
3770                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3771                 <retrieve/>
3772                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3773                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3774             </actions>
3775         </permacrud>
3776         </class>
3777         <class id="bmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::monograph_part" oils_persist:tablename="biblio.monograph_part" reporter:label="Monograph Parts" oils_persist:field_safe="true">
3778                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3779                         <field name="id" reporter:datatype="id" />
3780                         <field name="record" reporter:datatype="link"/>
3781                         <field name="label" reporter:datatype="text"/>
3782                         <field name="label_sortkey" reporter:datatype="text"/>
3783                         <field name="deleted" reporter:datatype="bool"/>
3784                 </fields>
3785                 <links>
3786                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3787                 </links>
3788         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3789             <actions>
3790                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3791                 <retrieve/>
3792                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3793                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3794             </actions>
3795         </permacrud>
3796         </class>
3797         <class id="acpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_part_map" oils_persist:tablename="asset.copy_part_map" reporter:label="Copy Monograph Part Map">
3798                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3799                         <field name="id" reporter:datatype="id" />
3800                         <field name="target_copy" reporter:datatype="link" />
3801                         <field name="part" reporter:datatype="link"/>
3802                 </fields>
3803                 <links>
3804                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3805                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3806                 </links>
3807         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3808             <actions>
3809                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3810                 <retrieve/>
3811                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3812                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3813             </actions>
3814         </permacrud>
3815         </class>
3816     <class  id="aecc"
3817             controller="open-ils.cstore open-ils.pcrud"
3818             oils_obj:fieldmapper="action::emergency_closing_circulation"
3819             oils_persist:tablename="action.emergency_closing_circulation"
3820             reporter:label="Emergency Closing Circulation Entry"
3821             oils_persist:readonly="true"
3822     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3823         <fields oils_persist:primary="id">
3824             <field name="id" reporter:datatype="id" />
3825             <field name="circulation" reporter:datatype="link" />
3826                         <field name="emergency_closing" reporter:datatype="link"/>
3827             <field name="original_due_date" reporter:datatype="timestamp" />
3828             <field name="process_time" reporter:datatype="timestamp" />
3829         </fields>
3830         <links>
3831             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3832             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3833         </links>
3834         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3835             <actions>
3836                 <retrieve/>
3837             </actions>
3838         </permacrud>
3839     </class>
3840     <class  id="aecr"
3841             controller="open-ils.cstore open-ils.pcrud"
3842             oils_obj:fieldmapper="action::emergency_closing_reservation"
3843             oils_persist:tablename="action.emergency_closing_reservation"
3844             reporter:label="Emergency Closing Reservation Entry"
3845             oils_persist:readonly="true"
3846     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3847         <fields oils_persist:primary="id">
3848             <field name="id" reporter:datatype="id" />
3849             <field name="reservation" reporter:datatype="link" />
3850                         <field name="emergency_closing" reporter:datatype="link"/>
3851             <field name="original_end_time" reporter:datatype="timestamp" />
3852             <field name="process_time" reporter:datatype="timestamp" />
3853         </fields>
3854         <links>
3855             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3856             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3857         </links>
3858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3859             <actions>
3860                 <retrieve/>
3861             </actions>
3862         </permacrud>
3863     </class>
3864     <class  id="aech"
3865             controller="open-ils.cstore open-ils.pcrud"
3866             oils_obj:fieldmapper="action::emergency_closing_hold"
3867             oils_persist:tablename="action.emergency_closing_hold"
3868             reporter:label="Emergency Closing Hold Entry"
3869             oils_persist:readonly="true"
3870     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3871         <fields oils_persist:primary="id">
3872             <field name="id" reporter:datatype="id" />
3873             <field name="hold" reporter:datatype="link" />
3874                         <field name="emergency_closing" reporter:datatype="link"/>
3875             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3876             <field name="process_time" reporter:datatype="timestamp" />
3877         </fields>
3878         <links>
3879             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3880             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3881         </links>
3882         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3883             <actions>
3884                 <retrieve/>
3885             </actions>
3886         </permacrud>
3887     </class>
3888     <class  id="aecs"
3889             controller="open-ils.cstore open-ils.pcrud"
3890             oils_obj:fieldmapper="action::emergency_closing_status"
3891             oils_persist:tablename="action.emergency_closing_status"
3892             reporter:label="Emergency Closing Status"
3893             oils_persist:readonly="true"
3894     >
3895         <fields oils_persist:primary="id">
3896             <field name="id" reporter:datatype="id" />
3897             <field name="creator" reporter:datatype="link" />
3898             <field name="create_time" reporter:datatype="timestamp" />
3899             <field name="process_start_time" reporter:datatype="timestamp" />
3900             <field name="process_end_time" reporter:datatype="timestamp" />
3901             <field name="last_update_time" reporter:datatype="timestamp" />
3902             <field name="circulations" reporter:datatype="int" />
3903             <field name="circulations_complete" reporter:datatype="int" />
3904             <field name="reservations" reporter:datatype="int" />
3905             <field name="reservations_complete" reporter:datatype="int" />
3906             <field name="holds" reporter:datatype="int" />
3907             <field name="holds_complete" reporter:datatype="int" />
3908         </fields>
3909         <links>
3910             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3911         </links>
3912         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3913             <actions>
3914                 <retrieve/>
3915             </actions>
3916         </permacrud>
3917     </class>
3918     <class id="aec" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::emergency_closing" oils_persist:tablename="action.emergency_closing" reporter:label="Emergency Closing">
3919         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3920             <field name="id" reporter:datatype="id" />
3921             <field name="creator" reporter:datatype="link" />
3922             <field name="create_time" reporter:datatype="timestamp" />
3923             <field name="process_start_time" reporter:datatype="timestamp" />
3924             <field name="process_end_time" reporter:datatype="timestamp" />
3925             <field name="last_update_time" reporter:datatype="timestamp" />
3926             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3927             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3928             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3929             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3930             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3931         </fields>
3932         <links>
3933             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3934             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3935             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3936             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3937             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3938             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3939         </links>
3940         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3941             <actions>
3942                 <create permission="EMERGENCY_CLOSING">
3943                     <context link="closing" field="org_unit" />
3944                 </create>
3945                 <retrieve/>
3946                 <update permission="EMERGENCY_CLOSING">
3947                     <context link="closing" field="org_unit" />
3948                 </update>
3949                 <delete permission="EMERGENCY_CLOSING">
3950                     <context link="closing" field="org_unit" />
3951                 </delete>
3952             </actions>
3953         </permacrud>
3954     </class>
3955         <class id="aoucd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit::closed_date" oils_persist:tablename="actor.org_unit_closed" reporter:label="Closed Dates">
3956                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3957                         <field name="close_end" reporter:datatype="timestamp" />
3958                         <field name="close_start" reporter:datatype="timestamp" />
3959                         <field name="id" reporter:datatype="id" />
3960                         <field name="org_unit" reporter:datatype="org_unit"/>
3961                         <field name="reason" reporter:datatype="text"/>
3962                         <field name="full_day" reporter:datatype="bool"/>
3963                         <field name="multi_day" reporter:datatype="bool"/>
3964                         <field name="emergency_closing" reporter:datatype="link"/>
3965                 </fields>
3966                 <links>
3967                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3968                         <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3969                 </links>
3970         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3971             <actions>
3972                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3973                 <retrieve/>
3974                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3975                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3976             </actions>
3977         </permacrud>
3978         </class>
3979         <class id="crcd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::circ_duration" oils_persist:tablename="config.rule_circ_duration" reporter:label="Circulation Duration Rule">
3980                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3981                         <field name="extended" reporter:datatype="interval"/>
3982                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3983                         <field name="max_renewals" reporter:datatype="int" />
3984                         <field name="name" reporter:datatype="text"/>
3985                         <field name="normal" reporter:datatype="interval"/>
3986                         <field name="shrt" reporter:datatype="interval"/>
3987                         <field name="max_auto_renewals" reporter:datatype="int" />
3988                 </fields>
3989                 <links>
3990                 </links>
3991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3992             <actions>
3993                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3994                 <retrieve/>
3995                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3996                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3997             </actions>
3998         </permacrud>
3999         </class>
4000
4001         <class id="chdd" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date" oils_persist:tablename="config.hard_due_date" reporter:label="Hard Due Date">
4002                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
4003                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4004                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4005             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
4006                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4007             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
4008                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
4009                                 reporter:datatype="link" config_field="true"/>
4010                 </fields>
4011                 <links>
4012             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4013                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
4014                 </links>
4015                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4016             <actions>
4017                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4018                 <retrieve/>
4019                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4020                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4021             </actions>
4022                 </permacrud>
4023         </class>
4024
4025         <class id="chddv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hard_due_date_values" oils_persist:tablename="config.hard_due_date_values" reporter:label="Hard Due Date Values">
4026                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
4027                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4028                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
4029                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
4030             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
4031                 </fields>
4032                 <links>
4033                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
4034                 </links>
4035                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4036             <actions>
4037                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
4038                 <retrieve/>
4039                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
4040                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
4041             </actions>
4042                 </permacrud>
4043         </class>
4044
4045         <class id="mobts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_billable_transaction_summary" oils_persist:tablename="money.open_billable_xact_summary" reporter:label="Open Billable Transaction Summary">
4046                 <fields oils_persist:primary="id" oils_persist:sequence="">
4047                         <field name="balance_owed" reporter:datatype="money"/>
4048                         <field name="id" reporter:datatype="id" />
4049                         <field name="last_billing_note" reporter:datatype="text"/>
4050                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
4051                         <field name="last_billing_type" reporter:datatype="text"/>
4052                         <field name="last_payment_note" reporter:datatype="text"/>
4053                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
4054                         <field name="last_payment_type" reporter:datatype="text"/>
4055                         <field name="total_owed" reporter:datatype="money"/>
4056                         <field name="total_paid" reporter:datatype="money"/>
4057                         <field name="usr" reporter:datatype="link"/>
4058                         <field name="xact_finish" reporter:datatype="timestamp" />
4059                         <field name="xact_start" reporter:datatype="timestamp" />
4060                         <field name="xact_type" reporter:datatype="text"/>
4061                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4062                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4063                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4064                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4065                         <field name="billing_location" reporter:datatype="link"/>
4066                 </fields>
4067                 <links>
4068                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4069                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4070                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4071                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4072                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4073                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4074                 </links>
4075                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4076                         <actions>
4077                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4078                                         <context link="usr" field="home_ou" />
4079                                 </retrieve>
4080                         </actions>
4081                 </permacrud>
4082         </class>
4083         <class id="au" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user" oils_persist:tablename="actor.usr" reporter:core="true" reporter:label="ILS User">
4084                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4085                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4086                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4087                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4088                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4089                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4090                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4091                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4092                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4093                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4094                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4096                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4097                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4098                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4099                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4100                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4101                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4102                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4103                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4104                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4105                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4106                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4107                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4108                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4109                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4110                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4111                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4112                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4113                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4114                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4115                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4116                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4117                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4118                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4119                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4120                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4121                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4122                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4123                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4124                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4125                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4126                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4127                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4128                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4129                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4130                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4131                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4132                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4133                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4134                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4135                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4136                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4137                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4138                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4139                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4140                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4141                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4142                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4143                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4144                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4145                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4146                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4147                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4148                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4149                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4150                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4151                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4152                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4153                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4154                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4155                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4156                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4157             <field reporter:label="Patron Preferred Language" name="locale" reporter:datatype="link"/>
4158                 </fields>
4159                 <links>
4160                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4161                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4162                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4163                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4164                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4165                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4166                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4167                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4168                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4169                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4170                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4171                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4172                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4173                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4174                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4175                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4176                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4177                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4178                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4179                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4180                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4181                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4182                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4183                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4184                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4185                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4186                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4187                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4188                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4189                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4190                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4191                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4192             <link field="locale" reltype="has_a" key="code" map="" class="i18n_l"/>
4193                 </links>
4194                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4195                         <actions>
4196                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4197                         </actions>
4198                 </permacrud>
4199         </class>
4200         <class id="cuat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_activity_type" oils_persist:tablename="config.usr_activity_type" reporter:label="User Activity Type">
4201                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4202                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4203                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4204                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4205                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4206                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4207                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4208                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4209                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4210         </fields>
4211                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4212                         <actions>
4213                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4214                                 <retrieve/>
4215                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4216                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4217                         </actions>
4218                 </permacrud>
4219         </class>
4220         <class id="auact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_activity" oils_persist:tablename="actor.usr_activity" reporter:label="User Activity">
4221                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4222                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4223                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4224                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4225                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4226         </fields>
4227         <links>
4228                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4229                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4230                 </links>
4231                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4232                         <actions>
4233                                 <retrieve permission="RUN_REPORTS">
4234                                         <context link="usr" field="home_ou" />
4235                                 </retrieve>
4236                         </actions>
4237                 </permacrud>
4238         </class>
4239         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4240                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4241                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4242                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4243                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4244                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4245                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4246                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4247         </fields>
4248         <links>
4249                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4250                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4251                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4252                 </links>
4253                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4254                         <actions>
4255                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4256                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4257                                         <context link="usr" field="home_ou" />
4258                                         <context link="ws" field="owning_lib" />
4259                                 </retrieve>
4260                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4261                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4262                         </actions>
4263                 </permacrud>
4264         </class>
4265         <class id="csg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::settings_group" oils_persist:tablename="config.settings_group" reporter:label="Settings Group">
4266                 <fields oils_persist:primary="name">
4267                         <field name="name" reporter:datatype="text"/>
4268                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4269                 </fields>
4270                 <links/>
4271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4272                         <actions>
4273                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4274                                 <retrieve/>
4275                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4276                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4277                         </actions>
4278                 </permacrud>
4279         </class>
4280         <class id="cust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::usr_setting_type" oils_persist:tablename="config.usr_setting_type" reporter:label="User Setting Type">
4281                 <fields oils_persist:primary="name">
4282                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4283                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4284                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4285                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4286                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4287                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4288                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4289                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4290                 </fields>
4291                 <links>
4292                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4293                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4294                 </links>
4295                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4296                         <actions>
4297                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4298                                 <retrieve/>
4299                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4300                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4301                         </actions>
4302                 </permacrud>
4303         </class>
4304         <class id="coust" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::org_unit_setting_type" oils_persist:tablename="config.org_unit_setting_type" reporter:label="Organizational Unit Setting Type">
4305                 <fields oils_persist:primary="name">
4306                         <field name="name" reporter:datatype="text"/>
4307                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4308                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4309                         <field name="datatype" reporter:datatype="text"/>
4310                         <field name="view_perm" reporter:datatype="link"/>
4311                         <field name="update_perm" reporter:datatype="link"/>
4312                         <field name="fm_class" reporter:datatype="text"/>
4313                         <field name="grp" reporter:datatype="link"/>
4314                 </fields>
4315                 <links>
4316                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4317                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4318                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4319                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4320                 </links>
4321                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4322                         <actions>
4323                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4324                                 <retrieve/>
4325                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4326                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4327                         </actions>
4328                 </permacrud>
4329         </class>
4330         <class id="aous" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_setting" oils_persist:tablename="actor.org_unit_setting" reporter:label="Organizational Unit Setting">
4331                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4332                         <field name="id" />
4333                         <field name="name"  reporter:datatype="text"/>
4334                         <field name="org_unit" reporter:datatype="org_unit"/>
4335                         <field name="value"  reporter:datatype="text"/>
4336                 </fields>
4337                 <links>
4338                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4339                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4340                 </links>
4341         </class>
4342         <class id="acpn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_note" oils_persist:tablename="asset.copy_note" reporter:label="Copy Note">
4343                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4344                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4345                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4346                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4347                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4348                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4349                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4350                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4351                 </fields>
4352                 <links>
4353                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4354                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4355                 </links>
4356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4357             <actions>
4358                 <create permission="CREATE_COPY_NOTE">
4359                     <context link="owning_copy" field="circ_lib"/>
4360                 </create>
4361                 <retrieve permission="VIEW_COPY_NOTES">
4362                     <context link="owning_copy" field="circ_lib"/>
4363                 </retrieve>
4364                 <update permission="UPDATE_COPY_NOTE">
4365                     <context link="owning_copy" field="circ_lib"/>
4366                 </update>
4367                 <delete permission="DELETE_COPY_NOTE">
4368                     <context link="owning_copy" field="circ_lib"/>
4369                 </delete>
4370             </actions>
4371         </permacrud>
4372         </class>
4373         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4374                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4375                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4376                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4377                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4378                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4379                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4380                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4381                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4382                 </fields>
4383                 <links>
4384                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4385                 </links>
4386         </class>
4387         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4388                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4389                         <field name="fingerprint"  reporter:datatype="text"/>
4390                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4391                         <field name="master_record" reporter:datatype="link"/>
4392                         <field name="mods"  reporter:datatype="text"/>
4393                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4394                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4395                 </fields>
4396                 <links>
4397                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4398                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4399                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4400                 </links>
4401                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4402                         <actions>
4403                                 <retrieve/>
4404                         </actions>
4405                 </permacrud>
4406         </class>
4407         <class id="cnal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::net_access_level" oils_persist:tablename="config.net_access_level" reporter:label="Net Access Level">
4408                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4409                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4410                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4411                 </fields>
4412                 <links/>
4413         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4414             <actions>
4415                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4416                 <retrieve/>
4417                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4418                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4419             </actions>
4420         </permacrud>
4421         </class>
4422         <class id="ppl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::perm_list" oils_persist:tablename="permission.perm_list" reporter:label="Permission List">
4423                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4424                         <field name="code"  reporter:datatype="text"/>
4425                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4426                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4427                 </fields>
4428                 <links/>
4429         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4430             <actions>
4431                 <create permission="CREATE_PERM" global_required="true"/>
4432                 <retrieve permission="VIEW_PERMISSION CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4433                 <update permission="UPDATE_PERM" global_required="true"/>
4434                 <delete permission="DELETE_PERM" global_required="true"/>
4435             </actions>
4436         </permacrud>
4437         </class>
4438         <class id="mmrsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
4439                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4440                         <field name="id" reporter:datatype="id" />
4441                         <field name="metarecord" reporter:datatype="link"/>
4442                         <field name="source" reporter:datatype="link"/>
4443                 </fields>
4444                 <links>
4445                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4446                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4447                 </links>
4448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4449                         <actions>
4450                                 <retrieve/>
4451                         </actions>
4452                 </permacrud>
4453         </class>
4454         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4455                         oils_obj:fieldmapper="metabib::display_entry" 
4456                         oils_persist:tablename="metabib.display_entry" 
4457                         oils_persist:field_safe="true"
4458                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4459                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4460                         <field name="id" reporter:datatype="id" />
4461                         <field name="field" reporter:datatype="link"/>
4462                         <field name="source" reporter:datatype="link"/>
4463                         <field name="value"  reporter:datatype="text"/>
4464                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4465                 </fields>
4466                 <links>
4467                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4468                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4469                 </links>
4470                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4471                         <actions>
4472                                 <retrieve/>
4473                         </actions>
4474                 </permacrud>
4475         </class>
4476         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4477                 oils_persist:tablename="metabib.flat_display_entry"
4478                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4479                 oils_persist:field_safe="true"
4480                 reporter:label="Flat Display Entry" 
4481                 oils_persist:readonly="true">
4482                 <fields>
4483                         <field name="source" reporter:datatype="id" />
4484                         <field name="name" reporter:datatype="text"/>
4485                         <field name="multi" reporter:datatype="bool"/>
4486                         <field name="label" reporter:datatype="text"/>
4487                         <field name="field" reporter:datatype="link"/>
4488                         <field name="value" reporter:datatype="text"/>
4489                 </fields>
4490                 <links>
4491                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4492                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4493                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4494                 </links>
4495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4496                         <actions>
4497                                 <retrieve/>
4498                         </actions>
4499                 </permacrud>
4500         </class>
4501         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4502                 oils_persist:tablename="metabib.compressed_display_entry"
4503                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4504                 oils_persist:field_safe="true"
4505                 reporter:label="Compressed Display Entry" 
4506                 oils_persist:readonly="true">
4507                 <fields>
4508                         <field name="source" reporter:datatype="id" />
4509                         <field name="name" reporter:datatype="text"/>
4510                         <field name="multi" reporter:datatype="bool"/>
4511                         <field name="label" reporter:datatype="text"/>
4512                         <field name="field" reporter:datatype="link"/>
4513                         <field name="value" reporter:datatype="text"/>
4514                 </fields>
4515                 <links>
4516                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4517                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4518                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4519                 </links>
4520                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4521                         <actions>
4522                                 <retrieve/>
4523                         </actions>
4524                 </permacrud>
4525         </class>
4526         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4527                 oils_persist:tablename="metabib.wide_display_entry"
4528                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4529                 oils_persist:field_safe="true"
4530                 reporter:label="Wide Display Entry" 
4531                 oils_persist:readonly="true">
4532                 <fields oils_persist:primary="source">
4533                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4534                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4535                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4536                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4537                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4538                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4539                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4540                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4541                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4542                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4543                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4544                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4545                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4546                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4547                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4548                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4549                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4550                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4551                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4552                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4553                 </fields>
4554                 <links>
4555                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4556                 </links>
4557                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4558                         <actions>
4559                                 <retrieve/>
4560                         </actions>
4561                 </permacrud>
4562         </class>
4563
4564         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4565                 oils_persist:tablename="config.display_field_map"
4566                 oils_obj:fieldmapper="config::display_field_map"
4567                 oils_persist:field_safe="true"
4568                 reporter:label="Display Field Map">
4569                 <fields oils_persist:primary="name">
4570                         <field name="name" reporter:datatype="text"/>
4571                         <field name="field" reporter:datatype="link"/>
4572                         <field name="multi" reporter:datatype="bool"/>
4573                 </fields>
4574                 <links>
4575                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4576                 </links>
4577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4578                         <actions>
4579                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4580                                 <retrieve/>
4581                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4582                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4583                         </actions>
4584                 </permacrud>
4585         </class>
4586
4587         <class id="mfae" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::facet_entry" oils_persist:tablename="metabib.facet_entry" reporter:label="Combined Facet Entry" oils_persist:readonly="true">
4588                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4589                         <field name="id" reporter:datatype="id" />
4590                         <field name="field" reporter:datatype="link"/>
4591                         <field name="source" reporter:datatype="link"/>
4592                         <field name="value"  reporter:datatype="text"/>
4593                 </fields>
4594                 <links>
4595                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4596                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4597                 </links>
4598         </class>
4599         <class id="mbe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry" oils_persist:tablename="metabib.browse_entry" reporter:label="Combined Browse Entry" oils_persist:readonly="true">
4600                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4601                         <field name="id" reporter:datatype="id" />
4602                         <field name="value" reporter:datatype="text"/>
4603                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4604                 </fields>
4605                 <links>
4606                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4607                 </links>
4608                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4609                         <actions>
4610                                 <retrieve/>
4611                         </actions>
4612                 </permacrud>
4613         </class>
4614         <class id="mbedm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_def_map" oils_persist:tablename="metabib.browse_entry_def_map" reporter:label="Combined Browse Entry Definition Map" oils_persist:readonly="true">
4615                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4616                         <field name="id" reporter:datatype="id" />
4617                         <field name="entry" reporter:datatype="link"/>
4618                         <field name="def" reporter:datatype="link"/>
4619                         <field name="source" reporter:datatype="link"/>
4620                 </fields>
4621                 <links>
4622                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4623                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4624                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4625                 </links>
4626         </class>
4627         <class id="mbeshm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::browse_entry_simple_heading_map" oils_persist:tablename="metabib.browse_entry_simple_heading_map" reporter:label="Combined Browse Entry Simple Authority Heading Map" oils_persist:readonly="true">
4628                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4629                         <field name="id" reporter:datatype="id" />
4630                         <field name="entry" reporter:datatype="link"/>
4631                         <field name="simple_heading" reporter:datatype="link"/>
4632                 </fields>
4633                 <links>
4634                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4635                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4636                 </links>
4637         </class>
4638         <class id="mfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::field_entry" reporter:label="Combined Field Entry View" oils_persist:readonly="true">
4639                 <oils_persist:source_definition><![CDATA[
4640                         SELECT * FROM metabib.author_field_entry
4641                                                 UNION ALL
4642                         SELECT * FROM metabib.keyword_field_entry
4643                                                 UNION ALL
4644                         SELECT * FROM metabib.identifier_field_entry
4645                                                 UNION ALL
4646                         SELECT * FROM metabib.title_field_entry
4647                                                 UNION ALL
4648                         SELECT * FROM metabib.subject_field_entry
4649                                                 UNION ALL
4650                         SELECT * FROM metabib.series_field_entry
4651                 ]]></oils_persist:source_definition>
4652                 <fields>
4653                         <field name="field" reporter:datatype="link"/>
4654                         <field name="id" reporter:datatype="id" />
4655                         <field name="source" reporter:datatype="link"/>
4656                         <field name="value"  reporter:datatype="text"/>
4657                 </fields>
4658                 <links>
4659                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4660                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4661                 </links>
4662         </class>
4663         <class id="mkfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::keyword_field_entry" oils_persist:tablename="metabib.keyword_field_entry" reporter:label="Keyword Field Entry">
4664                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4665                         <field name="field" reporter:datatype="link"/>
4666                         <field name="id" reporter:datatype="id" />
4667                         <field name="source" reporter:datatype="link"/>
4668                         <field name="value"  reporter:datatype="text"/>
4669                 </fields>
4670                 <links>
4671                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4672                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4673                 </links>
4674         </class>
4675         <class id="mcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::cash_payment" oils_persist:tablename="money.cash_payment" reporter:label="Cash Payment">
4676                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4677                         <field name="accepting_usr" reporter:datatype="link"/>
4678                         <field name="amount" reporter:datatype="money" />
4679                         <field name="amount_collected" reporter:datatype="money" />
4680                         <field name="cash_drawer" reporter:datatype="link"/>
4681                         <field name="id" reporter:datatype="id" />
4682                         <field name="note"  reporter:datatype="text"/>
4683                         <field name="payment_ts" reporter:datatype="timestamp"/>
4684                         <field name="xact" reporter:datatype="link"/>
4685                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4686                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4687                 </fields>
4688                 <links>
4689                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4690                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4691                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4692                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4693                 </links>
4694         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4695             <actions>
4696                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4697                     <context link="xact" jump="usr" field="home_ou"/>
4698                 </retrieve>
4699                         </actions>
4700                 </permacrud>
4701         </class>
4702         <class id="mfp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::forgive_payment" oils_persist:tablename="money.forgive_payment" reporter:label="Forgive Payment">
4703                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4704                         <field name="accepting_usr" reporter:datatype="link"/>
4705                         <field name="amount" reporter:datatype="money" />
4706                         <field name="amount_collected" reporter:datatype="money" />
4707                         <field name="id" reporter:datatype="id" />
4708                         <field name="note"  reporter:datatype="text"/>
4709                         <field name="payment_ts" reporter:datatype="timestamp"/>
4710                         <field name="xact" reporter:datatype="link"/>
4711                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4712                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4713                 </fields>
4714                 <links>
4715                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4716                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4717                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4718                 </links>
4719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4720             <actions>
4721                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4722                     <context link="xact" jump="usr" field="home_ou"/>
4723                 </retrieve>
4724                         </actions>
4725                 </permacrud>
4726         </class>
4727         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4728                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4729                         <field name="accepting_usr" reporter:datatype="link"/>
4730                         <field name="amount" reporter:datatype="money" />
4731                         <field name="amount_collected" reporter:datatype="money" />
4732                         <field name="id" reporter:datatype="id" />
4733                         <field name="note"  reporter:datatype="text"/>
4734                         <field name="payment_ts" reporter:datatype="timestamp"/>
4735                         <field name="xact" reporter:datatype="link"/>
4736                         <field name="billing" reporter:datatype="link"/>
4737                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4738                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4739                 </fields>
4740                 <links>
4741                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4742                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4743                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4744                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4745                 </links>
4746         </class>
4747         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4748                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4749                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4750                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4751                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4752                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4753                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4754                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4755                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4756                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4757                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4758                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4759                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4760                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4761                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4762                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4763                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4764                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4765                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4766                 </fields>
4767                 <links>
4768                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4769                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4770                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4771                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4772                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4773                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4774                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4775                 </links>
4776         </class>
4777
4778         <class id="csp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::standing_penalty" oils_persist:tablename="config.standing_penalty" reporter:label="Standing Penalty">
4779                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4780                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4781                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4782                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4783                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4784                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4785                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4786                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4787                 </fields>
4788                 <links/>
4789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4790             <actions>
4791                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4792                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4793                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4794                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4795             </actions>
4796         </permacrud>
4797         </class>
4798         <class id="pgpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_penalty_threshold" oils_persist:tablename="permission.grp_penalty_threshold" reporter:label="Group Penalty Threshold">
4799                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4800                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4801                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4802                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4803                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4804                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4805                 </fields>
4806                 <links>
4807                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4808                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4809                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4810         </links>
4811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4812             <actions>
4813                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4814                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4815                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4816                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4817             </actions>
4818         </permacrud>
4819         </class>
4820         <class id="ccs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_status" oils_persist:tablename="config.copy_status" oils_persist:restrict_primary="100" reporter:label="Item Status" oils_persist:field_safe="true">
4821                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4822                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4823                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4824                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4825                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4826             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4827             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4828             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4829             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4830                 </fields>
4831                 <links/>
4832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4833             <actions>
4834                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4835                 <retrieve/>
4836                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4837                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4838             </actions>
4839         </permacrud>
4840         </class>
4841         <class id="ausp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_standing_penalty" oils_persist:tablename="actor.usr_standing_penalty" oils_persist:restrict_primary="100" reporter:label="User Standing Penalty">
4842                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4843                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4844                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4845                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4846                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4847                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4848                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4849                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4850                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4851                 </fields>
4852                 <links>
4853                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4854                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4855                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4856                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4857                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4858                 </links>
4859                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4860                         <actions>
4861                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4862                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4863                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4864                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4865                         </actions>
4866                 </permacrud>
4867         </class>
4868         <class id="aua" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
4869                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4870                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4871                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4872                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4873                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4874                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4875                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4876                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4877                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4878                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4879                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4880                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4881                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4882                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4883                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4884                 </fields>
4885                 <links>
4886                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4887                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4888                 </links>
4889                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4890                         <actions>
4891                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4892                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4893                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4894                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4895                         </actions>
4896                 </permacrud>
4897         </class>
4898         <class id="aal" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::address_alert" oils_persist:tablename="actor.address_alert" reporter:label="Address Alert">
4899                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4900                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4901                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4902                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4903                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4904                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4905                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4906                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4907                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4908                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4909                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4910                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4911                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4912                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4913                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4914                 </fields>
4915                 <links>
4916                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4917                 </links>
4918                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4919                         <actions>
4920                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4921                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4922                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4923                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4924                         </actions>
4925                 </permacrud>
4926         </class>
4927
4928
4929         <class id="auss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_saved_search" oils_persist:tablename="actor.usr_saved_search" reporter:label="User Saved Search">
4930                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4931                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4932                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4933                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4934                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4935                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4936                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4937                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4938                 </fields>
4939                 <links>
4940                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4941                 </links>
4942         </class>
4943
4944         <class id="acnn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_note" oils_persist:tablename="asset.call_number_note" reporter:label="Call Number Note">
4945                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4946                         <field name="call_number" />
4947                         <field name="create_date" reporter:datatype="timestamp"/>
4948                         <field name="creator" reporter:datatype="link"/>
4949                         <field name="id" reporter:datatype="id" />
4950                         <field name="pub" reporter:datatype="bool"/>
4951                         <field name="title"  reporter:datatype="text"/>
4952                         <field name="value"  reporter:datatype="text"/>
4953                 </fields>
4954                 <links>
4955                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4956                 </links>
4957         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4958             <actions>
4959                 <create permission="CREATE_VOLUME_NOTE">
4960                     <context link="call_number" field="owning_lib"/>
4961                 </create>
4962                 <retrieve permission="VIEW_VOLUME_NOTES">
4963                     <context link="call_number" field="owning_lib"/>
4964                 </retrieve>
4965                 <update permission="UPDATE_VOLUME_NOTE">
4966                     <context link="call_number" field="owning_lib"/>
4967                 </update>
4968                 <delete permission="DELETE_VOLUME_NOTE">
4969                     <context link="call_number" field="owning_lib"/>
4970                 </delete>
4971             </actions>
4972         </permacrud>
4973         </class>
4974         <class id="arn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::record_note" oils_persist:tablename="authority.record_note" reporter:label="Authority Record Note">
4975                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4976                         <field name="create_date" reporter:datatype="timestamp"/>
4977                         <field name="creator" reporter:datatype="link"/>
4978                         <field name="edit_date" reporter:datatype="timestamp"/>
4979                         <field name="editor" reporter:datatype="link"/>
4980                         <field name="id" reporter:datatype="id" />
4981                         <field name="record" reporter:datatype="link"/>
4982                         <field name="value" reporter:datatype="text"/>
4983                 </fields>
4984                 <links>
4985                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4986                 </links>
4987         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4988             <actions>
4989                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4990                 <retrieve/>
4991                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4992                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4993             </actions>
4994         </permacrud>
4995         </class>
4996         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4997         <oils_persist:source_definition><![CDATA[
4998 SELECT  usr,
4999         SUM(
5000             CASE
5001                 WHEN (
5002                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5003                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5004                 ) THEN 1
5005                 ELSE 0
5006             END
5007         ) AS out,
5008
5009         SUM(
5010             CASE
5011                 WHEN (
5012                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5013                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5014                 ) THEN 1
5015                 ELSE 0
5016             END
5017         ) AS overdue,
5018
5019         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
5020         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
5021         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
5022   FROM  action.circulation
5023   WHERE checkin_time IS NULL
5024   GROUP BY 1
5025         ]]></oils_persist:source_definition>
5026         <fields oils_persist:primary="usr">
5027             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5028             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5029             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5030             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5031             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5032             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5033         </fields>
5034         <links>
5035             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5036         </links>
5037         </class>
5038         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
5039         <oils_persist:source_definition><![CDATA[
5040 SELECT  usr,
5041         STRING_AGG(
5042             CASE
5043                 WHEN (
5044                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
5045                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5046                 ) THEN id::TEXT
5047                 ELSE '0'
5048             END
5049         ,',') AS out,
5050
5051         STRING_AGG(
5052             CASE
5053                 WHEN (
5054                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
5055                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
5056                 ) THEN id::TEXT
5057                 ELSE '0'
5058             END
5059         ,',') AS overdue,
5060
5061         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5062         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5063         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5064   FROM  action.circulation
5065   WHERE checkin_time IS NULL
5066   GROUP BY 1
5067         ]]></oils_persist:source_definition>
5068         <fields oils_persist:primary="usr">
5069             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5070             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5071             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5072             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5073             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5074             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5075         </fields>
5076         <links>
5077             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5078         </links>
5079         </class>
5080         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5081                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5082                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5083                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5084                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5085                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5086                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5087                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5088                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5089                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5090                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5091                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5092                 </fields>
5093                 <links>
5094                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5095                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5096                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5097                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5098                 </links>
5099         </class>
5100         <class id="circ" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circulation" oils_persist:tablename="action.circulation" reporter:core="true" reporter:label="Circulation">
5101                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5102                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5103                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5104                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5105                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5106                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5107                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5108                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5109                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5110                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5111                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5112                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5113                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5114                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5115                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5116                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5117                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5118                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5119                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5120                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5121                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5122                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5123                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5124                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5125                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5126                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5127                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5128                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5129                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5130                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5131                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5132                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5133                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5134                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5135                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5136                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5137                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5138                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5139                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5140                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5141                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5142                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5143                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5144                 </fields>
5145                 <links>
5146                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5147                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5148                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5149                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5150                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5151                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5152                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5153                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5154                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5155                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5156                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5157                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5158                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5159                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5160                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5161                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5162                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5163                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5164                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5165                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5166                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5167                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5168                 </links>
5169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5170                         <actions>
5171                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5172                         </actions>
5173                 </permacrud>
5174         </class>
5175         <class id="aacct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_combined_types" oils_persist:tablename="action.all_circulation_combined_types" reporter:core="true" reporter:label="All Circulation Combined Types" oils_persist:readonly="true">
5176                 <fields>
5177                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5178                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5179                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5180                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5181                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5182                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5183                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5184                 </fields>
5185                 <links>
5186                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5187                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5188                 </links>
5189                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5190                         <actions>
5191                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5192                         </actions>
5193                 </permacrud>
5194         </class>
5195         <class id="aacs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_slim" oils_persist:tablename="action.all_circulation_slim" reporter:core="false" reporter:label="Combined Aged and Active Circulations (Slim Version)" oils_persist:readonly="true">
5196                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5197                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5198                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5199                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5200                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5201                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5202                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5203                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5204                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5205                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5206                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5207                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5208                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5209                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5210                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5211                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5212                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5213                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5214                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5215                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5216                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5217                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5218                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5219                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5220                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5221                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5222                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5223                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5224                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5225                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5226                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5227                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5228                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5229                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5230                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5231                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5232                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5233                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5234                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5235                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5236                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5237                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5238                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5239                 </fields>
5240                 <links>
5241                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5242                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5243                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5244                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5245                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5246                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5247                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5248                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5249                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5250                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5251                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5252                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5253                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5254                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5255                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5256                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5257                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5258                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5259                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5260                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5261                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5262                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5263                 </links>
5264                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5265                         <actions>
5266                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5267                         </actions>
5268                 </permacrud>
5269         </class>
5270
5271         <class id="combcirc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation" oils_persist:tablename="action.all_circulation" reporter:core="true" reporter:label="Combined Aged and Active Circulations" oils_persist:readonly="true">
5272                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5273                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5274                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5275                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5276                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5277                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5278                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5279                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5280                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5281                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5282                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5283                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5284                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5285                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5286                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5287                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5288                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5289                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5290                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5291                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5292                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5293                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5294                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5295                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5296                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5297                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5298                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5299                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5300                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5301                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5302                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5303                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5304                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5305                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5306                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5307                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5308                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5309                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5310                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5311                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5312                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5313                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5314                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5315                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5316                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5317                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5318                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5319                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5320                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5321                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5322                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5323                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5324                 </fields>
5325                 <links>
5326                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5327                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5328                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5329                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5330                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5331                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5332                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5333                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5334                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5335                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5336                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5337                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5338                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5339                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5340                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5341                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5342                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5343                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5344                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5345                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5346                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5347                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5348                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5349                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5350                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5351                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5352                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5353                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5354                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5355                 </links>
5356                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5357                         <actions>
5358                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5359                         </actions>
5360                 </permacrud>
5361         </class>
5362         <class id="acirc" controller="open-ils.cstore" oils_obj:fieldmapper="action::aged_circulation" oils_persist:tablename="action.aged_circulation" reporter:core="true" reporter:label="Aged (patronless) Circulation">
5363                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5364                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5365                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5366                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5367                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5368                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5369                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5370                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5371                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5372                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5373                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5374                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5375                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5376                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5377                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5378                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5379                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5380                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5381                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5382                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5383                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5384                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5385                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5386                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5387                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5388                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5389                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5390                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5391                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5392                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5393                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5394                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5395                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5396                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5397                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5398                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5399                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5400                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5401                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5402                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5403                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5404                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5405                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5406                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5407                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5408                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5409                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5410                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5411                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5412                 </fields>
5413                 <links>
5414                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5415                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5416                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5417                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5418                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5419                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5420                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5421                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5422                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5423                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5424                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5425                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5426                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5427                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5428                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5429                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5430                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5431                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5432                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5433                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5434                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5435                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5436                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5437                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5438                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5439                 </links>
5440         </class>
5441         <class id="auch" 
5442                 controller="open-ils.cstore" 
5443                 oils_obj:fieldmapper="action::user_circ_history" 
5444                 oils_persist:tablename="action.usr_circ_history" 
5445                 reporter:label="User Checkout History">
5446                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5447                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5448                         <!-- prevent reporting on the user that owns the checkout history -->
5449                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5450                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5451                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5452                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5453                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5454                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5455                 </fields>
5456                 <links>
5457                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5458                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5459                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5460                 </links>
5461         </class>
5462         <class id="brt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_type" oils_persist:tablename="booking.resource_type" reporter:label="Resource Type">
5463                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5464                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5465                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5466                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5467                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5468                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5469                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5470                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5471                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5472                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5473                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5474                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5475                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5476                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5477                 </fields>
5478                 <links>
5479                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5480                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5481                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5482                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5483                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5484                 </links>
5485                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5486                         <actions>
5487                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5488                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5489                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5490                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5491                         </actions>
5492                 </permacrud>
5493         </class>
5494
5495         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5496                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5497                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5498                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5499                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5500                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5501                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5502                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5503                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5504                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5505                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5506                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5507                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5508                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5509                 </fields>
5510                 <links>
5511                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5512                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5513                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5514                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5515                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5516                 </links>
5517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5518                         <actions>
5519                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5520                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5521                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5522                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5523                         </actions>
5524                 </permacrud>
5525         </class>
5526         
5527         <class id="bra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr" oils_persist:tablename="booking.resource_attr" reporter:label="Resource Attribute">
5528                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5529                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5530                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5531                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5532                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5533                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5534                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5535                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5536                 </fields>
5537                 <links>
5538                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5539                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5540                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5541                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5542                 </links>
5543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5544                         <actions>
5545                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5546                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5547                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5548                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5549                         </actions>
5550                 </permacrud>
5551         </class>
5552         
5553         <class id="brav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_value" oils_persist:tablename="booking.resource_attr_value" reporter:label="Resource Attribute Value">
5554                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5555                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5556                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5557                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5558                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5559                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5560                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5561                 </fields>
5562                 <links>
5563                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5564                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5565                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5566                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5567                 </links>
5568                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5569                         <actions>
5570                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5571                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5572                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5573                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5574                         </actions>
5575                 </permacrud>
5576         </class>
5577         
5578         <class id="bram" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_map" oils_persist:tablename="booking.resource_attr_map" reporter:label="Resource Attribute Map">
5579                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5580                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5581                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5582                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5583                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5584                 </fields>
5585                 <links>
5586                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5587                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5588                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5589                 </links>
5590                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5591                         <actions>
5592                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5593                     <context link="resource" field="owner" />
5594                 </create>
5595                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5596                     <context link="resource" field="owner" />
5597                 </retrieve>
5598                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5599                     <context link="resource" field="owner" />
5600                 </update>
5601                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5602                     <context link="resource" field="owner" />
5603                 </delete>
5604                         </actions>
5605                 </permacrud>
5606         </class>
5607         
5608         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5609                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5610                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5611                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5612                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5613                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5614                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5615                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5616                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5617                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5618                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5619                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5620                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5621                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5622                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5623                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5624                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5625                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5626                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5627                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5628                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5629                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5630                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5631                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5632                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5633                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5634                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5635                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5636                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5637                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5638                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5639                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5640                 </fields>
5641                 <links>
5642                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5643                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5644                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5645                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5646                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5647                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5648                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5649                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5650                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5651                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5652                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5653                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5654                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5655                 </links>
5656                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5657                         <actions>
5658                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5659                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5660                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5661                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5662                         </actions>
5663                 </permacrud>
5664         </class>
5665         
5666         <class id="bravm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation_attr_value_map" oils_persist:tablename="booking.reservation_attr_value_map" reporter:label="Reservation Attribute Value Map">
5667                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5668                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5669                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5670                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5671                 </fields>
5672                 <links>
5673                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5674                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5675                 </links>
5676                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5677                         <actions>
5678                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5679                                         <context link="reservation" field="pickup_lib"/>
5680                                 </create>
5681                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5682                                         <context link="reservation" field="pickup_lib"/>
5683                                 </retrieve>
5684                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5685                                         <context link="reservation" field="pickup_lib"/>
5686                                 </update>
5687                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5688                                         <context link="reservation" field="pickup_lib"/>
5689                                 </delete>
5690                         </actions>
5691                 </permacrud>
5692         </class>
5693
5694         <class id="ccnbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
5695                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5696                         <field name="bucket" reporter:datatype="link"/>
5697                         <field name="id" reporter:datatype="id" />
5698                         <field name="target_call_number" reporter:datatype="link" />
5699                         <field name="create_time" reporter:datatype="timestamp" />
5700                         <field name="pos" reporter:datatype="int" />
5701                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5702                 </fields>
5703                 <links>
5704                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5705                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5706             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5707                 </links>
5708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5709                         <actions>
5710                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5711                     <context link="bucket" field="owning_lib"/>
5712                 </retrieve>
5713             </actions>
5714         </permacrud>
5715         </class>
5716         <class id="ccnbin" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_item_note" oils_persist:tablename="container.call_number_bucket_item_note" reporter:label="Call Number Bucket Item Note">
5717                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5718                         <field name="id" reporter:datatype="id" />
5719                         <field name="item" reporter:datatype="link"/>
5720                         <field name="note" reporter:datatype="text" />
5721                 </fields>
5722                 <links>
5723                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5724                 </links>
5725         </class>
5726         <class id="cbreb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
5727                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5728                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5729                         <field name="btype" reporter:datatype="text"/>
5730                         <field name="id" reporter:datatype="id" />
5731                         <field name="name" reporter:datatype="text"/>
5732                         <field name="description" reporter:datatype="text"/>
5733                         <field name="owner" reporter:datatype="link"/>
5734                         <field name="pub" reporter:datatype="bool"/>
5735                         <field name="create_time" reporter:datatype="timestamp" />
5736                         <field name="owning_lib" reporter:datatype="org_unit" />
5737                 </fields>
5738                 <links>
5739                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5740                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5741                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5742                 </links>
5743                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5744                         <actions>
5745                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5746                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5747                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5748                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5749                         </actions>
5750                 </permacrud>
5751         </class>
5752         <class id="cbrebn" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_note" oils_persist:tablename="container.biblio_record_entry_bucket_note" reporter:label="Bibliographic Record Entry Bucket Note">
5753                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5754                         <field name="id" reporter:datatype="id" />
5755                         <field name="bucket" reporter:datatype="link"/>
5756                         <field name="note" reporter:datatype="text" />
5757                 </fields>
5758                 <links>
5759                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5760                 </links>
5761         </class>
5762         <class id="ahcm" controller="open-ils.cstore" oils_obj:fieldmapper="action::hold_copy_map" oils_persist:tablename="action.hold_copy_map" reporter:label="Hold Copy Map">
5763                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5764                         <field name="hold" reporter:datatype="link"/>
5765                         <field name="id" reporter:datatype="id" />
5766                         <field name="target_copy" reporter:datatype="link"/>
5767                         <field name="proximity" reporter:datatype="number"/>
5768                 </fields>
5769                 <links>
5770                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5771                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5772                 </links>
5773         </class>
5774         <class id="ahn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_notification" oils_persist:tablename="action.hold_notification" reporter:label="Hold Notification">
5775                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5776                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5777                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5778                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5779                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5780                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5781                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5782                 </fields>
5783                 <links>
5784                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5785                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5786                 </links>
5787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5788             <actions>
5789                 <create permission="CREATE_HOLD_NOTIFICATION">
5790                                         <context link="hold" jump="usr" field="home_ou" />
5791                                 </create>
5792                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5793                                         <context link="hold" jump="usr" field="home_ou" />
5794                                 </retrieve>
5795                 <update permission="CREATE_HOLD_NOTIFICATION">
5796                                         <context link="hold" jump="usr" field="home_ou" />
5797                                 </update>
5798                 <delete permission="CREATE_HOLD_NOTIFICATION">
5799                                         <context link="hold" jump="usr" field="home_ou" />
5800                                 </delete>
5801             </actions>
5802         </permacrud>
5803         </class>
5804         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Shelving Location"  oils_persist:field_safe="true">
5805                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5806                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5807                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5808                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5809                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5810                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5811                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5812                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5813                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5814                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5815                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5816                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5817                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5818                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5819                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5820                 </fields>
5821                 <links>
5822                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5823                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5824                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5825                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5826                 </links>
5827         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5828             <actions>
5829                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5830                 <retrieve/>
5831                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5832                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5833             </actions>
5834         </permacrud>
5835         </class>
5836         <class id="acplg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group" oils_persist:tablename="asset.copy_location_group" reporter:label="Copy/Shelving Location Group">
5837                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5838                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5839                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5840                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5841                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5842             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5843             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5844             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5845                 </fields>
5846                 <links>
5847                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5848                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5849                 </links>
5850         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5851             <actions>
5852                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5853                 <retrieve/>
5854                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5855                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5856             </actions>
5857         </permacrud>
5858         </class>
5859         <class id="acplgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_group_map" oils_persist:tablename="asset.copy_location_group_map" reporter:label="Copy/Shelving Location Group Map">
5860                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5861                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5862             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5863             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5864                 </fields>
5865                 <links>
5866                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5867                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5868                 </links>
5869         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5870             <actions>
5871                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5872                                         <context link="lgroup" field="owner" />
5873                 </create>
5874                 <retrieve/>
5875                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5876                                         <context link="lgroup" field="owner" />
5877                 </update>
5878                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5879                                         <context link="lgroup" field="owner" />
5880                 </delete>
5881             </actions>
5882         </permacrud>
5883         </class>
5884
5885     <class id="acplo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location_order" oils_persist:tablename="asset.copy_location_order" reporter:label="Copy/Shelving Location Order">
5886         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5887             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5888             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5889             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5890             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5891         </fields>
5892         <links>
5893             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5894             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5895         </links>
5896         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5897             <actions>
5898                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5899                 <retrieve/>
5900                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5901                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5902             </actions>
5903         </permacrud>
5904     </class>
5905
5906         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5907                 <fields>
5908                         <field name="sre_id" oils_persist:virtual="true" />
5909                         <field name="location" oils_persist:virtual="true" />
5910                         <field name="owning_lib" oils_persist:virtual="true" />
5911                         <field name="basic_holdings" oils_persist:virtual="true" />
5912                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5913                         <field name="supplement_holdings" oils_persist:virtual="true" />
5914                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5915                         <field name="index_holdings" oils_persist:virtual="true" />
5916                         <field name="index_holdings_add" oils_persist:virtual="true" />
5917                         <field name="online" oils_persist:virtual="true" />
5918                         <field name="missing" oils_persist:virtual="true" />
5919                         <field name="incomplete" oils_persist:virtual="true" />
5920                 </fields>
5921         </class>
5922
5923         <class id="sre" controller="open-ils.pcrud open-ils.cstore" oils_obj:fieldmapper="serial::record_entry" oils_persist:tablename="serial.record_entry" reporter:label="Serial Record Entry">
5924                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5925                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5926                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5927                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5928                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5929                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5930                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5931                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5932                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5933                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5934                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5935                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5936                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5937                 </fields>
5938                 <links>
5939                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5940                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5941                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5942                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5943                 </links>
5944                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5945                         <actions>
5946                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5947                                 <retrieve/>
5948                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5949                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5950                         </actions>
5951                 </permacrud>
5952         </class>
5953
5954         <class id="scap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::caption_and_pattern" oils_persist:tablename="serial.caption_and_pattern" reporter:label="Caption and Pattern">
5955                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5956                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5957                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5958                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5959                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5960                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5961                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5962                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5963                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5964                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5965                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5966                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5967                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5968                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5969                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5970                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5971                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5972                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5973                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5974                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5975                 </fields>
5976                 <links>
5977                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5978                 </links>
5979                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5980                         <actions>
5981                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5982                                         <context link="subscription" field="owning_lib" />
5983                                 </create>
5984                                 <retrieve />
5985                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5986                                         <context link="subscription" field="owning_lib" />
5987                                 </update>
5988                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5989                                         <context link="subscription" field="owning_lib" />
5990                                 </delete>
5991                         </actions>
5992                 </permacrud>
5993         </class>
5994
5995         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5996                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5997                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5998                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5999                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
6000                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
6001                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
6002                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
6003                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
6004                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
6005                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
6006                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6007                 </fields>
6008                 <links>
6009                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6010                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
6011                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
6012                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
6013                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
6014                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
6015                 </links>
6016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6017                         <actions>
6018                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6019                                 <retrieve />
6020                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6021                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
6022                         </actions>
6023                 </permacrud>
6024         </class>
6025
6026         <class id="ssubn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
6027                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
6028                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6029                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6030                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6031                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6032                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6033                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6034                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6035                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6036                 </fields>
6037                 <links>
6038                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6039                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6040                 </links>
6041                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6042                         <actions>
6043                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6044                     <context link="subscription" field="owning_lib"/>
6045                 </create>
6046                                 <retrieve />
6047                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6048                     <context link="subscription" field="owning_lib"/>
6049                 </update>
6050                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
6051                     <context link="subscription" field="owning_lib"/>
6052                 </delete>
6053                         </actions>
6054                 </permacrud>
6055         </class>
6056
6057         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
6058                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
6059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6060                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6061                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6062                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6063                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6064                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6065                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6066                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6067                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6068                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6069                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6070                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6071                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6072                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6073                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6074                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6075                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6076                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6077                 </fields>
6078                 <links>
6079                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6080                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6081                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6082                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6083                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6084                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6085                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6086                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6087                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6088                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6089                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6090                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6091                 </links>
6092                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6093                         <actions>
6094                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6095                                 <retrieve />
6096                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6097                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6098                         </actions>
6099                 </permacrud>
6100         </class>
6101
6102         <class id="sdistn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution_note" oils_persist:tablename="serial.distribution_note" reporter:label="Distribution Note">
6103                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6104                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6105                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6106                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6107                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6108                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6109                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6110                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6111                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6112                 </fields>
6113                 <links>
6114                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6115                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6116                 </links>
6117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6118                         <actions>
6119                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6120                                         <context link="distribution" field="holding_lib" />
6121                                 </create>
6122                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6123                                         <context link="distribution" field="holding_lib" />
6124                                 </retrieve>
6125                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6126                                         <context link="distribution" field="holding_lib" />
6127                                 </update>
6128                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6129                                         <context link="distribution" field="holding_lib" />
6130                                 </delete>
6131                         </actions>
6132                 </permacrud>
6133         </class>
6134
6135         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6136                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6137                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6138                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6139                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6140                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6141                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6142                 </fields>
6143                 <links>
6144                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6145                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6146                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6147                 </links>
6148                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6149                         <actions>
6150                                 <create permission="ADMIN_SERIAL_STREAM">
6151                                         <context link="distribution" field="holding_lib" />
6152                                 </create>
6153                                 <retrieve />
6154                                 <update permission="ADMIN_SERIAL_STREAM">
6155                                         <context link="distribution" field="holding_lib" />
6156                                 </update>
6157                                 <delete permission="ADMIN_SERIAL_STREAM">
6158                                         <context link="distribution" field="holding_lib" />
6159                                 </delete>
6160                         </actions>
6161                 </permacrud>
6162         </class>
6163
6164         <class id="srlu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::routing_list_user" oils_persist:tablename="serial.routing_list_user" reporter:label="Routing List User">
6165                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6166                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6167                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6168                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6169                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6170                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6171                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6172                 </fields>
6173                 <links>
6174                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6175                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
6176                 </links>
6177                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6178                         <actions>
6179                                 <create permission="ADMIN_SERIAL_STREAM">
6180                                         <context link="stream" jump="distribution" field="holding_lib" />
6181                                 </create>
6182                                 <retrieve permission="RECEIVE_SERIAL">
6183                                         <context link="stream" jump="distribution" field="holding_lib" />
6184                                 </retrieve>
6185                                 <update permission="ADMIN_SERIAL_STREAM">
6186                                         <context link="stream" jump="distribution" field="holding_lib" />
6187                                 </update>
6188                                 <delete permission="ADMIN_SERIAL_STREAM">
6189                                         <context link="stream" jump="distribution" field="holding_lib" />
6190                                 </delete>
6191                         </actions>
6192                 </permacrud>
6193         </class>
6194
6195         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6196                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6197                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6198                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6199                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6200                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6201                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6202                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6203                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6204                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6205                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6206                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6207                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6208                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6209                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6210                 </fields>
6211                 <links>
6212                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6213                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6214                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6215                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6216                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6217                 </links>
6218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6219                         <actions>
6220                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6221                                         <context link="subscription" field="owning_lib" />
6222                                 </create>
6223                                 <retrieve/>
6224                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6225                                         <context link="subscription" field="owning_lib" />
6226                                 </update>
6227                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6228                                         <context link="subscription" field="owning_lib" />
6229                                 </delete>
6230                         </actions>
6231                 </permacrud>
6232         </class>
6233
6234         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6235                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6236                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6237                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6238                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6239                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6240                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6241                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6242                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6243                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6244                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6245                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6246                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6247                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6248                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6249                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6250                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6251                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6252                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6253                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6254                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6255                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6256                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6257                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6258                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6259                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6260                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6261                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6262                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6263                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6264                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6265                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6266                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6267                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6268                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6269                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6270                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6271                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6272                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6273                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6274                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6275                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6276                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6277                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6278                 </fields>
6279                 <links>
6280                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6281                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6282                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6283                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6284                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6285                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6286                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6287                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6288                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6289                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6290                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6291                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6292                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6293                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6294                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6295                 </links>
6296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6297                         <actions>
6298                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6299                                 <retrieve/>
6300                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6301                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6302                         </actions>
6303                 </permacrud>
6304         </class>
6305
6306         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6307                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6308                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6309                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6310                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6311                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6312                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6313                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6314                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6315                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6316                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6317                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6318                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6319                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6320                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6321                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6322                 </fields>
6323                 <links>
6324                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6325                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6326                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6327                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6328                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6329                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6330                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6331                 </links>
6332                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6333                         <actions>
6334                                 <create permission="ADMIN_SERIAL_ITEM">
6335                                         <context link="stream" jump="distribution" field="holding_lib" />
6336                                 </create>
6337                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6338                                         <context link="stream" jump="distribution" field="holding_lib" />
6339                                 </retrieve>
6340                                 <update permission="ADMIN_SERIAL_ITEM">
6341                                         <context link="stream" jump="distribution" field="holding_lib" />
6342                                 </update>
6343                                 <delete permission="ADMIN_SERIAL_ITEM">
6344                                         <context link="stream" jump="distribution" field="holding_lib" />
6345                                 </delete>
6346                         </actions>
6347                 </permacrud>
6348         </class>
6349
6350         <class id="sin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
6351                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6352                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6353                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6354                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6355                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6356                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6357                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6358                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6359                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6360                 </fields>
6361                 <links>
6362                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6363                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6364                 </links>
6365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6366                         <actions>
6367                                 <create permission="ADMIN_SERIAL_ITEM">
6368                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6369                                 </create>
6370                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6371                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6372                                 </retrieve>
6373                                 <update permission="ADMIN_SERIAL_ITEM">
6374                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6375                                 </update>
6376                                 <delete permission="ADMIN_SERIAL_ITEM">
6377                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6378                                 </delete>
6379                         </actions>
6380                 </permacrud>
6381         </class>
6382         <class id="sasum" controller="open-ils.cstore" oils_obj:fieldmapper="serial::any_summary" oils_persist:tablename="serial.any_summary" reporter:label="All Issues' Summaries" oils_persist:readonly="true">
6383                 <fields>
6384                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6385                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6386                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6387                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6388                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6389                 </fields>
6390                 <links>
6391                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6392                 </links>
6393         </class>
6394         <class id="smhc" controller="open-ils.cstore" oils_obj:fieldmapper="serial::materialized_holding_code" oils_persist:tablename="serial.materialized_holding_code" reporter:label="Materialized Holding Code" oils_persist:readonly="true">
6395                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6396                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6397                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6398                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6399                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6400                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6401                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6402                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6403                 </fields>
6404                 <links>
6405                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6406                 </links>
6407         </class>
6408         <class id="sbsum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::basic_summary" oils_persist:tablename="serial.basic_summary" reporter:label="Basic Issue Summary">
6409                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6410                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6411                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6412                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6413                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6414                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6415                 </fields>
6416                 <links>
6417                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6418                 </links>
6419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6420                         <actions>
6421                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6422                                         <context link="distribution" field="holding_lib" />
6423                                 </create>
6424                                 <retrieve/>
6425                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6426                                         <context link="distribution" field="holding_lib" />
6427                                 </update>
6428                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6429                                         <context link="distribution" field="holding_lib" />
6430                                 </delete>
6431                         </actions>
6432                 </permacrud>
6433         </class>
6434
6435         <class id="sssum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::supplement_summary" oils_persist:tablename="serial.supplement_summary" reporter:label="Supplemental Issue Summary">
6436                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6437                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6438                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6439                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6440                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6441                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6442                 </fields>
6443                 <links>
6444                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6445                 </links>
6446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6447                         <actions>
6448                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6449                                         <context link="distribution" field="holding_lib" />
6450                                 </create>
6451                                 <retrieve/>
6452                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6453                                         <context link="distribution" field="holding_lib" />
6454                                 </update>
6455                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6456                                         <context link="distribution" field="holding_lib" />
6457                                 </delete>
6458                         </actions>
6459                 </permacrud>
6460         </class>
6461
6462         <class id="sisum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::index_summary" oils_persist:tablename="serial.index_summary" reporter:label="Index Issue Summary">
6463                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6464                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6465                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6466                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6467                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6468                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6469                 </fields>
6470                 <links>
6471                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6472                 </links>
6473                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6474                         <actions>
6475                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6476                                         <context link="distribution" field="holding_lib" />
6477                                 </create>
6478                                 <retrieve/>
6479                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6480                                         <context link="distribution" field="holding_lib" />
6481                                 </update>
6482                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6483                                         <context link="distribution" field="holding_lib" />
6484                                 </delete>
6485                         </actions>
6486                 </permacrud>
6487         </class>
6488
6489         <class id="spt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::pattern_template" oils_persist:tablename="serial.pattern_template" reporter:label="Prediction Pattern Template">
6490                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6491                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6492                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6493                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6494                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6495                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6496                 </fields>
6497                 <links>
6498                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6499                 </links>
6500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6501                         <actions>
6502                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6503                                 <retrieve/>
6504                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6505                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6506                         </actions>
6507                 </permacrud>
6508         </class>
6509
6510         <class id="ascecm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry_copy_map" oils_persist:tablename="asset.stat_cat_entry_copy_map" reporter:label="Statistical Category Entry Copy Map">
6511                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6512                         <field name="id" reporter:datatype="id" />
6513                         <field name="owning_copy" reporter:datatype="link"/>
6514                         <field name="stat_cat" reporter:datatype="link"/>
6515                         <field name="stat_cat_entry" reporter:datatype="link"/>
6516                 </fields>
6517                 <links>
6518                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6519                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6520                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6521                 </links>
6522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6523                         <actions>
6524                                 <retrieve/>
6525                         </actions>
6526                 </permacrud>
6527         </class>
6528         <class id="citm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::item_type_map" oils_persist:tablename="config.item_type_map" reporter:label="Item Type Map" oils_persist:field_safe="true">
6529                 <fields oils_persist:primary="code">
6530                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6531                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6532                 </fields>
6533                 <links/>
6534         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6535             <actions>
6536                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6537                 <retrieve/>
6538                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6539                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6540             </actions>
6541         </permacrud>
6542         </class>
6543         <class id="cblvl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_level_map" oils_persist:tablename="config.bib_level_map" reporter:label="Bib Level Map" oils_persist:field_safe="true">
6544                 <fields oils_persist:primary="code">
6545                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6546                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6547                 </fields>
6548                 <links/>
6549         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6550             <actions>
6551                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6552                 <retrieve/>
6553                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6554                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6555             </actions>
6556         </permacrud>
6557         </class>
6558         <class id="sra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="search::relevance_adjustment" oils_persist:tablename="search.relevance_adjustment" reporter:label="Relevance Adjustment">
6559                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6560                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6561                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6562                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6563                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6564                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6565                 </fields>
6566                 <links>
6567             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6568         </links>
6569         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6570             <actions>
6571                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6572                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6573                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6574                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6575             </actions>
6576         </permacrud>
6577         </class>
6578         <class id="lasso" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso" oils_persist:tablename="actor.org_lasso" reporter:label="Library Group">
6579                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6580                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6581                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6582                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6583                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6584                 </fields>
6585                 <links>
6586                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6587         </links>
6588         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6589             <actions>
6590                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6591                 <retrieve/>
6592                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6593                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6594             </actions>
6595         </permacrud>
6596         </class>
6597         <class id="lmap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso_map" oils_persist:tablename="actor.org_lasso_map" reporter:label="Library Group Map">
6598                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6599                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6600                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6601                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6602                 </fields>
6603                 <links>
6604                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6605                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6606                 </links>
6607         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6608             <actions>
6609                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6610                 <retrieve/>
6611                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6612                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6613             </actions>
6614         </permacrud>
6615         </class>
6616         <class id="aoupa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_proximity_adjustment" oils_persist:tablename="actor.org_unit_proximity_adjustment" reporter:label="Org Unit Proximity Adjustment">
6617                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6618                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6619                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6620                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6621                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6622                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6623                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6624                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6625                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6626                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6627                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6628                 </fields>
6629                 <links>
6630                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6631                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6632                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6633                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6634                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6635                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6636                 </links>
6637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6638             <actions>
6639                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6640                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6641                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6642                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6643             </actions>
6644         </permacrud>
6645         </class>
6646         <class id="aoup" controller="open-ils.cstore" oils_obj:fieldmapper="actor::org_unit_proximity" oils_persist:tablename="actor.org_unit_proximity" reporter:label="Org Unit Proximity">
6647                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6648                         <field name="id" reporter:datatype="id" />
6649                         <field name="from_org" reporter:datatype="org_unit"/>
6650                         <field name="to_org" reporter:datatype="org_unit"/>
6651                         <field name="prox" reporter:datatype="int" />
6652                 </fields>
6653                 <links>
6654                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6655                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6656                 </links>
6657         </class>
6658         <class id="ssr" controller="open-ils.cstore" oils_obj:fieldmapper="search::search_result" oils_persist:tablename="search.search_result" oils_persist:readonly="true" reporter:label="Search Result">
6659                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6660                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6661                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6662                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6663                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6664                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6665                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6666                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6667                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6668                 </fields>
6669                 <links/>
6670         </class>
6671         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6672                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6673                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6674                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6675                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6676                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6677                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6678                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6679                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6680                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6681                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6682                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6683                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6684                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6685                 </fields>
6686                 <links>
6687                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6688                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6689                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6690                 </links>
6691         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6692             <actions>
6693                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6694                 <retrieve/>
6695                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6696                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6697             </actions>
6698         </permacrud>
6699         </class>
6700         <class id="aoa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_address" oils_persist:tablename="actor.org_address" reporter:label="Org Address">
6701                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6702                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6703                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6704                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6705                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6706                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6707                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6708                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6709                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6710                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6711                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6712                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6713                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6714                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6715                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6716                 </fields>
6717                 <links>
6718                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6719                 </links>
6720         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6721             <actions>
6722                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6723                 <retrieve/>
6724                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6725                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6726             </actions>
6727         </permacrud>
6728         </class>
6729         <class id="asq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_query" oils_persist:tablename="actor.search_query" reporter:label="Search Query" oils_persist:field_safe="true">
6730                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6731                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6732                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6733                         <field name="query_text" reporter:datatype="text"/>
6734                 </fields>
6735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6736             <actions>
6737                 <retrieve/>
6738             </actions>
6739         </permacrud>
6740         </class>
6741
6742         <class id="asfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group" oils_persist:tablename="actor.search_filter_group" reporter:label="Search Filter Group" oils_persist:field_safe="true">
6743                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6744                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6745                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6746                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6747                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6748                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6749                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6750                 </fields>
6751                 <links>
6752                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6753                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6754                 </links>
6755         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6756             <actions>
6757                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6758                 <retrieve/>
6759                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6760                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6761             </actions>
6762         </permacrud>
6763         </class>
6764         <class id="asfge" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::search_filter_group_entry" oils_persist:tablename="actor.search_filter_group_entry" reporter:label="Search Filter Group Entry" oils_persist:field_safe="true">
6765                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6766                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6767                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6768                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6769                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6770                 </fields>
6771                 <links>
6772                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6773                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6774                 </links>
6775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6776             <actions>
6777                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6778                     <context link="grp" field="owner"/>
6779                 </create>
6780                 <retrieve/>
6781                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6782                     <context link="grp" field="owner"/>
6783                 </update>
6784                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6785                     <context link="grp" field="owner"/>
6786                 </delete>
6787             </actions>
6788         </permacrud>
6789         </class>
6790
6791         <!-- A note: Please update alhr and ahopl when updating ahr -->
6792         <class id="ahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request" oils_persist:tablename="action.hold_request" reporter:core="true" reporter:label="Hold Request">
6793                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6794                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6795                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6796                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6797                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6798                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6799                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6800                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6801                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6802                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6803                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6804                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6805                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6806                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6807                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6808                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6809                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6810                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6811                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6812                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6813                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6814                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6815                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6816                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6817                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6818                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6819                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6820                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6821                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6822                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6823                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6824                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6825                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6826                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6827                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6828                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6829                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6830                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6831                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6832                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6833                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6834                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6835                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6836                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6837                 </fields>
6838                 <links>
6839                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6840                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6841                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6842                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6843                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6844                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6845                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6846                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6847                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6848                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6849                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6850                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6851                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6852                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6853                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6854                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6855                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6856                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6857                 </links>
6858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6859                         <actions>
6860                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6861                         </actions>
6862                 </permacrud>
6863         </class>
6864         <class id="ahopl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_on_pull_list" reporter:label="Hold On Pull List" oils_persist:readonly="true">
6865                 <oils_persist:source_definition><![CDATA[
6866                 SELECT
6867                         ahr.*,
6868                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6869                                 copy_location_order_position,
6870                         CASE WHEN au.alias IS NOT NULL THEN
6871                                 au.alias
6872                         ELSE
6873                                 au.first_given_name
6874                         END AS usr_alias_or_first_given_name,
6875                         au.first_given_name AS usr_first_given_name,
6876                         au.second_given_name AS usr_second_given_name,
6877                         au.family_name AS usr_family_name,
6878                         au.prefix AS usr_prefix,
6879                         au.suffix AS usr_suffix,
6880                         au.alias AS usr_alias,
6881                         CASE WHEN au.alias IS NOT NULL THEN
6882                                 au.alias
6883                         ELSE
6884                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6885                                         COALESCE(au.family_name, ''),
6886                                         COALESCE(au.suffix, ''),
6887                                         ', ',
6888                                         COALESCE(au.prefix, ''),
6889                                         COALESCE(au.first_given_name, ''),
6890                                         COALESCE(au.second_given_name, '')
6891                                 ], ' '), E'\\s+,', ',')
6892                         END AS usr_alias_or_display_name,
6893                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6894                                 COALESCE(au.family_name, ''),
6895                                 COALESCE(au.suffix, ''),
6896                                 ', ',
6897                                 COALESCE(au.prefix, ''),
6898                                 COALESCE(au.first_given_name, ''),
6899                                 COALESCE(au.second_given_name, '')
6900                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6901                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6902                                 AS call_number_label,
6903                         siss.label AS issuance_label,
6904                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6905                         ahcm_1.copy_count AS potential_copies
6906                 FROM action.hold_request ahr
6907                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6908                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6909                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6910                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6911                 JOIN actor.usr au ON (au.id = ahr.usr)
6912                 JOIN (
6913                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6914                         FROM asset.copy_location
6915                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6916                 LEFT JOIN actor.usr_standing_penalty ausp 
6917                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6918                 LEFT JOIN config.standing_penalty csp
6919                         ON (
6920                                 csp.id = ausp.standing_penalty AND 
6921                                 csp.block_list LIKE '%CAPTURE%' AND (
6922                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6923                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6924                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6925                                         )
6926                                 )
6927                         )
6928                 JOIN (
6929                         SELECT COUNT(target_copy) AS copy_count, hold
6930                         FROM action.hold_copy_map
6931                         GROUP BY 2
6932                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6933                 LEFT JOIN serial.issuance siss
6934                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6935                 LEFT JOIN asset.copy_location_order acplo
6936                         ON (acp.location = acplo.location AND
6937                                 acp.circ_lib = acplo.org)
6938                 WHERE
6939                         ahr.capture_time IS NULL AND
6940                         ahr.cancel_time IS NULL AND
6941                         csp.id IS NULL AND
6942                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6943                         acp.status IN (0,7)
6944                 ]]></oils_persist:source_definition>
6945                 <fields oils_persist:primary="id">
6946                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6947                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6948                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6949                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6950                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6951                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6952                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6953                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6954                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6955                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6956                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6957                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6958                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6959                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6960                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6961                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6962                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6963                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6964                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6965                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6966                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6967                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6968                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6969                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6970                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6971                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6972                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6973                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6974                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6975                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6976                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6977                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6978                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6979                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6980                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6981                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6982                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6983                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6984                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6985                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6986                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6987                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6988                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6989                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6990                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6991                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6992                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6993                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6994                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6995                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6996                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6997                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6998                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6999                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
7000                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
7001                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7002                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7003                 </fields>
7004                 <links>
7005                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7006                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7007                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7008                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7009                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7010                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7011                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7012                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7013                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7014                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7015                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7016                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7017                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7018                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7019                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7020                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
7021                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7022                 </links>
7023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7024                         <actions>
7025                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7026                         </actions>
7027                 </permacrud>
7028         </class>
7029         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
7030                 <oils_persist:source_definition><![CDATA[
7031                         SELECT ahr.* FROM action.hold_request ahr JOIN (SELECT current_copy, MAX(capture_time) AS capture_time FROM action.hold_request WHERE capture_time IS NOT NULL AND current_copy IS NOT NULL AND fulfillment_time IS NULL GROUP BY current_copy)x USING (current_copy, capture_time)
7032                 ]]></oils_persist:source_definition>
7033                 <fields oils_persist:primary="id">
7034                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7035                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
7036                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7037                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7038                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7039                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7040                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7041                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7042                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7043                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7044                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7045                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7046                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
7047                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7048                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7049                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7050                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7051                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
7052                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7053                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7054                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7055                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
7056                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7057                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
7058                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
7059                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7060                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7061                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7062                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7063                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7064                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7065                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7066                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7067                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7068                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7069                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7070                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7071                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7072                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7073                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7074                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7075                 </fields>
7076                 <links>
7077                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7078                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7079                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7080                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7081                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7082                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7083                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7084                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7085                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7086                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7087                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7088                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7089                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7090                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7091                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7092                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7093                 </links>
7094         </class>
7095
7096         <class id="ahrn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_note" oils_persist:tablename="action.hold_request_note" reporter:label="Hold Request Note">
7097                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7098                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7099                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7100                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7101                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7102                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7103                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7104                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7105                 </fields>
7106                 <links>
7107                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7108                 </links>
7109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7110                         <actions>
7111                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7112                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7113                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7114                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7115                         </actions>
7116                 </permacrud>
7117         </class>
7118         <class id="combahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_hold_request" oils_persist:tablename="action.all_hold_request" reporter:core="true" reporter:label="Combined (Active &amp; Aged) Hold Request">
7119                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7120                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7121                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7122                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7123                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7124                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7125                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7126                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7127                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7128                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7129                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7130                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7131                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7132                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7133                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7134                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7135                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7136                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7137                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7138                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7139                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7140                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7141                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7142                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7143                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7144                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7145                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7146                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7147                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7148                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7149                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7150                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7151                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7152                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7153                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7154                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7155                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7156                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7157                 </fields>
7158                 <links>
7159                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7160                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7161                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7162                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7163                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7164                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7165                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7166                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7167                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7168                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7169                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7170                 </links>
7171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7172                         <actions>
7173                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7174                         </actions>
7175                 </permacrud>
7176         </class>
7177         <class id="aahr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::aged_hold_request" oils_persist:tablename="action.aged_hold_request" reporter:core="true" reporter:label="Aged Hold Request">
7178                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7179                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7180                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7181                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7182                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7183                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7184                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7185                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7186                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7187                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7188                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7189                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7190                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7191                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7192                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7193                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7194                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7195                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7196                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7197                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7198                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7199                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7200                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7201                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7202                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7203                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7204                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7205                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7207                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7208                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7209                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7210                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7211                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7212                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7213                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7214                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7215                 </fields>
7216                 <links>
7217                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7218                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7219                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7220                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7221                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7222                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7223                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7224                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7225                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7226                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7227                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7228                 </links>
7229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7230                         <actions>
7231                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7232                         </actions>
7233                 </permacrud>
7234         </class>
7235
7236         <class id="aou" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit" oils_persist:tablename="actor.org_unit" reporter:label="Organizational Unit" oils_persist:field_safe="true">
7237                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7238                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7239                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7240                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7241                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7242                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7243                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7244                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7245                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7246                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7247                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7248                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7249                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7250                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7251                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7252                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7253                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7254                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7255                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7256                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7257                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7258                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7259                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7260                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7261                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7262                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7263                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7264                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7265                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7266                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7267                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7268                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7269                 </fields>
7270                 <links>
7271                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7272                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7273                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7274                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7275                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7276                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7277                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7278                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7279                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7280                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7281                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7282                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7283                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7284                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7285                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7286                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7287                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7288                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7289                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7290                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7291                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7292                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7293                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7294                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7295                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7296                 </links>
7297         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7298             <actions>
7299                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7300                 <retrieve />
7301                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7302                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7303             </actions>
7304         </permacrud>
7305         </class>
7306         <class id="aouct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree" oils_persist:tablename="actor.org_unit_custom_tree" reporter:label="Org Unit Custom Tree">
7307                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7308                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7309                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7310                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7311                 </fields>
7312                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7313                         <actions>
7314                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7315                                 <retrieve/>
7316                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7317                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7318                         </actions>
7319                 </permacrud>
7320         </class>
7321         <class id="aouctn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree_node" oils_persist:tablename="actor.org_unit_custom_tree_node" reporter:label="Org Unit Custom Tree Node">
7322                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7323                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7324                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7325                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7326                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7327                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7328                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7329                 </fields>
7330                 <links>
7331                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7332                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7333                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7334                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7335                 </links>
7336                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7337                         <actions>
7338                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7339                                 <retrieve/>
7340                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7341                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7342                         </actions>
7343                 </permacrud>
7344         </class>
7345         <class id="ccnb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
7346                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7347                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7348                         <field name="btype" reporter:datatype="text"/>
7349                         <field name="id" reporter:datatype="id" />
7350                         <field name="name"  reporter:datatype="text"/>
7351                         <field name="description" reporter:datatype="text"/>
7352                         <field name="owner" reporter:datatype="link"/>
7353                         <field name="pub" reporter:datatype="bool"/>
7354                         <field name="create_time" reporter:datatype="timestamp" />
7355                         <field name="owning_lib" reporter:datatype="org_unit" />
7356                 </fields>
7357                 <links>
7358                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7359                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7360                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7361                 </links>
7362                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7363                         <actions>
7364                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7365                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7366                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7367                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7368                         </actions>
7369                 </permacrud>
7370         </class>
7371         <class id="ccnbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_note" oils_persist:tablename="container.call_number_bucket_note" reporter:label="Call Number Bucket Note">
7372                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7373                         <field name="id" reporter:datatype="id" />
7374                         <field name="bucket" reporter:datatype="link"/>
7375                         <field name="note" reporter:datatype="text" />
7376                 </fields>
7377                 <links>
7378                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7379                 </links>
7380         </class>
7381         <class id="asc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat" oils_persist:tablename="asset.stat_cat" reporter:label="Asset Statistical Category">
7382                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7383                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7384                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7385                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7386                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7387                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7388                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7389                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7390                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7391                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7392                 </fields>
7393                 <links>
7394                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7395                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7396                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7397                 </links>
7398                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7399                         <actions>
7400                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7401                         </actions>
7402                 </permacrud>
7403         </class>
7404         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7405                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7406                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7407                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7408                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7409                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7410                 </fields>
7411                 <links>
7412                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7413                 </links>
7414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7415                         <actions>
7416                                 <retrieve permission="VIEW_USER user_request.view">
7417                                         <context link="usr" field="home_ou" />
7418                                 </retrieve>
7419                         </actions>
7420                 </permacrud>
7421         </class>
7422     <class id="actscsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat_sip_fields" oils_persist:tablename="actor.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
7423         <fields oils_persist:primary="field">
7424             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7425             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7426             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7427         </fields>
7428         <links/>
7429         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7430             <actions>
7431                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7432                 <retrieve />
7433                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7434                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7435             </actions>
7436         </permacrud>
7437     </class>
7438         <class id="actsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
7439                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7440                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7441                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7442                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7443                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7444                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7445                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7446                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7447                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7448                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7449                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7450                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7451                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
7452                 </fields>
7453                 <links>
7454                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7455                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
7456                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7457                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7458                 </links>
7459         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7460             <actions>
7461                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7462                 <retrieve />
7463                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7464                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7465             </actions>
7466         </permacrud>
7467         </class>
7468         <class id="msefe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::series_field_entry" oils_persist:tablename="metabib.series_field_entry" reporter:label="Series Field Entry">
7469                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7470                         <field name="field" reporter:datatype="link"/>
7471                         <field name="id" reporter:datatype="id" />
7472                         <field name="source" reporter:datatype="link"/>
7473                         <field name="value"  reporter:datatype="text"/>
7474                 </fields>
7475                 <links>
7476                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7477                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7478                 </links>
7479         </class>
7480         <class id="cub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
7481                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7482                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7483                         <field name="btype" reporter:datatype="text"/>
7484                         <field name="id" reporter:datatype="id" />
7485                         <field name="name"  reporter:datatype="text"/>
7486                         <field name="description" reporter:datatype="text"/>
7487                         <field name="owner" reporter:datatype="link"/>
7488                         <field name="pub" reporter:datatype="bool"/>
7489                         <field name="create_time" reporter:datatype="timestamp" />
7490                         <field name="owning_lib" reporter:datatype="org_unit" />
7491                 </fields>
7492                 <links>
7493                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7494                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7495                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7496                 </links>
7497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7498                         <actions>
7499                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7500                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7501                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7502                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7503                         </actions>
7504                 </permacrud>
7505         </class>
7506         <class id="cubn" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_note" oils_persist:tablename="container.user_bucket_note" reporter:label="User Bucket Note">
7507                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7508                         <field name="id" reporter:datatype="id" />
7509                         <field name="bucket" reporter:datatype="link"/>
7510                         <field name="note" reporter:datatype="text" />
7511                 </fields>
7512                 <links>
7513                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7514                 </links>
7515         </class>
7516         <class id="mcrp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::credit_payment" oils_persist:tablename="money.credit_payment" reporter:label="House Credit Payment">
7517                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7518                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7519                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7520                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7521                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7522                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7523                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7524                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7525                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7526                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7527                 </fields>
7528                 <links>
7529                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7530                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7531                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7532                 </links>
7533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7534             <actions>
7535                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7536                     <context link="xact" jump="usr" field="home_ou"/>
7537                 </retrieve>
7538                         </actions>
7539                 </permacrud>
7540         </class>
7541         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7542                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7543                         <field name="id" reporter:datatype="id" />
7544                         <field name="ind1" />
7545                         <field name="ind2" />
7546                         <field name="record" />
7547                         <field name="subfield" />
7548                         <field name="tag" />
7549                         <field name="value" />
7550                 </fields>
7551                 <links>
7552                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7553                 </links>
7554         </class>
7555         <class id="aalink" controller="open-ils.cstore" oils_obj:fieldmapper="authority::authority_linking" oils_persist:tablename="authority.authority_linking" reporter:label="Authority to Authority Linking">
7556                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7557                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7558                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7559                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7560                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7561                 </fields>
7562                 <links>
7563                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7564                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7565                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7566                 </links>
7567         </class>
7568         <class id="cnct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::non_cataloged_type" oils_persist:tablename="config.non_cataloged_type" reporter:label="Non-cataloged Type">
7569                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7570                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7571                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7572                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7573                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7574                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7575                 </fields>
7576                 <links>
7577                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7578                 </links>
7579         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7580             <actions>
7581                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7582                 <retrieve/>
7583                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7584                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7585             </actions>
7586         </permacrud>
7587
7588         </class>
7589         <class id="aout" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_type" oils_persist:tablename="actor.org_unit_type" reporter:label="Organizational Unit Type" oils_persist:field_safe="true">
7590                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7591                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7592                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7593                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7594                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7595                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7596                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7597                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7598                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7599                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7600                 </fields>
7601                 <links>
7602                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7603                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7604                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7605                 </links>
7606         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7607             <actions>
7608                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7609                 <retrieve/>
7610                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7611                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7612             </actions>
7613         </permacrud>
7614         </class>
7615         <class id="bren" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note" oils_persist:field_safe="true">
7616                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7617                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7618                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7619                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7620                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7621                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7622                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7623                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7624                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7625                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7626                 </fields>
7627                 <links>
7628                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7629                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7630                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7631                 </links>
7632                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7633                 <actions>
7634                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7635                     <retrieve/>
7636                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7637                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7638                 </actions>
7639              </permacrud>
7640         </class>
7641         <class id="mucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_circulation_summary" oils_persist:tablename="money.usr_circulation_summary" reporter:label="User Circulation Summary">
7642                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7643                         <field name="balance_owed" reporter:datatype="money" />
7644                         <field name="total_owed" reporter:datatype="money" />
7645                         <field name="total_paid" reporter:datatype="money" />
7646                         <field name="usr" reporter:datatype="link"/>
7647                 </fields>
7648                 <links>
7649                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7650                 </links>
7651         </class>
7652     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7653                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7654                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7655                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7656                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7657                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7658                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7659                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7660                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7661                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7662                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7663                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7664                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7665                 </fields>
7666                 <links>
7667                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7668                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7669                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7670                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7671                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7672                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7673                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7674                 </links>
7675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7676             <actions>
7677                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7678             </actions>
7679         </permacrud>
7680         </class>
7681         <class id="cbs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::bib_source" oils_persist:tablename="config.bib_source" reporter:label="Bib Source">
7682                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7683                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7684                         <field name="quality" reporter:datatype="int" />
7685                         <field name="source" reporter:datatype="text"/>
7686                         <field name="transcendant" reporter:datatype="bool"/>
7687                         <field name="can_have_copies" reporter:datatype="bool"/>
7688                 </fields>
7689                 <links/>
7690         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7691             <actions>
7692                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7693                 <retrieve/>
7694                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7695                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7696             </actions>
7697         </permacrud>
7698         </class>
7699         <class id="mbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction" oils_persist:tablename="money.billable_xact" reporter:label="Billable Transaction">
7700                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7701                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7702                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7703                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7704                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7705                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7706                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7707                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7708                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7709                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7710                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7711                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7712                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7713                 </fields>
7714                 <links>
7715                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7716                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7717                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7718                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7719                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7720                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7721                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7722                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7723                 </links>
7724                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7725                         <actions>
7726                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7727                                         <context link="usr" field="home_ou" />
7728                                 </retrieve>
7729                         </actions>
7730                 </permacrud>
7731         </class>
7732         <class id="actsce" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry" oils_persist:tablename="actor.stat_cat_entry" reporter:label="User Stat Cat Entry">
7733                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7734                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7735                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7736                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7737                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7738                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7739                 </fields>
7740                 <links>
7741                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7742                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7743                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7744                 </links>
7745         </class>
7746         <class id="actsced" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_default" oils_persist:tablename="actor.stat_cat_entry_default" reporter:label="User Stat Cat Default Entry">
7747                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7748                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7749                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7750                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7751                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7752                 </fields>
7753                 <links>
7754                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7755                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7756                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7757                 </links>
7758         </class>
7759         <class id="cubi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
7760                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7761                         <field name="bucket" reporter:datatype="link"/>
7762                         <field name="id" reporter:datatype="id" />
7763                         <field name="target_user" reporter:datatype="link"/>
7764                         <field name="create_time" reporter:datatype="timestamp" />
7765                         <field name="pos" reporter:datatype="int" />
7766                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7767                 </fields>
7768                 <links>
7769                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7770                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7771             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7772                 </links>
7773                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7774                         <actions>
7775                                 <retrieve permission="ADMIN_USER_BUCKET">
7776                     <context link="bucket" field="owning_lib"/>
7777                 </retrieve>
7778             </actions>
7779         </permacrud>
7780         </class>
7781         <class id="abhe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event" oils_persist:tablename="action.batch_hold_event" reporter:label="Hold Group Event">
7782                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7783                         <field name="id" reporter:datatype="id" />
7784                         <field name="staff" reporter:datatype="link"/>
7785                         <field name="bucket" reporter:datatype="link"/>
7786                         <field name="target" reporter:datatype="int" />
7787                         <field name="hold_type" reporter:datatype="text" />
7788                         <field name="run_date" reporter:datatype="timestamp" />
7789                         <field name="cancelled" reporter:datatype="timestamp" />
7790                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7791                 </fields>
7792                 <links>
7793                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7794                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7795                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7796                 </links>
7797                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7798                         <actions>
7799                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7800                 <retrieve/>
7801                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7802                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7803             </actions>
7804         </permacrud>
7805         </class>
7806         <class id="abhem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::batch_hold_event_map" oils_persist:tablename="action.batch_hold_event_map" reporter:label="Hold Group Event Map">
7807                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7808                         <field name="id" reporter:datatype="id" />
7809                         <field name="batch_hold_event" reporter:datatype="link"/>
7810                         <field name="hold" reporter:datatype="link"/>
7811                 </fields>
7812                 <links>
7813                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7814                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7815                 </links>
7816                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7817                         <actions>
7818                 <retrieve/>
7819             </actions>
7820         </permacrud>
7821         </class>
7822         <class id="cubin" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_item_note" oils_persist:tablename="container.user_bucket_item_note" reporter:label="User Bucket Item Note">
7823                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7824                         <field name="id" reporter:datatype="id" />
7825                         <field name="item" reporter:datatype="link"/>
7826                         <field name="note" reporter:datatype="text" />
7827                 </fields>
7828                 <links>
7829                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7830                 </links>
7831         </class>
7832         <class id="mus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7833                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7834                         <field name="balance_owed" reporter:datatype="money" />
7835                         <field name="total_owed" reporter:datatype="money" />
7836                         <field name="total_paid" reporter:datatype="money" />
7837                         <field name="usr" reporter:datatype="link"/>
7838                 </fields>
7839                 <links>
7840                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7841                 </links>
7842                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7843                         <actions>
7844                                 <retrieve permission="VIEW_USER">
7845                                         <context link="usr" field="home_ou"/>
7846                                 </retrieve>
7847                         </actions>
7848                 </permacrud>
7849         </class>
7850         <class id="clfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::lit_form_map" oils_persist:tablename="config.lit_form_map" reporter:label="Literary Form" oils_persist:field_safe="true">
7851                 <fields oils_persist:primary="code" oils_persist:sequence="">
7852                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7853                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7854                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7855                 </fields>
7856                 <links/>
7857         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7858             <actions>
7859                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7860                 <retrieve/>
7861                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7862                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7863             </actions>
7864         </permacrud>
7865         </class>
7866         <class id="mwp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::work_payment" oils_persist:tablename="money.work_payment" reporter:label="Work Payment">
7867                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7868                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7869                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7870                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7871                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7872                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7873                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7874                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7875                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7876                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7877                 </fields>
7878                 <links>
7879                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7880                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7881                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7882                 </links>
7883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7884             <actions>
7885                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7886                     <context link="xact" jump="usr" field="home_ou"/>
7887                 </retrieve>
7888                         </actions>
7889                 </permacrud>
7890         </class>
7891         <class id="mgp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::goods_payment" oils_persist:tablename="money.goods_payment" reporter:label="Goods Payment">
7892                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7893                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7894                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7895                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7896                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7897                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7898                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7899                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7900                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7901                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7902                 </fields>
7903                 <links>
7904                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7905                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7906                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7907                 </links>
7908         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7909             <actions>
7910                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7911                     <context link="xact" jump="usr" field="home_ou"/>
7912                 </retrieve>
7913                         </actions>
7914                 </permacrud>
7915         </class>
7916         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7917                 <fields oils_persist:primary="id" oils_persist:sequence="">
7918                         <field name="checkin_lib" reporter:datatype="link"/>
7919                         <field name="checkin_staff" reporter:datatype="link"/>
7920                         <field name="checkin_time" reporter:datatype="timestamp"/>
7921                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7922                         <field name="circ_staff" reporter:datatype="link"/>
7923                         <field name="desk_renewal" reporter:datatype="bool"/>
7924                         <field name="due_date" reporter:datatype="timestamp"/>
7925                         <field name="duration" reporter:datatype="interval"/>
7926                         <field name="duration_rule" reporter:datatype="link"/>
7927                         <field name="fine_interval" reporter:datatype="interval"/>
7928                         <field name="id" reporter:datatype="id" />
7929                         <field name="max_fine" reporter:datatype="money" />
7930                         <field name="max_fine_rule" reporter:datatype="link"/>
7931                         <field name="opac_renewal" reporter:datatype="bool"/>
7932                         <field name="phone_renewal" reporter:datatype="bool"/>
7933                         <field name="recurring_fine" reporter:datatype="money" />
7934                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7935                         <field name="renewal_remaining" reporter:datatype="int" />
7936             <field name="grace_period" reporter:datatype="interval" />
7937                         <field name="stop_fines" reporter:datatype="text"/>
7938                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7939                         <field name="target_copy" reporter:datatype="link"/>
7940                         <field name="usr" reporter:datatype="link"/>
7941                         <field name="xact_finish" reporter:datatype="timestamp" />
7942                         <field name="xact_start" reporter:datatype="timestamp" />
7943                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7944                         <field name="auto_renewal" reporter:datatype="bool"/>
7945                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7946                 </fields>
7947                 <links>
7948                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7949                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7950                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7951                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7952                 </links>
7953         </class>
7954         <class id="msfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::subject_field_entry" oils_persist:tablename="metabib.subject_field_entry" reporter:label="Subject Field Entry">
7955                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7956                         <field name="field" reporter:datatype="link"/>
7957                         <field name="id" reporter:datatype="id" />
7958                         <field name="source" reporter:datatype="link"/>
7959                         <field name="value" reporter:datatype="text"/>
7960                 </fields>
7961                 <links>
7962                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7963                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7964                 </links>
7965         </class>
7966         <class id="crrf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::recurring_fine" oils_persist:tablename="config.rule_recurring_fine" reporter:label="Recurring Fine Rule">
7967                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7968                         <field name="high" reporter:datatype="money" />
7969                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7970                         <field name="low" reporter:datatype="money" />
7971                         <field name="name" reporter:datatype="text"/>
7972                         <field name="normal" reporter:datatype="money" />
7973                         <field name="recurrence_interval" reporter:datatype="interval"/>
7974             <field name="grace_period" reporter:datatype="interval" />
7975                 </fields>
7976                 <links/>
7977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7978             <actions>
7979                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7980                 <retrieve/>
7981                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7982                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7983             </actions>
7984         </permacrud>
7985         </class>
7986         <class id="mckp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::check_payment" oils_persist:tablename="money.check_payment" reporter:label="Check Payment">
7987                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7988                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7989                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7990                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7991                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7992                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7993                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7994                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7995                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7996                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7997                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7998                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7999                 </fields>
8000                 <links>
8001                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8002                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8003                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8004                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8005                 </links>
8006         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8007             <actions>
8008                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8009                     <context link="xact" jump="usr" field="home_ou"/>
8010                 </retrieve>
8011                         </actions>
8012                 </permacrud>
8013         </class>
8014         <class id="mdcp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::debit_card_payment" oils_persist:tablename="money.debit_card_payment" reporter:label="Debit Card Payment">
8015                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8016                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
8017                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8018                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
8019                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
8020                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8021                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8022                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
8023                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
8024                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
8025                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
8026                 </fields>
8027                 <links>
8028                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
8029                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8030                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8031                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8032                 </links>
8033         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8034             <actions>
8035                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8036                     <context link="xact" jump="usr" field="home_ou"/>
8037                 </retrieve>
8038                         </actions>
8039                 </permacrud>
8040         </class>
8041         <class id="acp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy" oils_persist:tablename="asset.copy" reporter:core="true" reporter:label="Item">
8042                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
8043                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
8044                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8045                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
8046                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
8047                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
8048                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8049                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
8050                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
8051                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
8052                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
8053                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
8054                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
8055                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
8056                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
8057                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
8058                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
8059                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
8060                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
8061                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
8062                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
8063                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8064                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
8065                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
8066                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8067                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8068                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8069                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8070                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8071                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8072                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8073                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8074                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8075                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8076                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8077                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8078                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8079                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8080                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8081                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8082                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8083                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8084                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8085                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8086                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8087                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8088                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8089                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8090                         <field reporter:label="Copy Inventory" name="copy_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8091                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8092                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8093                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8094                 </fields>
8095                 <links>
8096                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8097                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8098                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8099                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8100                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8101                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8102                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8103                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8104                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8105                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8106                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8107                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8108                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8109                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8110                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8111                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8112                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8113                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8114                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8115                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8116                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8117                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8118                         <link field="copy_inventory" reltype="might_have" key="copy" map="" class="aci"/>
8119                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8120                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8121                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8122                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8123                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8124                 </links>
8125         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8126             <actions>
8127                 <create permission="CREATE_COPY">
8128                     <context link="call_number" field="owning_lib"/>
8129                 </create>
8130                 <retrieve/>
8131                 <update permission="UPDATE_COPY">
8132                     <context link="call_number" field="owning_lib"/>
8133                 </update>
8134                 <delete permission="DELETE_COPY">
8135                     <context link="call_number" field="owning_lib"/>
8136                 </delete>
8137             </actions>
8138         </permacrud>
8139         </class>
8140
8141         <class id="aci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_inventory" oils_persist:tablename="asset.copy_inventory" reporter:core="true" reporter:label="Copy Inventory">
8142                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8143                         <field reporter:label="Copy Inventory ID" name="id" reporter:datatype="id"/>
8144                         <field reporter:label="Copy Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8145                         <field reporter:label="Copy Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8146                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8147                 </fields>
8148                 <links>
8149                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8150                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8151                 </links>
8152                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8153                         <actions>
8154                 <create permission="STAFF_LOGIN"/>
8155                 <retrieve/>
8156                 <update permission="STAFF_LOGIN"/>
8157                 <delete permission="STAFF_LOGIN"/>
8158                         </actions>
8159                 </permacrud>
8160         </class>
8161
8162         <class id="alci" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::latest_inventory" oils_persist:tablename="asset.latest_inventory" reporter:core="true" reporter:label="Latest Inventory" oils_persist:readonly="true">
8163                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_inventory_id_seq">
8164             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8165                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8166                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8167                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8168                 </fields>
8169                 <links>
8170                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8171                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8172                 </links>
8173         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8174             <actions>
8175                                 <retrieve/>
8176             </actions>
8177         </permacrud>
8178         </class>
8179
8180         <class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
8181                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8182                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8183                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8184                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8185                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8186                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8187                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8188                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8189                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8190                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8191                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8192                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8193                 </fields>
8194                 <links>
8195                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8196                 </links>
8197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8198             <actions>
8199                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8200                 <retrieve/>
8201                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8202                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8203             </actions>
8204         </permacrud>
8205         </class>
8206
8207         <class id="acas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::copy_alert_suppress" oils_persist:tablename="actor.copy_alert_suppress" reporter:label="Item Alert Suppression">
8208                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8209                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8210                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8211                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8212                 </fields>
8213                 <links>
8214                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8215                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8216                 </links>
8217         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8218             <actions>
8219                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8220                 <retrieve/>
8221                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8222                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8223             </actions>
8224         </permacrud>
8225         </class>
8226
8227         <class id="aca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_alert" oils_persist:tablename="asset.copy_alert" reporter:label="Copy Alert">
8228                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8229                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8230                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8231                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8232                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8233                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8234                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8235                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8236                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8237                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8238                 </fields>
8239                 <links>
8240                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8241                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8242                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8243                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8244                 </links>
8245         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8246             <actions>
8247                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8248                     <context link="copy" field="circ_lib"/>
8249                 </create>
8250                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8251                     <context link="copy" field="circ_lib"/>
8252                                 </retrieve>
8253                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8254                     <context link="copy" field="circ_lib"/>
8255                                 </update>
8256                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8257                     <context link="copy" field="circ_lib"/>
8258                                 </delete>
8259             </actions>
8260         </permacrud>
8261         </class>
8262
8263         <class id="aaca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::active_copy_alert" oils_persist:tablename="asset.active_copy_alert" reporter:label="Active Copy Alert" oils_persist:readonly="true">
8264                 <fields oils_persist:primary="id">
8265                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8266                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8267                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8268                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8269                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8270                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8271                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8272                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8273                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8274                 </fields>
8275                 <links>
8276                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8277                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8278                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8279                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8280                 </links>
8281         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8282             <actions>
8283                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8284                     <context link="copy" field="circ_lib"/>
8285                 </create>
8286                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8287                     <context link="copy" field="circ_lib"/>
8288                                 </retrieve>
8289                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8290                     <context link="copy" field="circ_lib"/>
8291                                 </update>
8292                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8293                     <context link="copy" field="circ_lib"/>
8294                                 </delete>
8295             </actions>
8296         </permacrud>
8297         </class>
8298
8299         <class id="act" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_template" oils_persist:tablename="asset.copy_template" reporter:label="Asset Copy Template">
8300                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8301                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8302                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8303                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8304                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8305                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8306                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8307                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8308                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8309                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8310                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8311                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8312                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8313                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8314                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8315                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8316                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8317                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8318                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8319                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8320                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8321                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8322                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8323                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8324                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8325                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8326                 </fields>
8327                 <links>
8328                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8329                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8330                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8331                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8332                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8333                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8334                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8335                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8336                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8337                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8338                 </links>
8339                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8340                         <actions>
8341                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8342                                 <retrieve />
8343                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8344                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8345                         </actions>
8346                 </permacrud>
8347         </class>
8348
8349         <class id="crahp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::age_hold_protect" oils_persist:tablename="config.rule_age_hold_protect" reporter:label="Age Hold Protection Rule" oils_persist:field_safe="true">
8350                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8351                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8352                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8353                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8354                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8355                 </fields>
8356                 <links/>
8357         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8358             <actions>
8359                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8360                 <retrieve/>
8361                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8362                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8363             </actions>
8364         </permacrud>
8365         </class>
8366         <class id="crmf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::rules::max_fine" oils_persist:tablename="config.rule_max_fine" reporter:label="Max Fine Rule">
8367                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8368                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8369                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8370                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8371                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8372                 </fields>
8373                 <links/>
8374         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8375             <actions>
8376                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8377                 <retrieve/>
8378                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8379                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8380             </actions>
8381         </permacrud>
8382         </class>
8383         <class id="pgt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree" oils_persist:tablename="permission.grp_tree" reporter:label="Permission Group">
8384                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8385                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8386                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8387                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8388                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8389                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8390                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8391                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8392                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8393                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8394                 </fields>
8395                 <links>
8396                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8397                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8398                 </links>
8399         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8400             <actions>
8401                 <create permission="CREATE_PERM" global_required="true"/>
8402                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8403                 <update permission="UPDATE_PERM" global_required="true"/>
8404                 <delete permission="DELETE_PERM" global_required="true"/>
8405             </actions>
8406         </permacrud>
8407         </class>
8408         <class id="pgtde" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_tree_display_entry" oils_persist:tablename="permission.grp_tree_display_entry" reporter:label="Permission Group Tree Display Entry">
8409                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8410                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8411                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8412                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8413                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8414                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8415                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8416                 </fields>
8417                 <links>
8418                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8419                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8420                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8421                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8422                 </links>
8423                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8424                         <actions>
8425                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8426                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8427                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8428                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8429                         </actions>
8430                 </permacrud>
8431         </class>
8432         <class id="asva" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_answer" oils_persist:tablename="action.survey_answer" reporter:label="Survey Answer">
8433                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8434                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8435                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8436                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8437                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8438                 </fields>
8439                 <links>
8440                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8441                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8442                 </links>
8443         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8444             <actions>
8445                 <create permission="ADMIN_SURVEY">
8446                     <context link="question" jump="survey" field="owner"/>
8447                 </create>
8448                 <retrieve/>
8449                 <update permission="ADMIN_SURVEY">
8450                     <context link="question" jump="survey" field="owner"/>
8451                 </update>
8452                 <delete permission="ADMIN_SURVEY">
8453                     <context link="question" jump="survey" field="owner"/>
8454                 </delete>
8455             </actions>
8456         </permacrud>
8457         </class>
8458         <class id="ancc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cataloged_circulation" oils_persist:tablename="action.non_cataloged_circulation" reporter:core="true" reporter:label="Non-cataloged Circulation">
8459                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8460                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8461                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8462                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8463                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8464                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8465                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8466                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8467                 </fields>
8468                 <links>
8469                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8470                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8471                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8472                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8473                 </links>
8474                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8475                         <actions>
8476                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8477                         </actions>
8478                 </permacrud>
8479         </class>
8480         <class id="moucs" controller="open-ils.cstore" oils_obj:fieldmapper="money::open_user_circulation_summary" oils_persist:tablename="money.open_usr_circulation_summary" reporter:label="Open User Circulation Summary">
8481                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8482                         <field name="balance_owed" reporter:datatype="money" />
8483                         <field name="total_owed" reporter:datatype="money" />
8484                         <field name="total_paid" reporter:datatype="money" />
8485                         <field name="usr" reporter:datatype="link"/>
8486                 </fields>
8487                 <links>
8488                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8489                 </links>
8490         </class>
8491         <class id="aufh" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_list" oils_persist:tablename="action.unfulfilled_hold_list" reporter:label="Unfulfilled Hold Targets">
8492                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8493                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8494                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8495                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8496                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8497                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8498                 </fields>
8499                 <links>
8500                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8501                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8502                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8503                 </links>
8504         </class>
8505         <class id="mife" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::identifier_field_entry" oils_persist:tablename="metabib.identifier_field_entry" reporter:label="Identifier Field Entry">
8506                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8507                         <field name="field" reporter:datatype="link"/>
8508                         <field name="id" reporter:datatype="id" />
8509                         <field name="source" reporter:datatype="link"/>
8510                         <field name="value" reporter:datatype="text"/>
8511                 </fields>
8512                 <links>
8513                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8514                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8515                 </links>
8516         </class>
8517         <class id="mtfe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::title_field_entry" oils_persist:tablename="metabib.title_field_entry" reporter:label="Title Field Entry">
8518                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8519                         <field name="field" reporter:datatype="link"/>
8520                         <field name="id" reporter:datatype="id" />
8521                         <field name="source" reporter:datatype="link"/>
8522                         <field name="value" reporter:datatype="text"/>
8523                 </fields>
8524                 <links>
8525                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8526                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8527                 </links>
8528         </class>
8529         <class id="actscecm" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat_entry_user_map" oils_persist:tablename="actor.stat_cat_entry_usr_map"  reporter:label="User Statistical Category Entry">
8530                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8531                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8532                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8533                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8534                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8535                 </fields>
8536                 <links>
8537                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8538                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8539                 </links>
8540         </class>
8541         <class id="pgpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="permission::grp_perm_map" oils_persist:tablename="permission.grp_perm_map" reporter:label="Group Permission Map">
8542                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8543                         <field name="depth" reporter:datatype="int" />
8544                         <field name="grantable" reporter:datatype="bool"/>
8545                         <field name="grp" reporter:datatype="link"/>
8546                         <field name="id" reporter:datatype="id" />
8547                         <field name="perm" reporter:datatype="link"/>
8548                 </fields>
8549                 <links>
8550                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8551                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8552                 </links>
8553         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8554             <actions>
8555                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8556                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8557                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8558                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8559             </actions>
8560         </permacrud>
8561         </class>
8562         <class id="ccb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
8563                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8564                         <field name="items" oils_persist:virtual="true" />
8565                         <field name="btype" reporter:datatype="text"/>
8566                         <field name="id" reporter:datatype="id" />
8567                         <field name="name" reporter:datatype="text"/>
8568                         <field name="description" reporter:datatype="text"/>
8569                         <field name="owner" reporter:datatype="link"/>
8570                         <field name="pub" reporter:datatype="bool"/>
8571                         <field name="create_time" reporter:datatype="timestamp" />
8572                         <field name="owning_lib" reporter:datatype="org_unit" />
8573                 </fields>
8574                 <links>
8575                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8576                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8577                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8578                 </links>
8579                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8580                         <actions>
8581                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8582                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8583                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8584                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8585                         </actions>
8586                 </permacrud>
8587         </class>
8588         <class id="ccbn" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_note" oils_persist:tablename="container.copy_bucket_note" reporter:label="Copy Bucket Note">
8589                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8590                         <field name="id" reporter:datatype="id" />
8591                         <field name="bucket" reporter:datatype="link"/>
8592                         <field name="note" reporter:datatype="text" />
8593                 </fields>
8594                 <links>
8595                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8596                 </links>
8597         </class>
8598         <class id="puwoum" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_work_ou_map" oils_persist:tablename="permission.usr_work_ou_map" reporter:label="User Work Org Unit Map">
8599                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8600                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8601                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8602                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8603                 </fields>
8604                 <links>
8605                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8606                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8607                 </links>
8608         </class>
8609         <class id="pupm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_perm_map" oils_persist:tablename="permission.usr_perm_map" reporter:label="User Permission Map">
8610                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8611                         <field name="depth" reporter:datatype="int"/>
8612                         <field name="grantable" reporter:datatype="bool"/>
8613                         <field name="id" reporter:datatype="id" />
8614                         <field name="perm" reporter:datatype="link"/>
8615                         <field name="usr" reporter:datatype="link"/>
8616                 </fields>
8617                 <links>
8618                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8619                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8620                 </links>
8621         </class>
8622         <class id="puopm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_object_perm_map" oils_persist:tablename="permission.usr_object_perm_map" reporter:label="User Object Permission Map">
8623                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8624                         <field name="object_id" reporter:datatype="text"/>
8625                         <field name="grantable" reporter:datatype="bool"/>
8626                         <field name="id" reporter:datatype="id" />
8627                         <field name="perm" reporter:datatype="link"/>
8628                         <field name="usr" reporter:datatype="link"/>
8629                         <field name="object_type" reporter:datatype="text"/>
8630                 </fields>
8631                 <links>
8632                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8633                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8634                 </links>
8635         </class>
8636         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8637                 <fields oils_persist:primary="id" oils_persist:sequence="">
8638                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8639                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8640                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8641                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8642                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8643                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8644                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8645                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8646                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8647                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8648                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8649                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8650                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8651                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8652                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8653                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8654                 </fields>
8655                 <links>
8656                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8657                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8658                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8659                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8660                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8661                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8662                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8663                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8664                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8665                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8666                 </links>
8667         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8668             <actions>
8669                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8670                     <context link="xact" jump="usr" field="home_ou"/>
8671                 </retrieve>
8672                         </actions>
8673                 </permacrud>
8674         </class>
8675         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8676                 oils_obj:fieldmapper="money::aged_payment" 
8677                 oils_persist:tablename="money.aged_payment" 
8678                 reporter:label="Payments: Aged">
8679                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8680                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8681                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8682                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8683                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8684                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8685                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8686                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8687                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8688                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8689                         <field name="billing" reporter:datatype="link"/>
8690                 </fields>
8691                 <links>
8692                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8693                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8694                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8695                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8696                 </links>
8697                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8698                         <actions>
8699                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8700                                         <context link="xact" field="usr_home_ou"/>
8701                                 </retrieve>
8702                         </actions>
8703                 </permacrud>
8704         </class>
8705         <class id="mallp" controller="open-ils.cstore" 
8706                 oils_obj:fieldmapper="money::all_payments" 
8707                 oils_persist:tablename="money.all_payments" 
8708                 oils_persist:readonly="true" reporter:core="true"
8709                 reporter:label="Payments: All">
8710                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8711                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8712                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8713                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8714                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8715                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8716                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8717                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8718                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8719                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8720                         <field name="billing" reporter:datatype="link"/>
8721                 </fields>
8722                 <links>
8723                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8724                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8725                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8726                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8727                 </links>
8728         </class>
8729
8730         <class id="mbp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
8731                 <fields oils_persist:primary="id" oils_persist:sequence="">
8732                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8733                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8734                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8735                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8736                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8737                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8738                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8739                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8740                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8741                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8742                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8743                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8744                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8745                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8746                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8747                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8748                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8749                 </fields>
8750                 <links>
8751                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8752                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8753                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8754                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8755                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8756                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8757                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8758                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8759                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8760                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8761                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8762                 </links>
8763                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8764                         <actions>
8765                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8766                                         <context link="xact" jump="usr" field="home_ou"/>
8767                                 </retrieve>
8768                         </actions>
8769                 </permacrud>
8770         </class>
8771         <class id="mndp" controller="open-ils.reporter" oils_obj:fieldmapper="money::non_drawer_payment" oils_persist:tablename="money.non_drawer_payment_view" reporter:core="true" reporter:label="Payments: Non-drawer Staff">
8772                 <fields oils_persist:primary="id" oils_persist:sequence="">
8773                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8774                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8775                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8776                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8777                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8778                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8779                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8780                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8781                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8782                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8783                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8784                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8785                 </fields>
8786                 <links>
8787                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8788                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8789                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8790                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8791                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8792                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8793                 </links>
8794         </class>
8795         <class id="mdp" controller="open-ils.cstore" oils_obj:fieldmapper="money::desk_payment" oils_persist:tablename="money.desk_payment_view" reporter:core="true" reporter:label="Payments: Desk">
8796                 <fields oils_persist:primary="id" oils_persist:sequence="">
8797                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8798                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8799                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8800                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8801                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8802                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8803                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8804                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8805                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8806                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8807                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8808                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8809                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8810                 </fields>
8811                 <links>
8812                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8813                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8814                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8815                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8816                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8817                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8818                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8819                 </links>
8820         </class>
8821         <class id="cbrebi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item" oils_persist:tablename="container.biblio_record_entry_bucket_item" reporter:label="Biblio Record Entry Bucket Item">
8822                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8823                         <field name="bucket" reporter:datatype="link"/>
8824                         <field name="id" reporter:datatype="id" />
8825                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8826                         <field name="create_time" reporter:datatype="timestamp" />
8827                         <field name="pos" reporter:datatype="int" />
8828                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8829                 </fields>
8830                 <links>
8831                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8832                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8833             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8834                 </links>
8835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8836                         <actions>
8837                                 <retrieve permission="ADMIN_COPY_BUCKET">
8838                     <context link="bucket" field="owning_lib"/>
8839                 </retrieve>
8840             </actions>
8841         </permacrud>
8842         </class>
8843         <class id="cbrebin" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item_note" oils_persist:tablename="container.biblio_record_entry_bucket_item_note" reporter:label="Biblio Record Entry Bucket Item Note">
8844                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8845                         <field name="id" reporter:datatype="id" />
8846                         <field name="item" reporter:datatype="link"/>
8847                         <field name="note" reporter:datatype="text" />
8848                 </fields>
8849                 <links>
8850                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8851                 </links>
8852         </class>
8853         <class id="asce" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_entry" oils_persist:tablename="asset.stat_cat_entry" reporter:label="Item Stat Cat Entry">
8854                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8855                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8856                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8857                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8858                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8859                 </fields>
8860                 <links>
8861                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8862                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8863                 </links>
8864                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8865                         <actions>
8866                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8867                         </actions>
8868                 </permacrud>
8869         </class>
8870     <class id="ascsf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::stat_cat_sip_fields" oils_persist:tablename="asset.stat_cat_sip_fields" reporter:label="SIP Statistical Category Field Identifier">
8871         <fields oils_persist:primary="field">
8872             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8873             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8874             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8875         </fields>
8876         <links/>
8877         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8878             <actions>
8879                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8880                 <retrieve />
8881                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8882                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8883             </actions>
8884         </permacrud>
8885     </class>
8886         <class id="ahrcc" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="action::hold_request_cancel_cause" oils_persist:tablename="action.hold_request_cancel_cause" oils_persist:restrict_primary="100" reporter:label="Hold Request Cancel Cause">
8887                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8888                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8889                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8890                 </fields>
8891                 <links/>
8892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8893             <actions>
8894                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8895                 <retrieve/>
8896                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8897                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8898             </actions>
8899         </permacrud>
8900         </class>
8901
8902
8903         <class id="artc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::reservation_transit_copy" oils_persist:tablename="action.reservation_transit_copy" reporter:core="true" reporter:label="Reservation Transit">
8904                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8905                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8906                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8907                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8908                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8909                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8910                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8911                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8912                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8913                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8914                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8915                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8916                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8917                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8918                 </fields>
8919                 <links>
8920                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8921                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8922                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8923                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8924                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8925                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8926                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8927                 </links>
8928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8929             <actions>
8930                 <create permission="TRANSIT_COPY">
8931                     <context link="target_copy" field="owner"/>
8932                 </create>
8933                 <retrieve/>
8934                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8935                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8936             </actions>
8937         </permacrud>
8938         </class>
8939         <class id="ahtc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::hold_transit_copy" oils_persist:tablename="action.hold_transit_copy" reporter:core="true" reporter:label="Hold Transit">
8940                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8941                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8942                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8943                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8944                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8945                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8946                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8947                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8948                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8949                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8950                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8951                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8952                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8953                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8954                 </fields>
8955                 <links>
8956                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8957                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8958                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8959                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8960                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8961                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8962                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8963                 </links>
8964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8965             <actions>
8966                 <create permission="TRANSIT_COPY" context_field="owner">
8967                     <context link="target_copy" field="circ_lib"/>
8968                 </create>
8969                 <retrieve/>
8970                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8971                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8972             </actions>
8973         </permacrud>
8974         </class>
8975         <class id="mb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billing" oils_persist:tablename="money.billing" reporter:label="Billing Line Item">
8976                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8977                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8978                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8979                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8980                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8981                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8982                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8983                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8984                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8985                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8986                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8987                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8988                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8989                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8990                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8991                 </fields>
8992                 <links>
8993                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8994                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8995                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8996                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8997                 </links>
8998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8999             <actions>
9000                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9001                     <context link="xact" jump="usr" field="home_ou"/>
9002                 </retrieve>
9003                         </actions>
9004                 </permacrud>
9005         </class>
9006         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
9007                 oils_obj:fieldmapper="money::aged_billing" 
9008                 oils_persist:tablename="money.aged_billing" 
9009                 reporter:label="Aged Billing Line Item">
9010                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
9011                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9012                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9013                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9014                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9015                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9016                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9017                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9018                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9019                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9020                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9021                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9022                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9023                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9024                 </fields>
9025                 <links>
9026                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9027                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9028                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9029                 </links>
9030                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9031                         <actions>
9032                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
9033                                         <context link="xact" field="usr_home_ou"/>
9034                                 </retrieve>
9035                         </actions>
9036                 </permacrud>
9037         </class>
9038         <class id="mallb" controller="open-ils.cstore" 
9039                 oils_obj:fieldmapper="money::all_billings" 
9040                 oils_persist:tablename="money.all_billings" 
9041                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
9042                 <fields oils_persist:primary="id" oils_persist:sequence="">
9043                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9044                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
9045                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
9046                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
9047                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
9048                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
9049                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
9050                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9051                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
9052                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
9053                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
9054                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
9055                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
9056                 </fields>
9057                 <links>
9058                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
9059                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
9060                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
9061                 </links>
9062         </class>
9063         <class id="pugm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_grp_map" oils_persist:tablename="permission.usr_grp_map" reporter:label="User Group Map">
9064                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
9065                         <field name="grp" />
9066                         <field name="id" reporter:datatype="id" />
9067                         <field name="usr" />
9068                 </fields>
9069                 <links>
9070                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
9071                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9072                 </links>
9073         </class>
9074         <class id="i18n" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_core" oils_persist:tablename="config.i18n_core" oils_persist:field_safe="true" reporter:label="i18n Core">
9075                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
9076                         <field name="id" reporter:datatype="id" />
9077                         <field name="fq_field" reporter:datatype="text"/>
9078                         <field name="identity_value" reporter:datatype="text"/>
9079                         <field name="translation" reporter:datatype="text"/>
9080                         <field name="string" reporter:datatype="text"/>
9081                 </fields>
9082                 <links>
9083                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
9084                 </links>
9085         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9086             <actions>
9087                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9088                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9089                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9090                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9091             </actions>
9092         </permacrud>
9093         </class>
9094         <class id="fdoc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::idl_field_doc" oils_persist:tablename="config.idl_field_doc" oils_persist:field_safe="true" reporter:label="IDL Field Doc">
9095                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9096                         <field name="id"       reporter:label="ID" reporter:datatype="id" />
9097                         <field name="fm_class" reporter:label="Class" reporter:datatype="text" oils_obj:required="true"/>
9098                         <field name="field"    reporter:label="Field" reporter:datatype="text" oils_obj:required="true"/>
9099                         <field name="owner"    reporter:label="Field Documentation Owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9100                         <field name="string"   reporter:label="Field Documentation" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
9101                 </fields>
9102                 <links>
9103                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9104                 </links>
9105         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9106             <actions>
9107                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9108                 <retrieve/>
9109                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9110                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9111             </actions>
9112         </permacrud>
9113         </class>
9114         <class id="i18n_l" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::i18n_locale" oils_persist:tablename="config.i18n_locale" oils_persist:field_safe="true" reporter:label="Locale">
9115                 <fields oils_persist:primary="code">
9116                         <field name="code" reporter:datatype="id" />
9117                         <field name="marc_code" reporter:datatype="text"/>
9118                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9119                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9120                         <field name="rtl" reporter:datatype="bool"/>
9121                 </fields>
9122                 <links/>
9123         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9124             <actions>
9125                 <create permission="CREATE_LOCALE" global_required="true"/>
9126                 <retrieve/>
9127                 <update permission="UPDATE_LOCALE" global_required="true"/>
9128                 <delete permission="DELETE_LOCALE" global_required="true"/>
9129             </actions>
9130         </permacrud>
9131         </class>
9132         <class id="cbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::billing_type" oils_persist:tablename="config.billing_type" oils_persist:restrict_primary="100" reporter:label="Billing Type">
9133                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9134                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9135                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9136                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9137                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9138                 </fields>
9139                 <links>
9140                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9141                 </links>
9142         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9143             <actions>
9144                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9145                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9146                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9147                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9148             </actions>
9149         </permacrud>
9150         </class>
9151
9152         <class id="aurt" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_type" oils_persist:tablename="acq.user_request_type" reporter:label="User Purchase Request Type">
9153                 <fields oils_persist:primary="id">
9154                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9155                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9156                 </fields>
9157                 <links/>
9158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9159             <actions>
9160                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9161                 <retrieve/>
9162                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9163                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9164             </actions>
9165         </permacrud>
9166         </class>
9167
9168         <class id="aur" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request" oils_persist:tablename="acq.user_request" reporter:label="User Purchase Request">
9169                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9170                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9171                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9172                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9173                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9174                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9175                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9176                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9177                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9178                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9179                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9180                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9181                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9182                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9183                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9184                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9185                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9186                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9187                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9188                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9189                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9190                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9191                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9192                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9193                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9194                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9195                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9196                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9197                 </fields>
9198                 <links>
9199                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9200                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9201                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9202                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9203                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9204                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9205                 </links>
9206         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9207             <actions>
9208                 <create permission="user_request.create">
9209                     <context link="usr" field="home_ou"/>
9210                                 </create>
9211                 <retrieve permission="user_request.view">
9212                     <context link="usr" field="home_ou"/>
9213                                 </retrieve>
9214                 <update permission="user_request.update">
9215                     <context link="usr" field="home_ou"/>
9216                                 </update>
9217                 <delete permission="user_request.delete">
9218                     <context link="usr" field="home_ou"/>
9219                                 </delete>
9220             </actions>
9221         </permacrud>
9222         </class>
9223
9224         <class id="aurs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status" reporter:label="User Purchase Request with Status" oils_persist:readonly="true">
9225         <oils_persist:source_definition><![CDATA[
9226             SELECT r.*, CASE
9227                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9228                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9229                         WHEN l.state = 'received' THEN 5 -- Received
9230                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9231                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9232                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9233                         WHEN l.id IS NULL THEN 1 -- New
9234                         ELSE 0 -- Error
9235                     END AS request_status
9236                     ,u.home_ou
9237             FROM      acq.user_request r
9238             JOIN actor.usr u ON (r.usr = u.id)
9239             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9240             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9241             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9242         ]]></oils_persist:source_definition>
9243                 <fields oils_persist:primary="id">
9244                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9245                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9246                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9247                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9248                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9249                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9250                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9251                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9252                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9253                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9254                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9255                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9256                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9257                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9258                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9259                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9260                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9261                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9262                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9263                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9264                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9265                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9266                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9267                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9268                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9269                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9270                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9271                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9272                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9273                 </fields>
9274                 <links>
9275                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9276                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9277                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9278                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9279                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9280                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9281                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9282                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9283                 </links>
9284         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9285             <actions>
9286                 <retrieve permission="user_request.view">
9287                     <context link="usr" field="home_ou"/>
9288                                 </retrieve>
9289             </actions>
9290         </permacrud>
9291         </class>
9292
9293         <class id="aurst" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::user_request_status_type" oils_persist:tablename="acq.user_request_status_type" reporter:label="Acquisition Patron Request Status Type">
9294                 <fields oils_persist:primary="id">
9295                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9296                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9297                 </fields>
9298                 <links/>
9299         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9300             <actions>
9301                 <retrieve/>
9302             </actions>
9303         </permacrud>
9304         </class>
9305
9306         <class id="acqct" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::currency_type" oils_persist:tablename="acq.currency_type" reporter:label="Currency Type">
9307                 <fields oils_persist:primary="code">
9308                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9309                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9310                 </fields>
9311                 <links/>
9312         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9313             <actions>
9314                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9315                 <retrieve/>
9316                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9317                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9318             </actions>
9319         </permacrud>
9320         </class>
9321
9322         <class id="acqexr" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::exchange_rate" oils_persist:tablename="acq.exchange_rate" reporter:label="Exchange Rate">
9323                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9324                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9325                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9326                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9327                         <field reporter:label="Ratio" name="ratio" />
9328                 </fields>
9329                 <links>
9330                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9331                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9332                 </links>
9333                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9334                         <actions>
9335                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9336                                 <retrieve/>
9337                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9338                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9339                         </actions>
9340                 </permacrud>
9341         </class>
9342
9343         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9344                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9345                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9346                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9347                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9348                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9349                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9350                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9351                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9352                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9353                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9354                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9355                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9356                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9357                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9358                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9359                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9360                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9361                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9362                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9363                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9364                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9365                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9366                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9367                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9368                 </fields>
9369                 <links>
9370                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9371                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9372                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9373                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9374                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9375                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9376                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9377                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9378                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9379                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9380                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9381                 </links>
9382         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9383             <actions>
9384                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9385                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9386                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9387                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9388             </actions>
9389         </permacrud>
9390         </class>
9391
9392         <class id="acqpron" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::provider_note" oils_persist:tablename="acq.provider_note" reporter:label="Provider Note">
9393                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9394                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9395                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9396                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9397                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9398                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9399                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9400                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9401                 </fields>
9402                 <links>
9403                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9404                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9405                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9406                 </links>
9407         </class>
9408
9409         <class id="acqipm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_payment_method" oils_persist:tablename="acq.invoice_payment_method" reporter:label="Invoice Payment Method">
9410                 <fields oils_persist:primary="code">
9411                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9412                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9413                 </fields>
9414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9415             <actions>
9416                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9417                 <retrieve/>
9418                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9419                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9420             </actions>
9421                 </permacrud>
9422         </class>
9423
9424         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9425                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9426                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9427                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9428                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9429                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9430                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9431                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9432                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9433                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9434                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9435                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9436                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9437                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9438                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9439                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9440                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9441                 </fields>
9442                 <links>
9443                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9444                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9445                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9446                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9447                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9448                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9449                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9450                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9451                 </links>
9452         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9453             <actions>
9454                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9455                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9456                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9457                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9458             </actions>
9459         </permacrud>
9460         </class>
9461
9462         <class id="acqie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_entry" oils_persist:tablename="acq.invoice_entry" reporter:label="Invoice Entry">
9463                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9464                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9465                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9466                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9467                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9468                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9469                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9470                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9471                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9472                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9473                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9474                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9475                 </fields>
9476                 <links>
9477                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9478                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9479                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9480                 </links>
9481         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9482             <actions>
9483                 <create   permission="ADMIN_INVOICE">
9484                                         <context link="invoice" field="receiver"/>
9485                                 </create>
9486                 <retrieve permission="ADMIN_INVOICE">
9487                                         <context link="invoice" field="receiver"/>
9488                                 </retrieve>
9489                 <update   permission="ADMIN_INVOICE">
9490                                         <context link="invoice" field="receiver"/>
9491                                 </update>
9492                                 <delete   permission="ADMIN_INVOICE">
9493                                         <context link="invoice" field="receiver"/>
9494                                 </delete>
9495             </actions>
9496         </permacrud>
9497         </class>
9498
9499         <class id="acqii" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item" oils_persist:tablename="acq.invoice_item" reporter:label="Non-bibliographic Invoice Item">
9500                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9501                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9502                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9503                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9504                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9505                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9506                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9507                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9508                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9509                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9510                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9511                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9512                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9513                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9514                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9515                 </fields>
9516                 <links>
9517                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9518                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9519                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9520                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9521                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9522                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9523                 </links>
9524         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9525             <actions>
9526                 <create   permission="ADMIN_INVOICE">
9527                                         <context link="invoice" field="receiver"/>
9528                                 </create>
9529                 <retrieve permission="ADMIN_INVOICE">
9530                                         <context link="invoice" field="receiver"/>
9531                                 </retrieve>
9532                 <update   permission="ADMIN_INVOICE">
9533                                         <context link="invoice" field="receiver"/>
9534                                 </update>
9535                                 <delete   permission="ADMIN_INVOICE">
9536                                         <context link="invoice" field="receiver"/>
9537                                 </delete>
9538             </actions>
9539         </permacrud>
9540         </class>
9541
9542         <class id="acqpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_address" oils_persist:tablename="acq.provider_address" reporter:label="Provider Address">
9543                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9544                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9545                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9546                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9547                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9548                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9549                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9550                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9551                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9552                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9553                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9554                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9555                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9556                 </fields>
9557                 <links>
9558                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9559                 </links>
9560         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9561             <actions>
9562                 <create permission="ADMIN_PROVIDER">
9563                     <context link="provider" field="owner"/>
9564                 </create>
9565                 <retrieve permission="ADMIN_PROVIDER">
9566                     <context link="provider" field="owner"/>
9567                 </retrieve>
9568                 <update permission="ADMIN_PROVIDER">
9569                     <context link="provider" field="owner"/>
9570                 </update>
9571                 <delete permission="ADMIN_PROVIDER">
9572                     <context link="provider" field="owner"/>
9573                 </delete>
9574             </actions>
9575         </permacrud>
9576         </class>
9577
9578         <class id="acqpc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact" oils_persist:tablename="acq.provider_contact" reporter:label="Provider Contact">
9579                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9580                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9581                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9582                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9583                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9584                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9585                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9586                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9587         </fields>
9588                 <links>
9589                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9590                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9591                 </links>
9592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9593             <actions>
9594                 <create permission="ADMIN_PROVIDER">
9595                     <context link="provider" field="owner"/>
9596                 </create>
9597                 <retrieve permission="ADMIN_PROVIDER">
9598                     <context link="provider" field="owner"/>
9599                 </retrieve>
9600                 <update permission="ADMIN_PROVIDER">
9601                     <context link="provider" field="owner"/>
9602                 </update>
9603                 <delete permission="ADMIN_PROVIDER">
9604                     <context link="provider" field="owner"/>
9605                 </delete>
9606             </actions>
9607         </permacrud>
9608     </class>
9609         <class id="acqpca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_contact_address" oils_persist:tablename="acq.provider_contact_address" reporter:label="Provider Contact Address">
9610                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9611                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9612                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9613                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9614                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9615                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9616                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9617                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9618                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9619                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9620                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9621                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9622                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9623                 </fields>
9624                 <links>
9625                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9626                 </links>
9627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9628             <actions>
9629                 <create permission="ADMIN_PROVIDER">
9630                     <context link="contact" jump='provider' field="owner"/>
9631                 </create>
9632                 <retrieve permission="ADMIN_PROVIDER">
9633                     <context link="contact" jump='provider' field="owner"/>
9634                 </retrieve>
9635                 <update permission="ADMIN_PROVIDER">
9636                     <context link="contact" jump='provider' field="owner"/>
9637                 </update>
9638                 <delete permission="ADMIN_PROVIDER">
9639                     <context link="contact" jump='provider' field="owner"/>
9640                 </delete>
9641             </actions>
9642         </permacrud>
9643         </class>
9644
9645         <class id="acqftr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
9646                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9647                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9648                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9649                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9650                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9651                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9652                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9653                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9654                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9655                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9656                 </fields>
9657                 <links>
9658                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9659                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9660                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9661                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9662                 </links>
9663         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9664             <actions>
9665                 <create permission="ADMIN_ACQ_FUND">
9666                     <context link="src_fund" field="org"/>
9667                 </create>
9668                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9669                     <context link="src_fund" field="org"/>
9670                     <context link="dest_fund" field="org"/>
9671                 </retrieve>
9672                 <update permission="ADMIN_ACQ_FUND">
9673                     <context link="src_fund" field="org"/>
9674                 </update>
9675                 <delete permission="ADMIN_ACQ_FUND">
9676                     <context link="src_fund" field="org"/>
9677                 </delete>
9678             </actions>
9679         </permacrud>
9680         </class>
9681
9682         <class id="acqfc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_calendar" oils_persist:tablename="acq.fiscal_calendar" reporter:label="Fiscal Calendar">
9683                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9684                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9685                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9686                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9687                 </fields>
9688                 <links>
9689             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9690                 </links>
9691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9692                         <actions>
9693                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9694                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9695                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9696                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9697                         </actions>
9698                 </permacrud>
9699         </class>
9700
9701         <class id="acqfy" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fiscal_year" oils_persist:tablename="acq.fiscal_year" reporter:label="Fiscal Year">
9702                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9703                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9704                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9705                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9706                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9707                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9708                 </fields>
9709                 <links>
9710                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9711                 </links>
9712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9713                         <actions>
9714                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9715                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9716                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9717                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9718                         </actions>
9719                 </permacrud>
9720         </class>
9721
9722         <class id="acqfs" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source" oils_persist:tablename="acq.funding_source" reporter:label="Funding Source">
9723                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9724                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9725                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9726                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9727                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9728                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9729                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9730                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9731                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9732                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9733                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9734                 </fields>
9735                 <links>
9736                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9737                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9738             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9739             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9740                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9741                 </links>
9742         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9743             <actions>
9744                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9745                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9746                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9747                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9748             </actions>
9749         </permacrud>
9750         </class>
9751
9752         <class id="acqfscred" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::funding_source_credit" oils_persist:tablename="acq.funding_source_credit" reporter:label="Credit to Funding Source">
9753                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9754                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9755                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9756                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9757                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9758                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9759                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9760                 </fields>
9761                 <links>
9762                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9763                 </links>
9764                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9765                         <actions>
9766                                 <create permission="ADMIN_FUNDING_SOURCE">
9767                     <context link="funding_source" field="owner"/>
9768                 </create>
9769                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9770                     <context link="funding_source" field="owner"/>
9771                 </retrieve>
9772                                 <update permission="ADMIN_FUNDING_SOURCE">
9773                     <context link="funding_source" field="owner"/>
9774                 </update>
9775                                 <delete permission="ADMIN_FUNDING_SOURCE">
9776                     <context link="funding_source" field="owner"/>
9777                 </delete>
9778                         </actions>
9779                 </permacrud>
9780         </class>
9781
9782         <class id="acqofscred" controller="open-ils.cstore" oils_obj:fieldmapper="acq::ordered_funding_source_credit" oils_persist:tablename="acq.ordered_funding_source_credit" reporter:label="Ordered Funding Source Credit">
9783                 <fields oils_persist:primary="id">
9784                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9785                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9786                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9787                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9788                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9789                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9790                 </fields>
9791                 <links>
9792                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9793                 </links>
9794         </class>
9795
9796         <class id="acqfdeb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_debit" oils_persist:tablename="acq.fund_debit" reporter:label="Debit From Fund">
9797                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9798                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9799                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9800                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9801                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9802                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9803                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9804                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9805                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9806                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9807                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9808                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9809                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9810                 </fields>
9811                 <links>
9812                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9813                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9814                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9815                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9816                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9817                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9818                 </links>
9819                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9820                         <actions>
9821                                 <create permission="ADMIN_ACQ_FUND">
9822                     <context link="fund" field="org"/>
9823                 </create>
9824                                 <retrieve permission="ADMIN_ACQ_FUND">
9825                     <context link="fund" field="org"/>
9826                 </retrieve>
9827                                 <update permission="ADMIN_ACQ_FUND">
9828                     <context link="fund" field="org"/>
9829                 </update>
9830                                 <delete permission="ADMIN_ACQ_FUND">
9831                     <context link="fund" field="org"/>
9832                 </delete>
9833                         </actions>
9834                 </permacrud>
9835         </class>
9836
9837         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9838                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9839                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9840                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9841                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9842                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9843                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9844                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9845                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9846                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9847                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9848                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9849                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9850                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9851                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9852                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9853                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9854                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9855                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9856                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9857                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9858                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9859                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9860                 </fields>
9861                 <links>
9862                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9863                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9864             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9865             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9866             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9867             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9868             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9869             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9870             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9871             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9872             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9873                 </links>
9874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9875             <actions>
9876                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9877                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9878                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9879                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9880             </actions>
9881         </permacrud>
9882         </class>
9883
9884         <class id="acqfat" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_allocation_total" reporter:label="Fund Allocation Total">
9885                 <fields oils_persist:primary="fund">
9886                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9887                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9888                 </fields>
9889                 <links>
9890                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9891                 </links>
9892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9893             <actions>
9894                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9895                                         <context link="fund" field="org" />
9896                 </retrieve>
9897             </actions>
9898         </permacrud>
9899         </class>
9900
9901         <class id="acqfdt" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_debit_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_debit_total" reporter:label="Total Debit from Fund">
9902                 <fields oils_persist:primary="fund">
9903                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9904                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9905                 </fields>
9906                 <links>
9907                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9908                 </links>
9909         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9910             <actions>
9911                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9912                                         <context link="fund" field="org" />
9913                 </retrieve>
9914             </actions>
9915         </permacrud>
9916         </class>
9917
9918         <class id="acqfet" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_encumbrance_total" reporter:label="Total Fund Encumbrance">
9919                 <fields oils_persist:primary="fund">
9920                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9921                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9922                 </fields>
9923                 <links>
9924                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9925                 </links>
9926         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9927             <actions>
9928                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9929                                         <context link="fund" field="org" />
9930                 </retrieve>
9931             </actions>
9932         </permacrud>
9933         </class>
9934
9935         <class id="acqfst" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_total" reporter:label="Total Spent from Fund">
9936                 <fields oils_persist:primary="fund">
9937                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9938                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9939                 </fields>
9940                 <links>
9941                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9942                 </links>
9943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9944             <actions>
9945                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9946                                         <context link="fund" field="org" />
9947                 </retrieve>
9948             </actions>
9949         </permacrud>
9950         </class>
9951
9952         <class id="acqfcb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_combined_balance" reporter:label="Fund Combined Balance">
9953                 <fields oils_persist:primary="fund">
9954                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9955                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9956                 </fields>
9957                 <links>
9958                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9959                 </links>
9960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9961             <actions>
9962                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9963                                         <context link="fund" field="org" />
9964                 </retrieve>
9965             </actions>
9966         </permacrud>
9967         </class>
9968
9969    <class id="acqafat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_allocation_total" reporter:label="All Fund Allocation Total">
9970         <fields oils_persist:primary="fund">
9971             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9972             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9973         </fields>
9974         <links>
9975             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9976         </links>
9977     </class>
9978
9979    <class id="acqafet" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_encumbrance_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_encumbrance_total" reporter:label="All Fund Encumbrance Total">
9980         <fields oils_persist:primary="fund">
9981             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9982             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9983         </fields>
9984         <links>
9985             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9986         </links>
9987     </class>
9988
9989    <class id="acqafst" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_total" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_total" reporter:label="All Fund Spent Total">
9990         <fields oils_persist:primary="fund">
9991             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9992             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9993         </fields>
9994         <links>
9995             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9996         </links>
9997     </class>
9998
9999    <class id="acqafsb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_spent_balance" reporter:label="All Fund Spent Balance">
10000         <fields oils_persist:primary="fund">
10001             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10002             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
10003         </fields>
10004         <links>
10005             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10006         </links>
10007     </class>
10008
10009    <class id="acqafcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::all_fund_combined_balance" oils_persist:readonly="true" oils_persist:tablename="acq.all_fund_combined_balance" reporter:label="All Fund Combined Total">
10010         <fields oils_persist:primary="fund">
10011             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10012             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
10013         </fields>
10014         <links>
10015             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10016         </links>
10017     </class>
10018
10019         <class id="acqfsrcct" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_credit_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_credit_total" reporter:label="Total Credit to Funding Source">
10020                 <fields oils_persist:primary="funding_source">
10021                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10022                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
10023                 </fields>
10024                 <links>
10025                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10026                 </links>
10027         </class>
10028
10029         <class id="acqfsrcat" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_allocation_total" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_allocation_total" reporter:label="Total Allocation to Funding Source">
10030                 <fields oils_persist:primary="funding_source">
10031                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10032                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
10033                 </fields>
10034                 <links>
10035                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10036                 </links>
10037         </class>
10038
10039         <class id="acqfsrcb" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::funding_source_balance" oils_persist:readonly="true" oils_persist:tablename="acq.funding_source_balance" reporter:label="Funding Source Balance">
10040                 <fields oils_persist:primary="funding_source">
10041                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10042                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
10043                 </fields>
10044                 <links>
10045                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10046                 </links>
10047         </class>
10048
10049         <class id="acqfsb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_spent_balance" oils_persist:readonly="true" oils_persist:tablename="acq.fund_spent_balance" reporter:label="Fund Spent Balance">
10050                 <fields oils_persist:primary="fund">
10051                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
10052                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
10053                 </fields>
10054                 <links>
10055                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10056                 </links>
10057         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10058             <actions>
10059                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
10060                                         <context link="fund" field="org" />
10061                 </retrieve>
10062             </actions>
10063         </permacrud>
10064     </class>
10065     <class id="acqfsum" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="acq::fund_summary" reporter:label="Fund Summary" reporter:core="true" oils_persist:readonly="true">
10066         <oils_persist:source_definition><![CDATA[
10067             SELECT
10068                 acqf.*,
10069                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
10070                 COALESCE(acqfst.amount, 0.00) AS spent_total,
10071                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
10072                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
10073             FROM
10074                 acq.fund acqf
10075                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
10076                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
10077                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
10078                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
10079         ]]></oils_persist:source_definition>
10080         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
10081             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
10082             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10083             <field reporter:label="Name" name="name" reporter:datatype="text" />
10084             <field reporter:label="Year" name="year" reporter:datatype="int" />
10085             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
10086             <field reporter:label="Code" name="code" reporter:datatype="text" />
10087             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10088             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10089             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10090             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10091             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10092
10093             <!-- non fund-native fields -->
10094             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10095             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10096             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10097             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10098         </fields>
10099         <links>
10100             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10101             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10102             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10103         </links>
10104         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10105             <actions>
10106                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10107             </actions>
10108         </permacrud>
10109         </class>
10110         <class id="acqfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation" oils_persist:tablename="acq.fund_allocation" reporter:label="Fund Allocation">
10111                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10112                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10113                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10114                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10115                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10116                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10117                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10118                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10119                 </fields>
10120                 <links>
10121                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10122                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10123                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10124                 </links>
10125                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10126                         <actions>
10127                                 <create permission="ADMIN_ACQ_FUND">
10128                     <context link="fund" field="org"/>
10129                 </create>
10130                                 <retrieve permission="ADMIN_ACQ_FUND">
10131                     <context link="fund" field="org"/>
10132                 </retrieve>
10133                                 <update permission="ADMIN_ACQ_FUND">
10134                     <context link="fund" field="org"/>
10135                 </update>
10136                                 <delete permission="ADMIN_ACQ_FUND">
10137                     <context link="fund" field="org"/>
10138                 </delete>
10139                         </actions>
10140                 </permacrud>
10141         </class>
10142
10143     <class id="acqfap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_allocation_percent" oils_persist:tablename="acq.fund_allocation_percent" reporter:label="Fund Allocation Percent">
10144         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10145             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10146             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10147             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10148             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10149             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10150             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10151             <field reporter:label="Note" name="note" reporter:datatype="text" />
10152             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10153         </fields>
10154         <links>
10155             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10156             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10157             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10158         </links>
10159                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10160                         <actions>
10161                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10162                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10163                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10164                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10165                         </actions>
10166                 </permacrud>
10167     </class>
10168
10169         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10170                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10171                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10172                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10173                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10174                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10175                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10176                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10177                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10178                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10179                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10180                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10181                 </fields>
10182                 <links>
10183                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10184                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10185                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10186                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10187                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10188                 </links>
10189                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10190                         <actions>
10191                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10192                         </actions>
10193                 </permacrud>
10194         </class>
10195
10196         <class id="acqcr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::cancel_reason" oils_persist:tablename="acq.cancel_reason" reporter:label="Cancel Reason">
10197                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10198                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10199                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10200                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10201                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10202                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10203                 </fields>
10204                 <links>
10205                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10206                 </links>
10207                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10208                         <actions>
10209                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10210                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10211                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10212                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10213                         </actions>
10214                 </permacrud>
10215         </class>
10216
10217         <class id="acqpo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::purchase_order" oils_persist:tablename="acq.purchase_order" reporter:label="Purchase Order">
10218                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10219                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10220                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10221                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10222                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10223                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10224                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10225                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10226                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10227                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10228                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10229                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10230                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10231                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10232                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10233                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10234                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10235                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10236                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10237                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10238                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10239                 </fields>
10240                 <links>
10241                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10242                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10243                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10244                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10245                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10246                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10247                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10248                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10249                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10250                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10251                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10252                 </links>
10253                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10254                         <actions>
10255                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10256                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10257                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10258                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10259                         </actions>
10260                 </permacrud>
10261         </class>
10262
10263         <class id="acqpoh" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_purchase_order_history" oils_persist:tablename="acq.acq_purchase_order_history" reporter:label="Purchase Order History">
10264                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10265                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10266                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10267                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10268                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10269                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10270                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10271                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10272                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10273                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10274                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10275                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10276                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10277                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10278                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10279                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10280                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10281                 </fields>
10282                 <links>
10283                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10284                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10285                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10286                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10287                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10288                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10289                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10290                 </links>
10291                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10292             <actions>
10293                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10294             </actions>
10295                 </permacrud>
10296         </class>
10297
10298         <class id="acqpon" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_note" oils_persist:tablename="acq.po_note" reporter:label="PO Note">
10299                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10300                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10301                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10302                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10303                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10304                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10305                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10306                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10307                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10308                 </fields>
10309                 <links>
10310                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10311                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10312                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10313                 </links>
10314                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10315             <actions>
10316                 <create permission="CREATE_PURCHASE_ORDER">
10317                     <context link="purchase_order" field="ordering_agency"/>
10318                 </create>
10319                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10320                     <context link="purchase_order" field="ordering_agency"/>
10321                 </retrieve>
10322                 <update permission="CREATE_PURCHASE_ORDER">
10323                     <context link="purchase_order" field="ordering_agency"/>
10324                 </update>
10325                 <delete permission="CREATE_PURCHASE_ORDER">
10326                     <context link="purchase_order" field="ordering_agency"/>
10327                 </delete>
10328             </actions>
10329                 </permacrud>
10330         </class>
10331
10332         <class id="acqpoi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_item" oils_persist:tablename="acq.po_item" reporter:label="Purchase Order Item">
10333                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10334                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10335                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10336                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10337                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10338                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10339                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10340                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10341                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10342                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10343                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10344                 </fields>
10345                 <links>
10346                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10347                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10348                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10349                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10350                 </links>
10351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10352             <actions>
10353                 <create permission="CREATE_PURCHASE_ORDER">
10354                     <context link="purchase_order" field="ordering_agency"/>
10355                 </create>
10356                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10357                     <context link="purchase_order" field="ordering_agency"/>
10358                 </retrieve>
10359                 <update permission="CREATE_PURCHASE_ORDER">
10360                     <context link="purchase_order" field="ordering_agency"/>
10361                 </update>
10362                 <delete permission="CREATE_PURCHASE_ORDER">
10363                     <context link="purchase_order" field="ordering_agency"/>
10364                 </delete>
10365             </actions>
10366                 </permacrud>
10367         </class>
10368
10369         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10370                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10371                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10372                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10373                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10374                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10375                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10376                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10377                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10378                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10379                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10380                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10381                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10382                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10383                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10384                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10385                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10386                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10387                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10388                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10389                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10390                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10391                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10392                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10393                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10394                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10395                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10396                 </fields>
10397                 <links>
10398                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10399                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10400                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10401                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10402                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10403                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10404                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10405                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10406                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10407                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10408                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10409                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10410                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10411                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10412                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10413                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10414                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10415                 </links>
10416                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10417                         <actions>
10418                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10419                                         <context link="purchase_order" field="ordering_agency"/>
10420                                         <context link="picklist" field="org_unit"/>
10421                                 </retrieve>
10422                         </actions>
10423                 </permacrud>
10424         </class>
10425
10426         <class id="acqlih" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::acq_lineitem_history" oils_persist:tablename="acq.acq_lineitem_history" reporter:label="Line Item History">
10427                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10428                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10429                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10430                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10431                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10432                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10433                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10434                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10435                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10436                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10437                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10438                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10439                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10440                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10441                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10442                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10443                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10444                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10445                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10446                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10447                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10448                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10449                 </fields>
10450                 <links>
10451                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10452                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10453                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10454                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10455                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10456                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10457                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10458                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10459                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10460                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10461                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10462                 </links>
10463                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10464                         <actions>
10465                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10466                                         <context link="purchase_order" field="ordering_agency"/>
10467                                         <context link="picklist" field="org_unit"/>
10468                                 </retrieve>
10469                         </actions>
10470                 </permacrud>
10471         </class>
10472
10473         <class id="acqliat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_alert_text" oils_persist:tablename="acq.lineitem_alert_text" reporter:label="Line Item Alert Text">
10474                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10475                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id" reporter:selector="code"/>
10476                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10477                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10478                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10479                 </fields>
10480                 <links>
10481                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10482                 </links>
10483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10484                         <actions>
10485                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10486                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10487                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10488                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10489                         </actions>
10490                 </permacrud>
10491         </class>
10492
10493         <class id="acqlin" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_note" oils_persist:tablename="acq.lineitem_note" reporter:label="Line Item Note">
10494                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10495                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10496                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10497                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10498                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10499                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10500                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10501                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10502                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10503                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10504                 </fields>
10505                 <links>
10506                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10507                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10508                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10509                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10510                 </links>
10511         </class>
10512
10513         <class id="acqlia" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_attr" oils_persist:tablename="acq.lineitem_attr" reporter:label="Line Item Attribute">
10514                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10515                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10516                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10517                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10518                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10519                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10520                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10521                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10522                 </fields>
10523                 <links>
10524                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10525                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10526                 </links>
10527         </class>
10528
10529         <class id="acqlid" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_detail" oils_persist:tablename="acq.lineitem_detail" reporter:label="Line Item Detail">
10530                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10531                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10532                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10533                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10534                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10535                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10536                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10537                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10538                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10539                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10540                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10541                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10542                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10543                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10544                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10545                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10546                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10547                 </fields>
10548                 <links>
10549                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10550                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10551                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10552                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10553                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10554                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10555                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10556                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10557                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10558                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10559                 </links>
10560         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10561             <actions>
10562                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10563                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10564                     <context link="lineitem" jump="picklist" field="org_unit"/>
10565                 </retrieve>
10566             </actions>
10567         </permacrud>
10568         </class>
10569
10570         <class id="acqliad" controller="open-ils.cstore open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_attr_definition" oils_persist:tablename="acq.lineitem_attr_definition" reporter:label="Line Item Attribute Definition">
10571                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10572                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10573                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10574                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10575                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10576                 </fields>
10577                 <links/>
10578                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10579                         <actions>
10580                                 <retrieve />
10581                         </actions>
10582                 </permacrud>
10583         </class>
10584
10585         <class id="acqlimad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_marc_attr_definition" oils_persist:tablename="acq.lineitem_marc_attr_definition" reporter:label="Line Item MARC Attribute Definition">
10586                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10587                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10588                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10589                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10590                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10591                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10592             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10593                 </fields>
10594                 <links/>
10595         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10596             <actions>
10597                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10598                 <retrieve />
10599                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10600                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10601             </actions>
10602         </permacrud>
10603         </class>
10604
10605         <class id="acqligad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_generated_attr_definition" oils_persist:tablename="acq.lineitem_generated_attr_definition" reporter:label="Line Item Generated Attribute Definition">
10606                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10607                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10608                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10609                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10610                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10611                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10612                 </fields>
10613                 <links/>
10614         </class>
10615         <class id="acqliuad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_usr_attr_definition" oils_persist:tablename="acq.lineitem_usr_attr_definition" reporter:label="Line Item User Attribute Definition">
10616                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10617                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10618                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10619                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10620                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10621                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10622                 </fields>
10623                 <links>
10624                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10625                 </links>
10626         </class>
10627
10628         <class id="acqlipad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_provider_attr_definition" oils_persist:tablename="acq.lineitem_provider_attr_definition" reporter:label="Line Item Provider Attribute Definition">
10629             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10630                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10631                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10632                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10633                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10634                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10635                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10636         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10637
10638             </fields>
10639             <links>
10640                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10641             </links>
10642             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10643                 <actions>
10644                     <create permission="ADMIN_PROVIDER">
10645                         <context link="provider" field="owner"/>
10646                     </create>
10647                     <retrieve permission="ADMIN_PROVIDER">
10648                         <context link="provider" field="owner"/>
10649                     </retrieve>
10650                     <update permission="ADMIN_PROVIDER">
10651                         <context link="provider" field="owner"/>
10652                     </update>
10653                     <delete permission="ADMIN_PROVIDER">
10654                         <context link="provider" field="owner"/>
10655                     </delete>
10656                 </actions>
10657             </permacrud>
10658         </class>
10659         
10660         <class id="acqphsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider_holding_subfield_map" oils_persist:tablename="acq.provider_holding_subfield_map" reporter:label="Provider Holding Subfield Map">
10661             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10662                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10663                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10664                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10665                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10666             </fields>
10667             <links>
10668                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10669             </links>
10670             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10671                 <actions>
10672                     <create permission="ADMIN_PROVIDER">
10673                         <context link="provider" field="owner"/>
10674                     </create>
10675                     <retrieve permission="ADMIN_PROVIDER">
10676                         <context link="provider" field="owner"/>
10677                     </retrieve>
10678                     <update permission="ADMIN_PROVIDER">
10679                         <context link="provider" field="owner"/>
10680                     </update>
10681                     <delete permission="ADMIN_PROVIDER">
10682                         <context link="provider" field="owner"/>
10683                     </delete>
10684                 </actions>
10685             </permacrud>
10686         </class>
10687         
10688         <class id="acqlilad" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_local_attr_definition" oils_persist:tablename="acq.lineitem_local_attr_definition" reporter:label="Line Item Local Attribute Definition">
10689             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10690                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10691                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10692                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10693                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10694                 </fields>
10695                 <links/>
10696         </class>
10697
10698         <class id="acqedi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_account" oils_persist:tablename="acq.edi_account" reporter:label="EDI Account">
10699                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10700                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10701                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10702                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10703                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10704                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10705                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10706                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10707                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10708                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10709                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10710                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10711                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10712                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10713                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10714                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10715                 </fields>
10716                 <links>
10717                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10718                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10719                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10720                 </links>
10721         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10722             <actions>
10723                 <create permission="ADMIN_PROVIDER">
10724                     <context link="provider" field="owner"/>
10725                 </create>
10726                 <retrieve permission="ADMIN_PROVIDER">
10727                     <context link="provider" field="owner"/>
10728                 </retrieve>
10729                 <update permission="ADMIN_PROVIDER">
10730                     <context link="provider" field="owner"/>
10731                 </update>
10732                 <delete permission="ADMIN_PROVIDER">
10733                     <context link="provider" field="owner"/>
10734                 </delete>
10735             </actions>
10736         </permacrud>
10737         </class>
10738
10739         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10740                 oils_obj:fieldmapper="acq::edi_attr" 
10741                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10742                 <fields oils_persist:primary="key">
10743                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10744                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10745                 </fields>
10746         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10747             <actions>
10748                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10749                 <retrieve/>
10750                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10751                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10752             </actions>
10753         </permacrud>
10754         </class>
10755         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10756                 oils_obj:fieldmapper="acq::edi_attr_set" 
10757                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10758                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10759                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10760                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10761                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10762                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10763                 </fields>
10764                 <links>
10765                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10766                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10767                 </links>
10768         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10769             <actions>
10770                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10771                 <retrieve/>
10772                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10773                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10774             </actions>
10775         </permacrud>
10776         </class>
10777         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10778                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10779                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10780                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10781                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10782                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10783                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10784                 </fields>
10785                 <links>
10786                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10787                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10788                 </links>
10789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10790             <actions>
10791                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10792                 <retrieve/>
10793                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10794                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10795             </actions>
10796         </permacrud>
10797         </class>
10798
10799
10800         <class id="acqedim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::edi_message" oils_persist:tablename="acq.edi_message" reporter:label="EDI Message">
10801                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10802                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10803                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10804                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10805                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10806                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10807                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10808                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10809                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10810                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10811                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10812                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10813                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10814                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10815                 </fields>
10816                 <links>
10817                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10818                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10819                 </links>
10820         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10821             <actions>
10822                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10823                     <context link="account" jump="provider" field="owner"/>
10824                 </retrieve>
10825                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10826                     <context link="account" jump="provider" field="owner"/>
10827                 </update>
10828                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10829                     <context link="account" jump="provider" field="owner"/>
10830                 </delete>
10831             </actions>
10832         </permacrud>
10833         </class>
10834
10835
10836         <class id="rof" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
10837                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10838                         <field name="id" reporter:datatype="id" />
10839                         <field name="parent" reporter:datatype="link"/>
10840                         <field name="owner" reporter:datatype="link"/>
10841                         <field name="create_time" reporter:datatype="timestamp"/>
10842                         <field name="name" reporter:datatype="text"/>
10843                         <field name="shared" reporter:datatype="bool"/>
10844                         <field name="share_with" reporter:datatype="link"/>
10845                         <field name="simple_reporter" reporter:datatype="bool"/>
10846                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10847                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10848                 </fields>
10849                 <links>
10850                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10851                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10852                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10853                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10854                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10855                 </links>
10856         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10857             <actions>
10858                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10859                     <context link="owner" field="home_ou"/>
10860                 </create>
10861                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10862                     <context link="owner" field="home_ou"/>
10863                 </retrieve>
10864                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10865                     <context link="owner" field="home_ou"/>
10866                 </update>
10867                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10868                     <context link="owner" field="home_ou"/>
10869                 </delete>
10870             </actions>
10871         </permacrud>
10872         </class>
10873         <class id="rtf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
10874                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10875                         <field name="id" reporter:datatype="id" />
10876                         <field name="parent" reporter:datatype="link"/>
10877                         <field name="owner" reporter:datatype="link"/>
10878                         <field name="create_time" reporter:datatype="timestamp"/>
10879                         <field name="name" reporter:datatype="text"/>
10880                         <field name="shared" reporter:datatype="bool"/>
10881                         <field name="share_with" reporter:datatype="link"/>
10882                         <field name="simple_reporter" reporter:datatype="bool"/>
10883                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10884                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10885                 </fields>
10886                 <links>
10887                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10888                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10889                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10890                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10891                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10892                 </links>
10893         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10894             <actions>
10895                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10896                     <context link="owner" field="home_ou"/>
10897                 </create>
10898                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10899                     <context link="owner" field="home_ou"/>
10900                 </retrieve>
10901                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10902                     <context link="owner" field="home_ou"/>
10903                 </update>
10904                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10905                     <context link="owner" field="home_ou"/>
10906                 </delete>
10907             </actions>
10908         </permacrud>
10909         </class>
10910         <class id="rrf" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
10911                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10912                         <field name="id" reporter:datatype="id" />
10913                         <field name="parent" reporter:datatype="link"/>
10914                         <field name="owner" reporter:datatype="link"/>
10915                         <field name="create_time" reporter:datatype="timestamp"/>
10916                         <field name="name" reporter:datatype="text"/>
10917                         <field name="shared" reporter:datatype="bool"/>
10918                         <field name="share_with" reporter:datatype="link"/>
10919                         <field name="simple_reporter" reporter:datatype="bool"/>
10920                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10921                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10922                 </fields>
10923                 <links>
10924                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10925                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10926                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10927                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10928                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10929                 </links>
10930         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10931             <actions>
10932                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10933                     <context link="owner" field="home_ou"/>
10934                 </create>
10935                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10936                     <context link="owner" field="home_ou"/>
10937                 </retrieve>
10938                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10939                     <context link="owner" field="home_ou"/>
10940                 </update>
10941                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10942                     <context link="owner" field="home_ou"/>
10943                 </delete>
10944             </actions>
10945         </permacrud>
10946         </class>
10947         <class id="rt" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::template" oils_persist:tablename="reporter.template" reporter:label="Template">
10948                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10949                         <field name="id" reporter:datatype="id" />
10950                         <field name="owner" reporter:datatype="link"/>
10951                         <field name="create_time" reporter:datatype="timestamp"/>
10952                         <field name="name" reporter:datatype="text"/>
10953                         <field name="data" reporter:datatype="text"/>
10954                         <field name="folder" reporter:datatype="link"/>
10955                         <field name="description" reporter:datatype="text"/>
10956                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10957                 </fields>
10958                 <links>
10959                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10960                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10961                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10962                 </links>
10963         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10964             <actions>
10965                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10966                     <context link="owner" field="home_ou"/>
10967                 </create>
10968                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10969                     <context link="owner" field="home_ou"/>
10970                 </retrieve>
10971                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10972                     <context link="owner" field="home_ou"/>
10973                 </update>
10974                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10975                     <context link="owner" field="home_ou"/>
10976                 </delete>
10977             </actions>
10978         </permacrud>
10979         </class>
10980         <class id="rr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
10981                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10982                         <field name="id" reporter:datatype="id" />
10983                         <field name="owner" reporter:datatype="link"/>
10984                         <field name="create_time" reporter:datatype="timestamp"/>
10985                         <field name="template" reporter:datatype="link"/>
10986                         <field name="data" reporter:datatype="text"/>
10987                         <field name="folder" reporter:datatype="link"/>
10988                         <field name="recur" reporter:datatype="bool"/>
10989                         <field name="recurrence" reporter:datatype="interval"/>
10990                         <field name="name" reporter:datatype="text"/>
10991                         <field name="description" reporter:datatype="text"/>
10992                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10993                 </fields>
10994                 <links>
10995                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10996                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10997                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10998                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10999                 </links>
11000         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11001             <actions>
11002                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11003                     <context link="owner" field="home_ou"/>
11004                 </create>
11005                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11006                     <context link="owner" field="home_ou"/>
11007                 </retrieve>
11008                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11009                     <context link="owner" field="home_ou"/>
11010                 </update>
11011                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11012                     <context link="owner" field="home_ou"/>
11013                 </delete>
11014             </actions>
11015         </permacrud>
11016         </class>
11017         <class id="rs" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
11018                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
11019                         <field reporter:label="Id" name="id" reporter:datatype="id" />
11020                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11021                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
11022                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
11023                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
11024                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
11025                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
11026                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
11027                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
11028                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
11029                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11030                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
11031                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
11032                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
11033                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
11034                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
11035                 </fields>
11036                 <links>
11037                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11038                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11039                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
11040                 </links>
11041         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11042             <actions>
11043                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11044                     <context link="runner" field="home_ou"/>
11045                 </create>
11046                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11047                     <context link="runner" field="home_ou"/>
11048                 </retrieve>
11049                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11050                     <context link="runner" field="home_ou"/>
11051                 </update>
11052                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11053                     <context link="runner" field="home_ou"/>
11054                 </delete>
11055             </actions>
11056         </permacrud>
11057         </class>
11058     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
11059            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
11060            reporter:label="Completed Report Runs" oils_persist:readonly="true">
11061                 <fields oils_persist:primary="run">
11062             <field reporter:label="Run" name="run" reporter:datatype="link"/>
11063             <field reporter:label="Report" name="report" reporter:datatype="link"/>
11064             <field reporter:label="Template" name="template" reporter:datatype="link"/>
11065             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
11066             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
11067             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
11068             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
11069             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
11070             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
11071             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
11072             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
11073             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
11074             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
11075             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
11076             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
11077             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
11078                 </fields>
11079                 <links>
11080             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
11081             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
11082             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
11083             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
11084             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
11085             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
11086             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11087             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11088             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11089                 </links>
11090         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11091             <actions>
11092                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11093                     <context link="runner" field="home_ou"/>
11094                 </retrieve>
11095             </actions>
11096         </permacrud>
11097     </class>
11098         <class id="rmsr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::materialized_simple_record" oils_persist:tablename="reporter.materialized_simple_record" reporter:label="Fast Simple Record Extracts">
11099                 <fields oils_persist:primary="id">
11100                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11101                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11102                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11103                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11104                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11105                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11106                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11107                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11108                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11109                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11110                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11111                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11112                 </fields>
11113                 <links>
11114                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11115                 </links>
11116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11117                         <actions>
11118                                 <retrieve />
11119                         </actions>
11120                 </permacrud>
11121         </class>
11122         <class id="rssr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::super_simple_record" oils_persist:tablename="reporter.super_simple_record" reporter:label="Simple Record Extracts">
11123                 <fields oils_persist:primary="id">
11124                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11125                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11126                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11127                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11128                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11129                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11130                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11131                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11132                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11133                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11134                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11135                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11136                 </fields>
11137                 <links>
11138                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11139                 </links>
11140         </class>
11141         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11142                 <fields oils_persist:primary="id">
11143                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11144                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11145                         <field reporter:label="Fingerprint" name="fingerprint" />
11146                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11147                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11148                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11149                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11150                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11151                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11152                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11153                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11154                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11155                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11156                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11157                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11158                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11159                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11160                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11161                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11162                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11163                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11164                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11165                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11166                 </fields>
11167                 <links>
11168                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11169                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11170                 </links>
11171         </class>
11172         <class id="rud" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::user_demographic" oils_persist:tablename="reporter.demographic" reporter:label="User Demographics">
11173                 <fields oils_persist:primary="id">
11174                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11175                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11176                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11177                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11178                 </fields>
11179                 <links>
11180                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11181                 </links>
11182         </class>
11183         <class id="rcirct" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::circulation_type" oils_persist:tablename="reporter.circ_type" reporter:label="Circulation Type">
11184                 <fields oils_persist:primary="id">
11185                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11186                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11187                 </fields>
11188                 <links>
11189                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11190                 </links>
11191         </class>
11192         <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
11193                 <fields oils_persist:primary="id">
11194                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11195                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11196                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11197                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11198                 </fields>
11199                 <links>
11200                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11201                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11202                 </links>
11203                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11204                         <actions>
11205                                 <retrieve permission="VIEW_HOLD">
11206                                         <context link="id" field="pickup_lib"/>
11207                                 </retrieve>
11208                         </actions>
11209                 </permacrud>
11210         </class>
11211         <class id="rxbt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_billing_totals" oils_persist:tablename="reporter.xact_billing_totals" reporter:label="Transaction Billing Totals">
11212                 <fields oils_persist:primary="xact">
11213                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11214                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11215                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11216                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11217                 </fields>
11218                 <links>
11219                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11220                 </links>
11221         </class>
11222         <class id="rxpt" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::xact_paid_totals" oils_persist:tablename="reporter.xact_paid_totals" reporter:label="Transaction Paid Totals">
11223                 <fields oils_persist:primary="xact">
11224                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11225                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11226                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11227                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11228                 </fields>
11229                 <links>
11230                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11231                 </links>
11232         </class>
11233         <class id="ergbhu" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::global_bibs_by_holding_update" oils_persist:tablename="extend_reporter.global_bibs_by_holding_update" reporter:label="Bib IDs by Holding Add/Delete Time (OCLC batch update)">
11234                 <fields oils_persist:primary="id">
11235                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11236                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11237                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11238                 </fields>
11239                 <links>
11240                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11241                 </links>
11242         </class>
11243         <class id="erfcc" controller="open-ils.reporter-store open-ils.pcrud" oils_obj:fieldmapper="extend_reporter::full_circ_count" oils_persist:tablename="extend_reporter.full_circ_count" reporter:label="Total Circulation Count, Including Legacy">
11244                 <fields oils_persist:primary="id">
11245                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11246                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11247                 </fields>
11248                 <links>
11249                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11250                 </links>
11251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11252                         <actions>
11253                                 <retrieve permission="STAFF_LOGIN">
11254                                         <context link="id" field="circ_lib"/>
11255                                 </retrieve>
11256                         </actions>
11257                 </permacrud>
11258         </class>
11259         <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
11260                 <fields oils_persist:primary="bibid">
11261                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11262                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11263                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11264                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11265                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11266                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11267                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11268                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11269                 </fields>
11270                 <links>
11271                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11272                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11273                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11274                 </links>
11275         </class>
11276         <class id="rcsv" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::copy_statistics_view" oils_persist:tablename="reporter.copy_statistics_view" reporter:label="Item Statistics View">
11277                 <fields oils_persist:primary="copy_id">
11278                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11279                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11280                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11281                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11282                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11283                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11284                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11285                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11286                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11287                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11288                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11289                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11290                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11291                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11292                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11293                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11294                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11295                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11296                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11297                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11298                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11299                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11300                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11301                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11302                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11303                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11304                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11305                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11306                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11307                 </fields>
11308                 <links>
11309                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11310                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11311                 </links>
11312         </class>
11313         <class id="acqdf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula" oils_persist:tablename="acq.distribution_formula" reporter:label="Distribution Formula">
11314                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11315                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11316                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11317                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11318                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11319                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11320                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11321                 </fields>
11322                 <links>
11323                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11324                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11325                 </links>
11326                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11327                         <actions>
11328                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11329                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11330                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11331                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11332                         </actions>
11333                 </permacrud>
11334         </class>
11335         <class id="acqdfe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_entry" oils_persist:tablename="acq.distribution_formula_entry" reporter:label="Distribution Formula Entry">
11336                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11337                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11338                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11339                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11340                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11341                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11342                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11343                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11344                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11345                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11346                 </fields>
11347                 <links>
11348                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11349                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11350                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11351                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11352                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11353                 </links>
11354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11355                         <actions>
11356                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11357                                         <context link="formula" field="owner"/>
11358                                 </create>
11359                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11360                                         <context link="formula" field="owner"/>
11361                                 </retrieve>
11362                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11363                                         <context link="formula" field="owner"/>
11364                                 </update>
11365                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11366                                         <context link="formula" field="owner"/>
11367                                 </delete>
11368                         </actions>
11369                 </permacrud>
11370         </class>
11371
11372         <class id="acqdfa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::distribution_formula_application" oils_persist:tablename="acq.distribution_formula_application" reporter:label="Distribution Formula Application">
11373                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11374                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11375                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11376                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11377                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11378                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11379                 </fields>
11380                 <links>
11381                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11382                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11383                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11384                 </links>
11385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11386                         <actions>
11387                                 <create permission="CREATE_PURCHASE_ORDER">
11388                                         <context link="formula" field="owner"/>
11389                 </create>
11390                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11391                                         <context link="formula" field="owner"/>
11392                 </retrieve>
11393                                 <update permission="CREATE_PURCHASE_ORDER">
11394                                         <context link="formula" field="owner"/>
11395                 </update>
11396                                 <delete permission="CREATE_PURCHASE_ORDER">
11397                                         <context link="formula" field="owner"/>
11398                 </delete>
11399                         </actions>
11400                 </permacrud>
11401         </class>
11402
11403         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11404                 <fields oils_persist:primary="id">
11405                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11406                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11407                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11408                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11409                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11410                 </fields>
11411                 <links>
11412                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11413                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11414                 </links>
11415         </class>
11416
11417         <class id="acqclt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_type" oils_persist:tablename="acq.claim_type" reporter:label="Claim Type">
11418                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11419                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11420                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11421                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11422                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11423                 </fields>
11424                 <links>
11425                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11426                 </links>
11427                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11428                         <actions>
11429                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11430                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11431                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11432                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11433                         </actions>
11434                 </permacrud>
11435         </class>
11436
11437         <class id="acqclet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_event_type" oils_persist:tablename="acq.claim_event_type" reporter:label="Claim Event Type">
11438                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11439                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11440                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11441                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11442                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11443                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11444                 </fields>
11445                 <links>
11446                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11447                 </links>
11448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11449                         <actions>
11450                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11451                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11452                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11453                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11454                         </actions>
11455                 </permacrud>
11456         </class>
11457
11458         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11459                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11460                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11461                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11462                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11463                 </fields>
11464                 <links>
11465                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11466                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11467                 </links>
11468         </class>
11469
11470         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11471                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11472                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11473                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11474                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11475                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11476                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11477                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11478                 </fields>
11479                 <links>
11480                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11481                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11482                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11483                 </links>
11484         </class>
11485
11486         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11487                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11488                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11489                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11490                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11491                 </fields>
11492                 <links>
11493                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11494                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11495                 </links>
11496         </class>
11497
11498         <class id="acqscle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim_event" oils_persist:tablename="acq.serial_claim_event" reporter:label="Serial Claim Event">
11499                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11500                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11501                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11502                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11503                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11504                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11505                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11506                 </fields>
11507                 <links>
11508                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11509                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11510                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11511                 </links>
11512         </class>
11513
11514         <class id="acqclp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy" oils_persist:tablename="acq.claim_policy" reporter:label="Claim Policy">
11515                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11516                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11517                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11518                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11519                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11520                 </fields>
11521                 <links>
11522                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11523                 </links>
11524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11525             <actions>
11526                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11527                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11528                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11529                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11530             </actions>
11531                 </permacrud>
11532         </class>
11533
11534         <class id="acqclpa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::claim_policy_action" oils_persist:tablename="acq.claim_policy_action" reporter:label="Claim Policy Action">
11535                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11536                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11537                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11538                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11539                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11540                 </fields>
11541                 <links>
11542                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11543                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11544                 </links>
11545                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11546                         <actions>
11547                                 <create permission="ADMIN_CLAIM_POLICY">
11548                                         <context link="claim_policy" field="org_unit"/>
11549                 </create>
11550                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11551                                         <context link="claim_policy" field="org_unit"/>
11552                 </retrieve>
11553                                 <update permission="ADMIN_CLAIM_POLICY">
11554                                         <context link="claim_policy" field="org_unit"/>
11555                 </update>
11556                                 <delete permission="ADMIN_CLAIM_POLICY">
11557                                         <context link="claim_policy" field="org_unit"/>
11558                 </delete>
11559                         </actions>
11560                 </permacrud>
11561         </class>
11562
11563     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11564         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11565             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11566             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11567             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11568             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11569             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11570             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11571             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11572             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11573             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11574             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11575             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11576             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11577             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11578             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11579             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11580             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11581                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11582                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11583                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11584         </fields>
11585         <links>
11586             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11587             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11588         </links>
11589     </class>
11590
11591     <class id="stgc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::card_stage" oils_persist:tablename="staging.card_stage" reporter:label="Card Stage">
11592         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11593             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11594             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11595             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11596             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11597             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11598         </fields>
11599     </class>
11600
11601     <class id="stgma" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::mailing_address_stage" oils_persist:tablename="staging.mailing_address_stage" reporter:label="Mailing Address Stage">
11602         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11603             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11604             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11605             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11606             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11607             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11608             <field reporter:label="City" name="city" reporter:datatype="text"/>
11609             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11610             <field reporter:label="State" name="state" reporter:datatype="text"/>
11611             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11612             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11613             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11614         </fields>
11615     </class>
11616
11617     <class id="stgba" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::billing_address_stage" oils_persist:tablename="staging.billing_address_stage" reporter:label="Billing Address Stage">
11618         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11619             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11620             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11621             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11622             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11623             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11624             <field reporter:label="City" name="city" reporter:datatype="text"/>
11625             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11626             <field reporter:label="State" name="state" reporter:datatype="text"/>
11627             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11628             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11629             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11630         </fields>
11631     </class>
11632
11633     <class id="stgsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::statcat_stage" oils_persist:tablename="staging.statcat_stage" reporter:label="Statistical Category Stage">
11634         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11635             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11636             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11637             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11638             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11639             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11640             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11641         </fields>
11642     </class>
11643
11644     <class id="stgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="staging::setting_stage" oils_persist:tablename="staging.setting_stage" reporter:label="User Setting Stage">
11645         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11646             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11647             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11648             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11649             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11650             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11651             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11652         </fields>
11653     </class>
11654
11655         <class id="afsg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_group" oils_persist:tablename="action.fieldset_group" reporter:label="Fieldset Group">
11656                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11657                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11658                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11659                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11660                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11661                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11662                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11663                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11664                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11665                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11666                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11667                 </fields>
11668                 <links>
11669                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11670                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11671                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11672                 </links>
11673                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11674                         <actions>
11675                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11676                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11677                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11678                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11679                         </actions>
11680                 </permacrud>
11681         </class>
11682
11683         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11684                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11685                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11686                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11687                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11688                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11689                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11690                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11691                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11692                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11693                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11694                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11695                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11696                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11697                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11698                 </fields>
11699                 <links>
11700                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11701                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11702                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11703                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11704                 </links>
11705                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11706                         <actions>
11707                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11708                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11709                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11710                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11711                         </actions>
11712                 </permacrud>
11713         </class>
11714
11715         <class id="afscv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
11716                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11717                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11718                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11719                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11720                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11721                 </fields>
11722                 <links>
11723                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11724                 </links>
11725                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11726                         <actions>
11727                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11728                     <context link="fieldset" field="owning_lib"/>
11729                 </create>
11730                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11731                     <context link="fieldset" field="owning_lib"/>
11732                 </retrieve>
11733                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11734                     <context link="fieldset" field="owning_lib"/>
11735                 </update>
11736                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11737                     <context link="fieldset" field="owning_lib"/>
11738                 </delete>
11739                         </actions>
11740                 </permacrud>
11741         </class>
11742
11743     <class id="aufhl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_loops" oils_persist:tablename="action.unfulfilled_hold_loops" oils_persist:readonly="true">
11744         <fields>
11745             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11746             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11747             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11748         </fields>
11749                 <links>
11750                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11751                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11752                 </links>
11753     </class>
11754
11755     <class id="aufhml" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_min_loop" oils_persist:tablename="action.unfulfilled_hold_min_loop" oils_persist:readonly="true">
11756         <fields>
11757             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11758             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11759         </fields>
11760                 <links>
11761                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11762                 </links>
11763     </class>
11764
11765     <class id="aufhil" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_innermost_loop" oils_persist:tablename="action.unfulfilled_hold_innermost_loop" oils_persist:readonly="true">
11766         <fields>
11767             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11768             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11769             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11770         </fields>
11771                 <links>
11772                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11773                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11774                 </links>
11775     </class>
11776
11777     <class id="aufhmxl" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_max_loop" oils_persist:tablename="action.unfulfilled_hold_max_loop" oils_persist:readonly="true">
11778         <fields>
11779             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11780             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11781         </fields>
11782                 <links>
11783                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11784                 </links>
11785     </class>
11786
11787     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11788                 <oils_persist:source_definition><![CDATA[
11789
11790             SELECT  DISTINCT l.*
11791               FROM  action.unfulfilled_hold_loops l
11792                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11793               WHERE l.count = m.max
11794
11795                 ]]></oils_persist:source_definition>
11796         <fields>
11797             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11798             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11799             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11800         </fields>
11801                 <links>
11802                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11803                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11804                 </links>
11805     </class>
11806
11807         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11808                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11809                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11810                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11811                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11812                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11813                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11814                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11815                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11816                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11817                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11818                 </fields>
11819                 <links>
11820                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11821                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11822                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11823                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11824                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11825                 </links>
11826         </class>
11827
11828         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11829                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11830                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11831                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11832                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11833                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11834                 </fields>
11835                 <links>
11836                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11837                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11838                 </links>
11839         </class>
11840
11841         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11842                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11843                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11844                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11845                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11846                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11847                 </fields>
11848                 <links>
11849                 </links>
11850         </class>
11851
11852         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11853                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11854                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11855                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11856                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11857                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11858                 </fields>
11859                 <links>
11860                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11861                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11862                 </links>
11863         </class>
11864         
11865         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11866                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11867                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11868                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11869                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11870                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11871                 </fields>
11872                 <links>
11873                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11874                 </links>
11875         </class>
11876         
11877         <class id="qfpd" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_param_def" oils_persist:tablename="query.function_param_def" reporter:label="Function Parameter Definition">
11878                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11879                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11880                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11881                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11882                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11883                 </fields>
11884                 <links>
11885                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11886                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11887                 </links>
11888         </class>
11889
11890         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11891                 <fields oils_persist:primary="name">
11892                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11893                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11894                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11895                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11896                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11897                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11898                 </fields>
11899                 <links>
11900                 </links>
11901         </class>
11902
11903         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11904                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11905                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11906                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11907                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11908                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11909                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11910                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11911                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11912                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11913                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11914                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11915                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11916                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11917                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11918                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11919                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11920                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11921                 </fields>
11922                 <links>
11923                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11924                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11925                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11926                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11927                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11928                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11929                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11930                 </links>
11931         </class>
11932
11933         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11934                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11935                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11936                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11937                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11938                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11939                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11940                 </fields>
11941                 <links>
11942                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11943                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11944                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11945                 </links>
11946         </class>
11947
11948         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11949                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11950                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11951                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11952                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11953                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11954                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11955                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11956                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11957                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11958                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11959                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11960                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11961                 </fields>
11962                 <links>
11963                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11964                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11965                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11966                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11967                 </links>
11968         </class>
11969
11970         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11971                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11972                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11973                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11974                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11975                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11976                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11977                 </fields>
11978                 <links>
11979                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11980                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11981                 </links>
11982         </class>
11983
11984         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11985                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11986                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11987                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11988                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11989                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11990                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11991                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11992                 </fields>
11993                 <links>
11994                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11995                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11996                 </links>
11997         </class>
11998
11999         <class id="qobi" controller="open-ils.cstore" oils_obj:fieldmapper="query::order_by_item" oils_persist:tablename="query.order_by_item" reporter:label="Order By Item">
12000                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
12001                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
12002                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
12003                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12004                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
12005                 </fields>
12006                 <links>
12007                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
12008                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
12009                 </links>
12010         </class>
12011
12012         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
12013                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12014                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12015                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12016                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12017                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12018                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12019                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12020                 </fields>
12021                 <links>
12022                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12023                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12024                 </links>
12025         </class>
12026
12027         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
12028                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12029                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12030                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12031                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12032                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12033                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
12034                 </fields>
12035                 <links>
12036                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12037                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
12038                 </links>
12039         </class>
12040
12041         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
12042                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12043                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12044                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12045                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12046                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12047                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12048                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12049                 </fields>
12050                 <links>
12051                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12052                 </links>
12053         </class>
12054
12055         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
12056                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12057                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12058                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12059                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12060                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12061                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12062                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12063                 </fields>
12064                 <links>
12065                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12066                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12067                 </links>
12068         </class>
12069
12070         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
12071                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12072                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12073                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12074                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12075                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12076                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12077                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
12078                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12079                 </fields>
12080                 <links>
12081                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12082                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12083                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
12084                 </links>
12085         </class>
12086
12087         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12088                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12089                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12090                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12091                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12092                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12093                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12094                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12095                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12096                 </fields>
12097                 <links>
12098                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12099                 </links>
12100         </class>
12101
12102         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12103                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12104                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12105                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12106                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12107                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12108                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12109                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12110                 </fields>
12111                 <links>
12112                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12113                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12114                 </links>
12115         </class>
12116
12117         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12118                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12119                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12120                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12121                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12122                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12123                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12124                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12125                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12126                 </fields>
12127                 <links>
12128                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12129                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12130                 </links>
12131         </class>
12132
12133         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12134                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12135                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12136                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12137                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12138                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12139                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12140                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12141                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12142                 </fields>
12143                 <links>
12144                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12145                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12146                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12147                 </links>
12148         </class>
12149
12150         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12151                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12152                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12153                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12154                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12155                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12156                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12157                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12158                 </fields>
12159                 <links>
12160                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12161                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12162                 </links>
12163         </class>
12164
12165         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12166                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12167                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12168                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12169                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12170                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12171                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12172                 </fields>
12173                 <links>
12174                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12175                 </links>
12176         </class>
12177
12178         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12179                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12180                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12181                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12182                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12183                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12184                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12185                 </fields>
12186                 <links>
12187                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12188                 </links>
12189         </class>
12190
12191         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12192                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12193                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12194                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12195                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12196                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12197                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12198                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12199                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12200                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12201                 </fields>
12202                 <links>
12203                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12204                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12205                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12206                 </links>
12207         </class>
12208
12209         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12210                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12211                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12212                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12213                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12214                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12215                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12216                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12217                 </fields>
12218                 <links>
12219                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12220                 </links>
12221         </class>
12222
12223         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12224                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12225                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12226                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12227                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12228                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12229                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12230                 </fields>
12231                 <links>
12232                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12233                 </links>
12234         </class>
12235
12236         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12237                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12238                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12239                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12240                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12241                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12242                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12243                 </fields>
12244                 <links>
12245                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12246                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12247                 </links>
12248         </class>
12249
12250         <class id="bmpc" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::marc21_physical_characteristics" oils_persist:tablename="biblio.marc21_physical_characteristics" reporter:label="MARC21 Physical Characteristics" oils_persist:field_safe="true" oils_persist:readonly="true">
12251                 <fields oils_persist:primary="id">
12252                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12253                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12254                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12255                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12256                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12257                 </fields>
12258                 <links>
12259                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12260                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12261                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12262                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12263                 </links>
12264         </class>
12265
12266         <class id="cmfpm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_ff_pos_map" oils_persist:tablename="config.marc21_ff_pos_map" reporter:label="MARC21 Fixed Field Map" oils_persist:field_safe="true">
12267                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12268                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12269                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12270                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12271                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12272                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12273                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12274                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12275                 </fields>
12276                 <links/>
12277                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12278                         <actions>
12279                                 <retrieve/>
12280                         </actions>
12281                 </permacrud>
12282         </class>
12283
12284         <class id="cmpctm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_type_map" oils_persist:tablename="config.marc21_physical_characteristic_type_map" reporter:label="MARC21 Physical Characteristic Type Map" oils_persist:field_safe="true">
12285                 <fields oils_persist:primary="ptype_key">
12286                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12287                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12288                 </fields>
12289                 <links/>
12290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12291                         <actions>
12292                                 <retrieve/>
12293                         </actions>
12294                 </permacrud>
12295         </class>
12296
12297         <class id="cmpcsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_subfield_map" oils_persist:tablename="config.marc21_physical_characteristic_subfield_map" reporter:label="MARC21 Physical Characteristic Subfield Map" oils_persist:field_safe="true">
12298                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12299                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12300                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12301                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12302                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12303                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12304                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12305                 </fields>
12306                 <links>
12307                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12308                 </links>
12309                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12310                         <actions>
12311                                 <retrieve/>
12312                         </actions>
12313                 </permacrud>
12314         </class>
12315
12316         <class id="cmpcvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_physical_characteristic_value_map" oils_persist:tablename="config.marc21_physical_characteristic_value_map" reporter:label="MARC21 Physical Characteristic Value Map" oils_persist:field_safe="true">
12317                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12318                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12319                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12320                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12321                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12322                 </fields>
12323                 <links>
12324                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12325                 </links>
12326                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12327                         <actions>
12328                                 <retrieve/>
12329                         </actions>
12330                 </permacrud>
12331         </class>
12332
12333     <class
12334         id="uvs"
12335         controller="open-ils.cstore open-ils.pcrud"
12336         oils_obj:fieldmapper="url_verify::session"
12337         oils_persist:tablename="url_verify.session"
12338         reporter:label="URL Verification Session"
12339     >
12340         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12341             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12342             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12343                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12344             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12345             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12346             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12347             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12348             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12349             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12350         </fields>
12351
12352         <links>
12353             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12354             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12355             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12356             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12357             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12358         </links>
12359
12360         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12361             <actions>
12362                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12363             </actions>
12364         </permacrud>
12365
12366     </class>
12367
12368     <class id="uvsbrem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="url_verify::session_biblio_record_entry_map" oils_persist:readonly="true" reporter:label="URL Verify Session Biblio Record Entry Map">
12369         <oils_persist:source_definition><![CDATA[
12370             SELECT
12371                 cbrebi.id AS id,  -- so we can have a pkey in our view
12372                 uvs.id AS session,
12373                 uvs.owning_lib,
12374                 cbrebi.target_biblio_record_entry
12375             FROM url_verify.session uvs
12376             JOIN container.biblio_record_entry_bucket cbreb
12377                 ON (uvs.container = cbreb.id)
12378             JOIN container.biblio_record_entry_bucket_item cbrebi
12379                 ON (cbrebi.bucket = cbreb.id)
12380         ]]></oils_persist:source_definition>
12381         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12382             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12383             <field reporter:label="Session" name="session" reporter:datatype="link" />
12384             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12385             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12386         </fields>
12387         <links>
12388             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12389             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12390             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12391         </links>
12392         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12393             <actions>
12394                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12395             </actions>
12396         </permacrud>
12397     </class>
12398
12399     <class
12400         id="uvus"
12401         controller="open-ils.cstore open-ils.pcrud"
12402         oils_obj:fieldmapper="url_verify::url_selector"
12403         oils_persist:tablename="url_verify.url_selector"
12404         reporter:label="URL Verification URL Selector"
12405     >
12406         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12407             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12408             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12409                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12410             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12411         </fields>
12412
12413         <links>
12414             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12415             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12416         </links>
12417
12418         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12419             <actions>
12420                 <create permission="URL_VERIFY">
12421                     <context link="session" field="owning_lib"/>
12422                 </create>
12423                 <retrieve permission="URL_VERIFY">
12424                     <context link="session" field="owning_lib"/>
12425                 </retrieve>
12426                 <update permission="URL_VERIFY">
12427                     <context link="session" field="owning_lib"/>
12428                 </update>
12429                 <delete permission="URL_VERIFY">
12430                     <context link="session" field="owning_lib"/>
12431                 </delete>
12432             </actions>
12433         </permacrud>
12434
12435     </class>
12436
12437     <class
12438         id="uvu"
12439         controller="open-ils.cstore open-ils.pcrud"
12440         oils_obj:fieldmapper="url_verify::url"
12441         oils_persist:tablename="url_verify.url"
12442         reporter:label="URL Verification URL"
12443     >
12444         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12445             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12446                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12447                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12448                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12449                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12450             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12451             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12452             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12453             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12454             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12455             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12456             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12457             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12458             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12459             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12460             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12461             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12462             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12463         </fields>
12464
12465         <links>
12466             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12467             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12468             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12469             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12470             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12471         </links>
12472
12473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12474             <actions>
12475                 <create permission="URL_VERIFY">
12476                     <context link="session" field="owning_lib"/>
12477                 </create>
12478                 <retrieve permission="URL_VERIFY">
12479                     <context link="session" field="owning_lib"/>
12480                 </retrieve>
12481                 <update permission="URL_VERIFY">
12482                     <context link="session" field="owning_lib"/>
12483                 </update>
12484                 <delete permission="URL_VERIFY">
12485                     <context link="session" field="owning_lib"/>
12486                 </delete>
12487             </actions>
12488         </permacrud>
12489
12490     </class>
12491
12492     <class
12493         id="uvva"
12494         controller="open-ils.cstore open-ils.pcrud"
12495         oils_obj:fieldmapper="url_verify::verification_attempt"
12496         oils_persist:tablename="url_verify.verification_attempt"
12497         reporter:label="URL Verification Attempt"
12498     >
12499         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12500             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12501                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12502                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12503             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12504             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12505         </fields>
12506
12507         <links>
12508             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12509             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12510         </links>
12511
12512         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12513             <actions>
12514                 <create permission="URL_VERIFY">
12515                     <context link="session" field="owning_lib"/>
12516                 </create>
12517                 <retrieve permission="URL_VERIFY">
12518                     <context link="session" field="owning_lib"/>
12519                 </retrieve>
12520                 <update permission="URL_VERIFY">
12521                     <context link="session" field="owning_lib"/>
12522                 </update>
12523                 <delete permission="URL_VERIFY">
12524                     <context link="session" field="owning_lib"/>
12525                 </delete>
12526             </actions>
12527         </permacrud>
12528
12529     </class>
12530
12531     <class
12532         id="uvuv"
12533         controller="open-ils.cstore open-ils.pcrud"
12534         oils_obj:fieldmapper="url_verify::url_verification"
12535         oils_persist:tablename="url_verify.url_verification"
12536         reporter:label="URL Verification"
12537     >
12538         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12539             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12540                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12541                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12542             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12543             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12544             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12545             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12546                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12547         </fields>
12548
12549         <links>
12550             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12551             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12552             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12553         </links>
12554
12555         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12556             <actions>
12557                 <create permission="URL_VERIFY">
12558                     <context link="attempt" jump="session" field="owning_lib"/>
12559                 </create>
12560                 <retrieve permission="URL_VERIFY">
12561                     <context link="attempt" jump="session" field="owning_lib"/>
12562                 </retrieve>
12563                 <update permission="URL_VERIFY">
12564                     <context link="attempt" jump="session" field="owning_lib"/>
12565                 </update>
12566                 <delete permission="URL_VERIFY">
12567                     <context link="attempt" jump="session" field="owning_lib"/>
12568                 </delete>
12569             </actions>
12570         </permacrud>
12571
12572     </class>
12573
12574         <class
12575                 id="cfdi"
12576                 controller="open-ils.cstore open-ils.pcrud"
12577                 oils_obj:fieldmapper="config::filter_dialog_interface"
12578                 oils_persist:tablename="config.filter_dialog_interface"
12579                 reporter:label="FilterDialog Interface">
12580                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12581                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12582                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12583                 </fields>
12584                 <links>
12585                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12586                 </links>
12587                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12588                         <actions>
12589                                 <retrieve />
12590                         </actions>
12591                 </permacrud>
12592         </class>
12593
12594         <class
12595                 id="cfdfs"
12596                 controller="open-ils.cstore open-ils.pcrud"
12597                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12598                 oils_persist:tablename="config.filter_dialog_filter_set"
12599                 reporter:label="FilterDialog Filter Set">
12600                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12601                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12602                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12603                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12604                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12605                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12606                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12607                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12608                 </fields>
12609                 <links>
12610                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12611                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12612                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12613                 </links>
12614                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12615                         <actions>
12616                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12617                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12618                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12619                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12620                         </actions>
12621                 </permacrud>
12622
12623         </class>
12624
12625         <class id="cmrtm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc21_rec_type_map" oils_persist:tablename="config.marc21_rec_type_map" reporter:label="MARC21 Record Type Map" oils_persist:field_safe="true">
12626                 <fields oils_persist:primary="code">
12627                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12628                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12629                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12630                 </fields>
12631                 <links/>
12632                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12633                         <actions>
12634                                 <retrieve/>
12635                         </actions>
12636                 </permacrud>
12637         </class>
12638
12639         <class id="rlcd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_copy_deleted" oils_persist:readonly="true" reporter:core="true" reporter:label="Last Copy Delete Time">
12640                 <oils_persist:source_definition><![CDATA[
12641
12642             SELECT  b.id,
12643                     MAX(dcp.edit_date) AS last_delete_date
12644              FROM   biblio.record_entry b
12645                     JOIN asset.call_number cn ON (cn.record = b.id)
12646                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12647              WHERE  NOT b.deleted
12648              GROUP BY b.id
12649              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12650
12651                 ]]></oils_persist:source_definition>
12652                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12653                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12654                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12655                 </fields>
12656                 <links>
12657                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12658                 </links>
12659                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12660                         <actions>
12661                                 <retrieve/>
12662                         </actions>
12663                 </permacrud>
12664         </class>
12665
12666         <class id="jubstlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::li_state_label" oils_persist:tablename="acq.li_state_label" oils_persist:readonly="true" reporter:label="Line Item State Labels" oils_persist:field_safe="true">
12667                 <fields oils_persist:primary="id">
12668                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12669                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12670                 </fields>
12671                 <links/>
12672                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12673                         <actions>
12674                                 <retrieve/>
12675                         </actions>
12676                 </permacrud>
12677         </class>
12678
12679         <class id="acqpostlbl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::po_state_label" oils_persist:tablename="acq.po_state_label" oils_persist:readonly="true" reporter:label="PO State Labels">
12680                 <fields oils_persist:primary="id">
12681                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12682                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12683                 </fields>
12684                 <links/>
12685                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12686                         <actions>
12687                                 <retrieve/>
12688                         </actions>
12689                 </permacrud>
12690         </class>
12691
12692
12693         <class id="rhcrpb" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib" oils_persist:readonly="true" reporter:core="true" reporter:label="Hold/Copy Ratio per Bib">
12694                 <oils_persist:source_definition><![CDATA[
12695                 SELECT
12696                     x.id,
12697                     COALESCE( y.copy_count, 0 ) AS copy_count,
12698                     x.hold_count AS hold_count,
12699                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12700                 FROM
12701                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12702                         FROM
12703                             action.hold_request ahr
12704                             JOIN reporter.hold_request_record rhrr USING (id)
12705                         WHERE
12706                             ahr.cancel_time IS NULL
12707                             AND ahr.fulfillment_time IS NULL
12708                         GROUP BY bib_record
12709                     )x
12710                     JOIN
12711                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12712                         FROM
12713                             action.hold_request ahr
12714                             JOIN reporter.hold_request_record rhrr USING (id)
12715                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12716                         WHERE
12717                             ahr.cancel_time IS NULL
12718                             AND ahr.fulfillment_time IS NULL
12719                             AND ahr.capture_time IS NULL
12720                             AND ahr.frozen IS FALSE
12721                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12722                             AND ahr.hold_type != 'M'
12723                            GROUP BY bib_record
12724                     )y
12725                     USING (id)
12726                 ]]></oils_persist:source_definition>
12727                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12728                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12729                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12730                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12731                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12732                 </fields>
12733                 <links>
12734                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12735                 </links>
12736                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12737                         <actions>
12738                                 <retrieve/>
12739                         </actions>
12740                 </permacrud>
12741         </class>
12742
12743         <class id="rhcrpbap" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library">
12744                 <oils_persist:source_definition><![CDATA[
12745             SELECT *,
12746                 CASE WHEN copy_count_at_pickup_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_pickup_library::FLOAT/copy_count_at_pickup_library END AS pickup_library_ratio,
12747                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12748             FROM
12749                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12750                     FROM
12751                         action.hold_request ahr
12752                         JOIN reporter.hold_request_record rhrr USING (id)
12753                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12754                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12755                     WHERE
12756                         ahr.cancel_time IS NULL
12757                         AND ahr.fulfillment_time IS NULL
12758                     GROUP BY bib_record, pickup_lib
12759                 )x
12760                 JOIN
12761                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12762                     FROM
12763                         action.hold_request ahr
12764                         JOIN reporter.hold_request_record rhrr USING (id)
12765                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12766                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12767                     WHERE
12768                         ahr.cancel_time IS NULL
12769                         AND ahr.fulfillment_time IS NULL
12770                         AND ahr.capture_time IS NULL
12771                         AND ahr.frozen IS FALSE
12772                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12773                         AND ahr.hold_type != 'M'
12774                     GROUP BY bib_record, pickup_lib
12775                 )y
12776                 USING(id,pickup_lib)
12777                 JOIN
12778                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12779                     FROM
12780                         action.hold_request ahr
12781                         JOIN reporter.hold_request_record rhrr USING (id)
12782                     WHERE
12783                         ahr.cancel_time IS NULL
12784                         AND ahr.fulfillment_time IS NULL
12785                     GROUP BY bib_record
12786                 )z
12787                 USING (id)
12788                 JOIN
12789                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12790                     FROM
12791                         action.hold_request ahr
12792                         JOIN reporter.hold_request_record rhrr USING (id)
12793                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12794                     WHERE
12795                         ahr.cancel_time IS NULL
12796                         AND ahr.fulfillment_time IS NULL
12797                         AND ahr.capture_time IS NULL
12798                         AND ahr.frozen IS FALSE
12799                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12800                         AND ahr.hold_type != 'M'
12801                         GROUP BY bib_record
12802                 )u
12803                 USING (id)
12804                 ]]></oils_persist:source_definition>
12805                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12806                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12807                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12808                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12809                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12810                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12811                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12812                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12813                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12814                 </fields>
12815                 <links>
12816                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12817                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12818                 </links>
12819                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12820                         <actions>
12821                                 <retrieve/>
12822                         </actions>
12823                 </permacrud>
12824         </class>
12825
12826         <class id="rhcrpbah" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_home" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Home Library">
12827                 <oils_persist:source_definition><![CDATA[
12828             SELECT *,
12829                 CASE WHEN copy_count_at_home_library = 0 THEN 'Infinity'::FLOAT ELSE holds_at_home_library::FLOAT/copy_count_at_home_library END AS home_library_ratio,
12830                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12831             FROM
12832                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12833                     FROM
12834                         action.hold_request ahr
12835                         JOIN actor.usr au ON (ahr.usr = au.id)
12836                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12837                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12838                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12839                     WHERE
12840                         ahr.cancel_time IS NULL
12841                         AND ahr.fulfillment_time IS NULL
12842                     GROUP BY bib_record, home_ou
12843                 )x
12844                 JOIN
12845                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12846                     FROM
12847                         action.hold_request ahr
12848                         JOIN actor.usr au ON (ahr.usr = au.id)
12849                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12850                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12851                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12852                     WHERE
12853                         ahr.cancel_time IS NULL
12854                         AND ahr.fulfillment_time IS NULL
12855                         AND ahr.capture_time IS NULL
12856                         AND ahr.frozen IS FALSE
12857                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12858                         AND ahr.hold_type != 'M'
12859                     GROUP BY bib_record, home_ou
12860                 )y
12861                 USING (id,home_ou)
12862                 JOIN
12863                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12864                     FROM
12865                         action.hold_request ahr
12866                         JOIN reporter.hold_request_record rhrr USING (id)
12867                     WHERE
12868                         ahr.cancel_time IS NULL
12869                         AND ahr.fulfillment_time IS NULL
12870                     GROUP BY bib_record
12871                 )z
12872                 USING (id)
12873                 JOIN
12874                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12875                     FROM
12876                         action.hold_request ahr
12877                         JOIN reporter.hold_request_record rhrr USING (id)
12878                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12879                     WHERE
12880                         ahr.cancel_time IS NULL
12881                         AND ahr.fulfillment_time IS NULL
12882                         AND ahr.capture_time IS NULL
12883                         AND ahr.frozen IS FALSE
12884                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12885                         AND ahr.hold_type != 'M'
12886                     GROUP BY bib_record
12887                 )u
12888                 USING (id)
12889         ]]></oils_persist:source_definition>
12890         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12891                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12892                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12893                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12894                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12895                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12896                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12897                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12898                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12899         </fields>
12900         <links>
12901                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12902                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12903         </links>
12904         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12905                 <actions>
12906                         <retrieve/>
12907                 </actions>
12908         </permacrud>
12909 </class>
12910
12911         <class id="rhcrpbapd" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::hold_copy_ratio_per_bib_and_pickup_desc" oils_persist:readonly="true" reporter:label="Hold/Copy Ratio per Bib and Pickup Library (and Descendants) ">
12912                 <oils_persist:source_definition><![CDATA[
12913                 WITH counts_at_ou AS (
12914                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12915                 FROM
12916                     (SELECT rhrr.bib_record AS id,
12917                             aou.id AS pickup_lib_or_desc,
12918                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12919                        FROM actor.org_unit aou
12920                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12921                             action.hold_request ahr
12922                             JOIN reporter.hold_request_record rhrr USING (id)
12923                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12924                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12925                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12926                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12927                             AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12928                       GROUP BY 1, 2
12929                 ) a
12930                 JOIN
12931                     (SELECT rhrr.bib_record AS id,
12932                             aou.id AS pickup_lib_or_desc,
12933                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12934                        FROM actor.org_unit aou
12935                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12936                             action.hold_request ahr
12937                             JOIN reporter.hold_request_record rhrr USING (id)
12938                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12939                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12940                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12941                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12942                             AND ahr.hold_type != 'M'
12943                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12944                             AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
12945                       GROUP BY 1, 2
12946                 ) b
12947                 USING (id,pickup_lib_or_desc)
12948             )
12949             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
12950                    y.holds_everywhere, z.copy_count_everywhere,
12951                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
12952                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
12953             FROM counts_at_ou x
12954                 JOIN
12955                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12956                     FROM
12957                         action.hold_request ahr
12958                         JOIN reporter.hold_request_record rhrr USING (id)
12959                     WHERE
12960                         ahr.cancel_time IS NULL
12961                         AND ahr.fulfillment_time IS NULL
12962                     GROUP BY bib_record
12963                 )y
12964                 USING (id)
12965                 JOIN
12966                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12967                     FROM
12968                         action.hold_request ahr
12969                         JOIN reporter.hold_request_record rhrr USING (id)
12970                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12971                     WHERE
12972                         ahr.cancel_time IS NULL
12973                         AND ahr.fulfillment_time IS NULL
12974                         AND ahr.capture_time IS NULL
12975                         AND ahr.frozen IS FALSE
12976                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12977                         AND ahr.hold_type != 'M'
12978                         GROUP BY bib_record
12979                 )z
12980                 USING (id)
12981                 ]]></oils_persist:source_definition>
12982                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12983                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12984                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12985                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12986                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12987                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12988                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12989                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12990                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12991                 </fields>
12992                 <links>
12993                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12994                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12995                 </links>
12996                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12997                         <actions>
12998                                 <retrieve/>
12999                         </actions>
13000                 </permacrud>
13001         </class>
13002
13003         <class id="rlc" controller="open-ils.cstore open-ils.pcrud open-ils.reporter-store" oils_obj:fieldmapper="reporter::last_circ_date" oils_persist:readonly="true" reporter:label="Last Circulation or Creation Date">
13004                 <oils_persist:source_definition><![CDATA[
13005             SELECT
13006                 ac.id,
13007                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
13008                 MAX(actac.xact_start) AS last_circ
13009             FROM asset.copy ac
13010                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13011             GROUP BY ac.id
13012
13013             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
13014             --SELECT
13015             --    ac.id,
13016             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
13017             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
13018             --FROM asset.copy ac
13019             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
13020             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
13021             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
13022                 ]]></oils_persist:source_definition>
13023                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
13024                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
13025                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
13026                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
13027                 </fields>
13028                 <links>
13029                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13030                 </links>
13031                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13032                         <actions>
13033                                 <retrieve/>
13034                         </actions>
13035                 </permacrud>
13036         </class>
13037
13038         <class id="ctcl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ts_config_list" oils_persist:tablename="config.ts_config_list" reporter:label="Text Search Configs">
13039                 <fields oils_persist:primary="id">
13040                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
13041                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
13042                 </fields>
13043                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13044                         <actions>
13045                                 <retrieve/>
13046                         </actions>
13047                 </permacrud>
13048         </class>
13049
13050         <class id="cmcts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_class_ts_map" oils_persist:tablename="config.metabib_class_ts_map" reporter:label="Metabib Class TS Map">
13051                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
13052                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13053                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
13054                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13055                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13056                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13057                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13058                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13059                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
13060                 </fields>
13061                 <links>
13062                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
13063                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13064                 </links>
13065                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13066                         <actions>
13067                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13068                                 <retrieve/>
13069                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13070                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13071                         </actions>
13072                 </permacrud>
13073         </class>
13074
13075         <class id="cmfts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_ts_map" oils_persist:tablename="config.metabib_field_ts_map" reporter:label="Metabib Field TS Map">
13076                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
13077                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
13078                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
13079                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
13080                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
13081                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
13082                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
13083                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
13084                 </fields>
13085                 <links>
13086                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13087                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13088                 </links>
13089                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13090                         <actions>
13091                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13092                                 <retrieve/>
13093                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13094                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13095                         </actions>
13096                 </permacrud>
13097         </class>
13098
13099
13100         <!-- ********************************************************************************************************************* -->
13101         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13102         <!-- ********************************************************************************************************************* -->
13103         <class id="rccc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_circ" oils_persist:tablename="reporter.classic_current_circ" reporter:core="true" reporter:label="Classic Circulation View">
13104                 <fields oils_persist:primary="id">
13105                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13106                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13107                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13108                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13109                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13110                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13111                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13112                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13113                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13114                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13115                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13116                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13117                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13118                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13119                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13120                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13121                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13122                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13123                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13124                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13125                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13126                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13127                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13128                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13129                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13130                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13131                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13132                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13133                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13134                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13135                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13136                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13137                 </fields>
13138                 <links>
13139                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13140                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13141                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13142                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13143                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13144                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13145                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13146                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13147                 </links>
13148         </class>
13149
13150         <class id="rsce1" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat1" oils_persist:tablename="reporter.legacy_cat1" reporter:label="CAT1 Entry">
13151                 <fields oils_persist:primary="id">
13152                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13153                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13154                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13155                 </fields>
13156                 <links>
13157                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13158                 </links>
13159         </class>
13160
13161         <class id="rsce2" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::legacy_cat2" oils_persist:tablename="reporter.legacy_cat2" reporter:label="CAT2 Entry">
13162                 <fields oils_persist:primary="id">
13163                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13164                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13165                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13166                 </fields>
13167                 <links>
13168                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13169                 </links>
13170         </class>
13171
13172         <class id="rccbs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_current_billing_summary" oils_persist:tablename="reporter.classic_current_billing_summary" reporter:core="true" reporter:label="Classic Open Transaction Summary">
13173                 <fields oils_persist:primary="id">
13174                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13175
13176                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13177                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13178                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13179
13180                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13181                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13182                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13183
13184                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13185                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13186
13187                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13188                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13189                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13190
13191                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13192                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13193
13194                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13195                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13196                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13197
13198                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13199                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13200                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13201
13202                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13203                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13204                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13205                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13206
13207                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13208                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13209
13210                 </fields>
13211                 <links>
13212                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13213                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13214                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13215                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13216                 </links>
13217         </class>
13218
13219         <class id="acrlid" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_ready_lineitem_detail" oils_persist:readonly="true" reporter:label="Claim Ready Lineitem Details">
13220                 <oils_persist:source_definition><![CDATA[
13221
13222             SELECT
13223                 po.ordering_agency AS ordering_agency,
13224                 po.id AS purchase_order,
13225                 li.id AS lineitem,
13226                 lid.id AS lineitem_detail,
13227                 cpa.id AS claim_policy_action
13228             FROM
13229                 acq.lineitem_detail lid
13230                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13231                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13232                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13233                 JOIN acq.claim_policy_action cpa ON (
13234                     cpa.claim_policy = cp.id
13235
13236                     -- we only care about claim policy actions whose claim
13237                     -- interval we'd reached or exceeded
13238                     AND (NOW() - cpa.action_interval) > po.order_date
13239
13240                     -- filter out all claim policy actions where claim events
13241                     -- have occurred on or after the action's action_interval
13242                     AND NOT EXISTS (
13243                         SELECT 1
13244                         FROM
13245                             acq.claim_event evt
13246                             JOIN acq.claim claim ON (
13247                                 claim.id = evt.claim
13248                                 AND claim.lineitem_detail = lid.id
13249                             )
13250                         WHERE
13251                             evt.event_date >= (po.order_date + cpa.action_interval)
13252                     )
13253                 )
13254             WHERE
13255                 lid.cancel_reason IS NULL
13256                 AND li.cancel_reason IS NULL -- belt/suspenders
13257                 AND po.cancel_reason IS NULL -- belt/suspenders
13258                 AND lid.recv_time IS NULL
13259                 AND po.state = 'on-order'
13260             ORDER BY 1, 2, 3, 4, 5
13261
13262                 ]]></oils_persist:source_definition>
13263                 <fields>
13264                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13265                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13266                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13267                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13268                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13269                 </fields>
13270                 <links>
13271                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13272                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13273                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13274                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13275                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13276                 </links>
13277         </class>
13278         <class id="acqlisum" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary" oils_persist:readonly="true" reporter:label="Lineitem Summary" oils_persist:tablename="acq.lineitem_summary">
13279                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13280                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13281                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13282                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13283                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13284                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13285                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13286                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13287                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13288                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13289                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13290                 </fields>
13291                 <links>
13292                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13293                 </links>
13294     </class>
13295         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13296                 <oils_persist:source_definition><![CDATA[
13297             SELECT * FROM acq.lineitem_summary 
13298                                 WHERE item_count > (invoice_count + cancel_count)
13299         ]]></oils_persist:source_definition>
13300                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13301                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13302                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13303                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13304                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13305                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13306                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13307                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13308                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13309                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13310                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13311                 </fields>
13312                 <links>
13313                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13314                 </links>
13315     </class>
13316         <class id="iatc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::intersystem_transit_copy" oils_persist:readonly="true" reporter:core="true" reporter:label="Inter-system Copy Transit">
13317                 <oils_persist:source_definition><![CDATA[
13318
13319                         SELECT  t.*
13320                           FROM  action.transit_copy t
13321                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13322                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13323                           WHERE s.parent_ou <> d.parent_ou
13324
13325                 ]]></oils_persist:source_definition>
13326                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13327                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13328                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13329                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13330                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13331                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13332                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13333                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13334                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13335                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13336                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13337                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13338                 </fields>
13339                 <links>
13340                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13341                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13342                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13343                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13344                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13345                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13346                 </links>
13347         </class>
13348
13349     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13350                 <oils_persist:source_definition><![CDATA[
13351
13352         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13353                 SELECT
13354                         cp.id as copy,
13355                         COUNT(circ.id),
13356                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13357                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13358                 FROM
13359                         asset.copy cp
13360                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13361                 GROUP BY 1, 3, 4
13362                 UNION ALL
13363                 SELECT
13364                         cp.id as copy,
13365                         COUNT(circ.id),
13366                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13367                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13368                 FROM
13369                         asset.copy cp
13370                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13371                 GROUP BY 1, 3, 4
13372                 UNION ALL
13373                 SELECT
13374                         id as copy,
13375                         circ_count,
13376                         -1 AS year,
13377                         false as is_renewal
13378                 FROM
13379                         extend_reporter.legacy_circ_count
13380         )x GROUP BY 1, 3, 4
13381
13382                 ]]></oils_persist:source_definition>
13383         <fields>
13384             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13385             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13386             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13387             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13388         </fields>
13389                 <links>
13390                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13391                 </links>
13392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13393                         <actions>
13394                                 <retrieve/>
13395                         </actions>
13396                 </permacrud>
13397     </class>
13398
13399         <class id="rodcirc" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::overdue_circs" oils_persist:tablename="reporter.overdue_circs" reporter:core="true" reporter:label="Overdue Circulation">
13400                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13401                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13402                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13403                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13404                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13405                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13406                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13407                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13408                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13409                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13410                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13411                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13412                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13413                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13414                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13415                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13416                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13417                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13418                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13419                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13420                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13421                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13422                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13423                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13424                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13425                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13426                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13427                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13428                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13429                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13430                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13431                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13432                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13433                 </fields>
13434                 <links>
13435                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13436                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13437                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13438                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13439                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13440                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13441                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13442                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13443                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13444                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13445                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13446                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13447                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13448                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13449                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13450                 </links>
13451         </class>
13452
13453     <class id="rocit" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::classic_item_list" oils_persist:tablename="reporter.classic_item_list" reporter:core="true" reporter:label="Classic Item List">
13454         <fields oils_persist:primary="id">
13455             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13456             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13457             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13458             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13459             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13460             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13461             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13462             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13463             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13464             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13465             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13466             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13467             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13468             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13469             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13470             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13471             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13472             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13473             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13474             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13475             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13476             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13477             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13478             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13479             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13480             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13481             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13482             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13483             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13484             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13485             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13486             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13487             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13488             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13489         </fields>
13490         <links>
13491             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13492             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13493             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13494             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13495             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13496             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13497             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13498             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13499         </links>
13500     </class>
13501
13502     <class id="rmocbbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_owning_lib" oils_persist:tablename="money.open_circ_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Owning Library">
13503         <fields oils_persist:primary="id">
13504             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13505             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13506             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13507             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13508         </fields>
13509         <links>
13510             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13511             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13512         </links>
13513     </class>
13514
13515     <class id="rmobbol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_owning_lib" oils_persist:tablename="money.open_balance_by_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Owning Library">
13516         <fields oils_persist:primary="owning_lib">
13517             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13518             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13519             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13520         </fields>
13521         <links>
13522             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13523         </links>
13524     </class>
13525
13526     <class id="rmocbbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by Circulating Library and Owning Library">
13527         <fields oils_persist:primary="id">
13528             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13529             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13530             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13531             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13532             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13533         </fields>
13534         <links>
13535             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13536             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13537             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13538         </links>
13539     </class>
13540
13541     <class id="rmobbcol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_circ_and_owning_lib" oils_persist:tablename="money.open_balance_by_circ_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by Circulating Library and Owning Library">
13542         <fields oils_persist:primary="circ_lib">
13543             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13544             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13545             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13546             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13547         </fields>
13548         <links>
13549             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13550             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13551         </links>
13552     </class>
13553
13554     <class id="rmocbbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_circ_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_circ_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Billing by User Home Library and Owning Library">
13555         <fields oils_persist:primary="id">
13556             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13557             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13558             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13559             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13560             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13561         </fields>
13562         <links>
13563             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13564             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13565             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13566         </links>
13567     </class>
13568
13569     <class id="rmobbhol" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::money::open_balance_by_usr_home_and_owning_lib" oils_persist:tablename="money.open_balance_by_usr_home_and_owning_lib" reporter:core="true" reporter:label="Open Circulation Balance by User Home Library and Owning Library">
13570         <fields oils_persist:primary="home_ou">
13571             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13572             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13573             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13574             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13575         </fields>
13576         <links>
13577             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13578             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13579         </links>
13580     </class>
13581         <class id="acqft" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag" oils_persist:tablename="acq.fund_tag" reporter:label="Fund Tag">
13582                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13583                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13584                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13585                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13586                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13587                 </fields>
13588                 <links>
13589                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13590                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13591                 </links>
13592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13593                         <actions>
13594                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13595                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13596                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13597                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13598                         </actions>
13599                 </permacrud>
13600         </class>
13601         <class id="acqftm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund_tag_map" oils_persist:tablename="acq.fund_tag_map" reporter:label="Fund Tag Map">
13602                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13603                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13604                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13605                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13606                 </fields>
13607                 <links>
13608                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13609                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13610                         </links>
13611                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13612                 <actions>
13613                                 <create permission="ADMIN_ACQ_FUND_TAG">
13614                                         <context link="tag" field="owner"/>
13615                                 </create>
13616                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13617                                         <context link="tag" field="owner"/>
13618                                 </retrieve>
13619                                 <update permission="ADMIN_ACQ_FUND_TAG">
13620                                         <context link="tag" field="owner"/>
13621                                 </update>
13622                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13623                                         <context link="tag" field="owner"/>
13624                                 </delete>
13625                         </actions>
13626                 </permacrud>
13627         </class>
13628         <class id="acqmapinv" controller="open-ils.cstore" oils_obj:fieldmapper="acq::map_to_invoice" reporter:label="Acq Map to Invoice View" oils_persist:readonly="true">
13629                 <oils_persist:source_definition><![CDATA[
13630                 SELECT
13631                         poi.purchase_order AS purchase_order,
13632                         ii.invoice AS invoice,
13633                         NULL AS lineitem,
13634                         poi.id AS po_item,
13635                         NULL AS picklist
13636                 FROM
13637                         acq.po_item poi
13638                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13639                 UNION SELECT
13640                         jub.purchase_order AS purchase_order,
13641                         ie.invoice AS invoice,
13642                         jub.id AS lineitem,
13643                         NULL AS po_item,
13644                         jub.picklist AS picklist
13645                 FROM
13646                         acq.lineitem jub
13647                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13648                 UNION SELECT
13649                         ii.purchase_order AS purchase_order,
13650                         ii.invoice AS invoice,
13651                         NULL AS lineitem,
13652                         NULL AS po_item,
13653                         NULL AS picklist
13654                 FROM
13655                         acq.invoice_item ii
13656                 WHERE ii.po_item IS NULL
13657                 UNION SELECT
13658                         ie.purchase_order AS purchase_order,
13659                         ie.invoice AS invoice,
13660                         NULL AS lineitem,
13661                         NULL AS po_item,
13662                         NULL AS picklist
13663                 FROM
13664                         acq.invoice_entry ie
13665                 WHERE ie.lineitem IS NULL
13666                 UNION SELECT
13667                         NULL AS purchase_order,
13668                         NULL AS invoice,
13669                         jub.id AS lineitem,
13670                         NULL AS po_item,
13671                         jub.picklist AS picklist
13672                 FROM
13673                         acq.lineitem jub
13674                 WHERE jub.purchase_order IS NULL
13675                 ]]></oils_persist:source_definition>
13676                 <fields>
13677                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13678                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13679                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13680                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13681                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13682                 </fields>
13683                 <links>
13684                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13685                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13686                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13687                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13688                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13689                 </links>
13690         </class>
13691         <class id="cbc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::barcode_completion" oils_persist:tablename="config.barcode_completion" reporter:label="Barcode Completions">
13692                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13693                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13694                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13695                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13696                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13697                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13698                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13699                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13700                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13701                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13702                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13703                 </fields>
13704                 <links>
13705                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13706                 </links>
13707                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13708                         <actions>
13709                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13710                                 <retrieve/>
13711                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13712                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13713                         </actions>
13714                 </permacrud>
13715         </class>
13716
13717         <class id="coustl" controller="open-ils.cstore" oils_obj:fieldmapper="config::org_unit_setting_type_log" oils_persist:tablename="config.org_unit_setting_type_log" reporter:label="Organizational Unit Setting Type Log">
13718                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13719                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13720                         <field name="date_applied" reporter:datatype="timestamp"/>
13721                         <field name="org" reporter:datatype="org_unit"/>
13722                         <field name="original_value" reporter:datatype="text"/>
13723                         <field name="new_value" reporter:datatype="text"/>
13724                         <field name="field_name" reporter:datatype="link"/>
13725                 </fields>
13726                 <links>
13727                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13728                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13729                 </links>
13730         </class>
13731         <class id="aaactsc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_actor_stat_cat" oils_persist:tablename="action.archive_actor_stat_cat" reporter:label="Circ-Archived Patron Statistical Category Entries">
13732                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13733                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13734                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13735                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13736                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13737                 </fields>
13738                 <links>
13739                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13740                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13741                 </links>
13742         </class>
13743         <class id="aaasc" controller="open-ils.reporter-store" oils_obj:fieldmapper="action::archive_asset_stat_cat" oils_persist:tablename="action.archive_asset_stat_cat" reporter:label="Circ-Archived Copy Statistical Category Entries">
13744                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13745                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13746                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13747                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13748                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13749                 </fields>
13750                 <links>
13751                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13752                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13753                 </links>
13754         </class>
13755         <class id="cfg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group" oils_persist:tablename="config.floating_group" reporter:label="Floating Group">
13756                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13757                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13758                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13759                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13760                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13761                 </fields>
13762                 <links>
13763                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13764                 </links>
13765                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13766                         <actions>
13767                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13768                                 <retrieve/>
13769                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13770                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13771                         </actions>
13772                 </permacrud>
13773         </class>
13774         <class id="cfgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::floating_group_member" oils_persist:tablename="config.floating_group_member" reporter:label="Floating Group Members">
13775                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13776                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13777                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13778                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13779                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13780                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13781                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13782                 </fields>
13783                 <links>
13784                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13785                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13786                 </links>
13787                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13788                         <actions>
13789                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13790                                 <retrieve/>
13791                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13792                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13793                         </actions>
13794                 </permacrud>
13795         </class>
13796         <class id="cctt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_tag_type" oils_persist:tablename="config.copy_tag_type" reporter:label="Copy Tag Types" oils_persist:field_safe="true">
13797                 <fields oils_persist:primary="code">
13798                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13799                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13800                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13801                 </fields>
13802                 <links>
13803                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13804                 </links>
13805                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13806                         <actions>
13807                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13808                                 <retrieve/>
13809                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13810                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13811                         </actions>
13812                 </permacrud>
13813         </class>
13814         <class id="acpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag" oils_persist:tablename="asset.copy_tag" reporter:label="Item Tags" oils_persist:field_safe="true">
13815                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13816                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13817                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13818                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13819                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13820                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13821                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13822                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13823                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13824                 </fields>
13825                 <links>
13826                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13827                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13828                 </links>
13829                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13830                         <actions>
13831                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13832                                 <retrieve/>
13833                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13834                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13835                         </actions>
13836                 </permacrud>
13837         </class>
13838         <class id="acptcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag_copy_map" oils_persist:tablename="asset.copy_tag_copy_map" reporter:label="Copy Tag Copy Map" oils_persist:field_safe="true">
13839                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13840                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13841                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13842                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13843                 </fields>
13844                 <links>
13845                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13846                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13847                 </links>
13848                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13849                         <actions>
13850                                 <create permission="UPDATE_COPY">
13851                     <context link="copy" field="circ_lib"/>
13852                 </create>
13853                                 <retrieve/>
13854                                 <update permission="UPDATE_COPY">
13855                     <context link="copy" field="circ_lib"/>
13856                 </update>
13857                                 <delete permission="UPDATE_COPY">
13858                     <context link="copy" field="circ_lib"/>
13859                 </delete>
13860                         </actions>
13861                 </permacrud>
13862         </class>
13863         <class id="hasholdscount" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::has_holds_count" reporter:label="Copy Has Holds Count" oils_persist:readonly="true">
13864         <oils_persist:source_definition><![CDATA[
13865         SELECT ahcm.target_copy AS id,count(*) AS count
13866          FROM
13867          action.hold_request ahr,
13868          action.hold_copy_map ahcm
13869          WHERE
13870          ahr.cancel_time IS NULL AND
13871          ahr.fulfillment_time IS NULL AND
13872          ahr.capture_time IS NULL AND
13873          ahr.id = ahcm.hold
13874          GROUP BY ahcm.target_copy
13875         ]]></oils_persist:source_definition>
13876         <fields oils_persist:primary="id">
13877             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13878             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13879         </fields>
13880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13881             <actions>
13882                <retrieve/>
13883             </actions>
13884         </permacrud>
13885         </class>
13886
13887         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13888                 oils_obj:fieldmapper="config::workstation_setting_type" 
13889                 oils_persist:tablename="config.workstation_setting_type" 
13890                 reporter:label="Workstation Setting Type">
13891                 <fields oils_persist:primary="name">
13892                         <field name="name" reporter:datatype="text"/>
13893                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13894                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13895                         <field name="datatype" reporter:datatype="text"/>
13896                         <field name="fm_class" reporter:datatype="text"/>
13897                         <field name="grp" reporter:datatype="link"/>
13898                 </fields>
13899                 <links>
13900                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13901                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13902                 </links>
13903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13904                         <actions>
13905                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13906                                 <retrieve/>
13907                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13908                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13909                         </actions>
13910                 </permacrud>
13911         </class>
13912
13913         <!-- no pcrud access is granted for now, because it's assumed these
13914                          setting values will be applied and retrived via the API. -->
13915         <class id="awss" 
13916                 controller="open-ils.cstore"
13917                 oils_obj:fieldmapper="actor::workstation_setting" 
13918                 oils_persist:tablename="actor.workstation_setting" 
13919                 reporter:label="Workstation Setting">
13920                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13921                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13922                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13923                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13924                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13925                 </fields>
13926                 <links>
13927                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13928                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13929                 </links>
13930         </class>
13931
13932         <class id="cht" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_type" oils_persist:tablename="config.hold_type" reporter:label="Hold Type" oils_persist:readonly="true">
13933         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13934                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13935                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
13936                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
13937         </fields>
13938         </class>
13939
13940         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
13941                 oils_obj:fieldmapper="config::print_template" 
13942                 oils_persist:tablename="config.print_template" 
13943                 reporter:label="Print Templates">
13944                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13945                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
13946                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13947                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13948                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13949                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13950                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13951                         <field name="content_type" reporter:datatype="text"/>
13952                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13953                 </fields>
13954                 <links>
13955                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13956                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13957                 </links>
13958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13959                         <actions>
13960                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13961                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
13962                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13963                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13964                         </actions>
13965                 </permacrud>
13966         </class>
13967
13968         <class id="cct" 
13969                 controller="open-ils.cstore open-ils.pcrud"
13970                 oils_obj:fieldmapper="config::carousel_type" 
13971                 oils_persist:tablename="config.carousel_type" 
13972                 reporter:label="Carousel Types">
13973                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13974                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13975                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13976                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13977                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13978                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13979                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13980                 </fields>
13981                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13982                         <actions>
13983                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13984                                 <retrieve/>
13985                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13986                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13987                         </actions>
13988                 </permacrud>
13989         </class>
13990
13991         <class id="cc" 
13992                 controller="open-ils.cstore open-ils.pcrud"
13993                 oils_obj:fieldmapper="container::carousel" 
13994                 oils_persist:tablename="container.carousel" 
13995                 reporter:label="Carousels">
13996                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13997                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13998                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13999                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14000                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
14001                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
14002                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
14003                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
14004                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
14005                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
14006                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
14007                         <field reporter:label="Item Libraries" name="owning_lib_filter" reporter:datatype="text" />      <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
14008                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
14009                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
14010                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
14011                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
14012                 </fields>
14013                 <links>
14014                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
14015                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14016                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
14017                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
14018                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
14019                 </links>
14020                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14021                         <actions>
14022                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
14023                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
14024                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
14025                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
14026                         </actions>
14027                 </permacrud>
14028         </class>
14029
14030         <class id="ccou" 
14031                 controller="open-ils.cstore open-ils.pcrud"
14032                 oils_obj:fieldmapper="container::carousel_org_unit" 
14033                 oils_persist:tablename="container.carousel_org_unit" 
14034                 reporter:label="Carousels Visible at Library">
14035                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
14036                         <field reporter:label="ID" name="id" reporter:datatype="id" />
14037                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
14038                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
14039                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
14040                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
14041                 </fields>
14042                 <links>
14043                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
14044                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
14045                 </links>
14046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14047                         <actions>
14048                                 <create permission="ADMIN_CAROUSEL">
14049                                     <context link="carousel" field="owner" />
14050                                 </create>
14051                                 <retrieve permission="ADMIN_CAROUSEL">
14052                                     <context link="carousel" field="owner" />
14053                                 </retrieve>
14054                                 <update permission="ADMIN_CAROUSEL">
14055                                     <context link="carousel" field="owner" />
14056                                 </update>
14057                                 <delete permission="ADMIN_CAROUSEL">
14058                                     <context link="carousel" field="owner" />
14059                                 </delete>
14060                         </actions>
14061                 </permacrud>
14062         </class>
14063
14064         <class id="cra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remoteauth_profile" oils_persist:tablename="config.remoteauth_profile" reporter:label="Remote Patron Authentication Configuration Profile">
14065                 <fields oils_persist:primary="name">
14066                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
14067                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
14068                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
14069                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
14070                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
14071                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
14072                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
14073                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
14074                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
14075                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
14076                 </fields>
14077                 <links>
14078                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
14079                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
14080                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
14081                 </links>
14082                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14083                         <actions>
14084                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14085                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
14086                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14087                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14088                         </actions>
14089                 </permacrud>
14090         </class>
14091         <class id="cgs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::geolocation_service" oils_persist:tablename="config.geolocation_service" reporter:label="Geographic Location Service">
14092                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14093                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14094                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14095                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14096                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14097                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14098                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14099                 </fields>
14100                 <links>
14101                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14102                 </links>
14103                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14104                         <actions>
14105                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14106                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14107                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14108                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14109                         </actions>
14110                 </permacrud>
14111         </class>
14112
14113     <class id="cusppet" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry_type" oils_persist:tablename="config.ui_staff_portal_page_entry_type" reporter:label="Portal Page Entry Type">
14114         <fields oils_persist:primary="code">
14115             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14116             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14117         </fields>
14118                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14119                         <actions>
14120                                 <retrieve/>
14121                         </actions>
14122                 </permacrud>
14123         </class>
14124
14125     <class id="cusppe" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::ui_staff_portal_page_entry" oils_persist:tablename="config.ui_staff_portal_page_entry" reporter:label="Portal Page Entry">
14126         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14127             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14128             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14129             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14130             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14131             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14132             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14133             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14134             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14135                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14136         </fields>
14137                 <links>
14138                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14139                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14140                 </links>
14141         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14142             <actions>
14143                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14144                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14145                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14146                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14147             </actions>
14148         </permacrud>
14149     </class>
14150
14151         <!-- Simple Reporter classes are currently used only by the SR UI -->
14152     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14153         <oils_persist:source_definition><![CDATA[
14154             SELECT
14155               -- Circ id; just for counting
14156               combcirc.id AS circ_id,
14157
14158               -- User info, currently limiting to what's available from action.all_circulation
14159               combcirc.usr_post_code AS usr_post_code,
14160               combcirc.usr_birth_year AS usr_bith_year,
14161               combcirc.usr_profile AS usr_profile_id,
14162               pgtu.name AS usr_profile,
14163               combcirc.usr_home_ou AS usr_home_ou_id,
14164               aouuh.shortname AS usr_home_ou_shortname,
14165               aouuh.name AS usr_home_ou_name,
14166               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14167               aouus.shortname AS usr_sys_shortname,
14168               aouus.name AS usr_sys_name,
14169
14170               -- Circ info
14171               -- Checkout
14172               combcirc.xact_start AS xact_start,
14173               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14174               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14175               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14176               combcirc.circ_lib AS circ_lib_id,
14177               aouco.shortname AS circ_lib_shortname,
14178               aouco.name AS circ_lib_name,
14179               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14180               aoucos.shortname AS circ_sys_shortname,
14181               aoucos.name AS circ_sys_name,
14182               auco.usrname AS circ_staff,
14183               awso.name AS checkout_workstation,
14184
14185               combcirc.due_date AS due_date,
14186               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14187               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14188               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14189
14190               -- Checkin
14191               combcirc.xact_finish AS xact_finish,
14192               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14193               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14194               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14195               aouci.shortname AS checkin_lib_shortname,
14196               aouci.name AS checkin_lib_name,
14197               auci.usrname AS checkin_staff,
14198               awsi.name AS checkin_workstation,
14199               aoucis.shortname AS checkin_sys_shortname,
14200               aoucis.name AS checkin_sys_name,
14201
14202               combcirc.checkin_time AS checkin_time,
14203
14204               -- Misc circ info
14205               combcirc.renewal_remaining AS renewal_remaining,
14206               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14207               combcirc.grace_period AS grace_period,
14208
14209               combcirc.stop_fines AS stop_fines,
14210               combcirc.stop_fines_time AS stop_fines_time,
14211
14212               combcirc.duration AS duration,
14213               combcirc.fine_interval AS fine_interval,
14214               combcirc.recurring_fine AS recurring_fine,
14215               combcirc.max_fine AS max_fine,
14216               combcirc.duration_rule AS duration_rule,
14217               combcirc.recurring_fine_rule AS recurring_fine_rule,
14218               combcirc.max_fine_rule AS max_fine_rule,
14219               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14220               CASE WHEN phone_renewal THEN 'phone' WHEN desk_renewal THEN 'desk' WHEN opac_renewal THEN 'opac' WHEN auto_renewal THEN 'auto' ELSE null END AS renewal_type,
14221               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14222
14223               -- Copy info
14224               acp.barcode AS copy_barcode,
14225               acp.circ_modifier AS copy_circ_modifier_code,
14226               ccm.name AS copy_circ_modifier_name,
14227               acp.circ_lib AS copy_circ_lib_id,
14228               acp.location AS location_id,
14229               acpl.name AS location_name,
14230               aoucp.shortname AS copy_circ_lib_shortname,
14231               aoucp.name AS copy_circ_lib_name,
14232               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14233               aoucps.shortname AS copy_sys_shortname,
14234               aoucps.name AS copy_sys_name,
14235               combcirc.copy_owning_lib AS copy_owning_lib_id,
14236               aoucpo.shortname AS copy_owning_lib_shortname,
14237               aoucpo.name AS copy_owning_lib_name,
14238               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14239               acnp.label AS copy_call_number_prefix,
14240               acn.label AS copy_call_number_label,
14241               acns.label AS copy_call_number_suffix,
14242               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14243               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14244               acn.label_sortkey AS copy_call_number_label_sortkey,
14245               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14246               COALESCE(rmsr.title, acp.dummy_title) AS title,
14247               COALESCE(rmsr.author, acp.dummy_author) AS author,
14248               rmsr.publisher AS publisher,
14249               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14250               array_to_string(rmsr.isbn, ', ') AS isbn,
14251               array_to_string(rmsr.issn, ', ') AS issn,
14252               part.label AS part_label,
14253               part.label_sortkey AS part_label_sortkey,
14254               acn.record AS bib_id,
14255               rmsr.tcn_value AS tcn_value
14256
14257             FROM
14258               action.all_circulation combcirc
14259
14260               -- User
14261               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14262               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14263               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14264
14265               -- Circ
14266               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14267               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14268               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14269               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14270               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14271               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14272               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14273               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14274
14275               -- Copy / call / title
14276               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14277                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14278               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14279               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14280               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14281               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14282               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14283               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14284               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14285               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14286               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14287               LEFT JOIN (
14288                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14289                 FROM biblio.monograph_part bmp
14290                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14291                 WHERE NOT bmp.deleted
14292               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14293         ]]></oils_persist:source_definition>
14294         <field_groups>
14295             <group name="common" reporter:label="Common Fields"/>
14296             <group name="item" reporter:label="Item Fields"/>
14297             <group name="user" reporter:label="Patron Fields"/>
14298             <group name="title" reporter:label="Call Number and Title Fields"/>
14299             <group name="org" reporter:label="Libraries"/>
14300         </field_groups>
14301         <fields oils_persist:primary="circ_id">
14302             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14303             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14304             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14305             <field reporter:label="Patron Profile Group" name="usr_profile_id" sr:hide_from="display" reporter:datatype="link" field_groups="user,common" sr:suggest_filter="true"/>
14306             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14307             <field reporter:label="Patron Home Library" name="usr_home_ou_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14308             <field reporter:label="Patron Home Library Short (Policy) Name" sr:hide_from="filter" name="usr_home_ou_shortname" reporter:datatype="text" field_groups="org,user,common"/>
14309             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14310             <field reporter:label="Patron System Library" name="usr_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,user,common" sr:suggest_filter="true"/>
14311             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14312             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14313             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14314             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14315             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14316             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14317             <field reporter:label="Checkout Library" name="circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,common" sr:suggest_filter="true"/>
14318             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14319             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14320             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14321             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14322             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14323             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14324             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14325             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14326             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14327             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14328             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14329             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14330             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14331             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14332             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14333             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14334             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14335             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14336             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14337             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14338             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14339             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14340             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14341             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14342             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14343             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14344             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14345             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14346             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14347             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14348             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14349             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14350             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14351             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14352             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14353             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14354             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14355             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14356             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14357             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14358             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14359             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14360             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14361             <field reporter:label="Item Circulating Library Short (Policy) Name" name="copy_circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14362             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14363             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14364             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14365             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14366             <field reporter:label="Item Owning Library" name="copy_owning_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item" sr:suggest_filter="true"/>
14367             <field reporter:label="Item Owning Library Short (Policy) Name" name="copy_owning_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14368             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14369             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14370             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14371             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14372             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14373             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14374             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14375             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14376             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14377             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14378             <field reporter:label="Call Number Dewey Block Tens" name="copy_call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14379             <field reporter:label="Call Number Dewey Block Hundreds" name="copy_call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14380             <field reporter:label="Call Number Dewey Range Tens" name="copy_call_number_dewey_range_tens" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14381             <field reporter:label="Call Number Dewey Range Hundreds" name="copy_call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title,common" sr:suggest_filter="true"/>
14382             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14383             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14384             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14385             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14386             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14387             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14388             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14389             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14390             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14391             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14392         </fields>
14393         <links>
14394             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14395             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14396             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14397         </links>
14398     </class>
14399
14400     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14401         <oils_persist:source_definition><![CDATA[
14402             SELECT
14403               au.home_ou AS home_ou_filter,
14404               au.id AS user_id,
14405               cardp.barcode AS barcode_primary,
14406               au.usrname AS usrname,
14407               au.email AS email,
14408               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14409               au.prefix AS prefix,
14410               au.first_given_name AS first_given_name,
14411               au.second_given_name AS second_given_name,
14412               au.family_name AS family_name,
14413               au.suffix AS suffix,
14414               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14415               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14416               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14417               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14418               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14419               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14420               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14421               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14422               au.profile AS profile_id,
14423               pgt.name AS profile,
14424               au.alias AS alias,
14425               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14426               au.day_phone AS day_phone,
14427               au.evening_phone AS evening_phone,
14428               au.other_phone AS other_phone,
14429               au.dob AS dob,
14430               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14431               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14432               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14433               au.active AS active,
14434               au.barred AS barred,
14435               au.deleted AS deleted,
14436               au.juvenile AS juvenile,
14437               au.claims_returned_count AS claims_returned_count,
14438               au.credit_forward_balance AS credit_forward_balance,
14439               au.create_date AS create_date,
14440               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14441               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14442               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14443               au.expire_date AS expire_date,
14444               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14445               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14446               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14447               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14448               au.last_update_time AS last_update_time,
14449               au.home_ou AS home_ou_id,
14450               aouh.shortname AS home_ou_shortname,
14451               aouh.name AS home_ou_name,
14452               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14453               aous.shortname AS home_sys_shortname,
14454               aous.name AS home_sys_name,
14455               auam.valid AS mailing_valid,
14456               auam.address_type AS mailing_address_type,
14457               auam.street1 AS mailing_street1,
14458               auam.street2 AS mailing_street2,
14459               auam.city AS mailing_city,
14460               auam.state AS mailing_state,
14461               auam.country AS mailing_country,
14462               auam.post_code AS mailing_post_code,
14463               auam.county AS mailing_county,
14464               auam.within_city_limits AS mailing_within_city_limits,
14465               auam.pending AS mailing_pending,
14466               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14467               auap.valid AS physical_valid,
14468               auap.address_type AS physical_address_type,
14469               auap.street1 AS physical_street1,
14470               auap.street2 AS physical_street2,
14471               auap.city AS physical_city,
14472               auap.state AS physical_state,
14473               auap.country AS physical_country,
14474               auap.post_code AS physical_post_code,
14475               auap.county AS physical_county,
14476               auap.within_city_limits AS physical_within_city_limits,
14477               auap.pending AS physical_pending,
14478               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14479               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14480               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14481               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14482               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14483               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14484               asceum1.stat_cat_entry AS legacy_stat_cat1,
14485               asceum2.stat_cat_entry AS legacy_stat_cat2,
14486
14487               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14488               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14489               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14490               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14491               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL AND now() > circ.due_date THEN circ.id ELSE NULL END) AS circs_overdue,
14492               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14493
14494             FROM
14495               actor.usr au
14496               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14497               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14498               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14499               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14500               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14501               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14502               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14503               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14504               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14505               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14506               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14507               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14508               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14509               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14510               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14511               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14512
14513             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14514               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14515               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14516               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14517               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14518               76,77,78,79,80,81
14519         ]]></oils_persist:source_definition>
14520         <field_groups>
14521             <group name="common" reporter:label="Common Fields"/>
14522             <group name="name" reporter:label="Name Fields"/>
14523             <group name="contact" reporter:label="Contact Fields"/>
14524             <group name="address" reporter:label="Address Related Fields"/>
14525             <group name="org" reporter:label="Libraries"/>
14526         </field_groups>
14527         <fields oils_persist:primary="user_id">
14528             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14529                 sr:hide_from="display,filter" sr:force_transform="reporter.intersect_user_perm_ou,SR__USER_ID,VIEW_USER" sr:force_filter="true" sr:force_filtervalues="t"/>
14530             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14531             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14532             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14533             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14534             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14535             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14536             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14537             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14538             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14539             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14540             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14541             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14542             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14543             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14544             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14545             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14546             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14547             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14548             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14549             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14550             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14551             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14552             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14553             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14554             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14555             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14556             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14557             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14558             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14559             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14560             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14561             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14562             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14563             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14564             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14565             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14566             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14567             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14568             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14569             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14570             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14571             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14572             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14573             <field reporter:label="Home Library" name="home_ou_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14574             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14575             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14576             <field reporter:label="Home System" name="home_sys_id" reporter:datatype="org_unit" sr:suggest_filter="true" sr:hide_from="display" field_groups="org,common"/>
14577             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14578             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14579             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14580             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14581             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14582             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14583             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14584             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14585             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14586             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14587             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14588             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14589             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14590             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14591             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14592             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14593             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14594             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14595             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14596             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14597             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14598             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14599             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14600             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14601             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14602             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14603             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14604             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14605             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14606             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14607             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14608             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14609             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14610             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14611             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14612             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14613             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14614             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14615         </fields>
14616         <links>
14617             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14618         </links>
14619     </class>
14620
14621     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14622         <oils_persist:source_definition><![CDATA[
14623             SELECT
14624               -- ids
14625               acp.id AS copy_id,
14626               acp.floating AS floating_id,
14627               acn.id AS acn_id,
14628               acp.circ_lib AS circ_lib_id,
14629               acp.status AS status_id,
14630               acp.location AS location_id,
14631               acp.age_protect AS age_protect_id,
14632               aous.id AS circ_sys_id,
14633               acn.owning_lib AS owning_lib_id,
14634               aouos.id AS owning_sys_id,
14635               awsi.id AS inv_workstation_id,
14636
14637               -- OUs
14638               aou.shortname AS circ_lib_shortname,
14639               aou.name AS circ_lib_name,
14640               aous.shortname AS circ_sys_shortname,
14641               aous.name AS circ_sys_name,
14642               aouo.shortname AS owning_lib_shortname,
14643               aouo.name AS owning_lib_name,
14644               aouos.shortname AS owning_sys_shortname,
14645               aouos.name AS owning_sys_name,
14646
14647               -- dates
14648               acp.create_date AS create_date_time,
14649               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14650               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14651               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14652               acp.active_date AS active_date_time,
14653               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14654               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14655               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14656               acp.edit_date AS edit_date_time,
14657               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14658               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14659               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14660               acp.status_changed_time AS status_changed_time_time,
14661               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14662               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14663               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14664               ali.inventory_date AS latest_inv_date,
14665               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14666               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14667               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14668
14669               -- acp
14670               acp.barcode AS barcode,
14671               ccs.name AS status,
14672               acpl.name AS location_name,
14673                                                         acp.circ_modifier AS copy_circ_modifier_code,
14674                                                         ccm.name AS copy_circ_modifier_name,
14675               acp.price AS price,
14676               acp.cost AS acq_price,
14677               acp.deleted AS copy_deleted,
14678               acp.ref AS reference,
14679               acp.circulate AS copy_circulate,
14680               (acp.circulate AND acpl.circulate) AS circulate,
14681               acp.holdable AS copy_holdable,
14682               acp.deposit AS deposit,
14683               acp.deposit_amount AS deposit_amount,
14684               acp.alert_message AS alert_message,
14685               acp.opac_visible AS copy_opac_visible,
14686               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14687               crahp.name AS age_protect,
14688               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14689               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14690               acp.copy_number AS copy_number,
14691               acp.circ_as_type AS circ_as_type,
14692               acp.loan_duration AS loan_duration_int,
14693               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14694               acp.fine_level AS fine_level_int,
14695               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14696
14697               -- Call Number
14698               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14699               acnp.label AS copy_call_number_prefix,
14700               acn.label AS copy_call_number_label,
14701               acns.label AS copy_call_number_suffix,
14702               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14703               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14704               acn.label_sortkey AS copy_call_number_label_sortkey,
14705               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14706               racnd.dewey AS call_number_dewey,
14707               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14708               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14709               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14710               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14711
14712               -- Misc
14713               COALESCE(rmsr.title, acp.dummy_title) AS title,
14714               COALESCE(rmsr.author, acp.dummy_author) AS author,
14715               rmsr.publisher AS publisher,
14716               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14717               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14718               array_to_string(rmsr.issn, ', ') AS issn,
14719               part.label AS part_label,
14720               part.label_sortkey AS part_label_sortkey,
14721               acn.record AS bib_id,
14722               rmsr.tcn_value AS tcn_value,
14723               acn.deleted AS call_deleted,
14724               bre.deleted AS bib_deleted,
14725               ccs.holdable AS status_holdable,
14726               acpl.holdable AS location_holdable,
14727               acp.circulate AS location_circulate,
14728               awsi.name AS inventory_workstation,
14729               aucr.usrname AS creating_user,
14730               aued.usrname AS editing_user,
14731
14732               -- Aggregates
14733               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14734               COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
14735               COUNT(DISTINCT combcirc.id) AS circ_total,
14736               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14737
14738             FROM
14739               asset.copy acp
14740               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14741               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14742               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14743               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14744               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14745               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14746               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14747               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14748               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14749               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14750               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14751               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14752               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14753               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14754               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14755               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14756               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14757               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14758               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14759               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14760               LEFT JOIN (
14761                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14762                 FROM biblio.monograph_part bmp
14763                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14764                 WHERE NOT bmp.deleted
14765               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14766
14767             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14768               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14769               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14770               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14771               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14772               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14773               91,92,93,94,95,96
14774
14775         ]]></oils_persist:source_definition>
14776         <field_groups>
14777             <group name="common" reporter:label="Common Fields"/>
14778             <group name="dates" reporter:label="Date Fields"/>
14779             <group name="title" reporter:label="Call Number and Title Fields"/>
14780             <group name="org" reporter:label="Libraries"/>
14781         </field_groups>
14782         <fields oils_persist:primary="copy_id">
14783             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14784             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14785             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14786             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14787             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14788             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14789             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14790             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14791             <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14792             <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
14793             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14794             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14795             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14796             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14797             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14798             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14799             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14800             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14801             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14802             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14803             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14804             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14805             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14806             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14807             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14808             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14809             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14810             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14811             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14812             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14813             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14814             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14815             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14816             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14817             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14818             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14819             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14820             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14821             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14822             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14823             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14824             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14825             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14826             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14827             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14828             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14829             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14830             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14831             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14832             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14833             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14834             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14835             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14836             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14837             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14838             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14839             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14840             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14841             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14842             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14843             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14844             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14845             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14846             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14847             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14848             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14849             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14850             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14851             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14852             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14853             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14854             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14855             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14856             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14857             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14858             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14859             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14860             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14861             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14862             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14863             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14864             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14865             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14866             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14867             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14868             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14869             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14870             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14871             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14872             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14873             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14874             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14875             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14876             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14877         </fields>
14878         <links>
14879             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14880             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14881             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14882             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14883             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14884             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14885         </links>
14886     </class>
14887
14888     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14889         <oils_persist:source_definition><![CDATA[
14890
14891             SELECT
14892               -- ids
14893               acp.id AS copy_id,
14894               acn.id AS acn_id,
14895               acp.circ_lib AS circ_lib_id,
14896               acp.status AS status_id,
14897               acp.location AS location_id,
14898               acp.age_protect AS age_protect_id,
14899               aous.id AS circ_sys_id,
14900               acn.owning_lib AS owning_lib_id,
14901               aouos.id AS owning_sys_id,
14902               awsi.id AS inv_workstation_id,
14903
14904               -- OUs
14905               aou.shortname AS circ_lib_shortname,
14906               aou.name AS circ_lib_name,
14907               aous.shortname AS circ_sys_shortname,
14908               aous.name AS circ_sys_name,
14909               aouo.shortname AS owning_lib_shortname,
14910               aouo.name AS owning_lib_name,
14911               aouos.shortname AS owning_sys_shortname,
14912               aouos.name AS owning_sys_name,
14913
14914               -- dates
14915               acp.create_date AS create_date_time,
14916               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14917               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14918               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14919               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14920               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14921               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14922               acp.active_date AS active_date_time,
14923               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14924               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14925               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14926               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14927               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14928               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14929               acp.edit_date AS edit_date_time,
14930               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14931               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14932               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14933               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14934               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14935               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14936               acp.status_changed_time AS status_changed_time_time,
14937               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14938               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14939               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14940               ali.inventory_date AS latest_inv_date,
14941               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14942               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14943               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14944               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14945               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14946               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14947
14948               -- acp
14949               acp.barcode AS barcode,
14950               ccs.name AS status,
14951               acpl.name AS location_name,
14952               acp.circ_modifier AS circ_modifier_code,
14953               ccm.name AS circ_modifier_name,
14954               acp.price AS price,
14955               acp.cost AS acq_price,
14956               acp.deleted AS copy_deleted,
14957               acp.ref AS reference,
14958               acp.circulate AS copy_circulate,
14959               (acp.circulate AND acpl.circulate) AS circulate,
14960               acp.holdable AS copy_holdable,
14961               acp.deposit AS deposit,
14962               acp.deposit_amount AS deposit_amount,
14963               acp.alert_message AS alert_message,
14964               acp.opac_visible AS copy_opac_visible,
14965               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14966               crahp.name AS age_protect,
14967               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14968               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14969               acp.copy_number AS copy_number,
14970               acp.circ_as_type AS circ_as_type,
14971               acp.loan_duration AS loan_duration_int,
14972               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14973               acp.fine_level AS fine_level_int,
14974               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14975
14976               -- Call Number
14977               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14978               acnp.label AS copy_call_number_prefix,
14979               acn.label AS copy_call_number_label,
14980               acns.label AS copy_call_number_suffix,
14981               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14982               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14983               acn.label_sortkey AS copy_call_number_label_sortkey,
14984               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14985               racnd.dewey AS call_number_dewey,
14986               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14987               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14988               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14989               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14990
14991               -- Misc
14992               COALESCE(rmsr.title, acp.dummy_title) AS title,
14993               COALESCE(rmsr.author, acp.dummy_author) AS author,
14994               rmsr.publisher AS publisher,
14995               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14996               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14997               array_to_string(rmsr.issn, ', ') AS issn,
14998               part.label AS part_label,
14999               part.label_sortkey AS part_label_sortkey,
15000               acn.record AS bib_id,
15001               rmsr.tcn_value AS tcn_value,
15002               acn.deleted AS call_deleted,
15003               bre.deleted AS bib_deleted,
15004               ccs.holdable AS status_holdable,
15005               acpl.holdable AS location_holdable,
15006               acp.circulate AS location_circulate,
15007               awsi.name AS inventory_workstation,
15008
15009               -- Aggregates
15010               -- may decide these price games aren't worth it, but estimated collection value is useful
15011               COALESCE(acp.cost, acp.price, (select first(value::numeric(8,2)) from actor.org_unit_ancestor_setting('cat.default_item_price', acp.circ_lib)), 5.00) AS est_price,
15012               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
15013               MAX(combcirc.xact_start) AS last_circ_datetime,
15014               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
15015               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
15016               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
15017               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
15018               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
15019               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
15020               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
15021               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
15022               (EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) * 12) + EXTRACT(MONTH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_months,
15023               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
15024               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
15025               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
15026               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
15027               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
15028               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
15029               COUNT(DISTINCT CASE WHEN date_part('year', now() - '1 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_year,
15030               COUNT(DISTINCT CASE WHEN date_part('year', now() - '2 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_two_years_ago,
15031               COUNT(DISTINCT CASE WHEN date_part('year', now() - '3 year'::interval) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_three_years_ago,
15032               COUNT(DISTINCT CASE WHEN date_part('year', now() - '5 year'::interval) <= date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_last_five_years
15033
15034             FROM
15035               asset.copy acp
15036               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
15037               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
15038               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
15039               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
15040               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
15041               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
15042               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
15043               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
15044               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
15045               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
15046               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
15047               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
15048               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
15049               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
15050               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
15051               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
15052               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
15053               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
15054               LEFT JOIN (
15055                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
15056                 FROM biblio.monograph_part bmp
15057                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
15058                 WHERE NOT bmp.deleted
15059               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
15060
15061             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
15062               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
15063               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
15064               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
15065               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
15066               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
15067               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
15068
15069         ]]></oils_persist:source_definition>
15070         <field_groups>
15071             <group name="common" reporter:label="Common Fields"/>
15072             <group name="dates" reporter:label="Date Fields"/>
15073             <group name="inv" reporter:label="Inventory Fields"/>
15074             <group name="title" reporter:label="Call Number and Title Fields"/>
15075             <group name="org" reporter:label="Libraries"/>
15076         </field_groups>
15077         <fields oils_persist:primary="copy_id">
15078              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
15079              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
15080              <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15081              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
15082              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
15083              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
15084              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15085              <field reporter:label="Owning Library" name="owning_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common" sr:suggest_filter="true"/>
15086              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15087              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15088              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15089              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15090              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15091              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15092              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15093              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15094              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15095              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15096              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15097              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15098              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15099              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15100              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15101              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15102              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15103              <field reporter:label="Last Circulated or Item Created Date / Time" name="last_circ_create_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15104              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15105              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15106              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15107              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15108              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15109              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15110              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15111              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15112              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15113              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15114              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15115              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15116              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15117              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15118              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15119              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15120              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15121              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15122              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15123              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15124              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15125              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15126              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15127              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15128              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15129              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15130              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15131              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15132              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15133              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15134              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15135              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15136              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15137              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15138              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15139              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15140              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15141              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15142              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15143              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15144              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15145              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15146              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15147              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15148              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15149              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15150              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15151              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15152              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15153              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15154              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15155              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15156              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15157              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15158              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15159              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15160              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15161              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15162              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15163              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15164              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15165              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15166              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15167              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15168              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15169              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15170              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15171              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15172              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15173              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15174              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15175              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15176              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15177              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15178              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15179              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15180              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15181              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15182              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15183              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15184              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15185              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15186              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15187              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15188              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15189              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15190              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15191              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15192              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15193              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15194              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15195              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15196              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15197              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15198              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15199              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15200              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15201              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15202              <field reporter:label="Circulation Two Years Ago" name="circ_two_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15203              <field reporter:label="Circulation Three Years Ago" name="circ_three_years_ago" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15204              <field reporter:label="Circulation Total Last Five Years" name="circ_last_five_years" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15205         </fields>
15206         <links>
15207             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15208             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15209             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15210             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15211             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15212         </links>
15213     </class>
15214
15215     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15216         <oils_persist:source_definition><![CDATA[
15217
15218             SELECT
15219               -- ids
15220               xact.id AS xact_id,
15221               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15222               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15223
15224               -- OUs
15225               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15226               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15227               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15228               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15229
15230               -- billings
15231               billings.total_amount AS billing_grand_total,
15232               billings.total_unvoided_amount AS billing_total,
15233
15234               billings.voided_billing_count AS billing_voided_count,
15235               billings.all_billing_types AS all_billing_types,
15236               billings.billing_types AS billing_types,
15237
15238               billings.total_voided_amount AS billing_total_voided,
15239               billings.total_overdue_amount AS billing_overdue_amount,
15240               billings.total_lost_amount AS billing_lost_amount,
15241               billings.total_long_od_amount AS billing_long_od_amount,
15242               billings.total_damaged_amount AS billing_damaged_amount,
15243               billings.total_deposit_amount AS billing_deposit_amount,
15244               billings.total_rental_amount AS billing_rental_amount,
15245
15246               -- payments
15247               payments.total_amount AS payment_grand_total,
15248               payments.total_unvoided_amount AS payment_total,
15249
15250               payments.voided_payment_count AS payment_voided_count,
15251               payments.all_payment_types AS all_payment_types,
15252               payments.payment_types AS payment_types,
15253
15254               payments.total_voided_amount AS payment_total_voided,
15255               payments.total_account_adjustment AS payment_account_adjustment_amount,
15256               payments.total_cash_payment AS payment_cash_amount,
15257               payments.total_check_payment AS payment_check_amount,
15258               payments.total_credit_card_payment AS payment_credit_card_amount,
15259               payments.total_debit_card_payment AS payment_debit_card_amount,
15260               payments.total_credit_payment AS payment_credit_amount,
15261               payments.total_forgive_payment AS payment_forgive_amount,
15262               payments.total_work_payment AS payment_work_amount,
15263               payments.total_goods_payment AS payment_goods_amount,
15264               payments.total_currency_payment AS payment_currency_amount,
15265               payments.total_non_currency_payment AS payment_non_currency_amount,
15266
15267               -- dates
15268               xact.xact_start AS xact_start,
15269               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15270               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15271               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15272               xact.xact_finish AS xact_finish,
15273               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15274               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15275               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15276               billings.earliest_billing_ts AS earliest_billing_ts,
15277               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15278               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15279               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15280               billings.latest_billing_ts AS latest_billing_ts,
15281               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15282               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15283               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15284               payments.earliest_payment_ts AS earliest_payment_ts,
15285               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15286               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15287               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15288               payments.latest_payment_ts AS latest_payment_ts,
15289               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15290               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15291               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15292
15293               -- Misc
15294               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15295               (xact.xact_finish IS NOT NULL) AS xact_closed
15296
15297             FROM
15298               money.billable_xact xact
15299               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15300               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15301               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15302               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15303               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15304               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15305
15306               -- oohh nooo.... If not done this way you encounter situations
15307               -- like multiplying billing totals x number of payments and
15308               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15309               LEFT JOIN (
15310                 SELECT
15311                   xact,
15312                   MIN(billing_ts) AS earliest_billing_ts,
15313                   MAX(billing_ts) AS latest_billing_ts,
15314
15315                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15316                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15317                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15318
15319                   SUM(amount) AS total_amount,
15320                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15321                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15322                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15323                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15324                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15325                   SUM(CASE WHEN NOT voided AND btype IN (7,8) THEN amount ELSE NULL END) AS total_damaged_amount, -- Likely incomplete because damaged billing interface is whack.
15326                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15327                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15328
15329                 FROM
15330                   money.all_billings
15331                 GROUP BY 1
15332               ) billings ON (xact.id = billings.xact)
15333               -- Can't include accepting user or cash_drawer because that will "duplicate"
15334               -- rows if multiple staff accept payments on a single xact...
15335               LEFT JOIN (
15336                 SELECT
15337                   xact,
15338                   MIN(payment_ts) AS earliest_payment_ts,
15339                   MAX(payment_ts) AS latest_payment_ts,
15340
15341                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15342                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15343                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15344
15345                   SUM(amount) AS total_amount,
15346                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15347                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15348                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15349                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15350                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15351                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15352                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15353                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15354                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15355                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15356                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15357                   SUM(CASE WHEN NOT voided AND payment_type IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_currency_payment,
15358                   SUM(CASE WHEN NOT voided AND payment_type NOT IN ('cash_payment', 'check_payment', 'credit_card_payment', 'debit_card_payment', 'credit_payment') THEN amount ELSE NULL END) AS total_non_currency_payment
15359
15360                 FROM
15361                   money.all_payments
15362                 GROUP BY 1
15363               ) payments ON (xact.id = payments.xact)
15364
15365         ]]></oils_persist:source_definition>
15366         <field_groups>
15367             <group name="common" reporter:label="Common Fields"/>
15368             <group name="bill" reporter:label="Billing Fields"/>
15369             <group name="pay" reporter:label="Payment Fields"/>
15370             <group name="dates" reporter:label="Date Fields"/>
15371             <group name="org" reporter:label="Libraries"/>
15372         </field_groups>
15373         <fields oils_persist:primary="xact_id">
15374              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15375              <field reporter:label="Billing Library" name="billing_lib_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15376              <field reporter:label="Billing System" name="billing_sys_id" reporter:datatype="org_unit" sr:hide_from="display" sr:suggest_filter="true" field_groups="org,common"/>
15377              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15378              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15379              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15380              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15381              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15382              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15383              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15384              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15385              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15386              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15387              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15388              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15389              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15390              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15391              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15392              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15393              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15394              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15395              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15396              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15397              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15398              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15399              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15400              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15401              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15402              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15403              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15404              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15405              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15406              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15407              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15408              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15409              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15410              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15411              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15412              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15413              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15414              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15415              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15416              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15417              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15418              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15419              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15420              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15421              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15422              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15423              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15424              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15425              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15426              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15427              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15428              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15429              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15430              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15431              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15432              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15433              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15434              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15435              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15436         </fields>
15437     </class>
15438
15439         <class id="coauf" 
15440                 controller="open-ils.cstore open-ils.pcrud"
15441                 oils_obj:fieldmapper="config::openathens_uid_field" 
15442                 oils_persist:tablename="config.openathens_uid_field" 
15443                 reporter:label="OpenAthens unique identifiers">
15444                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_uid_field_id_seq">
15445                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15446                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15447                 </fields>
15448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15449                         <actions>
15450                                 <retrieve/>
15451                         </actions>
15452                 </permacrud>
15453         </class>
15454
15455         <class id="coanf" 
15456                 controller="open-ils.cstore open-ils.pcrud"
15457                 oils_obj:fieldmapper="config::openathens_name_field" 
15458                 oils_persist:tablename="config.openathens_name_field" 
15459                 reporter:label="OpenAthens name fields">
15460                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_name_field_id_seq">
15461                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id" />
15462                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
15463                 </fields>
15464                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15465                         <actions>
15466                                 <retrieve/>
15467                         </actions>
15468                 </permacrud>
15469         </class>
15470
15471         <class id="coai" 
15472                 controller="open-ils.cstore open-ils.pcrud"
15473                 oils_obj:fieldmapper="config::openathens_identity" 
15474                 oils_persist:tablename="config.openathens_identity" 
15475                 reporter:label="Sign-on to OpenAthens">
15476                 <fields oils_persist:primary="id" oils_persist:sequence="config.openathens_identity_id_seq">
15477                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
15478                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
15479                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
15480                         <field reporter:label="API key" name="api_key" reporter:datatype="text" oils_obj:required="true"/>
15481                         <field reporter:label="Connection ID" name="connection_id" reporter:datatype="text" oils_obj:required="true"/>
15482                         <field reporter:label="Connection URI" name="connection_uri" reporter:datatype="text" oils_obj:required="true"/>
15483                         <field reporter:label="Auto sign-on" name="auto_signon_enabled" reporter:datatype="bool"/>
15484                         <field reporter:label="Auto sign-out" name="auto_signout_enabled" reporter:datatype="bool"/>
15485                         <field reporter:label="Unique identifier field" name="unique_identifier" reporter:datatype="link" oils_obj:required="true"/>
15486                         <field reporter:label="Display name field" name="display_name" reporter:datatype="link" oils_obj:required="true"/>
15487                         <field reporter:label="Release prefix" name="release_prefix" reporter:datatype="bool"/>
15488                         <field reporter:label="Release first name" name="release_first_given_name" reporter:datatype="bool"/>
15489                         <field reporter:label="Release middle name" name="release_second_given_name" reporter:datatype="bool"/>
15490                         <field reporter:label="Release surname" name="release_family_name" reporter:datatype="bool"/>
15491                         <field reporter:label="Release suffix" name="release_suffix" reporter:datatype="bool"/>
15492                         <field reporter:label="Release email" name="release_email" reporter:datatype="bool"/>
15493                         <field reporter:label="Release home library" name="release_home_ou" reporter:datatype="bool"/>
15494                         <field reporter:label="Release barcode" name="release_barcode" reporter:datatype="bool"/>
15495                 </fields>
15496                 <links>
15497                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
15498                         <link field="unique_identifier" reltype="has_a" key="id" map="" class="coauf"/>
15499                         <link field="display_name" reltype="has_a" key="id" map="" class="coanf"/>
15500                 </links>
15501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
15502                         <actions>
15503                                 <create permission="ADMIN_OPENATHENS" global_required="true"/>
15504                                 <retrieve/>
15505                                 <update permission="ADMIN_OPENATHENS" global_required="true"/>
15506                                 <delete permission="ADMIN_OPENATHENS" global_required="true"/>
15507                         </actions>
15508                 </permacrud>
15509         </class>
15510
15511         <!-- ********************************************************************************************************************* -->
15512 </IDL>
15513
15514 <!--
15515     vim:noet:ts=4:sw=4:
15516 -->