]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
Validate IDL Against XSD
[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         <class id="mups" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_payment_summary" oils_persist:virtual="true" reporter:label="User Payment Summary">
78                 <fields>
79                         <field name="usr" oils_persist:virtual="true" />
80                         <field name="forgive_payment" oils_persist:virtual="true" />
81                         <field name="work_payment" oils_persist:virtual="true" />
82                         <field name="credit_payment" oils_persist:virtual="true" />
83                         <field name="goods_payment" oils_persist:virtual="true" />
84                         <field name="account_adjustment" oils_persist:virtual="true" />
85                 </fields>
86                 <links>
87                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
88                 </links>
89         </class>
90
91         <class id="mwps" controller="open-ils.cstore" oils_obj:fieldmapper="money::workstation_payment_summary" oils_persist:virtual="true" reporter:label="Workstation Payment Summary">
92                 <fields>
93                         <field name="workstation" oils_persist:virtual="true" />
94                         <field name="cash_payment" oils_persist:virtual="true" />
95                         <field name="check_payment" oils_persist:virtual="true" />
96                         <field name="credit_card_payment" oils_persist:virtual="true" />
97                         <field name="debit_card_payment" oils_persist:virtual="true" />
98                 </fields>
99                 <links>
100                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
101                 </links>
102         </class>
103
104         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
105                 <fields>
106                         <field name="id" oils_persist:virtual="true" />
107                         <field name="children" oils_persist:virtual="true" />
108                         <field name="owner_doc" oils_persist:virtual="true" />
109                         <field name="intra_doc_id" oils_persist:virtual="true" />
110                         <field name="parent_node" oils_persist:virtual="true" />
111                         <field name="node_type" oils_persist:virtual="true" />
112                         <field name="namespace_uri" oils_persist:virtual="true" />
113                         <field name="name" oils_persist:virtual="true" />
114                         <field name="value" oils_persist:virtual="true" />
115                 </fields>
116         </class>
117
118         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
119                 <fields>
120                         <field name="title" oils_persist:virtual="true" />
121                         <field name="author" oils_persist:virtual="true" />
122                         <field name="doc_id" oils_persist:virtual="true" />
123                         <field name="doc_type" oils_persist:virtual="true" />
124                         <field name="pubdate" oils_persist:virtual="true" />
125                         <field name="isbn" oils_persist:virtual="true" />
126                         <field name="publisher" oils_persist:virtual="true" />
127                         <field name="tcn" oils_persist:virtual="true" />
128                         <field name="subject" oils_persist:virtual="true" />
129                         <field name="types_of_resource" oils_persist:virtual="true" />
130                         <field name="call_numbers" oils_persist:virtual="true" />
131                         <field name="edition" oils_persist:virtual="true" />
132                         <field name="online_loc" oils_persist:virtual="true" />
133                         <field name="synopsis" oils_persist:virtual="true" />
134                         <field name="physical_description" oils_persist:virtual="true" />
135                         <field name="toc" oils_persist:virtual="true" />
136                         <field name="copy_count" oils_persist:virtual="true" />
137                         <field name="series" oils_persist:virtual="true" />
138                         <field name="serials" oils_persist:virtual="true" />
139                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
140                 </fields>
141         </class>
142
143         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
144                 <fields>
145                         <field name="err_msg" oils_persist:virtual="true" />
146                         <field name="type" oils_persist:virtual="true" />
147                 </fields>
148         </class>
149
150         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
151                 <fields>
152                         <field name="err_msg" oils_persist:virtual="true" />
153                         <field name="type" oils_persist:virtual="true" />
154                 </fields>
155         </class>
156
157         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
158                 <fields oils_persist:primary="matchpoint">
159                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
160                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
161                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
162                 </fields>
163                 <links>
164                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
165                 </links>
166         </class>
167
168         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
169         <!-- when the time is right, turn me into a view.  -->
170                 <fields>
171             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
172             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
173             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
174             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
175             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
176             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
177             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
178             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
179             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
180             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
181                 </fields>
182         </class>
183
184         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
185                 <fields>
186                         <field name="public_name" oils_persist:virtual="true" />
187                         <field name="target_url" oils_persist:virtual="true" />
188                         <field name="target_coverage" oils_persist:virtual="true" />
189                         <field name="target_embargo" oils_persist:virtual="true" />
190                 </fields>
191         </class>
192
193         <!-- Actually in the DB -->
194         <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">
195                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
196                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
197                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
198                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
199                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
200                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
201                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
202                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
203                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
204                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
205                         <field reporter:label="Update Bib. Edit Date" name="update_bib_editor" reporter:datatype="bool"/>
206                 </fields>
207                 <links>
208                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
209                 </links>
210                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
211                         <actions>
212                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
213                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
214                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
215                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
216                         </actions>
217                 </permacrud>
218         </class>
219
220         <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">
221                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
222                         <field reporter:label="Field ID" name="id" reporter:datatype="id" reporter:selector="field"/>
223                         <field reporter:label="Group" name="grp" reporter:datatype="link" config_field="true"/>
224                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
225                 </fields>
226                 <links>
227                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
228                 </links>
229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
230                         <actions>
231                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
232                     <context link="grp" field="owner"/>
233                 </create>
234                                 <retrieve/>
235                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
236                     <context link="grp" field="owner"/>
237                 </update>
238                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
239                     <context link="grp" field="owner"/>
240                 </delete>
241                         </actions>
242                 </permacrud>
243         </class>
244
245         <class  id="rrbs" 
246             controller="open-ils.cstore open-ils.pcrud" 
247             oils_obj:fieldmapper="rating::record_badge_score" 
248             oils_persist:tablename="rating.record_badge_score" 
249             reporter:label="Statistical Popularity Badge">
250                 <fields oils_persist:primary="id" 
251                 oils_persist:sequence="rating.record_badge_score_id_seq">
252                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
253                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
254                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
255                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
256                 </fields>
257         <links>
258             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
259             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
260         </links>
261                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
262                         <actions>
263                                 <retrieve/>
264                         </actions>
265                 </permacrud>
266         </class>
267
268         <class  id="rp" 
269             controller="open-ils.cstore open-ils.pcrud" 
270             oils_obj:fieldmapper="rating::popularity_parameter" 
271             oils_persist:tablename="rating.popularity_parameter" 
272             reporter:label="Statistical Popularity Parameter">
273                 <fields oils_persist:primary="id" 
274                 oils_persist:sequence="rating.popularity_parameter_id_seq">
275                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
276                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
277                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
278                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
279                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
280                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
281                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
282                 </fields>
283                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
284                         <actions>
285                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
286                                 <retrieve/>
287                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
288                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
289                         </actions>
290                 </permacrud>
291         </class>
292
293         <class  id="rb" 
294             controller="open-ils.cstore open-ils.pcrud" 
295             oils_obj:fieldmapper="rating::badge" 
296             oils_persist:tablename="rating.badge" 
297             reporter:label="Statistical Popularity Badge">
298                 <fields oils_persist:primary="id" 
299                 oils_persist:sequence="rating.badge_id_seq">
300                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
301                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
302                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
303                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
304                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
305                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
306                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
307                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
308                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
309                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
310                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
311                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
312                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
313                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
314                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
315                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
316                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
317                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
318                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
319                 </fields>
320                 <links>
321                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
322                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
323                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
324                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
325                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
326                 </links>
327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
328                         <actions>
329                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
330                                 <retrieve/>
331                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
332                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
333                         </actions>
334                 </permacrud>
335         </class>
336
337         <class  id="vibtg" 
338             controller="open-ils.cstore open-ils.pcrud" 
339             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
340             oils_persist:tablename="vandelay.import_bib_trash_group" 
341             reporter:label="Import/Overlay Field Groups for Removal">
342                 <fields oils_persist:primary="id" 
343                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
344                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
345                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
346                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
347                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
348                         <field reporter:label="Fields" name="import_bib_trash_fields" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
349                 </fields>
350                 <links>
351                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
352                         <link field="import_bib_trash_fields" reltype="has_many" key="grp" map="" class="vibtf"/>
353                 </links>
354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
355                         <actions>
356                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
357                                 <retrieve/>
358                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
359                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
360                         </actions>
361                 </permacrud>
362         </class>
363
364
365         <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">
366                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
367                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
368                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
369                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
370                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
371                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
372                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
373                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
374                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
375                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
376                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
377                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
378                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
379                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
380                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
381                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
382                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
383                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
384                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
385                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
386                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
387                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
388                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
389                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
390                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
391                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
392                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
393                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
394                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
395                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
396                 </fields>
397                 <links>
398                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
399                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
400                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
401                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
402                 </links>
403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
404                         <actions>
405                                 <create permission="CREATE_IMPORT_ITEM">
406                     <context link="definition" field="owner"/>
407                                 </create>
408                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
409                     <context link="definition" field="owner"/>
410                                 </retrieve>
411                                 <update permission="UPDATE_IMPORT_ITEM">
412                     <context link="definition" field="owner"/>
413                                 </update>
414                                 <delete permission="DELETE_IMPORT_ITEM">
415                     <context link="definition" field="owner"/>
416                                 </delete>
417                         </actions>
418                 </permacrud>
419         </class>
420
421         <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">
422                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
423                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
424                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
425                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
426                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
427                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
428                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
429                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
430                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
431                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
432                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
433                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
434                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
435                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
436                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
437                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
438                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
439                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
440                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
441                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
442                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
443                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
444                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
445                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
446                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
447                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
448                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
449                 </fields>
450                 <links>
451                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
452                 </links>
453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
454                         <actions>
455                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
456                                 <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"/>
457                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
458                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
459                         </actions>
460                 </permacrud>
461         </class>
462
463         <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">
464                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
465                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
466                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
467                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
468                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
469                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
470                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
471                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
472                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
473                 </fields>
474                 <links>
475                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
476                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
477                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
478                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
479                 </links>
480                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
481                         <actions>
482                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
483                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
484                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
485                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
486                         </actions>
487                 </permacrud>
488         </class>
489
490         <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">
491                 <fields oils_persist:primary="code">
492                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
493                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
494                 </fields>
495                 <links>
496                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
497                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
498                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
499                 </links>
500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
501                         <actions>
502                                 <retrieve/>
503                         </actions>
504                 </permacrud>
505         </class>
506
507         <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">
508                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
509                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
510                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
511                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
512                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
513                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
514                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
515                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
516                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
517                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
518                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
519                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
520                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
521                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
522                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
523                 </fields>
524                 <links>
525                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
526                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
527                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
528                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
529             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
530             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
531             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
532                 </links>
533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
534                         <actions>
535                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
536                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
537                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
538                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
539                         </actions>
540                 </permacrud>
541         </class>
542
543         <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">
544                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
545                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
546                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
547                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
548                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
549                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
550                 </fields>
551                 <links/>
552                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
553                         <actions>
554                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
555                 <retrieve/>
556                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
557                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
558                         </actions>
559                 </permacrud>
560         </class>
561
562         <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">
563                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
564                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
565                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
566                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
567                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
568                 </fields>
569                 <links>
570                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
571                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
572                 </links>
573                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
574                         <actions>
575                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
576                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
577                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
578                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
579                         </actions>
580                 </permacrud>
581         </class>
582
583         <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">
584                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
585                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
586                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
587                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
588                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
589                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
590                 </fields>
591                 <links>
592                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
593                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
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="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">
606                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
607                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
608                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
609                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
610                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
611                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
612                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
613                 </fields>
614                 <links>
615                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
616                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
617                 </links>
618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
619                         <actions>
620                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
621                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
622                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
623                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
624                         </actions>
625                 </permacrud>
626         </class>
627
628         <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">
629                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
630                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
631                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
632                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
633                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
634                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
635                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
636                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
637                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
638                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
639                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
640                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
641                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
642                 </fields>
643                 <links>
644                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
645                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
646                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
647             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
648             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
649                 </links>
650                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
651                         <actions>
652                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
653                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
654                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
655                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
656                         </actions>
657                 </permacrud>
658         </class>
659
660         <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">
661                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
662                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
663                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
664                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
665                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
666                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
667                 </fields>
668                 <links/>
669                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
670                         <actions>
671                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
672                 <retrieve/>
673                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
674                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
675                         </actions>
676                 </permacrud>
677         </class>
678
679         <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">
680                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
681                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
682                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
683                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
684                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
685                 </fields>
686                 <links>
687                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
688                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
689                 </links>
690                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
691                         <actions>
692                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
693                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
694                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
695                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
696                         </actions>
697                 </permacrud>
698         </class>
699
700         <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">
701                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
702                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
703                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
704                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
705                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
706                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
707                 </fields>
708                 <links>
709                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
710                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
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="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">
723                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
724                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
725                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
726                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
727                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
728                 </fields>
729                 <links>
730                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
731                 </links>
732                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
733                         <actions>
734                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
735                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
736                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
737                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
738                         </actions>
739                 </permacrud>
740         </class>
741
742         <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">
743                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
744                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
745                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
746                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
747                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
748                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
749                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
750                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
751             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
752                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
753                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
754                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
755                 </fields>
756                 <links>
757                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
758                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
759                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
760                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
761                 </links>
762                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
763                         <actions>
764                                 <create permission="ADMIN_IMPORT_MATCH_SET">
765                     <context link="match_set" field="owner"/>
766                                 </create>
767                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
768                     <context link="match_set" field="owner"/>
769                                 </retrieve>
770                                 <update permission="ADMIN_IMPORT_MATCH_SET">
771                     <context link="match_set" field="owner"/>
772                                 </update>
773                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
774                     <context link="match_set" field="owner"/>
775                                 </delete>
776                         </actions>
777                 </permacrud>
778         </class>
779
780         <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">
781                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
782                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
783                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
784                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
785                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
786                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
787                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
788                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
789                 </fields>
790                 <links>
791                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
792                 </links>
793                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
794                         <actions>
795                                 <create permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </create>
798                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
799                     <context link="match_set" field="owner"/>
800                                 </retrieve>
801                                 <update permission="ADMIN_IMPORT_MATCH_SET">
802                     <context link="match_set" field="owner"/>
803                                 </update>
804                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
805                     <context link="match_set" field="owner"/>
806                                 </delete>
807                         </actions>
808                 </permacrud>
809         </class>
810
811         <class id="vst" controller="open-ils.cstore open-ils.pcrud" 
812                 oils_obj:fieldmapper="vandelay::session_tracker" 
813                 oils_persist:tablename="vandelay.session_tracker" 
814                 reporter:label="Vandelay Session Tracker">
815                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.session_tracker_id_seq">
816                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
817                         <field reporter:label="Session Key" name="session_key" reporter:datatype="text"/>
818                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
819                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
820                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
821                         <field reporter:label="Record Type" name="record_type" reporter:datatype="text"/>
822                         <!-- queue doesn't use datatype 'link' because it may refer to a bib
823                                          queue or an auth queue and there's no IDL class for vandelay.queue .
824                                          parent table.
825                         -->
826                         <field reporter:label="Source Queue" name="queue" reporter:datatype="int"/>
827                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
828                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
829                         <field reporter:label="State" name="state" reporter:datatype="text"/>
830                         <field reporter:label="Action Type" name="action_type" reporter:datatype="text"/>
831                         <field reporter:label="Total Actions" name="total_actions" reporter:datatype="int"/>
832                         <field reporter:label="Actions Performed" name="actions_performed" reporter:datatype="int"/>
833                 </fields>
834                 <links>
835                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
836                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
837                 </links>
838                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
839                         <actions>
840                                 <!-- created by the API -->
841                                 <retrieve global_required="true"
842                                         permission="CREATE_BIB_IMPORT_QUEUE CREATE_AUTHORITY_IMPORT_QUEUE"/>
843                                 <update global_required="true"
844                                         permission="UPDATE_BIB_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE">
845                                         <context link="workstation" field="owning_lib"/>
846                                 </update>
847                                 <delete 
848                                         permission="DELETE_BIB_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE">
849                                         <context link="workstation" field="owning_lib"/>
850                                 </delete>
851                         </actions>
852                 </permacrud>
853         </class>
854
855         <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">
856                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
857                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
858                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
859                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
860                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
861                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
862                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
863                 </fields>
864                 <links>
865                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
866                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
867                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
868                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
869                 </links>
870         </class>
871
872     <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">
873         <fields oils_persist:primary="name">
874             <field reporter:label="Name" name="name" reporter:datatype="text"/>
875             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
876             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
877             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
878         </fields>
879         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
880             <actions>
881                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
882                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
883                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
884                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
885             </actions>
886         </permacrud>
887     </class>
888
889     <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">
890         <fields oils_persist:primary="id">
891             <field reporter:label="ID" name="id" reporter:datatype="id"/>
892             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
893             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
894             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
895             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
896         </fields>
897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
898             <actions>
899                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
900                 <retrieve/>
901                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
902                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
903             </actions>
904         </permacrud>
905     </class>
906
907         <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">
908                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
909                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
910                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
911                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
912                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
913                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
914                 </fields>
915                 <links>
916                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
917                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
918                 </links>
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="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">
930                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
931                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
932                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
933                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
934         </fields>
935         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
936             <actions>
937                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
938                 <retrieve/>
939                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
940                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
941             </actions>
942         </permacrud>
943         </class>
944
945         <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">
946                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
947                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
948                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
949                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
950                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
951                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
952                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
953                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
954                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
955                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
956                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
957                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
958         </fields>
959                 <links>
960                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
961                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
962         </links>
963         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
964             <actions>
965                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
966                 <retrieve/>
967                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
968                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
969             </actions>
970         </permacrud>
971         </class>
972
973         <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">
974                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
975                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
976                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
977                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
978                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
979                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
980                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
981                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
982                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
983                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
984                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
985         </fields>
986                 <links>
987                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
988                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
989         </links>
990         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
991             <actions>
992                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
993                 <retrieve/>
994                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
995                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
996             </actions>
997         </permacrud>
998         </class>
999
1000         <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">
1001                 <fields oils_persist:primary="name">
1002                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
1003                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1004                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
1005                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
1006                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
1007                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
1008                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
1009                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
1010                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
1011                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
1012                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
1013                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
1014                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
1015                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
1016                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
1017                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
1018                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
1019                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
1020                 </fields>
1021                 <links>
1022                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
1023                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
1024                 </links>
1025         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1026             <actions>
1027                 <create permission="ADMIN_SVF" global_required="true"/>
1028                 <retrieve/>
1029                 <update permission="ADMIN_SVF" global_required="true"/>
1030                 <delete permission="ADMIN_SVF" global_required="true"/>
1031             </actions>
1032         </permacrud>
1033         </class>
1034
1035         <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">
1036                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
1037                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1038                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
1039                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1040             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
1041                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
1042                 </fields>
1043                 <links/>
1044         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1045             <actions>
1046                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1047                 <retrieve/>
1048                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1049                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1050             </actions>
1051         </permacrud>
1052         </class>
1053
1054         <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">
1055                 <fields oils_persist:primary="coded_value">
1056                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1057                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1058                 </fields>
1059                 <links>
1060                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1061                 </links>
1062         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1063             <actions>
1064                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1065                 <retrieve/>
1066                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1067                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1068             </actions>
1069         </permacrud>
1070         </class>
1071
1072         <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">
1073                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1074                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1075                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1076                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1077                 </fields>
1078                 <links>
1079                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1080                 </links>
1081         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1082             <actions>
1083                 <retrieve/>
1084             </actions>
1085         </permacrud>
1086         </class>
1087
1088
1089         <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">
1090                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1091                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1092                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1093                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1094                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1095                 </fields>
1096                 <links>
1097                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1098                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1099                 </links>
1100         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1101             <actions>
1102                 <retrieve/>
1103             </actions>
1104         </permacrud>
1105         </class>
1106
1107
1108         <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">
1109                 <fields oils_persist:primary="source">
1110                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1111                         <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 -->
1112                 </fields>
1113                 <links>
1114                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1115                 </links>
1116         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1117             <actions>
1118                 <retrieve/>
1119             </actions>
1120         </permacrud>
1121         </class>
1122
1123         <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">
1124                 <fields>
1125                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1126                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1127                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1128                 </fields>
1129                 <links>
1130                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1131                 </links>
1132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1133             <actions>
1134                 <retrieve/>
1135             </actions>
1136         </permacrud>
1137         </class>
1138
1139         <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">
1140                 <fields oils_persist:primary="id">
1141                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1142                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1143                 </fields>
1144                 <links>
1145                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1146                 </links>
1147         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1148             <actions>
1149                 <retrieve/>
1150             </actions>
1151         </permacrud>
1152         </class>
1153
1154         <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">
1155                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1156                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1157                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1158                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1159                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1160                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1161                 </fields>
1162                 <links>
1163                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1164                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1165                 </links>
1166         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1167             <actions>
1168                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1169                 <retrieve/>
1170                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1171                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1172             </actions>
1173         </permacrud>
1174         </class>
1175
1176         <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">
1177                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1178                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1179                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1180                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1181                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1182                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1183                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1184                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1185             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1186             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1187             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1188                 </fields>
1189                 <links>
1190                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1191                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1192                 </links>
1193         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1194             <actions>
1195                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1196                 <retrieve/>
1197                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1198                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1199             </actions>
1200         </permacrud>
1201         </class>
1202
1203         <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">
1204                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1205                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1206                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1207                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1208                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1209                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1210                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1211                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1212                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1213                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1214                 </fields>
1215                 <links>
1216                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1217                 </links>
1218         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1219             <actions>
1220                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1221                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1222                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1223                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1224             </actions>
1225         </permacrud>
1226         </class>
1227
1228     <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">
1229         <fields oils_persist:primary="name">
1230             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1231             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1232             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1233             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1234             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1235             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1236             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1237             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1238             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
1239             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1240         </fields>
1241         <links>
1242             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1243             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1244         </links>
1245         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1246             <actions>
1247                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1248                 <retrieve/>
1249                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1250                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1251             </actions>
1252         </permacrud>
1253     </class>
1254
1255     <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">
1256         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1257             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1258             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link" config_field="true"/>
1259             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1260             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1261             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1262             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1263             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1264         </fields>
1265         <links>
1266             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1267         </links>
1268         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1269             <actions>
1270                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1271                 <retrieve/>
1272                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1273                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1274             </actions>
1275         </permacrud>
1276     </class>
1277
1278     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1279                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1280                         oils_persist:tablename="config.z3950_index_field_map" 
1281                         reporter:label="Z39.50 Index Field Map">
1282         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1283             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1284             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1285             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1286             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1287             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1288             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1289         </fields>
1290         <links>
1291             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1292             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1293             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1294         </links>
1295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1296             <actions>
1297                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1298                 <retrieve/>
1299                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1300                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1301             </actions>
1302         </permacrud>
1303     </class>
1304
1305
1306         <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">
1307                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1308                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1309                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1310                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1311                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1312                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1313                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1314                 </fields>
1315                 <links>
1316             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1317             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1318                 </links>
1319                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1320                         <actions>
1321                                 <retrieve/>
1322                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1323                         </actions>
1324                 </permacrud>
1325         </class>
1326
1327         <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">
1328                 <fields oils_persist:primary="key">
1329                         <field reporter:label="Hook Key" name="key" reporter:datatype="text" reporter:selector="key"/>
1330                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text" oils_obj:required="true"/>
1331                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1332                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1333                 </fields>
1334                 <links/>
1335                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1336                         <actions>
1337                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1338                                 <retrieve/>
1339                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1340                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1341                         </actions>
1342                 </permacrud>
1343         </class>
1344
1345         <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">
1346                 <fields oils_persist:primary="module">
1347                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1348                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1349                 </fields>
1350                 <links/>
1351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1352                         <actions>
1353                                 <retrieve/>
1354                         </actions>
1355                 </permacrud>
1356         </class>
1357
1358         <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">
1359                 <fields oils_persist:primary="module">
1360                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1361                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1362                 </fields>
1363                 <links/>
1364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1365                         <actions>
1366                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1367                                 <retrieve/>
1368                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1369                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1370                         </actions>
1371                 </permacrud>
1372         </class>
1373
1374         <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">
1375                 <fields oils_persist:primary="module">
1376                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module" oils_obj:required="true"/>
1377                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1378                 </fields>
1379                 <links/>
1380                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1381                         <actions>
1382                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1383                                 <retrieve/>
1384                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1385                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1386                         </actions>
1387                 </permacrud>
1388         </class>
1389
1390         <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">
1391                 <fields oils_persist:primary="module">
1392                         <field reporter:label="Module Name" name="module" reporter:datatype="text" reporter:selector="module"/>
1393                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1394                 </fields>
1395                 <links/>
1396                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1397                         <actions>
1398                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1399                                 <retrieve/>
1400                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1401                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1402                         </actions>
1403                 </permacrud>
1404         </class>
1405
1406         <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">
1407                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1408                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1409                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1410                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1411                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1412                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1413                 </fields>
1414                 <links>
1415                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1416                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1417                 </links>
1418                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1419                         <actions>
1420                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1421                     <context link="event_def" field="owner"/>
1422                 </create>
1423                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1424                     <context link="event_def" field="owner"/>
1425                 </retrieve>
1426                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1427                     <context link="event_def" field="owner"/>
1428                 </update>
1429                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1430                     <context link="event_def" field="owner"/>
1431                 </delete>
1432                         </actions>
1433                 </permacrud>
1434         </class>
1435
1436         <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">
1437                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1438                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1439                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1440                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit" oils_obj:required="true"/>
1441                         <field reporter:label="Hook" name="hook"  reporter:datatype="link" oils_obj:required="true"/>
1442                         <field reporter:label="Validator" name="validator"  reporter:datatype="link" oils_obj:required="true"/>
1443                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link" oils_obj:required="true"/>
1444                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1445                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1446                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1447                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1448                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1449                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1450                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1451                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_obj:required="true"/>
1452                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1453                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1454                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1455                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1456                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1457                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1458                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1459                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1460                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1461                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1462                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1463                         <field reporter:label="Context User Path" name="context_usr_path" reporter:datatype="text"/>
1464                         <field reporter:label="Context Library Path" name="context_library_path" reporter:datatype="text"/>
1465                         <field reporter:label="Context Bib Path" name="context_bib_path" reporter:datatype="text"/>
1466                         <field reporter:label="Context Item Path" name="context_item_path" reporter:datatype="text"/>
1467                 </fields>
1468                 <links>
1469                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1470                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1471                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1472                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1473                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1474                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1475                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1476                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1477                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1478                 </links>
1479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1480                         <actions>
1481                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1482                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1483                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1484                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1485                         </actions>
1486                 </permacrud>
1487         </class>
1488
1489         <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">
1490                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_id_seq">
1491                         <field reporter:label="Group ID" name="id" reporter:datatype="id"/>
1492                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1493                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1494                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1495                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1496                         <field reporter:label="Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
1497                 </fields>
1498                 <links>
1499                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1500                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1501                         <link field="members" reltype="has_many" key="grp" map="" class="atevdefgm"/>
1502                 </links>
1503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1504                         <actions>
1505                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1506                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1507                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1508                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1509                         </actions>
1510                 </permacrud>
1511         </class>
1512
1513         <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">
1514                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_def_group_member_id_seq">
1515                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1516                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1517                         <field reporter:label="Group" name="grp"  reporter:datatype="link"/>
1518                         <field reporter:label="Event Definition" name="event_def"  reporter:datatype="link"/>
1519                         <field reporter:label="Sortable" name="sortable" reporter:datatype="bool"/>
1520                         <field reporter:label="Include Holdings" name="holdings" reporter:datatype="bool"/>
1521                         <field reporter:label="Externally Processed" name="external" reporter:datatype="bool"/>
1522                 </fields>
1523                 <links>
1524                         <link field="grp" reltype="has_a" key="id" map="" class="atevdefg"/>
1525                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1526                 </links>
1527                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1528                         <actions>
1529                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1530                     <context link="grp" field="owner"/>
1531                 </create>
1532                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1533                     <context link="grp" field="owner"/>
1534                 </retrieve>
1535                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1536                     <context link="grp" field="owner"/>
1537                 </update>
1538                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1539                     <context link="grp" field="owner"/>
1540                 </delete>
1541                         </actions>
1542                 </permacrud>
1543         </class>
1544
1545         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1546                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1547                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1548                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1549                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1550                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1551                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1552                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1553                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1554                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1555                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1556                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1557                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1558                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1559                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1560                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1561                         <field reporter:label="Context User" name="context_user" reporter:datatype="link"/>
1562                         <field reporter:label="Context Library" name="context_library" reporter:datatype="link"/>
1563                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link"/>
1564                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link"/>
1565                 </fields>
1566                 <links>
1567                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1568                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1569                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1570                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1571                         <link field="context_user" reltype="has_a" key="id" map="" class="au"/>
1572                         <link field="context_library" reltype="has_a" key="id" map="" class="aou"/>
1573                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre"/>
1574                         <link field="context_item" reltype="has_a" key="id" map="" class="acp"/>
1575                 </links>
1576         </class>
1577
1578         <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">
1579                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1580                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1581                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link" oils_obj:required="true"/>
1582                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text" oils_obj:required="true"/>
1583                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text" oils_obj:required="true"/>
1584                 </fields>
1585                 <links>
1586                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1587                 </links>
1588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1589                         <actions>
1590                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1591                     <context link="event_def" field="owner"/>
1592                 </create>
1593                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1594                     <context link="event_def" field="owner"/>
1595                 </retrieve>
1596                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1597                     <context link="event_def" field="owner"/>
1598                 </update>
1599                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1600                     <context link="event_def" field="owner"/>
1601                 </delete>
1602                         </actions>
1603                 </permacrud>
1604         </class>
1605
1606         <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">
1607                 <oils_persist:source_definition><![CDATA[
1608                 SELECT  atevdef.hook,
1609                         atevdef.name,
1610                         atevdef.reactor,
1611                         atev.id,
1612                         atev.event_def,
1613                         atev.add_time,
1614                         atev.run_time,
1615                         atev.start_time,
1616                         atev.update_time,
1617                         atev.complete_time,
1618                         atev.update_process,
1619                         atev.state,
1620                         atev.user_data,
1621                         atev.template_output,
1622                         atev.error_output,
1623                         atev.async_output,
1624                         targ_circ.id AS target_circ,
1625                         targ_ahr.id AS target_hold,
1626                         COALESCE(
1627                                 targ_circ.circ_lib,
1628                                 targ_ahr.pickup_lib
1629                         ) AS perm_lib
1630                 FROM action_trigger.event atev
1631                 JOIN action_trigger.event_definition atevdef ON
1632                         (atevdef.id = atev.event_def)
1633                 JOIN action_trigger.hook ath ON
1634                         (ath.key = atevdef.hook)
1635                 LEFT JOIN action.circulation targ_circ ON
1636                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1637                 LEFT JOIN action.hold_request targ_ahr ON
1638                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1639                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1640                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1641                                 'circ.staff.max_visible_event_age',
1642                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1643                         ) UNION
1644                         SELECT '1000 YEARS'::INTERVAL AS value
1645                 ) ous)
1646                 ]]></oils_persist:source_definition>
1647                 <fields oils_persist:primary="id">
1648                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1649                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1650                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1651                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1652                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1653                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1654                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1655                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1656                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1657                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1658                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1659                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1660                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1661                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1662                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1663                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1664                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1665                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1666                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1667                 </fields>
1668                 <links>
1669                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1670                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1671                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1672                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1673                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1674                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1675                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1676                 </links>
1677                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1678                         <actions>
1679                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1680                         </actions>
1681                 </permacrud>
1682         </class>
1683
1684         <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">
1685                 <oils_persist:source_definition><![CDATA[
1686                 SELECT  atevdef.hook,
1687                         atevdef.name,
1688                         atevdef.reactor,
1689                         atev.id,
1690                         atev.event_def,
1691                         atev.add_time,
1692                         atev.run_time,
1693                         atev.start_time,
1694                         atev.update_time,
1695                         atev.complete_time,
1696                         atev.update_process,
1697                         atev.state,
1698                         atev.user_data,
1699                         atev.template_output,
1700                         atev.error_output,
1701                         atev.async_output,
1702             atev.target,
1703                         CASE WHEN ath.core_type = 'circ' THEN atev.target END AS target_circ,
1704                         CASE WHEN ath.core_type = 'ahr' THEN atev.target END AS target_hold,
1705             atev.context_user,
1706                         atev.context_library,
1707             atev.context_bib,
1708             atev.context_item,
1709             rssr.title,
1710             rssr.author
1711                 FROM action_trigger.event atev
1712                 JOIN action_trigger.event_definition atevdef ON
1713                         (atevdef.id = atev.event_def)
1714                 JOIN action_trigger.hook ath ON
1715                         (ath.key = atevdef.hook AND ath.core_type IN ('circ','ahr'))
1716         LEFT JOIN reporter.super_simple_record rssr ON
1717             (atev.context_bib = rssr.id)
1718                 WHERE atev.add_time > NOW() - (SELECT MIN(value) FROM (
1719                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1720                                 'circ.staff.max_visible_event_age',
1721                                 atev.context_library
1722                         ) UNION
1723                         SELECT '1000 YEARS'::INTERVAL AS value
1724                 ) ous)
1725                 ]]></oils_persist:source_definition>
1726                 <fields oils_persist:primary="id">
1727                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1728                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1729                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1730                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1731                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1732                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1733                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1734                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1735                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1736                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1737                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1738                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1739                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1740                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1741                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1742                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1743                         <field reporter:label="Event Target Object ID" name="target" reporter:datatype="link" />
1744                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1745                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1746                         <field reporter:label="Context User" name="context_user" reporter:datatype="link" />
1747                         <field reporter:label="Context Library" name="context_library" reporter:datatype="org_unit" />
1748                         <field reporter:label="Context Bib" name="context_bib" reporter:datatype="link" />
1749                         <field reporter:label="Context Item" name="context_item" reporter:datatype="link" />
1750                         <field reporter:label="Title" name="title" reporter:datatype="text" />
1751                         <field reporter:label="Author" name="author" reporter:datatype="text" />
1752                 </fields>
1753                 <links>
1754                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1755                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1756                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1757                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1758                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1759                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1760                         <link field="context_user" reltype="has_a" key="id" map="" class="au" />
1761                         <link field="context_library" reltype="has_a" key="id" map="" class="aou" />
1762                         <link field="context_bib" reltype="has_a" key="id" map="" class="bre" />
1763                         <link field="context_item" reltype="has_a" key="id" map="" class="acp" />
1764                 </links>
1765                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1766                         <actions>
1767                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="context_library" />
1768                         </actions>
1769                 </permacrud>
1770         </class>
1771
1772         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1773                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1774                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1775                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1776                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1777                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1778                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1779                 </fields>
1780                 <links>
1781                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1782                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1783                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1784                 </links>
1785                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1786                         <actions>
1787                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1788                         </actions>
1789                 </permacrud>
1790         </class>
1791
1792         <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">
1793                 <fields oils_persist:primary="code">
1794                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1795                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1796                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1797                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1798                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1799                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1800                 </fields>
1801                 <links/>
1802         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1803             <actions>
1804                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1805                 <retrieve/>
1806                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1807                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1808             </actions>
1809         </permacrud>
1810         </class>
1811
1812         <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">
1813                 <fields oils_persist:primary="code">
1814                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1815                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1816                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1817                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1818                 </fields>
1819                 <links/>
1820         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1821             <actions>
1822                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1823                 <retrieve/>
1824                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1825                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1826             </actions>
1827         </permacrud>
1828         </class>
1829
1830         <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">
1831                 <fields oils_persist:primary="code">
1832                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1833                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1834                 </fields>
1835                 <links/>
1836         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1837             <actions>
1838                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1839                 <retrieve/>
1840                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1841                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1842             </actions>
1843         </permacrud>
1844         </class>
1845
1846         <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">
1847                 <fields oils_persist:primary="code">
1848                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1849                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1850                 </fields>
1851                 <links/>
1852         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1853             <actions>
1854                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1855                 <retrieve/>
1856                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1857                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1858             </actions>
1859         </permacrud>
1860         </class>
1861
1862         <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">
1863                 <fields oils_persist:primary="code">
1864                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1865                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1866                 </fields>
1867                 <links/>
1868         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1869             <actions>
1870                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1871                 <retrieve/>
1872                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1873                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1874             </actions>
1875         </permacrud>
1876         </class>
1877
1878         <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">
1879                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1880                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1881                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1882                 </fields>
1883                 <links/>
1884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1885             <actions>
1886                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1887                 <retrieve/>
1888                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1889                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1890             </actions>
1891         </permacrud>
1892         </class>
1893
1894         <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">
1895                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1896                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1897                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1898                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1899                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1900                 </fields>
1901         <links>
1902             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1903             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1904             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1905         </links>
1906         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1907             <actions>
1908                 <create permission="UPDATE_COPY">
1909                     <context link="target_copy" field="circ_lib"/>
1910                 </create>
1911                 <retrieve/>
1912                 <update permission="UPDATE_COPY">
1913                     <context link="target_copy" field="circ_lib"/>
1914                 </update>
1915                 <delete permission="UPDATE_COPY">
1916                     <context link="target_copy" field="circ_lib"/>
1917                 </delete>
1918             </actions>
1919         </permacrud>
1920         </class>
1921
1922         <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">
1923                 <fields oils_persist:primary="code">
1924                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1925                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1926                 </fields>
1927                 <links/>
1928         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1929             <actions>
1930                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1931                 <retrieve/>
1932                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1933                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1934             </actions>
1935         </permacrud>
1936         </class>
1937
1938         <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">
1939                 <fields oils_persist:primary="code">
1940                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1941                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1942                 </fields>
1943                 <links/>
1944         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1945             <actions>
1946                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1947                 <retrieve/>
1948                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1949                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1950             </actions>
1951         </permacrud>
1952         </class>
1953
1954         <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">
1955                 <fields oils_persist:primary="code">
1956                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1957                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1958                 </fields>
1959                 <links/>
1960         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1961             <actions>
1962                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1963                 <retrieve/>
1964                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1965                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1966             </actions>
1967         </permacrud>
1968         </class>
1969
1970     <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">
1971         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1972             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1973             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1974             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1975             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1976             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1977             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1978             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1979             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1980             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1981             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1982             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1983             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1984             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1985             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1986             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1987             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1988             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1989         </fields>
1990         <links/>
1991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992             <actions>
1993                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1994                 <retrieve/>
1995                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1996                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1997             </actions>
1998         </permacrud>
1999     </class>
2000
2001     <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">
2002         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
2003             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2004             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2005             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
2006             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
2007             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
2008             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
2009             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
2010             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
2011             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
2012             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
2013             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
2014             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
2015             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
2016             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
2017             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
2018             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
2019             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
2020             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
2021             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
2022         </fields>
2023         <links/>
2024         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2025             <actions>
2026                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2027                 <retrieve/>
2028                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2029                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2030             </actions>
2031         </permacrud>
2032     </class>
2033
2034     <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">
2035         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
2036             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
2037             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2038             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
2039             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
2040             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
2041         </fields>
2042         <links>
2043             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2044             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
2045             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
2046         </links>
2047         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2048             <actions>
2049                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2050                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2051                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2052                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
2053             </actions>
2054         </permacrud>
2055     </class>
2056
2057         <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">
2058                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
2059                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2060                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2061                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
2062                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
2063                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
2064                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
2065                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
2066                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
2067                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
2068                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
2069                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2070                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2071                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2072                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2073                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2074                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2075             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2076                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
2077                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
2078                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
2079                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
2080                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
2081                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
2082                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2083                 </fields>
2084                 <links>
2085                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2086                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
2087                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
2088                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
2089                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
2090                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
2091                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
2092                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2093                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2094                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2095                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2096                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2097                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
2098             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
2099                 </links>
2100         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2101             <actions>
2102                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2103                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2104                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2105                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
2106             </actions>
2107         </permacrud>
2108         </class>
2109
2110         <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">
2111                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
2112                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
2113                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
2114                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
2115                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
2116                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
2117                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
2118                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
2119                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
2120                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
2121                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
2122                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
2123                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
2124                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
2125                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
2126                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
2127             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
2128                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
2129                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
2130             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
2131                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
2132                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
2133                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
2134                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
2135             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
2136             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
2137             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
2138                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
2139                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
2140                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
2141                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
2142                 </fields>
2143                 <links>
2144                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2145                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
2146                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2147                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
2148                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
2149                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
2150                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
2151                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
2152                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
2153                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
2154                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
2155                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
2156                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
2157                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
2158             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
2159                 </links>
2160         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2161             <actions>
2162                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2163                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2164                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2165                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
2166             </actions>
2167         </permacrud>
2168         </class>
2169
2170     <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">
2171         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
2172             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2173             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2174             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2175         </fields>
2176         <links/>
2177         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2178             <actions>
2179                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2180                 <retrieve/>
2181                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2182                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
2183             </actions>
2184         </permacrud>
2185     </class>
2186
2187     <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">
2188         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
2189             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2190             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2191             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2192             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
2193             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
2194             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
2195             <field reporter:label="Description" name="description" reporter:datatype="text"/>
2196         </fields>
2197         <links>
2198             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2199         </links>
2200         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2201             <actions>
2202                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2203                 <retrieve/>
2204                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2205                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
2206             </actions>
2207         </permacrud>
2208     </class>
2209
2210     <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">
2211         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2212             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2213             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2214             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2215             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2216             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2217         </fields>
2218         <links>
2219             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2220             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2221         </links>
2222         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2223             <actions>
2224                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2225                     <context link="matchpoint" field="org_unit"/>
2226                 </create>
2227                 <retrieve/>
2228                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2229                     <context link="matchpoint" field="org_unit"/>
2230                 </update>
2231                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2232                     <context link="matchpoint" field="org_unit"/>
2233                 </delete>
2234             </actions>
2235         </permacrud>
2236     </class>
2237
2238     <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">
2239         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2240             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2241             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2242             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2243         </fields>
2244         <links>
2245             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2246             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2247         </links>
2248         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2249             <actions>
2250                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2251                     <context link="limit_set" field="owning_lib"/>
2252                 </create>
2253                 <retrieve/>
2254                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2255                     <context link="limit_set" field="owning_lib"/>
2256                 </update>
2257                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2258                     <context link="limit_set" field="owning_lib"/>
2259                 </delete>
2260             </actions>
2261         </permacrud>
2262     </class>
2263     <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">
2264         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2265             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2266             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2267             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2268         </fields>
2269         <links>
2270             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2271             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2272         </links>
2273         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2274             <actions>
2275                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2276                     <context link="limit_set" field="owning_lib"/>
2277                 </create>
2278                 <retrieve/>
2279                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2280                     <context link="limit_set" field="owning_lib"/>
2281                 </update>
2282                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2283                     <context link="limit_set" field="owning_lib"/>
2284                 </delete>
2285             </actions>
2286         </permacrud>
2287     </class>
2288
2289     <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">
2290         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2291             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2292             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2293             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2294             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2295         </fields>
2296         <links>
2297             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2298             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2299         </links>
2300         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2301             <actions>
2302                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2303                     <context link="limit_set" field="owning_lib"/>
2304                 </create>
2305                 <retrieve/>
2306                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2307                     <context link="limit_set" field="owning_lib"/>
2308                 </update>
2309                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2310                     <context link="limit_set" field="owning_lib"/>
2311                 </delete>
2312             </actions>
2313         </permacrud>
2314     </class>
2315
2316         <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">
2317                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2318                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2319                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2320                 </fields>
2321                 <links/>
2322         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2323             <actions>
2324                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2325                 <retrieve/>
2326                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2327                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2328             </actions>
2329         </permacrud>
2330         </class>
2331
2332         <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">
2333                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2334                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2335                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2336                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2337                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2338                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2339                 </fields>
2340                 <links>
2341                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2342                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2343                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2344                 </links>
2345         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2346             <actions>
2347                 <create permission="ADMIN_SURVEY">
2348                     <context link="survey" field="owner"/>
2349                 </create>
2350                 <retrieve/>
2351                 <update permission="ADMIN_SURVEY">
2352                     <context link="survey" field="owner"/>
2353                 </update>
2354                 <delete permission="ADMIN_SURVEY">
2355                     <context link="survey" field="owner"/>
2356                 </delete>
2357             </actions>
2358         </permacrud>
2359         </class>
2360         <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">
2361                 <fields oils_persist:primary="id" oils_persist:sequence="">
2362                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2363                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2364                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2365                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2366                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2367                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2368                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2369                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2370                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2371                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2372                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2373                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2374                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2375                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2376                 </fields>
2377                 <links>
2378                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2379                 </links>
2380                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2381                         <actions>
2382                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2383                                         <context link="usr" field="home_ou" />
2384                                 </retrieve>
2385                         </actions>
2386                 </permacrud>
2387         </class>
2388         <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">
2389                 <fields oils_persist:primary="id" oils_persist:sequence="">
2390                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2391                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2392                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2393                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2394                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2395                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2396                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2397                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2398                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2399                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2400                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2401                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2402                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2403                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2404                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2405                 </fields>
2406                 <links>
2407                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2408                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2409                 </links>
2410         </class>
2411         <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">
2412                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2413                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2414                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2415                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2416                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2417                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2418                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2419                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2420                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2421                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2422                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2423                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2424                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2425                 </fields>
2426                 <links>
2427                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2428                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2429                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2430                 </links>
2431                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2432                         <actions> <!-- created magically, so no create action -->
2433                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2434                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2435                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2436                         </actions>
2437                 </permacrud>
2438         </class>
2439         <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)">
2440                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2441                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2442                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2443                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2444                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2445                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2446                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2447                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2448                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2449                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2450                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2451                         <field reporter:label="Editor" name="usr" reporter:datatype="link" />
2452                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2453                 </fields>
2454                 <links>
2455                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2456                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2457                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2458                 </links>
2459                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2460                         <actions> <!-- created magically, so no create action -->
2461                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2462                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2463                         </actions>
2464                 </permacrud>
2465         </class>
2466         <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">
2467         <fields oils_persist:primary="id">
2468                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
2469                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2470                         <field reporter:label="Debug: Set Date (Penalty)" name="ausp_set_date" reporter:datatype="timestamp"/>
2471                         <field reporter:label="Debug: Creation Date/Time (Message)" name="aum_create_date" reporter:datatype="timestamp"/>
2472                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2473                         <field reporter:label="Creating Library" name="org_unit" reporter:datatype="link"/>
2474                         <field reporter:label="Debug: Creating Library (Penalty)" name="ausp_org_unit" reporter:datatype="link"/>
2475                         <field reporter:label="Debug: Creating Library (Message)" name="aum_sending_lib" reporter:datatype="link"/>
2476                         <field reporter:label="Debug: Penalty ID" name="ausp_id" reporter:datatype="id" />
2477                         <field reporter:label="Debug: Message ID" name="aum_id" reporter:datatype="id" />
2478                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2479                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2480                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2481                         <field reporter:label="Debug: User (Penalty)" name="ausp_usr" reporter:datatype="link" />
2482                         <field reporter:label="Debug: User (Message)" name="aum_usr" reporter:datatype="link" />
2483                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2484                         <field reporter:label="Patron Visible?" name="pub" reporter:datatype="bool"/>
2485                         <field reporter:label="Stop Date/Time" name="stop_date" reporter:datatype="timestamp"/>
2486                         <field reporter:label="Debug: Stop Date/Time (Penalty)" name="ausp_stop_date" reporter:datatype="timestamp"/>
2487                         <field reporter:label="Debug: Stop Date/Time (Message)" name="aum_stop_date" reporter:datatype="timestamp"/>
2488                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
2489                         <field reporter:label="Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2490                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
2491                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
2492                         <field name="ausp_usr_message" reporter:datatype="link" reporter:label="Debug: User Message (Penalty)"/>
2493                 </fields>
2494                 <links>
2495                         <link field="ausp_id" reltype="has_a" key="id" map="" class="ausp"/>
2496                         <link field="aum_id" reltype="has_a" key="id" map="" class="aum"/>
2497                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2498                         <link field="ausp_usr" reltype="has_a" key="id" map="" class="au"/>
2499                         <link field="aum_usr" reltype="has_a" key="id" map="" class="au"/>
2500                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2501                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2502                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2503                         <link field="aum_sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2504                         <link field="ausp_org_unit" reltype="has_a" key="id" map="" class="aou"/>
2505                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
2506                         <link field="ausp_usr_message" reltype="has_a" key="id" map="" class="aum"/>
2507                 </links>
2508                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2509                         <actions> <!-- created magically, so no create action -->
2510                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
2511                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
2512                         </actions>
2513                 </permacrud>
2514         </class>
2515
2516         <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">
2517                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_privacy_waiver_id_seq">
2518                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2519                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2520                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2521                         <field reporter:label="Place Holds?" name="place_holds" reporter:datatype="bool" />
2522                         <field reporter:label="Pick Up Holds?" name="pickup_holds" reporter:datatype="bool" />
2523                         <field reporter:label="View Borrowing History?" name="view_history" reporter:datatype="bool" />
2524                         <field reporter:label="Check Out Items?" name="checkout_items" reporter:datatype="bool" />
2525                 </fields>
2526                 <links>
2527                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2528                 </links>
2529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2530                         <actions>
2531                                 <create permission="UPDATE_USER">
2532                                         <context link="usr" field="home_ou"/>
2533                                 </create>
2534                                 <retrieve permission="VIEW_USER">
2535                                         <context link="usr" field="home_ou"/>
2536                                 </retrieve>
2537                                 <update permission="UPDATE_USER">
2538                                         <context link="usr" field="home_ou"/>
2539                                 </update>
2540                                 <delete permission="UPDATE_USER">
2541                                         <context link="usr" field="home_ou"/>
2542                                 </delete>
2543                         </actions>
2544                 </permacrud>
2545         </class>
2546         <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">
2547                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2548                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2549                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2550                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2551                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2552                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2553                 </fields>
2554                 <links>
2555                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2556                 </links>
2557         </class>
2558         <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">
2559                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2560                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2561                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2562                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2563                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2564                 </fields>
2565                 <links>
2566                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2567                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2568                 </links>
2569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2570                         <actions>
2571                                 <retrieve permission="VIEW_USER">
2572                                         <context link="usr" field="home_ou" />
2573                                 </retrieve>
2574                         </actions>
2575                 </permacrud>
2576         </class>
2577         <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">
2578                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2579                         <field name="field" reporter:datatype="link"/>
2580                         <field name="id" reporter:datatype="id" />
2581                         <field name="source" reporter:datatype="link"/>
2582                         <field name="value" reporter:datatype="text"/>
2583                 </fields>
2584                 <links>
2585                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2586                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2587                 </links>
2588         </class>
2589         <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">
2590                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2591                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2592                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2593                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2594                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2595                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2596                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2597                 </fields>
2598                 <links>
2599                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2600                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2601                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2602                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2603                 </links>
2604                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2605                         <actions>
2606                                 <retrieve/>
2607                         </actions>
2608                 </permacrud>
2609         </class>
2610         <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">
2611                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2612                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2613                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2614                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2615                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2616                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
2617                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2618                 </fields>
2619                 <links>
2620                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2621                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2622                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
2623                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2624                 </links>
2625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2626                         <actions>
2627                                 <retrieve/>
2628                         </actions>
2629                 </permacrud>
2630         </class>
2631         <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">
2632                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2633                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2634                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2635                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2636                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2637                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2638                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2639                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2640                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2641                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2642                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2643                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2644                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2645                 </fields>
2646                 <links>
2647                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2648                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2649                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2650                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2651                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2652                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2653                 </links>
2654         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2655             <actions>
2656                 <create permission="TRANSIT_COPY" context_field="owner">
2657                     <context link="target_copy" field="circ_lib"/>
2658                 </create>
2659                 <retrieve/>
2660                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2661                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2662             </actions>
2663         </permacrud>
2664         </class>
2665         <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">
2666                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2667                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2668                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2669                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2670                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2671                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2672                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2673                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2674                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2675                 </fields>
2676                 <links>
2677                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2678                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2679                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2680                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2681                 </links>
2682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2683             <actions>
2684                 <create permission="ADMIN_SURVEY">
2685                     <context link="survey" field="owner"/>
2686                 </create>
2687                 <retrieve permission="VIEW_USER">
2688                     <context link="usr" field="home_ou"/>
2689                 </retrieve>
2690                 <update permission="ADMIN_SURVEY">
2691                     <context link="survey" field="owner"/>
2692                 </update>
2693                 <delete permission="ADMIN_SURVEY">
2694                     <context link="survey" field="owner"/>
2695                 </delete>
2696             </actions>
2697         </permacrud>
2698         </class>
2699         <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">
2700                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2701                         <field name="bucket" reporter:datatype="link"/>
2702                         <field name="id" reporter:datatype="id" />
2703                         <field name="target_copy" reporter:datatype="link"/>
2704                         <field name="create_time" reporter:datatype="timestamp" />
2705                         <field name="pos" reporter:datatype="int" />
2706                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2707                 </fields>
2708                 <links>
2709                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2710                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2711             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2712                 </links>
2713                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2714                         <actions>
2715                                 <retrieve permission="ADMIN_COPY_BUCKET">
2716                     <context link="bucket" field="owning_lib"/>
2717                 </retrieve>
2718             </actions>
2719         </permacrud>
2720         </class>
2721         <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">
2722                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2723                         <field name="id" reporter:datatype="id" />
2724                         <field name="item" reporter:datatype="link"/>
2725                         <field name="note" reporter:datatype="text" />
2726                 </fields>
2727                 <links>
2728                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2729                 </links>
2730         </class>
2731
2732         <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">
2733                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2734                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2735                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2736                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2737                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2738                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true" config_field="true"/>
2739                 </fields>
2740                 <links>
2741                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2742                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2743                 </links>
2744                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2745                         <actions>
2746                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2747                                 <retrieve/>
2748                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2749                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2750                         </actions>
2751                 </permacrud>
2752         </class>
2753
2754         <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">
2755                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2756                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2757                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2758                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2759                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2760                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2761                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2762                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2763                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2764                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2765                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2766                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2767                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2768                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2769                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2770                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2771                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2772                 </fields>
2773                 <links>
2774                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2775                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2776                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2777                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2778                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2779                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2780                         <link field="heading_field" reltype="has_a" key="id" map="" class="ahf"/>
2781                 </links>
2782                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2783                         <actions>
2784                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2785                                 <retrieve/>
2786                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2787                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2788                         </actions>
2789                 </permacrud>
2790         </class>
2791
2792         <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">
2793                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2794                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2795                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2796                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2797                 </fields>
2798                 <links>
2799                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2800                 </links>
2801                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2802                         <actions>
2803                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2804                                 <retrieve/>
2805                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2806                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2807                         </actions>
2808                 </permacrud>
2809         </class>
2810
2811         <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">
2812                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2813                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2814                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2815                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2816                 </fields>
2817                 <links>
2818                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2819                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2820                 </links>
2821                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2822                         <actions>
2823                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2824                                 <retrieve/>
2825                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2826                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2827                         </actions>
2828                 </permacrud>
2829         </class>
2830
2831         <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">
2832                 <fields oils_persist:primary="code">
2833                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2834                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link" config_field="true"/>
2835                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2836                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2837                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2838                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2839                 </fields>
2840                 <links>
2841                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2842                 </links>
2843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2844                         <actions>
2845                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2846                                 <retrieve/>
2847                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2848                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2849                         </actions>
2850                 </permacrud>
2851         </class>
2852
2853         <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">
2854                 <fields oils_persist:primary="code">
2855                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2856                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2857                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2858                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2859                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2860                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2861                 </fields>
2862                 <links>
2863                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2864                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2865                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2866                 </links>
2867                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2868                         <actions>
2869                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2870                                 <retrieve/>
2871                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2872                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2873                         </actions>
2874                 </permacrud>
2875         </class>
2876
2877     <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">
2878         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2879             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2880             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2881             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2882         </fields>
2883         <links>
2884             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2885             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2886         </links>
2887         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2888             <actions>
2889                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2890                 <retrieve/>
2891                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2892                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2893             </actions>
2894         </permacrud>
2895     </class>
2896
2897         <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">
2898                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2899                         <field name="active" reporter:datatype="bool"/>
2900                         <field name="create_date" reporter:datatype="timestamp"/>
2901                         <field name="creator" />
2902                         <field name="deleted" reporter:datatype="bool"/>
2903                         <field name="edit_date" reporter:datatype="timestamp"/>
2904                         <field name="editor" />
2905                         <field name="id" reporter:datatype="id" />
2906                         <field name="last_xact_id" />
2907                         <field name="marc" />
2908                         <field name="source" />
2909                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2910                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2911                         <field name="heading" />
2912                         <field name="simple_heading" />
2913                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2914                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2915                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2916                 </fields>
2917                 <links>
2918                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2919                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2920                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2921                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2922                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2923                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2924                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2925                 </links>
2926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2927                         <actions>
2928                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2929                                 <retrieve/>
2930                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2931                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2932                         </actions>
2933                 </permacrud>
2934         </class>
2935         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2936                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2937                         <field name="char_encoding" />
2938                         <field name="id" />
2939                         <field name="record" />
2940                         <field name="record_status" />
2941                         <field name="thesaurus" />
2942                 </fields>
2943                 <links>
2944                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2945                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2946                 </links>
2947         </class>
2948         <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">
2949                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2950                         <field name="id" reporter:datatype="id" />
2951                         <field name="bib" reporter:datatype="link" />
2952                         <field name="authority" reporter:datatype="link" />
2953                 </fields>
2954                 <links>
2955                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2956                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2957                 </links>
2958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2959                         <actions>
2960                                 <retrieve/>
2961                         </actions>
2962                 </permacrud>
2963         </class>
2964         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2965                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2966                         <field name="id" reporter:datatype="id" />
2967                         <field name="record" reporter:datatype="link" />
2968                         <field name="atag" reporter:datatype="link" />
2969                         <field name="value" reporter:datatype="text" />
2970                         <field name="thesaurus" reporter:datatype="text" />
2971                 </fields>
2972                 <links>
2973                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2974                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2975                 </links>
2976         </class>
2977
2978         <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">
2979                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
2980                         <field name="id" reporter:datatype="id" reporter:selector="label" />
2981                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
2982                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
2983                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
2984                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
2985                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
2986                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
2987                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
2988                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
2989                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
2990                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
2991                 </fields>
2992                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2993                         <actions>
2994                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2995                                 <retrieve/>
2996                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2997                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2998                         </actions>
2999                 </permacrud>
3000         </class>
3001
3002         <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">
3003                 <fields oils_persist:primary="code" oils_persist:sequence="">
3004                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3005                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
3006                 </fields>
3007                 <links/>
3008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3009             <actions>
3010                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3011                 <retrieve/>
3012                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3013                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3014             </actions>
3015         </permacrud>
3016         </class>
3017         <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">
3018                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3019                         <field name="accepting_usr" />
3020                         <field name="amount" reporter:datatype="money" />
3021                         <field name="amount_collected" reporter:datatype="money" />
3022                         <field name="approval_code" reporter:datatype="text"/>
3023                         <field name="cash_drawer" reporter:datatype="link"/>
3024                         <field name="cc_number" reporter:datatype="text"/>
3025                         <field name="cc_order_number" reporter:datatype="text"/>
3026                         <field name="cc_processor" reporter:datatype="text"/>
3027                         <field name="id" reporter:datatype="id" />
3028                         <field name="note" reporter:datatype="text"/>
3029                         <field name="payment_ts" reporter:datatype="timestamp"/>
3030                         <field name="xact" reporter:datatype="link"/>
3031                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
3032                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3033                 </fields>
3034                 <links>
3035                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3036                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3037                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3038                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3039                 </links>
3040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3041             <actions>
3042                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3043                     <context link="xact" jump="usr" field="home_ou"/>
3044                 </retrieve>
3045                         </actions>
3046                 </permacrud>
3047         </class>
3048         <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">
3049                 <fields oils_persist:primary="name">
3050                         <field reporter:label="Name" name="name" reporter:datatype="text" />
3051                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
3052                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
3053                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
3054                 </fields>
3055                 <links/>
3056         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3057             <actions>
3058                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
3059                 <retrieve/>
3060                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
3061                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
3062             </actions>
3063         </permacrud>
3064         </class>
3065
3066         <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">
3067                 <fields oils_persist:primary="alias">
3068                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
3069                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3070                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
3071                 </fields>
3072                 <links>
3073                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3074                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3075                 </links>
3076         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3077             <actions>
3078                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3079                 <retrieve/>
3080                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
3081                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
3082             </actions>
3083         </permacrud>
3084         </class>
3085
3086         <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">
3087                 <fields oils_persist:primary="name">
3088                         <field reporter:label="Name" name="name" reporter:datatype="text" reporter:selector="label"/>
3089                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3090                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
3091                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3092                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
3093                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
3094                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
3095                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
3096                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
3097                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
3098                 </fields>
3099                 <links>
3100                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
3101                 </links>
3102         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3103             <actions>
3104                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
3105                 <retrieve/>
3106                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
3107                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
3108             </actions>
3109         </permacrud>
3110         </class>
3111
3112         <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">
3113                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
3114                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
3115                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
3116                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3117                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3118                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
3119                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
3120                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
3121                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
3122                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
3123                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
3124                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
3125                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
3126                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
3127                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
3128                         <field reporter:label="Browse Folding is Case-Insensitive" name="browse_nocase" reporter:datatype="bool" />
3129                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
3130                         <field reporter:label="Browse Sort XPath" name="browse_sort_xpath" reporter:datatype="text" />
3131                         <field reporter:label="Authority XPath" name="authority_xpath" reporter:datatype="text" />
3132                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
3133                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
3134                         <field reporter:label="Virtual Field Data Suppliers" name="data_sources" oils_persist:virtual="true" reporter:datatype="link" config_field="true"/>
3135                 </fields>
3136                 <links>
3137                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
3138                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
3139                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
3140                         <link field="data_sources" reltype="has_many" key="virtual" map="" class="cmfvm"/>
3141                 </links>
3142         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3143             <actions>
3144                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3145                 <retrieve/>
3146                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3147                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3148             </actions>
3149         </permacrud>
3150         </class>
3151
3152         <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">
3153                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_virtual_map_id_seq">
3154                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3155                         <field reporter:label="Real" name="real" reporter:datatype="link"/>
3156                         <field reporter:label="Virtual" name="virtual" reporter:datatype="link" config_field="true"/>
3157                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
3158                 </fields>
3159                 <links>
3160                         <link field="real" reltype="has_a" key="id" map="" class="cmf"/>
3161                         <link field="virtual" reltype="has_a" key="id" map="" class="cmf"/>
3162                 </links>
3163         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3164             <actions>
3165                 <create permission="CREATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3166                 <retrieve/>
3167                 <update permission="UPDATE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3168                 <delete permission="DELETE_METABIB_FIELD ADMIN_METABIB_FIELD" global_required="true"/>
3169             </actions>
3170         </permacrud>
3171         </class>
3172
3173         <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">
3174                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
3175                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
3176                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3177                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
3178                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
3179                         <field reporter:label="Owning Lib to Patron Home Lib Proximity" name="owning_lib_to_home_lib_prox" reporter:datatype="int" />
3180                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
3181                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
3182                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
3183                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
3184                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
3185                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
3186                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
3187                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
3188                 </fields>
3189                 <links>
3190                 </links>
3191                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3192                         <actions>
3193                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3194                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3195                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3196                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
3197                         </actions>
3198                 </permacrud>
3199         </class>
3200         <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">
3201                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
3202                         <field name="id" reporter:datatype="id" />
3203                         <field name="name" reporter:datatype="text"/>
3204                         <field name="xpath" reporter:datatype="text"/>
3205                         <field name="format" reporter:datatype="link"/>
3206                         <field name="first_word" reporter:datatype="bool" />
3207                 </fields>
3208                 <links/>
3209         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3210             <actions>
3211                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
3212                 <retrieve/>
3213                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
3214                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
3215             </actions>
3216         </permacrud>
3217         </class>
3218         <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">
3219                 <fields oils_persist:primary="code" oils_persist:sequence="">
3220                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3221                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
3222                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3223                 </fields>
3224                 <links/>
3225         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3226             <actions>
3227                 <create permission="CREATE_MARC_CODE" global_required="true"/>
3228                 <retrieve/>
3229                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
3230                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
3231             </actions>
3232         </permacrud>
3233         </class>
3234         <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">
3235                 <fields oils_persist:primary="code" oils_persist:sequence="">
3236                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
3237                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
3238                 </fields>
3239                 <links/>
3240         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3241             <actions>
3242                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
3243                 <retrieve/>
3244                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
3245                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
3246             </actions>
3247         </permacrud>
3248         </class>
3249     <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">
3250         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_id_seq">
3251             <field reporter:label="ID" name="id" reporter:datatype="id" />
3252             <field reporter:label="Course Name" name="name" reporter:datatype="text" oils_obj:required="true" />
3253             <field reporter:label="Course Number" name="course_number" reporter:datatype="text" oils_obj:required="true" />
3254             <field reporter:label="Section Number" name="section_number" reporter:datatype="text" />
3255             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3256             <field reporter:label="Course Members" name="members" oils_persist:virtual="true" reporter:datatype="link" />
3257             <field reporter:label="Course Materials" name="materials" oils_persist:virtual="true" reporter:datatype="link" />
3258             <field reporter:label="Is Archived?" name="is_archived" reporter:datatype="bool" />
3259                         <field reporter:label="Terms Taught" name="terms_map" oils_persist:virtual="true" reporter:datatype="link" config_field="true" />
3260         </fields>
3261         <links>
3262             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3263             <link field="members" reltype="has_many" key="course" map="" class="acmcu" />
3264             <link field="materials" reltype="has_many" key="course" map="" class="acmcm" />
3265                         <link field="terms_map" reltype="has_many" key="course" map="" class="acmtcm" />
3266         </links>
3267         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3268             <actions>
3269                 <create permission="MANAGE_RESERVES" context_field="owning_lib"/>
3270                 <retrieve/>
3271                 <update permission="MANAGE_RESERVES" context_field="owning_lib"/>
3272                 <delete permission="MANAGE_RESERVES" context_field="owning_lib"/>
3273             </actions>
3274         </permacrud>
3275     </class>
3276     <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">
3277         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_users_id_seq">
3278             <field reporter:label="ID" name="id" reporter:datatype="id" />
3279             <field reporter:label="Course" name="course" reporter:datatype="link" />
3280             <field reporter:label="User" name="usr" reporter:datatype="link" />
3281             <field reporter:label="User Role" name="usr_role" reporter:datatype="link" />
3282         </fields>
3283         <links>
3284             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3285             <link field="usr" reltype="has_a" key="id" map="" class="au" />
3286             <link field="usr_role" reltype="has_a" key="id" map="" class="acmr" />
3287         </links>
3288         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3289             <actions>
3290                 <create permission="MANAGE_RESERVES">
3291                                         <context link="course" field="owning_lib" />
3292                 </create>
3293                 <retrieve/>
3294                 <update permission="MANAGE_RESERVES">
3295                                         <context link="course" field="owning_lib" />
3296                 </update>
3297                 <delete permission="MANAGE_RESERVES">
3298                                         <context link="course" field="owning_lib" />
3299                 </delete>
3300             </actions>
3301         </permacrud>
3302     </class>
3303     <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">
3304         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_course_materials_id_seq">
3305             <field reporter:label="ID" name="id" reporter:datatype="id" />
3306             <field reporter:label="Course" name="course" reporter:datatype="link" />
3307             <field reporter:label="Item" name="item" reporter:datatype="link" />
3308             <field reporter:label="Record" name="record" reporter:datatype="link" />
3309             <field reporter:label="Record is temporary?" name="temporary_record" reporter:datatype="bool" />
3310             <field reporter:label="Item Relationship" name="relationship" reporter:datatype="text" />
3311             <field reporter:label="Original Status" name="original_status" reporter:datatype="link" />
3312             <field reporter:label="Original Circ Modifier" name="original_circ_modifier" reporter:datatype="link" />
3313             <field reporter:label="Original Shelving Location" name="original_location" reporter:datatype="link" />
3314             <field reporter:label="Original Callnumber" name="original_callnumber" reporter:datatype="link" />
3315         </fields>
3316         <links>
3317             <link field="course" reltype="has_a" key="id" map="" class="acmc" />
3318             <link field="item" reltype="has_a" key="id" map="" class="acp" />
3319             <link field="record" reltype="has_a" key="id" map="" class="bre" />
3320             <link field="original_callnumber" reltype="has_a" key="id" map="" class="acn" />
3321             <link field="original_status" reltype="has_a" key="id" map="" class="ccs" />
3322             <link field="original_circ_modifier" reltype="has_a" key="code" map="" class="ccm" />
3323             <link field="original_location" reltype="has_a" key="id" map="" class="acpl" />
3324         </links>
3325         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3326             <actions>
3327                 <create permission="MANAGE_RESERVES">
3328                                         <context link="course" field="owning_lib" />
3329                 </create>
3330                 <retrieve/>
3331                 <update permission="MANAGE_RESERVES">
3332                                         <context link="course" field="owning_lib" />
3333                 </update>
3334                 <delete permission="MANAGE_RESERVES">
3335                                         <context link="course" field="owning_lib" />
3336                 </delete>
3337             </actions>
3338         </permacrud>
3339     </class>
3340         <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">
3341                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_id_seq">
3342                         <field reporter:label="Term ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3343                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3344             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" oils_obj:required="true" />
3345                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
3346                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
3347                         <field reporter:label="Courses" name="courses" reporter:datatype="link" oils_persist:virtual="true"/>
3348                         <field reporter:label="Course Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
3349                 </fields>
3350                 <links>
3351             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
3352                         <link field="courses" reltype="has_many" key="term" map="course" class="acmtcm"/>
3353                         <link field="maps" reltype="has_many" key="term" map="" class="acmtcm"/>
3354                 </links>
3355                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3356                         <actions>
3357                                 <create permission="MANAGE_RESERVES" context_field="owning_lib" />
3358                                 <retrieve/>
3359                                 <update permission="MANAGE_RESERVES" context_field="owning_lib" />
3360                                 <delete permission="MANAGE_RESERVES" context_field="owning_lib" />
3361                         </actions>
3362                 </permacrud>
3363         </class>
3364     <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">
3365         <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_term_course_map_id_seq">
3366             <field reporter:label="Course Term Map ID" name="id" reporter:datatype="id"/>
3367             <field reporter:label="Term" name="term" oils_obj:required="true" reporter:datatype="link"/>
3368             <field reporter:label="Course" name="course" reporter:datatype="link" oils_obj:required="true"/>
3369         </fields>
3370         <links>
3371             <link field="term" reltype="has_a" key="id" map="" class="acmt"/>
3372             <link field="course" reltype="has_a" key="id" map="" class="acmc"/>
3373         </links>
3374         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3375             <actions>
3376                 <create permission="MANAGE_RESERVES">
3377                                         <context link="course" field="owning_lib" />
3378                 </create>
3379                 <retrieve/>
3380                 <update permission="MANAGE_RESERVES">
3381                                         <context link="course" field="owning_lib" />
3382                 </update>
3383                 <delete permission="MANAGE_RESERVES">
3384                                         <context link="course" field="owning_lib" />
3385                 </delete>
3386             </actions>
3387         </permacrud>
3388     </class>
3389         <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">
3390                 <fields oils_persist:primary="id" oils_persist:sequence="asset.course_module_role_id_seq">
3391                         <field reporter:label="Role ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3392                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
3393             <field reporter:label="OPAC Viewable?" name="is_public" reporter:datatype="bool" />
3394                 </fields>
3395                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3396                         <actions>
3397                                 <create permission="MANAGE_RESERVES" global_required="true" />
3398                                 <retrieve/>
3399                                 <update permission="MANAGE_RESERVES" global_required="true" />
3400                                 <delete permission="MANAGE_RESERVES" global_required="true" />
3401                         </actions>
3402                 </permacrud>
3403         </class>
3404         
3405     <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">
3406         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
3407             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
3408             <field reporter:label="Name" name="name" reporter:datatype="text"/>
3409             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
3410             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
3411         </fields>
3412         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3413             <actions>
3414                 <retrieve/>
3415             </actions>
3416         </permacrud>
3417     </class>
3418         <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">
3419                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
3420                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3421                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3422                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3423                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3424                 </fields>
3425                 <links>
3426                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3427                 </links>
3428         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3429             <actions>
3430                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3431                 <retrieve/>
3432                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
3433                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
3434             </actions>
3435         </permacrud>
3436         </class>
3437         <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">
3438                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
3439                         <field reporter:label="ID" name="id" reporter:datatype="id" />
3440                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3441                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
3442                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3443                 </fields>
3444                 <links>
3445                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3446                 </links>
3447         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3448             <actions>
3449                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
3450                 <retrieve/>
3451                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
3452                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
3453             </actions>
3454         </permacrud>
3455         </class>
3456         <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">
3457                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
3458                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
3459                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
3460                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
3461                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3462                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
3463                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3464                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
3465                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
3466                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
3467                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
3468                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3469                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3470                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3471                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3472                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3473                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3474                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3475                         <field reporter:label="Dewey Classification" name="dewey" oils_persist:virtual="true" reporter:datatype="link"/>
3476                 </fields>
3477                 <links>
3478                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3479                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3480                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3481                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3482                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3483                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3484                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3485                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3486                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3487                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3488                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3489                         <link field="dewey" reltype="might_have" key="call_number" map="" class="racnd"/>
3490                 </links>
3491         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3492             <actions>
3493                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3494                 <retrieve/>
3495                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3496                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3497             </actions>
3498         </permacrud>
3499         </class>
3500         <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">
3501                 <fields oils_persist:primary="call_number">
3502                         <field reporter:label="Call Number" name="call_number" reporter:datatype="link" />
3503                         <field reporter:label="Dewey Number" name="dewey" reporter:datatype="text"/>
3504                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
3505                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
3506                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
3507                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
3508                 </fields>
3509                 <links>
3510                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3511                 </links>
3512         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3513             <actions>
3514                 <retrieve/>
3515             </actions>
3516         </permacrud>
3517         </class>
3518         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3519                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3520                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3521                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3522                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3523                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3524                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3525                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3526                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3527                 </fields>
3528                 <links>
3529                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3530                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3531         </links>
3532         </class>
3533         <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">
3534                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3535                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3536                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3537                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3538                 </fields>
3539                 <links>
3540                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3541                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3542                 </links>
3543         </class>
3544         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3545                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3546                         <field name="id" reporter:datatype="id" />
3547                         <field name="value" oils_persist:i18n="true" />
3548                 </fields>
3549                 <links/>
3550         </class>
3551         <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">
3552                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3553                         <field name="balance_owed" reporter:datatype="money" />
3554                         <field name="total_owed" reporter:datatype="money" />
3555                         <field name="total_paid" reporter:datatype="money" />
3556                         <field name="usr" reporter:datatype="link"/>
3557                 </fields>
3558                 <links>
3559                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3560         </links>
3561         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3562             <actions>
3563                 <retrieve permission="VIEW_USER">
3564                     <context link="usr" field="home_ou"/>
3565                 </retrieve>
3566             </actions>
3567         </permacrud>
3568         </class>
3569         <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">
3570                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3571                         <field name="balance_owed" reporter:datatype="money" />
3572                         <field name="total_owed" reporter:datatype="money" />
3573                         <field name="total_paid" reporter:datatype="money" />
3574                         <field name="usr" reporter:datatype="link"/>
3575                 </fields>
3576                 <links>
3577                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3578         </links>
3579         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3580             <actions>
3581                 <retrieve permission="VIEW_USER">
3582                     <context link="usr" field="home_ou"/>
3583                 </retrieve>
3584             </actions>
3585         </permacrud>
3586         </class>
3587         <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">
3588                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3589                         <field name="collector" />
3590                         <field name="enter_time" reporter:datatype="timestamp"/>
3591                         <field name="id" reporter:datatype="id" />
3592                         <field name="location" reporter:datatype="link"/>
3593                         <field name="usr" reporter:datatype="link"/>
3594                 </fields>
3595                 <links>
3596                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3597                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3598                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3599                 </links>
3600         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3601             <actions>
3602                 <create permission="money.collections_tracker.create" context_field="location"/>
3603                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3604                 <delete permission="money.collections_tracker.create" context_field="location"/>
3605             </actions>
3606         </permacrud>
3607         </class>
3608         <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">
3609                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3610                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3611                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3612                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3613                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3614                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3615                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3616                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3617                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3618                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3619                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3620                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3621                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3622                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3623                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3624                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3625                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3626                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3627                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3628                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3629                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3630                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3631                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3632                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3633                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3634                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3635                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3636                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3637                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3638                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3639                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3640                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3641                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3642                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3643                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3644                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3645                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3646                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3647                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3648                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3649                 </fields>
3650                 <links>
3651                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3652                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3653                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3654                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3655                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3656                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3657                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3658                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3659                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3660                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3661                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3662                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3663                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3664                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3665                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3666                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3667                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3668                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3669                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3670                         <link field="mattrs" reltype="has_many" key="id" map="" class="mraf"/>
3671                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3672                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3673                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3674                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3675                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3676                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3677                 </links>
3678         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3679             <actions>
3680                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3681                 <retrieve/>
3682                 <update permission="UPDATE_MARC" global_required="true"/>
3683                 <!-- 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. -->
3684                 <delete permission="DELETE_RECORD" global_required="true"/>
3685             </actions>
3686         </permacrud>
3687         </class>
3688         <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">
3689                 <fields oils_persist:primary="id">
3690                         <field name="dow_0_close" />
3691                         <field name="dow_0_open" />
3692                         <field name="dow_1_close" />
3693                         <field name="dow_1_open" />
3694                         <field name="dow_2_close" />
3695                         <field name="dow_2_open" />
3696                         <field name="dow_3_close" />
3697                         <field name="dow_3_open" />
3698                         <field name="dow_4_close" />
3699                         <field name="dow_4_open" />
3700                         <field name="dow_5_close" />
3701                         <field name="dow_5_open" />
3702                         <field name="dow_6_close" />
3703                         <field name="dow_6_open" />
3704                         <field name="id" reporter:datatype="id" />
3705                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3706                 </fields>
3707                 <links>
3708                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3709                 </links>
3710         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3711             <actions>
3712                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3713                 <retrieve/>
3714                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3715                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3716             </actions>
3717         </permacrud>
3718         </class>
3719         <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">
3720                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3721                         <field name="id" reporter:datatype="id" />
3722                         <field name="record" reporter:datatype="link"/>
3723                         <field name="label" reporter:datatype="text"/>
3724                         <field name="label_sortkey" reporter:datatype="text"/>
3725                         <field name="deleted" reporter:datatype="bool"/>
3726                 </fields>
3727                 <links>
3728                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3729                 </links>
3730         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3731             <actions>
3732                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3733                 <retrieve/>
3734                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3735                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3736             </actions>
3737         </permacrud>
3738         </class>
3739         <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">
3740                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3741                         <field name="id" reporter:datatype="id" />
3742                         <field name="target_copy" reporter:datatype="link" />
3743                         <field name="part" reporter:datatype="link"/>
3744                 </fields>
3745                 <links>
3746                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3747                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3748                 </links>
3749         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3750             <actions>
3751                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3752                 <retrieve/>
3753                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3754                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3755             </actions>
3756         </permacrud>
3757         </class>
3758     <class  id="aecc"
3759             controller="open-ils.cstore open-ils.pcrud"
3760             oils_obj:fieldmapper="action::emergency_closing_circulation"
3761             oils_persist:tablename="action.emergency_closing_circulation"
3762             reporter:label="Emergency Closing Circulation Entry"
3763             oils_persist:readonly="true"
3764     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3765         <fields oils_persist:primary="id">
3766             <field name="id" reporter:datatype="id" />
3767             <field name="circulation" reporter:datatype="link" />
3768                         <field name="emergency_closing" reporter:datatype="link"/>
3769             <field name="original_due_date" reporter:datatype="timestamp" />
3770             <field name="process_time" reporter:datatype="timestamp" />
3771         </fields>
3772         <links>
3773             <link field="circulation" reltype="has_a" key="id" map="" class="circ"/>
3774             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3775         </links>
3776         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3777             <actions>
3778                 <retrieve/>
3779             </actions>
3780         </permacrud>
3781     </class>
3782     <class  id="aecr"
3783             controller="open-ils.cstore open-ils.pcrud"
3784             oils_obj:fieldmapper="action::emergency_closing_reservation"
3785             oils_persist:tablename="action.emergency_closing_reservation"
3786             reporter:label="Emergency Closing Reservation Entry"
3787             oils_persist:readonly="true"
3788     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3789         <fields oils_persist:primary="id">
3790             <field name="id" reporter:datatype="id" />
3791             <field name="reservation" reporter:datatype="link" />
3792                         <field name="emergency_closing" reporter:datatype="link"/>
3793             <field name="original_end_time" reporter:datatype="timestamp" />
3794             <field name="process_time" reporter:datatype="timestamp" />
3795         </fields>
3796         <links>
3797             <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
3798             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3799         </links>
3800         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3801             <actions>
3802                 <retrieve/>
3803             </actions>
3804         </permacrud>
3805     </class>
3806     <class  id="aech"
3807             controller="open-ils.cstore open-ils.pcrud"
3808             oils_obj:fieldmapper="action::emergency_closing_hold"
3809             oils_persist:tablename="action.emergency_closing_hold"
3810             reporter:label="Emergency Closing Hold Entry"
3811             oils_persist:readonly="true"
3812     > <!-- This is not a view, but is managed via functions, so it's readonly. -->
3813         <fields oils_persist:primary="id">
3814             <field name="id" reporter:datatype="id" />
3815             <field name="hold" reporter:datatype="link" />
3816                         <field name="emergency_closing" reporter:datatype="link"/>
3817             <field name="original_shelf_expire_time" reporter:datatype="timestamp" />
3818             <field name="process_time" reporter:datatype="timestamp" />
3819         </fields>
3820         <links>
3821             <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
3822             <link field="emergency_closing" reltype="has_a" key="id" map="" class="aec"/>
3823         </links>
3824         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3825             <actions>
3826                 <retrieve/>
3827             </actions>
3828         </permacrud>
3829     </class>
3830     <class  id="aecs"
3831             controller="open-ils.cstore open-ils.pcrud"
3832             oils_obj:fieldmapper="action::emergency_closing_status"
3833             oils_persist:tablename="action.emergency_closing_status"
3834             reporter:label="Emergency Closing Status"
3835             oils_persist:readonly="true"
3836     >
3837         <fields oils_persist:primary="id">
3838             <field name="id" reporter:datatype="id" />
3839             <field name="creator" reporter:datatype="link" />
3840             <field name="create_time" reporter:datatype="timestamp" />
3841             <field name="process_start_time" reporter:datatype="timestamp" />
3842             <field name="process_end_time" reporter:datatype="timestamp" />
3843             <field name="last_update_time" reporter:datatype="timestamp" />
3844             <field name="circulations" reporter:datatype="int" />
3845             <field name="circulations_complete" reporter:datatype="int" />
3846             <field name="reservations" reporter:datatype="int" />
3847             <field name="reservations_complete" reporter:datatype="int" />
3848             <field name="holds" reporter:datatype="int" />
3849             <field name="holds_complete" reporter:datatype="int" />
3850         </fields>
3851         <links>
3852             <link field="id" reltype="has_a" key="id" map="" class="aec"/>
3853         </links>
3854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3855             <actions>
3856                 <retrieve/>
3857             </actions>
3858         </permacrud>
3859     </class>
3860     <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">
3861         <fields oils_persist:primary="id" oils_persist:sequence="action.emergency_closing_id_seq">
3862             <field name="id" reporter:datatype="id" />
3863             <field name="creator" reporter:datatype="link" />
3864             <field name="create_time" reporter:datatype="timestamp" />
3865             <field name="process_start_time" reporter:datatype="timestamp" />
3866             <field name="process_end_time" reporter:datatype="timestamp" />
3867             <field name="last_update_time" reporter:datatype="timestamp" />
3868             <field name="closing" oils_persist:virtual="true" reporter:datatype="link"/>
3869             <field name="status" oils_persist:virtual="true" reporter:datatype="link"/>
3870             <field name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3871             <field name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3872             <field name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
3873         </fields>
3874         <links>
3875             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3876             <link field="closing" reltype="might_have" key="emergency_closing" map="" class="aoucd"/>
3877             <link field="status" reltype="might_have" key="id" map="" class="aecs"/>
3878             <link field="circulations" reltype="has_many" key="emergency_closing" map="" class="aecc"/>
3879             <link field="reservations" reltype="has_many" key="emergency_closing" map="" class="aecr"/>
3880             <link field="holds" reltype="has_many" key="emergency_closing" map="" class="aech"/>
3881         </links>
3882         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3883             <actions>
3884                 <create permission="EMERGENCY_CLOSING">
3885                     <context link="closing" field="org_unit" />
3886                 </create>
3887                 <retrieve/>
3888                 <update permission="EMERGENCY_CLOSING">
3889                     <context link="closing" field="org_unit" />
3890                 </update>
3891                 <delete permission="EMERGENCY_CLOSING">
3892                     <context link="closing" field="org_unit" />
3893                 </delete>
3894             </actions>
3895         </permacrud>
3896     </class>
3897         <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">
3898                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3899                         <field name="close_end" reporter:datatype="timestamp" />
3900                         <field name="close_start" reporter:datatype="timestamp" />
3901                         <field name="id" reporter:datatype="id" />
3902                         <field name="org_unit" reporter:datatype="org_unit"/>
3903                         <field name="reason" reporter:datatype="text"/>
3904                         <field name="full_day" reporter:datatype="bool"/>
3905                         <field name="multi_day" reporter:datatype="bool"/>
3906                         <field name="emergency_closing" reporter:datatype="link"/>
3907                 </fields>
3908                 <links>
3909                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3910                         <link field="emergency_closing" 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                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3915                 <retrieve/>
3916                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3917                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3918             </actions>
3919         </permacrud>
3920         </class>
3921         <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">
3922                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3923                         <field name="extended" reporter:datatype="interval"/>
3924                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3925                         <field name="max_renewals" reporter:datatype="int" />
3926                         <field name="name" reporter:datatype="text"/>
3927                         <field name="normal" reporter:datatype="interval"/>
3928                         <field name="shrt" reporter:datatype="interval"/>
3929                         <field name="max_auto_renewals" reporter:datatype="int" />
3930                 </fields>
3931                 <links>
3932                 </links>
3933         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3934             <actions>
3935                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3936                 <retrieve/>
3937                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3938                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3939             </actions>
3940         </permacrud>
3941         </class>
3942
3943         <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">
3944                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3945                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3946                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3947             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3948                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3949             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3950                         <field reporter:label="Values" name="values" oils_persist:virtual="true" 
3951                                 reporter:datatype="link" config_field="true"/>
3952                 </fields>
3953                 <links>
3954             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3955                         <link field="values" reltype="has_many" key="hard_due_date" map="" class="chddv"/>
3956                 </links>
3957                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3958             <actions>
3959                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3960                 <retrieve/>
3961                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3962                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3963             </actions>
3964                 </permacrud>
3965         </class>
3966
3967         <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">
3968                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3969                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3970                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link" config_field="true"/>
3971                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3972             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3973                 </fields>
3974                 <links>
3975                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3976                 </links>
3977                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3978             <actions>
3979                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3980                 <retrieve/>
3981                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3982                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3983             </actions>
3984                 </permacrud>
3985         </class>
3986
3987         <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">
3988                 <fields oils_persist:primary="id" oils_persist:sequence="">
3989                         <field name="balance_owed" reporter:datatype="money"/>
3990                         <field name="id" reporter:datatype="id" />
3991                         <field name="last_billing_note" reporter:datatype="text"/>
3992                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3993                         <field name="last_billing_type" reporter:datatype="text"/>
3994                         <field name="last_payment_note" reporter:datatype="text"/>
3995                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3996                         <field name="last_payment_type" reporter:datatype="text"/>
3997                         <field name="total_owed" reporter:datatype="money"/>
3998                         <field name="total_paid" reporter:datatype="money"/>
3999                         <field name="usr" reporter:datatype="link"/>
4000                         <field name="xact_finish" reporter:datatype="timestamp" />
4001                         <field name="xact_start" reporter:datatype="timestamp" />
4002                         <field name="xact_type" reporter:datatype="text"/>
4003                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
4004                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
4005                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
4006                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
4007                         <field name="billing_location" reporter:datatype="link"/>
4008                 </fields>
4009                 <links>
4010                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4011                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
4012                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
4013                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
4014                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
4015                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
4016                 </links>
4017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4018                         <actions>
4019                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4020                                         <context link="usr" field="home_ou" />
4021                                 </retrieve>
4022                         </actions>
4023                 </permacrud>
4024         </class>
4025         <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">
4026                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
4027                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
4028                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
4029                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
4030                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
4031                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
4032                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
4033                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
4034                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4035                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
4036                         <field reporter:label="Privacy Waiver Entries" name = "waiver_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4037                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
4038                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
4039                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4040                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
4041                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
4042                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
4043                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
4044                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
4045                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4046                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
4047                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
4048                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
4049                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
4050                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
4051                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
4052                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
4053                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
4054                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
4055                         <field reporter:label="User ID" name="id" reporter:datatype="id" reporter:selector="usrname" />
4056                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
4057                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
4058                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
4059                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
4060                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4061                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
4062                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
4063                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
4064                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
4065                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
4066                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
4067                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
4068                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
4069                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
4070                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
4071                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
4072                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
4073                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
4074                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
4075                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
4076                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
4077                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
4078                         <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text"/>
4079                         <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
4080                         <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
4081                         <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
4082                         <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text"/>
4083                         <field reporter:label="Parent/Guardian" name="guardian" reporter:datatype="text"/>
4084                         <field reporter:label="Name Keywords" name="name_keywords" reporter:datatype="text"/>
4085                         <field reporter:label="Name Keyword internal tsvector" name="name_kw_tsvector" reporter:datatype="text"/>
4086                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
4087                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4088                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4089                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
4090                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
4091                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4092                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4093                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
4094                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
4095                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
4096                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
4097                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
4098                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
4099                 </fields>
4100                 <links>
4101                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
4102                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
4103                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
4104                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
4105                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
4106                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
4107                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
4108                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
4109                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
4110                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
4111                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
4112                         <link field="waiver_entries" reltype="has_many" key="usr" map="" class="aupw"/>
4113                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
4114                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
4115                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
4116                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
4117                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
4118                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
4119                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
4120                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
4121                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
4122                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
4123                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
4124                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
4125                         <link field="notes" reltype="has_many" key="usr" map="" class="aum"/>
4126                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
4127                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
4128                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
4129                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
4130                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
4131                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
4132                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
4133                 </links>
4134                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4135                         <actions>
4136                                 <retrieve permission="VIEW_USER user_request.view" context_field="home_ou" />
4137                         </actions>
4138                 </permacrud>
4139         </class>
4140         <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">
4141                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
4142                         <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
4143                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
4144                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
4145                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
4146                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
4147                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
4148                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
4149                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
4150         </fields>
4151                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4152                         <actions>
4153                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4154                                 <retrieve/>
4155                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4156                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
4157                         </actions>
4158                 </permacrud>
4159         </class>
4160         <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">
4161                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
4162                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4163                         <field name="usr" reporter:label="User" reporter:datatype="link" />
4164                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
4165                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
4166         </fields>
4167         <links>
4168                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4169                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
4170                 </links>
4171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4172                         <actions>
4173                                 <retrieve permission="RUN_REPORTS">
4174                                         <context link="usr" field="home_ou" />
4175                                 </retrieve>
4176                         </actions>
4177                 </permacrud>
4178         </class>
4179         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
4180                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
4181                         <field name="id" reporter:label="ID" reporter:datatype="id" />
4182                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
4183                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
4184                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
4185                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
4186                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
4187         </fields>
4188         <links>
4189                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
4190                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
4191                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
4192                 </links>
4193                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4194                         <actions>
4195                                 <create permission="ADMIN_TOOLBAR" context_field="org" />
4196                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
4197                                         <context link="usr" field="home_ou" />
4198                                         <context link="ws" field="owning_lib" />
4199                                 </retrieve>
4200                                 <update permission="ADMIN_TOOLBAR" context_field="org"/>
4201                                 <delete permission="ADMIN_TOOLBAR" context_field="org"/>
4202                         </actions>
4203                 </permacrud>
4204         </class>
4205         <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">
4206                 <fields oils_persist:primary="name">
4207                         <field name="name" reporter:datatype="text"/>
4208                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4209                 </fields>
4210                 <links/>
4211                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4212                         <actions>
4213                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4214                                 <retrieve/>
4215                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4216                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
4217                         </actions>
4218                 </permacrud>
4219         </class>
4220         <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">
4221                 <fields oils_persist:primary="name">
4222                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
4223                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
4224                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
4225                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
4226                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
4227                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
4228                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
4229                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
4230                 </fields>
4231                 <links>
4232                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
4233                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4234                 </links>
4235                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4236                         <actions>
4237                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4238                                 <retrieve/>
4239                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4240                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
4241                         </actions>
4242                 </permacrud>
4243         </class>
4244         <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">
4245                 <fields oils_persist:primary="name">
4246                         <field name="name" reporter:datatype="text"/>
4247                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
4248                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
4249                         <field name="datatype" reporter:datatype="text"/>
4250                         <field name="view_perm" reporter:datatype="link"/>
4251                         <field name="update_perm" reporter:datatype="link"/>
4252                         <field name="fm_class" reporter:datatype="text"/>
4253                         <field name="grp" reporter:datatype="link"/>
4254                 </fields>
4255                 <links>
4256                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
4257                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
4258                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
4259                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
4260                 </links>
4261                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4262                         <actions>
4263                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4264                                 <retrieve/>
4265                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4266                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
4267                         </actions>
4268                 </permacrud>
4269         </class>
4270         <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">
4271                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
4272                         <field name="id" />
4273                         <field name="name"  reporter:datatype="text"/>
4274                         <field name="org_unit" reporter:datatype="org_unit"/>
4275                         <field name="value"  reporter:datatype="text"/>
4276                 </fields>
4277                 <links>
4278                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4279                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
4280                 </links>
4281         </class>
4282         <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">
4283                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
4284                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
4285                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
4286                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
4287                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
4288                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
4289                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
4290                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
4291                 </fields>
4292                 <links>
4293                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
4294                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4295                 </links>
4296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4297             <actions>
4298                 <create permission="CREATE_COPY_NOTE">
4299                     <context link="owning_copy" field="circ_lib"/>
4300                 </create>
4301                 <retrieve permission="VIEW_COPY_NOTES">
4302                     <context link="owning_copy" field="circ_lib"/>
4303                 </retrieve>
4304                 <update permission="UPDATE_COPY_NOTE">
4305                     <context link="owning_copy" field="circ_lib"/>
4306                 </update>
4307                 <delete permission="DELETE_COPY_NOTE">
4308                     <context link="owning_copy" field="circ_lib"/>
4309                 </delete>
4310             </actions>
4311         </permacrud>
4312         </class>
4313         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
4314                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
4315                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
4316                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
4317                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
4318                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4319                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
4320                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
4321                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
4322                 </fields>
4323                 <links>
4324                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4325                 </links>
4326         </class>
4327         <class id="mmr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
4328                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
4329                         <field name="fingerprint"  reporter:datatype="text"/>
4330                         <field name="id" reporter:datatype="id" reporter:selector="fingerprint" />
4331                         <field name="master_record" reporter:datatype="link"/>
4332                         <field name="mods"  reporter:datatype="text"/>
4333                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
4334                         <field name="source_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4335                 </fields>
4336                 <links>
4337                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
4338                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
4339                         <link field="source_maps" reltype="has_many" key="metarecord" map="" class="mmrsm"/>
4340                 </links>
4341                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4342                         <actions>
4343                                 <retrieve/>
4344                         </actions>
4345                 </permacrud>
4346         </class>
4347         <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">
4348                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
4349                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4350                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4351                 </fields>
4352                 <links/>
4353         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4354             <actions>
4355                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
4356                 <retrieve/>
4357                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
4358                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
4359             </actions>
4360         </permacrud>
4361         </class>
4362         <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">
4363                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
4364                         <field name="code"  reporter:datatype="text"/>
4365                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
4366                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
4367                 </fields>
4368                 <links/>
4369         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4370             <actions>
4371                 <create permission="CREATE_PERM" global_required="true"/>
4372                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
4373                 <update permission="UPDATE_PERM" global_required="true"/>
4374                 <delete permission="DELETE_PERM" global_required="true"/>
4375             </actions>
4376         </permacrud>
4377         </class>
4378         <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">
4379                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
4380                         <field name="id" reporter:datatype="id" />
4381                         <field name="metarecord" reporter:datatype="link"/>
4382                         <field name="source" reporter:datatype="link"/>
4383                 </fields>
4384                 <links>
4385                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4386                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
4387                 </links>
4388                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4389                         <actions>
4390                                 <retrieve/>
4391                         </actions>
4392                 </permacrud>
4393         </class>
4394         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
4395                         oils_obj:fieldmapper="metabib::display_entry" 
4396                         oils_persist:tablename="metabib.display_entry" 
4397                         oils_persist:field_safe="true"
4398                         reporter:label="Display Field Entry" oils_persist:readonly="true">
4399                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
4400                         <field name="id" reporter:datatype="id" />
4401                         <field name="field" reporter:datatype="link"/>
4402                         <field name="source" reporter:datatype="link"/>
4403                         <field name="value"  reporter:datatype="text"/>
4404                         <field name="highlight" oils_persist:virtual="true"  reporter:datatype="text"/>
4405                 </fields>
4406                 <links>
4407                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4408                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4409                 </links>
4410                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4411                         <actions>
4412                                 <retrieve/>
4413                         </actions>
4414                 </permacrud>
4415         </class>
4416         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
4417                 oils_persist:tablename="metabib.flat_display_entry"
4418                 oils_obj:fieldmapper="metabib::flat_display_entry" 
4419                 oils_persist:field_safe="true"
4420                 reporter:label="Flat Display Entry" 
4421                 oils_persist:readonly="true">
4422                 <fields>
4423                         <field name="source" reporter:datatype="id" />
4424                         <field name="name" reporter:datatype="text"/>
4425                         <field name="multi" reporter:datatype="bool"/>
4426                         <field name="label" reporter:datatype="text"/>
4427                         <field name="field" reporter:datatype="link"/>
4428                         <field name="value" reporter:datatype="text"/>
4429                 </fields>
4430                 <links>
4431                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4432                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4433                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4434                 </links>
4435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4436                         <actions>
4437                                 <retrieve/>
4438                         </actions>
4439                 </permacrud>
4440         </class>
4441         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
4442                 oils_persist:tablename="metabib.compressed_display_entry"
4443                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
4444                 oils_persist:field_safe="true"
4445                 reporter:label="Compressed Display Entry" 
4446                 oils_persist:readonly="true">
4447                 <fields>
4448                         <field name="source" reporter:datatype="id" />
4449                         <field name="name" reporter:datatype="text"/>
4450                         <field name="multi" reporter:datatype="bool"/>
4451                         <field name="label" reporter:datatype="text"/>
4452                         <field name="field" reporter:datatype="link"/>
4453                         <field name="value" reporter:datatype="text"/>
4454                 </fields>
4455                 <links>
4456                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4457                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4458                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
4459                 </links>
4460                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4461                         <actions>
4462                                 <retrieve/>
4463                         </actions>
4464                 </permacrud>
4465         </class>
4466         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
4467                 oils_persist:tablename="metabib.wide_display_entry"
4468                 oils_obj:fieldmapper="metabib::wide_display_entry" 
4469                 oils_persist:field_safe="true"
4470                 reporter:label="Wide Display Entry" 
4471                 oils_persist:readonly="true">
4472                 <fields oils_persist:primary="source">
4473                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
4474                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
4475                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
4476                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
4477                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
4478                         <field name="issn" reporter:label="ISSN" reporter:datatype="text"/>
4479                         <field name="upc" reporter:label="UPC" reporter:datatype="text"/>
4480                         <field name="tcn" reporter:label="TCN" reporter:datatype="text"/>
4481                         <field name="edition" reporter:label="Edition" reporter:datatype="text"/>
4482                         <field name="physical_description" reporter:label="Physical Description" reporter:datatype="text"/>
4483                         <field name="publisher" reporter:label="Publisher" reporter:datatype="text"/>
4484                         <field name="series_title" reporter:label="Series Title" reporter:datatype="text"/>
4485                         <field name="subject_geographic" reporter:label="Geographic Subject" reporter:datatype="text"/>
4486                         <field name="subject_name" reporter:label="Name Subject" reporter:datatype="text"/>
4487                         <field name="subject_temporal" reporter:label="Temporal Subject" reporter:datatype="text"/>
4488                         <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
4489                         <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
4490                         <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
4491                         <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
4492                         <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
4493                 </fields>
4494                 <links>
4495                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4496                 </links>
4497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4498                         <actions>
4499                                 <retrieve/>
4500                         </actions>
4501                 </permacrud>
4502         </class>
4503
4504         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
4505                 oils_persist:tablename="config.display_field_map"
4506                 oils_obj:fieldmapper="config::display_field_map"
4507                 oils_persist:field_safe="true"
4508                 reporter:label="Display Field Map">
4509                 <fields oils_persist:primary="name">
4510                         <field name="name" reporter:datatype="text"/>
4511                         <field name="field" reporter:datatype="link"/>
4512                         <field name="multi" reporter:datatype="bool"/>
4513                 </fields>
4514                 <links>
4515                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4516                 </links>
4517                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4518                         <actions>
4519                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
4520                                 <retrieve/>
4521                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
4522                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
4523                         </actions>
4524                 </permacrud>
4525         </class>
4526
4527         <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">
4528                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
4529                         <field name="id" reporter:datatype="id" />
4530                         <field name="field" reporter:datatype="link"/>
4531                         <field name="source" reporter:datatype="link"/>
4532                         <field name="value"  reporter:datatype="text"/>
4533                 </fields>
4534                 <links>
4535                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4536                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4537                 </links>
4538         </class>
4539         <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">
4540                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
4541                         <field name="id" reporter:datatype="id" />
4542                         <field name="value" reporter:datatype="text"/>
4543                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4544                 </fields>
4545                 <links>
4546                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
4547                 </links>
4548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4549                         <actions>
4550                                 <retrieve/>
4551                         </actions>
4552                 </permacrud>
4553         </class>
4554         <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">
4555                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
4556                         <field name="id" reporter:datatype="id" />
4557                         <field name="entry" reporter:datatype="link"/>
4558                         <field name="def" reporter:datatype="link"/>
4559                         <field name="source" reporter:datatype="link"/>
4560                 </fields>
4561                 <links>
4562                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4563                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
4564                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4565                 </links>
4566         </class>
4567         <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">
4568                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
4569                         <field name="id" reporter:datatype="id" />
4570                         <field name="entry" reporter:datatype="link"/>
4571                         <field name="simple_heading" reporter:datatype="link"/>
4572                 </fields>
4573                 <links>
4574                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
4575                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
4576                 </links>
4577         </class>
4578         <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">
4579                 <oils_persist:source_definition><![CDATA[
4580                         SELECT * FROM metabib.author_field_entry
4581                                                 UNION ALL
4582                         SELECT * FROM metabib.keyword_field_entry
4583                                                 UNION ALL
4584                         SELECT * FROM metabib.identifier_field_entry
4585                                                 UNION ALL
4586                         SELECT * FROM metabib.title_field_entry
4587                                                 UNION ALL
4588                         SELECT * FROM metabib.subject_field_entry
4589                                                 UNION ALL
4590                         SELECT * FROM metabib.series_field_entry
4591                 ]]></oils_persist:source_definition>
4592                 <fields>
4593                         <field name="field" reporter:datatype="link"/>
4594                         <field name="id" reporter:datatype="id" />
4595                         <field name="source" reporter:datatype="link"/>
4596                         <field name="value"  reporter:datatype="text"/>
4597                 </fields>
4598                 <links>
4599                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4600                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4601                 </links>
4602         </class>
4603         <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">
4604                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
4605                         <field name="field" reporter:datatype="link"/>
4606                         <field name="id" reporter:datatype="id" />
4607                         <field name="source" reporter:datatype="link"/>
4608                         <field name="value"  reporter:datatype="text"/>
4609                 </fields>
4610                 <links>
4611                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
4612                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
4613                 </links>
4614         </class>
4615         <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">
4616                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4617                         <field name="accepting_usr" reporter:datatype="link"/>
4618                         <field name="amount" reporter:datatype="money" />
4619                         <field name="amount_collected" reporter:datatype="money" />
4620                         <field name="cash_drawer" reporter:datatype="link"/>
4621                         <field name="id" reporter:datatype="id" />
4622                         <field name="note"  reporter:datatype="text"/>
4623                         <field name="payment_ts" reporter:datatype="timestamp"/>
4624                         <field name="xact" reporter:datatype="link"/>
4625                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4626                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4627                 </fields>
4628                 <links>
4629                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4630                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4631                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
4632                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4633                 </links>
4634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4635             <actions>
4636                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4637                     <context link="xact" jump="usr" field="home_ou"/>
4638                 </retrieve>
4639                         </actions>
4640                 </permacrud>
4641         </class>
4642         <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">
4643                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4644                         <field name="accepting_usr" reporter:datatype="link"/>
4645                         <field name="amount" reporter:datatype="money" />
4646                         <field name="amount_collected" reporter:datatype="money" />
4647                         <field name="id" reporter:datatype="id" />
4648                         <field name="note"  reporter:datatype="text"/>
4649                         <field name="payment_ts" reporter:datatype="timestamp"/>
4650                         <field name="xact" reporter:datatype="link"/>
4651                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4652                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4653                 </fields>
4654                 <links>
4655                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4656                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4657                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4658                 </links>
4659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4660             <actions>
4661                 <retrieve permission="VIEW_USER_TRANSACTIONS">
4662                     <context link="xact" jump="usr" field="home_ou"/>
4663                 </retrieve>
4664                         </actions>
4665                 </permacrud>
4666         </class>
4667         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
4668                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
4669                         <field name="accepting_usr" reporter:datatype="link"/>
4670                         <field name="amount" reporter:datatype="money" />
4671                         <field name="amount_collected" reporter:datatype="money" />
4672                         <field name="id" reporter:datatype="id" />
4673                         <field name="note"  reporter:datatype="text"/>
4674                         <field name="payment_ts" reporter:datatype="timestamp"/>
4675                         <field name="xact" reporter:datatype="link"/>
4676                         <field name="billing" reporter:datatype="link"/>
4677                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
4678                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
4679                 </fields>
4680                 <links>
4681                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
4682                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4683                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4684                         <link field="billing" reltype="might_have" key="id" map="" class="mb"/>
4685                 </links>
4686         </class>
4687         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4688                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4689                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4690                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4691                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4692                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4693                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4694                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4695                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4696                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4697                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4698                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4699                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4700                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4701                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4702                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4703                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4704                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4705                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4706                 </fields>
4707                 <links>
4708                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4709                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4710                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4711                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4712                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4713                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4714                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4715                 </links>
4716         </class>
4717
4718         <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">
4719                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4720                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4721                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4722                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4723                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4724                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4725                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4726                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4727                 </fields>
4728                 <links/>
4729         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4730             <actions>
4731                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4732                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
4733                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4734                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4735             </actions>
4736         </permacrud>
4737         </class>
4738         <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">
4739                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4740                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4741                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4742                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4743                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4744                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4745                 </fields>
4746                 <links>
4747                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4748                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4749                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4750         </links>
4751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4752             <actions>
4753                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4754                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4755                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4756                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4757             </actions>
4758         </permacrud>
4759         </class>
4760         <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">
4761                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4762                         <field name="holdable" reporter:datatype="bool" reporter:label="Holdable"/>
4763                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4764                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
4765                         <field name="opac_visible" reporter:datatype="bool" reporter:label="OPAC Visible"/>
4766             <field name="copy_active" reporter:datatype="bool" reporter:label="Sets Item Active"/>
4767             <field name="restrict_copy_delete" reporter:datatype="bool" reporter:label="Restrict Deletion"/>
4768             <field name="is_available" reporter:datatype="bool" reporter:label="Available"/>
4769             <field name="hopeless_prone" reporter:datatype="bool" reporter:label="Prone to Hopeless Holds?"/>
4770                 </fields>
4771                 <links/>
4772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4773             <actions>
4774                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4775                 <retrieve/>
4776                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4777                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4778             </actions>
4779         </permacrud>
4780         </class>
4781         <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">
4782                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
4783                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4784                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4785                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4786                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4787                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4788                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4789                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4790                         <field name="usr_message" reporter:datatype="link" reporter:label="User Message"/>
4791                 </fields>
4792                 <links>
4793                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4794                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4795                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4796                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4797                         <link field="usr_message" reltype="has_a" key="id" map="" class="aum"/>
4798                 </links>
4799                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4800                         <actions>
4801                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4802                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4803                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4804                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4805                         </actions>
4806                 </permacrud>
4807         </class>
4808         <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">
4809                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4810                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4811                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4812                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4813                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4814                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4815                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4816                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4817                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4818                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4819                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4820                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4821                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4822                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4823                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4824                 </fields>
4825                 <links>
4826                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4827                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4828                 </links>
4829                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4830                         <actions>
4831                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4832                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4833                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4834                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4835                         </actions>
4836                 </permacrud>
4837         </class>
4838         <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">
4839                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4840                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4841                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4842                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4843                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4844                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4845                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4846                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4847                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4848                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4849                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4850                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4851                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4852                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4853                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4854                 </fields>
4855                 <links>
4856                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4857                 </links>
4858                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4859                         <actions>
4860                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4861                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4862                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4863                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4864                         </actions>
4865                 </permacrud>
4866         </class>
4867
4868
4869         <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">
4870                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4871                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4872                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4873                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4874                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4875                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4876                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4877                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4878                 </fields>
4879                 <links>
4880                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4881                 </links>
4882         </class>
4883
4884         <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">
4885                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4886                         <field name="call_number" />
4887                         <field name="create_date" reporter:datatype="timestamp"/>
4888                         <field name="creator" reporter:datatype="link"/>
4889                         <field name="id" reporter:datatype="id" />
4890                         <field name="pub" reporter:datatype="bool"/>
4891                         <field name="title"  reporter:datatype="text"/>
4892                         <field name="value"  reporter:datatype="text"/>
4893                 </fields>
4894                 <links>
4895                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4896                 </links>
4897         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4898             <actions>
4899                 <create permission="CREATE_VOLUME_NOTE">
4900                     <context link="call_number" field="owning_lib"/>
4901                 </create>
4902                 <retrieve permission="VIEW_VOLUME_NOTES">
4903                     <context link="call_number" field="owning_lib"/>
4904                 </retrieve>
4905                 <update permission="UPDATE_VOLUME_NOTE">
4906                     <context link="call_number" field="owning_lib"/>
4907                 </update>
4908                 <delete permission="DELETE_VOLUME_NOTE">
4909                     <context link="call_number" field="owning_lib"/>
4910                 </delete>
4911             </actions>
4912         </permacrud>
4913         </class>
4914         <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">
4915                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4916                         <field name="create_date" reporter:datatype="timestamp"/>
4917                         <field name="creator" reporter:datatype="link"/>
4918                         <field name="edit_date" reporter:datatype="timestamp"/>
4919                         <field name="editor" reporter:datatype="link"/>
4920                         <field name="id" reporter:datatype="id" />
4921                         <field name="record" reporter:datatype="link"/>
4922                         <field name="value" reporter:datatype="text"/>
4923                 </fields>
4924                 <links>
4925                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4926                 </links>
4927         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4928             <actions>
4929                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4930                 <retrieve/>
4931                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4932                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4933             </actions>
4934         </permacrud>
4935         </class>
4936         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4937         <oils_persist:source_definition><![CDATA[
4938 SELECT  usr,
4939         SUM(
4940             CASE
4941                 WHEN (
4942                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4943                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4944                 ) THEN 1
4945                 ELSE 0
4946             END
4947         ) AS out,
4948
4949         SUM(
4950             CASE
4951                 WHEN (
4952                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4953                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4954                 ) THEN 1
4955                 ELSE 0
4956             END
4957         ) AS overdue,
4958
4959         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4960         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4961         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4962   FROM  action.circulation
4963   WHERE checkin_time IS NULL
4964   GROUP BY 1
4965         ]]></oils_persist:source_definition>
4966         <fields oils_persist:primary="usr">
4967             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4968             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4969             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4970             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4971             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4972             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4973         </fields>
4974         <links>
4975             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4976         </links>
4977         </class>
4978         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4979         <oils_persist:source_definition><![CDATA[
4980 SELECT  usr,
4981         STRING_AGG(
4982             CASE
4983                 WHEN (
4984                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval < '1 day'  AND due_date > 'now'))
4985                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4986                 ) THEN id::TEXT
4987                 ELSE '0'
4988             END
4989         ,',') AS out,
4990
4991         STRING_AGG(
4992             CASE
4993                 WHEN (
4994                     ((fine_interval >= '1 day' AND due_date < 'today') OR (fine_interval < '1 day'  AND due_date < 'now'))
4995                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4996                 ) THEN id::TEXT
4997                 ELSE '0'
4998             END
4999         ,',') AS overdue,
5000
5001         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
5002         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
5003         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
5004   FROM  action.circulation
5005   WHERE checkin_time IS NULL
5006   GROUP BY 1
5007         ]]></oils_persist:source_definition>
5008         <fields oils_persist:primary="usr">
5009             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
5010             <field reporter:label="Out" name="out" reporter:datatype="text"/>
5011             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
5012             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
5013             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
5014             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
5015         </fields>
5016         <links>
5017             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5018         </links>
5019         </class>
5020         <class id="acsp" controller="open-ils.cstore" oils_obj:fieldmapper="action::curbside" oils_persist:tablename="action.curbside" reporter:label="Curbside Appointment Slot">
5021                 <fields oils_persist:primary="id" oils_persist:sequence="action.curbside_id_seq">
5022                         <field reporter:label="Appointment ID" name="id" reporter:datatype="id" />
5023                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
5024                         <field reporter:label="Pickup Library" name="org" reporter:datatype="org_unit"/>
5025                         <field reporter:label="Appointment Date/Time" name="slot" reporter:datatype="timestamp"/>
5026                         <field reporter:label="Staged" name="staged" reporter:datatype="timestamp"/>
5027                         <field reporter:label="Staging Staff" name="stage_staff" reporter:datatype="link"/>
5028                         <field reporter:label="Arrival Date/Time" name="arrival" reporter:datatype="timestamp"/>
5029                         <field reporter:label="Delivery Date/Time" name="delivered" reporter:datatype="timestamp"/>
5030                         <field reporter:label="Delivery Staff" name="delivery_staff" reporter:datatype="link"/>
5031                         <field reporter:label="Notes" name="notes" reporter:datatype="text"/>
5032                 </fields>
5033                 <links>
5034                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5035                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
5036                         <link field="stage_staff" reltype="has_a" key="id" map="" class="au"/>
5037                         <link field="delivery_staff" reltype="has_a" key="id" map="" class="au"/>
5038                 </links>
5039         </class>
5040         <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">
5041                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5042                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5043                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5044                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5045                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
5046                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5047                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5048                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5049                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5050                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5051                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5052                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5053                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5054                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5055                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5056                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5057                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5058                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5059                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5060                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5061                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5062                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5063                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5064                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5065                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5066                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5067                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5068                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5069                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5070                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5071                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5072                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5073                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5074                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5075                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5076                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5077                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5078                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5079                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5080                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5081                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5082                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5083                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5084                 </fields>
5085                 <links>
5086                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5087                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5088                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5089                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5090                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5091                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5092                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5093                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5094                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5095                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5096                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5097                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5098                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5099                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5100                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5101                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5102                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5103                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
5104                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5105                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5106                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5107                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5108                 </links>
5109                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5110                         <actions>
5111                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5112                         </actions>
5113                 </permacrud>
5114         </class>
5115         <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">
5116                 <fields>
5117                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
5118                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5119                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
5120                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5121                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
5122                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
5123                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
5124                 </fields>
5125                 <links>
5126                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5127                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5128                 </links>
5129                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5130                         <actions>
5131                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5132                         </actions>
5133                 </permacrud>
5134         </class>
5135         <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">
5136                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5137                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5138                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5139                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5140                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5141                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5142                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5143                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5144                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5145                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5146                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5147                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5148                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5149                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5150                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5151                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5152                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5153                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5154                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5155                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5156                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5157                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5158                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5159                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5160                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5161                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5162                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5163                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5164                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5165                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5166                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5167                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5168                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5169                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5170                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5171                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5172                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5173                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5174                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5175                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5176                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5177                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5178                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5179                 </fields>
5180                 <links>
5181                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5182                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5183                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5184                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5185                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5186                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5187                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5188                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5189                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5190                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5191                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5192                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5193                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5194                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5195                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5196                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5197                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5198                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5199                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5200                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5201                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5202                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5203                 </links>
5204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5205                         <actions>
5206                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5207                         </actions>
5208                 </permacrud>
5209         </class>
5210
5211         <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">
5212                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5213                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5214                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5215                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5216                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5217                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5218                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5219                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5220                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5221                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5222                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5223                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5224                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5225                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5226                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5227                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5228                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5229                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5230                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5231                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5232                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5233                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5234                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5235                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5236                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5237                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5238                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5239                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5240                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
5241                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5242                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
5243                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5244                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5245                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5246                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5247                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5248                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5249                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5250                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5251                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5252                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5253                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5254                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5255                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5256                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5257                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5258                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5259                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5260                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5261                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
5262                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5263                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5264                 </fields>
5265                 <links>
5266                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5267                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5268                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5269                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5270                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5271                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5272                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5273                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5274                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5275                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5276                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5277                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5278                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5279                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5280                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5281                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5282                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5283                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5284                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5285                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5286                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5287                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5288                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5289                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
5290                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
5291                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
5292                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
5293                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
5294                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5295                 </links>
5296                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5297                         <actions>
5298                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
5299                         </actions>
5300                 </permacrud>
5301         </class>
5302         <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">
5303                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5304                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
5305                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
5306                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
5307                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5308                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
5309                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
5310                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
5311                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
5312                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
5313                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5314                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
5315                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
5316                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
5317                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
5318                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
5319                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
5320                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
5321                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
5322                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
5323                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
5324                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
5325                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5326                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5327                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
5328                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
5329                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
5330                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
5331                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
5332                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
5333                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
5334                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5335                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5336                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
5337                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
5338                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5339                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5340                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5341                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5342                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5343                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
5344                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
5345                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
5346                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
5347                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
5348                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5349                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5350                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
5351                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
5352                 </fields>
5353                 <links>
5354                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
5355                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
5356                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
5357                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5358                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
5359                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5360                         <link field="payments" reltype="has_many" key="xact" map="" class="mallp"/>
5361                         <link field="billings" reltype="has_many" key="xact" map="" class="mallb"/>
5362                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
5363                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
5364                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
5365                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
5366                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5367                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5368                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
5369                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5370                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5371                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5372                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
5373                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
5374                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
5375                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
5376                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
5377                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
5378                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
5379                 </links>
5380         </class>
5381         <class id="auch" 
5382                 controller="open-ils.cstore" 
5383                 oils_obj:fieldmapper="action::user_circ_history" 
5384                 oils_persist:tablename="action.usr_circ_history" 
5385                 reporter:label="User Checkout History">
5386                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
5387                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5388                         <!-- prevent reporting on the user that owns the checkout history -->
5389                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
5390                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
5391                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
5392                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
5393                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
5394                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
5395                 </fields>
5396                 <links>
5397                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5398                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5399                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
5400                 </links>
5401         </class>
5402         <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">
5403                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
5404                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
5405                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5406                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5407                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5408                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5409                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5410                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
5411                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
5412                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
5413                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
5414                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
5415                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
5416                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
5417                 </fields>
5418                 <links>
5419                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5420                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5421                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
5422                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
5423                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
5424                 </links>
5425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5426                         <actions>
5427                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5428                                 <retrieve permission="VIEW_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5429                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5430                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
5431                         </actions>
5432                 </permacrud>
5433         </class>
5434
5435         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
5436                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
5437                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
5438                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5439                         <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
5440                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
5441                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
5442                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5443                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
5444                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
5445                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5446                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5447                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
5448                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
5449                 </fields>
5450                 <links>
5451                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5452                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
5453                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
5454                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
5455                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
5456                 </links>
5457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5458                         <actions>
5459                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5460                                 <retrieve permission="VIEW_BOOKING_RESOURCE" context_field='owner'/>
5461                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5462                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
5463                         </actions>
5464                 </permacrud>
5465         </class>
5466         
5467         <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">
5468                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
5469                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
5470                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5471                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5472                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
5473                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
5474                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
5475                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5476                 </fields>
5477                 <links>
5478                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5479                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
5480                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
5481                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
5482                 </links>
5483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5484                         <actions>
5485                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5486                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5487                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5488                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
5489                         </actions>
5490                 </permacrud>
5491         </class>
5492         
5493         <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">
5494                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
5495                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
5496                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
5497                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
5498                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
5499                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5500                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5501                 </fields>
5502                 <links>
5503                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5504                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
5505                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
5506                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
5507                 </links>
5508                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5509                         <actions>
5510                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5511                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5512                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5513                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
5514                         </actions>
5515                 </permacrud>
5516         </class>
5517         
5518         <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">
5519                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
5520                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
5521                         <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
5522                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
5523                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
5524                 </fields>
5525                 <links>
5526                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
5527                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
5528                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
5529                 </links>
5530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5531                         <actions>
5532                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5533                     <context link="resource" field="owner" />
5534                 </create>
5535                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5536                     <context link="resource" field="owner" />
5537                 </retrieve>
5538                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5539                     <context link="resource" field="owner" />
5540                 </update>
5541                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
5542                     <context link="resource" field="owner" />
5543                 </delete>
5544                         </actions>
5545                 </permacrud>
5546         </class>
5547         
5548         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
5549                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
5550                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
5551                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
5552                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
5553                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
5554                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
5555                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
5556                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
5557                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
5558                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
5559                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
5560                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
5561                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5562                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp" oils_obj:required="true"/>
5563                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
5564                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
5565                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
5566                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
5567                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
5568                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
5569                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
5570                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
5571                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
5572                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
5573                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
5574                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
5575                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
5576                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
5577                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5578                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5579                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5580                 </fields>
5581                 <links>
5582                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5583                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
5584                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
5585                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
5586                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
5587                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
5588                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
5589                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5590                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
5591                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5592                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5593                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
5594                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
5595                 </links>
5596                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5597                         <actions>
5598                                 <create permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5599                                 <retrieve permission="VIEW_BOOKING_RESERVATION" context_field="pickup_lib"/>
5600                                 <update permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5601                                 <delete permission="ADMIN_BOOKING_RESERVATION" context_field="pickup_lib"/>
5602                         </actions>
5603                 </permacrud>
5604         </class>
5605         
5606         <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">
5607                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
5608                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
5609                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
5610                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
5611                 </fields>
5612                 <links>
5613                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
5614                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
5615                 </links>
5616                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5617                         <actions>
5618                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5619                                         <context link="reservation" field="pickup_lib"/>
5620                                 </create>
5621                                 <retrieve permission="VIEW_BOOKING_RESERVATION_ATTR_MAP">
5622                                         <context link="reservation" field="pickup_lib"/>
5623                                 </retrieve>
5624                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5625                                         <context link="reservation" field="pickup_lib"/>
5626                                 </update>
5627                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP">
5628                                         <context link="reservation" field="pickup_lib"/>
5629                                 </delete>
5630                         </actions>
5631                 </permacrud>
5632         </class>
5633
5634         <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">
5635                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
5636                         <field name="bucket" reporter:datatype="link"/>
5637                         <field name="id" reporter:datatype="id" />
5638                         <field name="target_call_number" reporter:datatype="link" />
5639                         <field name="create_time" reporter:datatype="timestamp" />
5640                         <field name="pos" reporter:datatype="int" />
5641                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
5642                 </fields>
5643                 <links>
5644                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
5645                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
5646             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
5647                 </links>
5648                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5649                         <actions>
5650                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
5651                     <context link="bucket" field="owning_lib"/>
5652                 </retrieve>
5653             </actions>
5654         </permacrud>
5655         </class>
5656         <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">
5657                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
5658                         <field name="id" reporter:datatype="id" />
5659                         <field name="item" reporter:datatype="link"/>
5660                         <field name="note" reporter:datatype="text" />
5661                 </fields>
5662                 <links>
5663                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
5664                 </links>
5665         </class>
5666         <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">
5667                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
5668                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
5669                         <field name="btype" reporter:datatype="text"/>
5670                         <field name="id" reporter:datatype="id" />
5671                         <field name="name" reporter:datatype="text"/>
5672                         <field name="description" reporter:datatype="text"/>
5673                         <field name="owner" reporter:datatype="link"/>
5674                         <field name="pub" reporter:datatype="bool"/>
5675                         <field name="create_time" reporter:datatype="timestamp" />
5676                         <field name="owning_lib" reporter:datatype="org_unit" />
5677                 </fields>
5678                 <links>
5679                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5680                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
5681                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
5682                 </links>
5683                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5684                         <actions>
5685                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5686                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5687                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5688                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context_field="owning_lib" owning_user="owner"/>
5689                         </actions>
5690                 </permacrud>
5691         </class>
5692         <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">
5693                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
5694                         <field name="id" reporter:datatype="id" />
5695                         <field name="bucket" reporter:datatype="link"/>
5696                         <field name="note" reporter:datatype="text" />
5697                 </fields>
5698                 <links>
5699                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
5700                 </links>
5701         </class>
5702         <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">
5703                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
5704                         <field name="hold" reporter:datatype="link"/>
5705                         <field name="id" reporter:datatype="id" />
5706                         <field name="target_copy" reporter:datatype="link"/>
5707                         <field name="proximity" reporter:datatype="number"/>
5708                 </fields>
5709                 <links>
5710                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5711                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
5712                 </links>
5713         </class>
5714         <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">
5715                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
5716                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
5717                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
5718                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
5719                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
5720                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
5721                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5722                 </fields>
5723                 <links>
5724                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5725                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5726                 </links>
5727         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5728             <actions>
5729                 <create permission="CREATE_HOLD_NOTIFICATION">
5730                                         <context link="hold" jump="usr" field="home_ou" />
5731                                 </create>
5732                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5733                                         <context link="hold" jump="usr" field="home_ou" />
5734                                 </retrieve>
5735                 <update permission="CREATE_HOLD_NOTIFICATION">
5736                                         <context link="hold" jump="usr" field="home_ou" />
5737                                 </update>
5738                 <delete permission="CREATE_HOLD_NOTIFICATION">
5739                                         <context link="hold" jump="usr" field="home_ou" />
5740                                 </delete>
5741             </actions>
5742         </permacrud>
5743         </class>
5744         <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">
5745                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5746                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5747                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5748                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5749                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5750                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5751                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5752                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5753                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5754                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5755                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5756                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5757                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5758                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5759                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5760                 </fields>
5761                 <links>
5762                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5763                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5764                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5765                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5766                 </links>
5767         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5768             <actions>
5769                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5770                 <retrieve/>
5771                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5772                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5773             </actions>
5774         </permacrud>
5775         </class>
5776         <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">
5777                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5778                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5779                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5780                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5781                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" />
5782             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5783             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5784             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5785                 </fields>
5786                 <links>
5787                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5788                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5789                 </links>
5790         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5791             <actions>
5792                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5793                 <retrieve/>
5794                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5795                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5796             </actions>
5797         </permacrud>
5798         </class>
5799         <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">
5800                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5801                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5802             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5803             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5804                 </fields>
5805                 <links>
5806                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5807                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5808                 </links>
5809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5810             <actions>
5811                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5812                                         <context link="lgroup" field="owner" />
5813                 </create>
5814                 <retrieve/>
5815                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5816                                         <context link="lgroup" field="owner" />
5817                 </update>
5818                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5819                                         <context link="lgroup" field="owner" />
5820                 </delete>
5821             </actions>
5822         </permacrud>
5823         </class>
5824
5825     <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">
5826         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5827             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5828             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5829             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5830             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5831         </fields>
5832         <links>
5833             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5834             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5835         </links>
5836         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5837             <actions>
5838                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5839                 <retrieve/>
5840                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5841                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5842             </actions>
5843         </permacrud>
5844     </class>
5845
5846         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5847                 <fields>
5848                         <field name="sre_id" oils_persist:virtual="true" />
5849                         <field name="location" oils_persist:virtual="true" />
5850                         <field name="owning_lib" oils_persist:virtual="true" />
5851                         <field name="basic_holdings" oils_persist:virtual="true" />
5852                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5853                         <field name="supplement_holdings" oils_persist:virtual="true" />
5854                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5855                         <field name="index_holdings" oils_persist:virtual="true" />
5856                         <field name="index_holdings_add" oils_persist:virtual="true" />
5857                         <field name="online" oils_persist:virtual="true" />
5858                         <field name="missing" oils_persist:virtual="true" />
5859                         <field name="incomplete" oils_persist:virtual="true" />
5860                 </fields>
5861         </class>
5862
5863         <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">
5864                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5865                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5866                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5867                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5868                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5869                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5870                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5871                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5872                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5873                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5874                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5875                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5876                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5877                 </fields>
5878                 <links>
5879                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5880                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5881                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5882                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5883                 </links>
5884                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5885                         <actions>
5886                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5887                                 <retrieve/>
5888                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5889                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5890                         </actions>
5891                 </permacrud>
5892         </class>
5893
5894         <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">
5895                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5896                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5897                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5898                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5899                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5900                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5901                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5902                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5903                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5904                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5905                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5906                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5907                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5908                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5909                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5910                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5911                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5912                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5913                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5914                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5915                 </fields>
5916                 <links>
5917                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5918                 </links>
5919                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5920                         <actions>
5921                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5922                                         <context link="subscription" field="owning_lib" />
5923                                 </create>
5924                                 <retrieve />
5925                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5926                                         <context link="subscription" field="owning_lib" />
5927                                 </update>
5928                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5929                                         <context link="subscription" field="owning_lib" />
5930                                 </delete>
5931                         </actions>
5932                 </permacrud>
5933         </class>
5934
5935         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5936                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5937                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5938                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5939                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5940                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5941                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5942                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5943                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5944                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5945                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5946                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5947                 </fields>
5948                 <links>
5949                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5950                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5951                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5952                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5953                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5954                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5955                 </links>
5956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5957                         <actions>
5958                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5959                                 <retrieve />
5960                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5961                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5962                         </actions>
5963                 </permacrud>
5964         </class>
5965
5966         <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">
5967                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5968                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5969                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5970                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5971                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5972                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5973                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5974                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5975                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5976                 </fields>
5977                 <links>
5978                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5979                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5980                 </links>
5981                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5982                         <actions>
5983                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5984                     <context link="subscription" field="owning_lib"/>
5985                 </create>
5986                                 <retrieve />
5987                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5988                     <context link="subscription" field="owning_lib"/>
5989                 </update>
5990                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5991                     <context link="subscription" field="owning_lib"/>
5992                 </delete>
5993                         </actions>
5994                 </permacrud>
5995         </class>
5996
5997         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5998                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5999                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6000                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
6001                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
6002                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6003                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
6004                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6005                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
6006                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
6007                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
6008                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
6009                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
6010                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
6011                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
6012                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
6013                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6014                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6015                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6016                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
6017                 </fields>
6018                 <links>
6019                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
6020                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6021                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
6022                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
6023                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
6024                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
6025                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
6026                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
6027                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
6028                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
6029                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
6030                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
6031                 </links>
6032                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6033                         <actions>
6034                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6035                                 <retrieve />
6036                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6037                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
6038                         </actions>
6039                 </permacrud>
6040         </class>
6041
6042         <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">
6043                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
6044                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6045                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6046                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6047                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6048                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6049                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6050                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6051                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6052                 </fields>
6053                 <links>
6054                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6055                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6056                 </links>
6057                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6058                         <actions>
6059                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6060                                         <context link="distribution" field="holding_lib" />
6061                                 </create>
6062                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
6063                                         <context link="distribution" field="holding_lib" />
6064                                 </retrieve>
6065                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6066                                         <context link="distribution" field="holding_lib" />
6067                                 </update>
6068                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6069                                         <context link="distribution" field="holding_lib" />
6070                                 </delete>
6071                         </actions>
6072                 </permacrud>
6073         </class>
6074
6075         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
6076                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
6077                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6078                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6079                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
6080                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6081                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
6082                 </fields>
6083                 <links>
6084                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6085                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
6086                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
6087                 </links>
6088                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6089                         <actions>
6090                                 <create permission="ADMIN_SERIAL_STREAM">
6091                                         <context link="distribution" field="holding_lib" />
6092                                 </create>
6093                                 <retrieve />
6094                                 <update permission="ADMIN_SERIAL_STREAM">
6095                                         <context link="distribution" field="holding_lib" />
6096                                 </update>
6097                                 <delete permission="ADMIN_SERIAL_STREAM">
6098                                         <context link="distribution" field="holding_lib" />
6099                                 </delete>
6100                         </actions>
6101                 </permacrud>
6102         </class>
6103
6104         <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">
6105                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
6106                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6107                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6108                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
6109                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
6110                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
6111                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6112                 </fields>
6113                 <links>
6114                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6115                         <link field="reader" 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_STREAM">
6120                                         <context link="stream" jump="distribution" field="holding_lib" />
6121                                 </create>
6122                                 <retrieve permission="RECEIVE_SERIAL">
6123                                         <context link="stream" jump="distribution" field="holding_lib" />
6124                                 </retrieve>
6125                                 <update permission="ADMIN_SERIAL_STREAM">
6126                                         <context link="stream" jump="distribution" field="holding_lib" />
6127                                 </update>
6128                                 <delete permission="ADMIN_SERIAL_STREAM">
6129                                         <context link="stream" jump="distribution" field="holding_lib" />
6130                                 </delete>
6131                         </actions>
6132                 </permacrud>
6133         </class>
6134
6135         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
6136                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
6137                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6138                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6139                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6140                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6141                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6142                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
6143                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
6144                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
6145                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
6146                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
6147                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
6148                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
6149                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
6150                 </fields>
6151                 <links>
6152                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6153                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6154                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
6155                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
6156                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
6157                 </links>
6158                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6159                         <actions>
6160                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
6161                                         <context link="subscription" field="owning_lib" />
6162                                 </create>
6163                                 <retrieve/>
6164                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
6165                                         <context link="subscription" field="owning_lib" />
6166                                 </update>
6167                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
6168                                         <context link="subscription" field="owning_lib" />
6169                                 </delete>
6170                         </actions>
6171                 </permacrud>
6172         </class>
6173
6174         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
6175                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6176                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6177                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6178                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6179                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6180                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6181                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6182                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6183                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6184                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6185                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6186                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6187                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6188                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6189                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6190                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6191                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6192                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6193                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6194                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6195                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6196                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6197                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6198                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6199                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6200                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6201                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6202                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6203                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6204                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6205                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6206                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6207                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6208                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6209                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
6210                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
6211                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
6212                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6213                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6214                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6215                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6216                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6217                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6218                 </fields>
6219                 <links>
6220                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6221                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6222                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6223                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6224                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6225                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6226                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6227                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6228                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6229                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6230                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6231                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6232                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6233                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6234                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6235                 </links>
6236                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6237                         <actions>
6238                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6239                                 <retrieve/>
6240                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6241                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
6242                         </actions>
6243                 </permacrud>
6244         </class>
6245
6246         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
6247                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
6248                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6249                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6250                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6251                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6252                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6253                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
6254                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
6255                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
6256                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
6257                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
6258                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
6259                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
6260                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6261                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
6262                 </fields>
6263                 <links>
6264                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6265                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6266                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6267                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
6268                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
6269                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
6270                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
6271                 </links>
6272                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6273                         <actions>
6274                                 <create permission="ADMIN_SERIAL_ITEM">
6275                                         <context link="stream" jump="distribution" field="holding_lib" />
6276                                 </create>
6277                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6278                                         <context link="stream" jump="distribution" field="holding_lib" />
6279                                 </retrieve>
6280                                 <update permission="ADMIN_SERIAL_ITEM">
6281                                         <context link="stream" jump="distribution" field="holding_lib" />
6282                                 </update>
6283                                 <delete permission="ADMIN_SERIAL_ITEM">
6284                                         <context link="stream" jump="distribution" field="holding_lib" />
6285                                 </delete>
6286                         </actions>
6287                 </permacrud>
6288         </class>
6289
6290         <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">
6291                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
6292                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6293                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
6294                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6295                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6296                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
6297                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
6298                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6299                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
6300                 </fields>
6301                 <links>
6302                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
6303                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6304                 </links>
6305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6306                         <actions>
6307                                 <create permission="ADMIN_SERIAL_ITEM">
6308                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6309                                 </create>
6310                                 <retrieve permission="ADMIN_SERIAL_ITEM">
6311                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6312                                 </retrieve>
6313                                 <update permission="ADMIN_SERIAL_ITEM">
6314                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6315                                 </update>
6316                                 <delete permission="ADMIN_SERIAL_ITEM">
6317                                         <context link="item" jump="stream.distribution" field="holding_lib" />
6318                                 </delete>
6319                         </actions>
6320                 </permacrud>
6321         </class>
6322         <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">
6323                 <fields>
6324                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
6325                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
6326                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
6327                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
6328                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
6329                 </fields>
6330                 <links>
6331                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6332                 </links>
6333         </class>
6334         <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">
6335                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
6336                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6337                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
6338                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
6339                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
6340                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
6341                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
6342                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
6343                 </fields>
6344                 <links>
6345                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
6346                 </links>
6347         </class>
6348         <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">
6349                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
6350                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6351                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6352                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6353                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6354                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6355                 </fields>
6356                 <links>
6357                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6358                 </links>
6359                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6360                         <actions>
6361                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6362                                         <context link="distribution" field="holding_lib" />
6363                                 </create>
6364                                 <retrieve/>
6365                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6366                                         <context link="distribution" field="holding_lib" />
6367                                 </update>
6368                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6369                                         <context link="distribution" field="holding_lib" />
6370                                 </delete>
6371                         </actions>
6372                 </permacrud>
6373         </class>
6374
6375         <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">
6376                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
6377                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6378                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6379                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6380                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6381                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6382                 </fields>
6383                 <links>
6384                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6385                 </links>
6386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6387                         <actions>
6388                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6389                                         <context link="distribution" field="holding_lib" />
6390                                 </create>
6391                                 <retrieve/>
6392                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6393                                         <context link="distribution" field="holding_lib" />
6394                                 </update>
6395                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6396                                         <context link="distribution" field="holding_lib" />
6397                                 </delete>
6398                         </actions>
6399                 </permacrud>
6400         </class>
6401
6402         <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">
6403                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
6404                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6405                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
6406                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
6407                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
6408                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
6409                 </fields>
6410                 <links>
6411                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
6412                 </links>
6413                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6414                         <actions>
6415                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
6416                                         <context link="distribution" field="holding_lib" />
6417                                 </create>
6418                                 <retrieve/>
6419                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
6420                                         <context link="distribution" field="holding_lib" />
6421                                 </update>
6422                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
6423                                         <context link="distribution" field="holding_lib" />
6424                                 </delete>
6425                         </actions>
6426                 </permacrud>
6427         </class>
6428
6429         <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">
6430                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
6431                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6432                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
6433                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
6434                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
6435                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
6436                 </fields>
6437                 <links>
6438                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6439                 </links>
6440                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6441                         <actions>
6442                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6443                                 <retrieve/>
6444                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6445                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
6446                         </actions>
6447                 </permacrud>
6448         </class>
6449
6450         <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">
6451                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
6452                         <field name="id" reporter:datatype="id" />
6453                         <field name="owning_copy" reporter:datatype="link"/>
6454                         <field name="stat_cat" reporter:datatype="link"/>
6455                         <field name="stat_cat_entry" reporter:datatype="link"/>
6456                 </fields>
6457                 <links>
6458                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
6459                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
6460                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
6461                 </links>
6462                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6463                         <actions>
6464                                 <retrieve/>
6465                         </actions>
6466                 </permacrud>
6467         </class>
6468         <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">
6469                 <fields oils_persist:primary="code">
6470                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
6471                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6472                 </fields>
6473                 <links/>
6474         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6475             <actions>
6476                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
6477                 <retrieve/>
6478                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
6479                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
6480             </actions>
6481         </permacrud>
6482         </class>
6483         <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">
6484                 <fields oils_persist:primary="code">
6485                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
6486                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
6487                 </fields>
6488                 <links/>
6489         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6490             <actions>
6491                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6492                 <retrieve/>
6493                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6494                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6495             </actions>
6496         </permacrud>
6497         </class>
6498         <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">
6499                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
6500                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
6501                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
6502                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
6503                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
6504                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
6505                 </fields>
6506                 <links>
6507             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6508         </links>
6509         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6510             <actions>
6511                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6512                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6513                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6514                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
6515             </actions>
6516         </permacrud>
6517         </class>
6518         <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">
6519                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
6520                         <field reporter:label="Library Group ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6521                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6522                         <field reporter:label="Global?" name="global" reporter:datatype="bool"/>
6523                         <field reporter:label="Maps" name="maps" oils_persist:virtual="true" reporter:datatype="link"/>
6524                 </fields>
6525                 <links>
6526                         <link field="maps" reltype="has_many" key="lasso" map="" class="lmap"/>
6527         </links>
6528         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6529             <actions>
6530                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6531                 <retrieve/>
6532                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6533                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6534             </actions>
6535         </permacrud>
6536         </class>
6537         <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">
6538                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
6539                         <field reporter:label="Library Group Map ID" name="id" reporter:datatype="id" />
6540                         <field reporter:label="Library Group" name="lasso" reporter:datatype="link"/>
6541                         <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
6542                 </fields>
6543                 <links>
6544                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
6545                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6546                 </links>
6547         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6548             <actions>
6549                 <create permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6550                 <retrieve/>
6551                 <update permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6552                 <delete permission="ADMIN_LIBRARY_GROUPS" global_required="true"/>
6553             </actions>
6554         </permacrud>
6555         </class>
6556         <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">
6557                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
6558                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6559                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
6560                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
6561                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
6562                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
6563                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
6564                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
6565                         <field name="pos" reporter:label="Position" reporter:datatype="int" oils_obj:required="true" />
6566                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
6567                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
6568                 </fields>
6569                 <links>
6570                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6571                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6572                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6573                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
6574                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
6575                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
6576                 </links>
6577         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6578             <actions>
6579                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6580                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6581                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6582                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
6583             </actions>
6584         </permacrud>
6585         </class>
6586         <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">
6587                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6588                         <field name="id" reporter:datatype="id" />
6589                         <field name="from_org" reporter:datatype="org_unit"/>
6590                         <field name="to_org" reporter:datatype="org_unit"/>
6591                         <field name="prox" reporter:datatype="int" />
6592                 </fields>
6593                 <links>
6594                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
6595                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
6596                 </links>
6597         </class>
6598         <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">
6599                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
6600                         <field reporter:label="ID" name="id" reporter:datatype="id" />
6601                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
6602                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
6603                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
6604                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
6605                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
6606                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
6607                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
6608                 </fields>
6609                 <links/>
6610         </class>
6611         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
6612                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
6613                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
6614                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6615                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
6616                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
6617                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
6618                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6619                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
6620                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6621                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
6622                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
6623                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
6624                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
6625                 </fields>
6626                 <links>
6627                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6628                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
6629                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
6630                 </links>
6631         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6632             <actions>
6633                 <create permission="ADMIN_SURVEY" context_field="owner"/>
6634                 <retrieve/>
6635                 <update permission="ADMIN_SURVEY" context_field="owner"/>
6636                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
6637             </actions>
6638         </permacrud>
6639         </class>
6640         <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">
6641                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
6642                         <field name="address_type" reporter:label="Address Type" reporter:datatype="text" oils_obj:required="true" />
6643                         <field name="city" reporter:label="City" reporter:datatype="text" oils_obj:required="true"/>
6644                         <field name="country" reporter:label="Country" reporter:datatype="text" oils_obj:required="true"/>
6645                         <field name="county" reporter:label="County" reporter:datatype="text"/>
6646                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6647                         <field name="org_unit" reporter:label="Org Unit" reporter:datatype="org_unit" oils_obj:required="true"/>
6648                         <field name="post_code" reporter:label="Post Code" reporter:datatype="text" oils_obj:required="true"/>
6649                         <field name="state" reporter:label="State" reporter:datatype="text"/>
6650                         <field name="street1" reporter:label="Street1" reporter:datatype="text" oils_obj:required="true"/>
6651                         <field name="street2" reporter:label="Street2" reporter:datatype="text"/>
6652                         <field name="valid" reporter:label="Is Valid?" reporter:datatype="bool" oils_obj:required="true"/>
6653                         <field name="san" reporter:label="SAN" reporter:datatype="text"/>
6654                         <field name="latitude" reporter:label="Latitude" reporter:datatype="float"/>
6655                         <field name="longitude" reporter:label="Longitude" reporter:datatype="float"/>
6656                 </fields>
6657                 <links>
6658                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6659                 </links>
6660         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6661             <actions>
6662                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
6663                 <retrieve/>
6664                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
6665                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
6666             </actions>
6667         </permacrud>
6668         </class>
6669         <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">
6670                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
6671                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
6672                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
6673                         <field name="query_text" reporter:datatype="text"/>
6674                 </fields>
6675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6676             <actions>
6677                 <retrieve/>
6678             </actions>
6679         </permacrud>
6680         </class>
6681
6682         <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">
6683                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
6684                         <field name="id" reporter:datatype="id" reporter:selector="label" reporter:label="ID" oils_obj:required="true"/>
6685                         <field name="owner" reporter:datatype="org_unit" reporter:label="Owning Org Unit" oils_obj:required="true"/>
6686                         <field name="code" reporter:datatype="text" reporter:label="Code" oils_obj:required="true"/>
6687                         <field name="label" reporter:datatype="text" oils_persist:i18n="true" reporter:label="Label" oils_obj:required="true"/>
6688                         <field name="create_date" reporter:datatype="timestamp" reporter:label="Create Date"/>
6689                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link" reporter:label="Group Entries"/>
6690                 </fields>
6691                 <links>
6692                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6693                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
6694                 </links>
6695         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6696             <actions>
6697                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6698                 <retrieve/>
6699                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6700                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
6701             </actions>
6702         </permacrud>
6703         </class>
6704         <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">
6705                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
6706                         <field name="id" reporter:datatype="id" reporter:label="ID" oils_obj:required="true"/>
6707                         <field name="grp" reporter:datatype="link" reporter:label="Search Filter Group" oils_obj:required="true"/>
6708                         <field name="pos" reporter:datatype="int" reporter:label="Position" oils_obj:required="true"/>
6709                         <field name="query" reporter:datatype="link" reporter:label="Query" oils_obj:required="true"/>
6710                 </fields>
6711                 <links>
6712                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
6713                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
6714                 </links>
6715         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6716             <actions>
6717                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
6718                     <context link="grp" field="owner"/>
6719                 </create>
6720                 <retrieve/>
6721                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
6722                     <context link="grp" field="owner"/>
6723                 </update>
6724                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
6725                     <context link="grp" field="owner"/>
6726                 </delete>
6727             </actions>
6728         </permacrud>
6729         </class>
6730
6731         <!-- A note: Please update alhr and ahopl when updating ahr -->
6732         <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">
6733                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6734                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6735                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6736                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6737                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6738                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6739                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6740                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6741                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6742                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6743                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6744                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6745                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6746                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6747                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6748                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6749                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6750                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6751                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6752                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6753                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6754                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6755                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6756                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6757                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6758                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6759                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6760                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6761                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6762                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6763                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6764                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6765                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6766                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6767                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6768                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6769                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6770                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6771                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6772                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6773                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6774                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6775                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6776                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6777                 </fields>
6778                 <links>
6779                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6780                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6781                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6782                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6783                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6784                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6785                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6786                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6787                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6788                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6789                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6790                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6791                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6792                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6793                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6794                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6795                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6796                         <link field="hold_type" reltype="has_a" key="hold_type" map="" class="cht"/>
6797                 </links>
6798                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6799                         <actions>
6800                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6801                         </actions>
6802                 </permacrud>
6803         </class>
6804         <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">
6805                 <oils_persist:source_definition><![CDATA[
6806                 SELECT
6807                         ahr.*,
6808                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6809                                 copy_location_order_position,
6810                         CASE WHEN au.alias IS NOT NULL THEN
6811                                 au.alias
6812                         ELSE
6813                                 au.first_given_name
6814                         END AS usr_alias_or_first_given_name,
6815                         au.first_given_name AS usr_first_given_name,
6816                         au.second_given_name AS usr_second_given_name,
6817                         au.family_name AS usr_family_name,
6818                         au.prefix AS usr_prefix,
6819                         au.suffix AS usr_suffix,
6820                         au.alias AS usr_alias,
6821                         CASE WHEN au.alias IS NOT NULL THEN
6822                                 au.alias
6823                         ELSE
6824                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6825                                         COALESCE(au.family_name, ''),
6826                                         COALESCE(au.suffix, ''),
6827                                         ', ',
6828                                         COALESCE(au.prefix, ''),
6829                                         COALESCE(au.first_given_name, ''),
6830                                         COALESCE(au.second_given_name, '')
6831                                 ], ' '), E'\\s+,', ',')
6832                         END AS usr_alias_or_display_name,
6833                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6834                                 COALESCE(au.family_name, ''),
6835                                 COALESCE(au.suffix, ''),
6836                                 ', ',
6837                                 COALESCE(au.prefix, ''),
6838                                 COALESCE(au.first_given_name, ''),
6839                                 COALESCE(au.second_given_name, '')
6840                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6841                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6842                                 AS call_number_label,
6843                         siss.label AS issuance_label,
6844                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6845                         ahcm_1.copy_count AS potential_copies
6846                 FROM action.hold_request ahr
6847                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6848                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6849                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6850                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6851                 JOIN actor.usr au ON (au.id = ahr.usr)
6852                 JOIN (
6853                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6854                         FROM asset.copy_location
6855                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6856                 LEFT JOIN actor.usr_standing_penalty ausp 
6857                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6858                 LEFT JOIN config.standing_penalty csp
6859                         ON (
6860                                 csp.id = ausp.standing_penalty AND 
6861                                 csp.block_list LIKE '%CAPTURE%' AND (
6862                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6863                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6864                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6865                                         )
6866                                 )
6867                         )
6868                 JOIN (
6869                         SELECT COUNT(target_copy) AS copy_count, hold
6870                         FROM action.hold_copy_map
6871                         GROUP BY 2
6872                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6873                 LEFT JOIN serial.issuance siss
6874                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6875                 LEFT JOIN asset.copy_location_order acplo
6876                         ON (acp.location = acplo.location AND
6877                                 acp.circ_lib = acplo.org)
6878                 WHERE
6879                         ahr.capture_time IS NULL AND
6880                         ahr.cancel_time IS NULL AND
6881                         csp.id IS NULL AND
6882                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6883                         acp.status IN (0,7)
6884                 ]]></oils_persist:source_definition>
6885                 <fields oils_persist:primary="id">
6886                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6887                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6888                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6889                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6890                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6891                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6892                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6893                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6894                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6895                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6896                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6897                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6898                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6899                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6900                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6901                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6902                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6903                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6904                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6905                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6906                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6907                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6908                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6909                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6910                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6911                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6912                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6913                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6914                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6915                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6916                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6917                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6918                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6919                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6920                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6921                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6922                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6923                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6924                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6925                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6926                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
6927                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6928                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6929                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6930                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6931                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6932                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6933                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6934                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6935                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6936                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6937                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6938                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6939                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6940                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6941                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6942                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
6943                 </fields>
6944                 <links>
6945                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6946                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6947                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6948                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6949                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6950                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6951                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6952                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6953                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6954                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6955                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6956                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6957                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6958                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6959                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6960                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6961                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
6962                 </links>
6963                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6964                         <actions>
6965                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6966                         </actions>
6967                 </permacrud>
6968         </class>
6969         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6970                 <oils_persist:source_definition><![CDATA[
6971                         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)
6972                 ]]></oils_persist:source_definition>
6973                 <fields oils_persist:primary="id">
6974                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6975                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6976                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6977                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6978                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6979                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6980                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6981                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6982                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6983                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6984                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6985                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6986                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6987                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6988                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6989                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6990                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6991                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6992                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6993                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6994                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6995                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6996                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6997                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6998                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6999                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
7000                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7001                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
7002                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7003                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7004                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7005                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7006                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7007                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7008                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7009                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7010                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
7011                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7012                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7013                         <field reporter:label="Acquisition Request" name="acq_request" reporter:datatype="link" />
7014                         <field reporter:label="Hopeless Date" name="hopeless_date" reporter:datatype="timestamp"/>
7015                 </fields>
7016                 <links>
7017                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7018                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7019                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7020                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7021                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
7022                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7023                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7024                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7025                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
7026                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
7027                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
7028                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7029                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7030                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
7031                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7032                         <link field="acq_request" reltype="has_a" key="id" map="" class="aur"/>
7033                 </links>
7034         </class>
7035
7036         <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">
7037                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
7038                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7039                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
7040                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
7041                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
7042                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
7043                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
7044                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
7045                 </fields>
7046                 <links>
7047                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7048                 </links>
7049                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7050                         <actions>
7051                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
7052                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
7053                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
7054                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
7055                         </actions>
7056                 </permacrud>
7057         </class>
7058         <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">
7059                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7060                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7061                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7063                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7064                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7065                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7066                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7067                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7068                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7069                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7070                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7071                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7072                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7073                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7074                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7075                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7076                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7077                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7078                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7079                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7080                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7081                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7082                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7083                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7084                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7085                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7086                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7087                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7088                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7089                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7090                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7091                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7092                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7093                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7094                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7095                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7096                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
7097                 </fields>
7098                 <links>
7099                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7100                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7101                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7102                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7103                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7104                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7105                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7106                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7107                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7108                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7109                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7110                 </links>
7111                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7112                         <actions>
7113                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7114                         </actions>
7115                 </permacrud>
7116         </class>
7117         <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">
7118                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
7119                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
7120                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
7121                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
7122                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
7123                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
7124                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
7125                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
7126                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
7127                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
7128                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
7129                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
7130                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
7131                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
7132                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
7133                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
7134                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
7135                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
7136                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
7137                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
7138                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
7139                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
7140                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
7141                         <field reporter:label="Item Selection Depth" name="selection_depth" />
7142                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
7143                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
7144                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7145                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
7146                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
7147                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
7148                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
7149                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
7150                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
7151                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
7152                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
7153                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
7154                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
7155                 </fields>
7156                 <links>
7157                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
7158                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
7159                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7160                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
7161                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7162                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
7163                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
7164                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
7165                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
7166                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
7167                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
7168                 </links>
7169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7170                         <actions>
7171                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
7172                         </actions>
7173                 </permacrud>
7174         </class>
7175
7176         <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">
7177                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
7178                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
7179                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
7180                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
7181                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
7182                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
7183                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
7184                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
7185                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link" oils_obj:required="true"/>
7186                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
7187                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
7188                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
7189                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
7190                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7191                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link" oils_obj:required="true"/>
7192                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
7193                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
7194                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7195                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
7196                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
7208                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
7209                 </fields>
7210                 <links>
7211                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
7212                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
7213                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
7214                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
7215                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
7216                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
7217                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7218                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
7219                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
7220                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
7221                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
7222                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
7223                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
7224                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
7225                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
7226                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
7227                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
7228                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
7229                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
7230                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
7231                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
7232                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
7233                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
7234                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
7235                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
7236                 </links>
7237         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7238             <actions>
7239                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
7240                 <retrieve />
7241                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
7242                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
7243             </actions>
7244         </permacrud>
7245         </class>
7246         <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">
7247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
7248                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7249                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
7250                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
7251                 </fields>
7252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7253                         <actions>
7254                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7255                                 <retrieve/>
7256                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7257                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7258                         </actions>
7259                 </permacrud>
7260         </class>
7261         <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">
7262                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
7263                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7264                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
7265                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
7266                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
7267                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
7268                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
7269                 </fields>
7270                 <links>
7271                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
7272                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
7273                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
7274                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
7275                 </links>
7276                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7277                         <actions>
7278                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7279                                 <retrieve/>
7280                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7281                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
7282                         </actions>
7283                 </permacrud>
7284         </class>
7285         <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">
7286                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
7287                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7288                         <field name="btype" reporter:datatype="text"/>
7289                         <field name="id" reporter:datatype="id" />
7290                         <field name="name"  reporter:datatype="text"/>
7291                         <field name="description" reporter:datatype="text"/>
7292                         <field name="owner" reporter:datatype="link"/>
7293                         <field name="pub" reporter:datatype="bool"/>
7294                         <field name="create_time" reporter:datatype="timestamp" />
7295                         <field name="owning_lib" reporter:datatype="org_unit" />
7296                 </fields>
7297                 <links>
7298                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7299                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7300                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
7301                 </links>
7302                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7303                         <actions>
7304                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7305                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7306                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7307                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7308                         </actions>
7309                 </permacrud>
7310         </class>
7311         <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">
7312                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
7313                         <field name="id" reporter:datatype="id" />
7314                         <field name="bucket" reporter:datatype="link"/>
7315                         <field name="note" reporter:datatype="text" />
7316                 </fields>
7317                 <links>
7318                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
7319                 </links>
7320         </class>
7321         <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">
7322                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
7323                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7324                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7325                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7326                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7327                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7328                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7329                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7330                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7331                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7332                 </fields>
7333                 <links>
7334                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7335                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
7336                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
7337                 </links>
7338                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7339                         <actions>
7340                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7341                         </actions>
7342                 </permacrud>
7343         </class>
7344         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
7345                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
7346                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
7347                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7348                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
7349                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7350                 </fields>
7351                 <links>
7352                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7353                 </links>
7354                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7355                         <actions>
7356                                 <retrieve permission="VIEW_USER user_request.view">
7357                                         <context link="usr" field="home_ou" />
7358                                 </retrieve>
7359                         </actions>
7360                 </permacrud>
7361         </class>
7362     <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">
7363         <fields oils_persist:primary="field">
7364             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7365             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7366             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7367         </fields>
7368         <links/>
7369         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7370             <actions>
7371                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
7372                 <retrieve />
7373                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
7374                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
7375             </actions>
7376         </permacrud>
7377     </class>
7378         <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">
7379                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
7380                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
7381                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7382                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
7383                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7384                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
7385                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
7386                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
7387                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
7388                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
7389                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
7390                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
7391                         <field reporter:label="Free Text" name="allow_freetext" 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="actscsf"/>
7396                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
7397                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
7398                 </links>
7399         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7400             <actions>
7401                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
7402                 <retrieve />
7403                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
7404                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
7405             </actions>
7406         </permacrud>
7407         </class>
7408         <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">
7409                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
7410                         <field name="field" reporter:datatype="link"/>
7411                         <field name="id" reporter:datatype="id" />
7412                         <field name="source" reporter:datatype="link"/>
7413                         <field name="value"  reporter:datatype="text"/>
7414                 </fields>
7415                 <links>
7416                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7417                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7418                 </links>
7419         </class>
7420         <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">
7421                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
7422                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
7423                         <field name="btype" reporter:datatype="text"/>
7424                         <field name="id" reporter:datatype="id" />
7425                         <field name="name"  reporter:datatype="text"/>
7426                         <field name="description" reporter:datatype="text"/>
7427                         <field name="owner" reporter:datatype="link"/>
7428                         <field name="pub" reporter:datatype="bool"/>
7429                         <field name="create_time" reporter:datatype="timestamp" />
7430                         <field name="owning_lib" reporter:datatype="org_unit" />
7431                 </fields>
7432                 <links>
7433                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7434                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7435                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
7436                 </links>
7437                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7438                         <actions>
7439                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7440                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7441                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7442                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context_field="owning_lib" owning_user="owner"/>
7443                         </actions>
7444                 </permacrud>
7445         </class>
7446         <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">
7447                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
7448                         <field name="id" reporter:datatype="id" />
7449                         <field name="bucket" reporter:datatype="link"/>
7450                         <field name="note" reporter:datatype="text" />
7451                 </fields>
7452                 <links>
7453                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7454                 </links>
7455         </class>
7456         <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">
7457                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7458                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7459                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7460                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7461                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7462                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
7463                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7464                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7465                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
7466                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7467                 </fields>
7468                 <links>
7469                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7470                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7471                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7472                 </links>
7473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7474             <actions>
7475                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7476                     <context link="xact" jump="usr" field="home_ou"/>
7477                 </retrieve>
7478                         </actions>
7479                 </permacrud>
7480         </class>
7481         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
7482                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
7483                         <field name="id" reporter:datatype="id" />
7484                         <field name="ind1" />
7485                         <field name="ind2" />
7486                         <field name="record" />
7487                         <field name="subfield" />
7488                         <field name="tag" />
7489                         <field name="value" />
7490                 </fields>
7491                 <links>
7492                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
7493                 </links>
7494         </class>
7495         <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">
7496                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
7497                         <field name="id" reporter:label="ID" reporter:datatype="id" />
7498                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
7499                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
7500                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
7501                 </fields>
7502                 <links>
7503                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
7504                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
7505                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
7506                 </links>
7507         </class>
7508         <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">
7509                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
7510                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
7511                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7512                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
7513                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7514                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
7515                 </fields>
7516                 <links>
7517                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7518                 </links>
7519         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7520             <actions>
7521                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7522                 <retrieve/>
7523                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7524                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
7525             </actions>
7526         </permacrud>
7527
7528         </class>
7529         <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">
7530                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
7531                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7532                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
7533                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
7534                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
7535                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7536                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
7537                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
7538                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
7539                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
7540                 </fields>
7541                 <links>
7542                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
7543                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
7544                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
7545                 </links>
7546         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7547             <actions>
7548                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
7549                 <retrieve/>
7550                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
7551                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
7552             </actions>
7553         </permacrud>
7554         </class>
7555         <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">
7556                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
7557                         <field reporter:label="Creation Date" name="create_date" reporter:datatype="timestamp"/>
7558                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7559                         <field reporter:label="Last Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7560                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7561                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
7562                         <field reporter:label="Public" name="pub" reporter:datatype="bool"/>
7563                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
7564                         <field reporter:label="Note" name="value" reporter:datatype="text"/>
7565                         <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/> 
7566                 </fields>
7567                 <links>
7568                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7569                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7570                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
7571                 </links>
7572                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7573                 <actions>
7574                     <create permission="CREATE_RECORD_NOTE" global_required="true"/>
7575                     <retrieve/>
7576                     <update permission="UPDATE_RECORD_NOTE" global_required="true"/>
7577                     <delete permission="DELETE_RECORD_NOTE" global_required="true"/>
7578                 </actions>
7579              </permacrud>
7580         </class>
7581         <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">
7582                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7583                         <field name="balance_owed" reporter:datatype="money" />
7584                         <field name="total_owed" reporter:datatype="money" />
7585                         <field name="total_paid" reporter:datatype="money" />
7586                         <field name="usr" reporter:datatype="link"/>
7587                 </fields>
7588                 <links>
7589                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7590                 </links>
7591         </class>
7592     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
7593                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7594                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
7595                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7596                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
7597                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7598                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
7599                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
7600                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7601                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7602                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
7603                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7604                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7605                 </fields>
7606                 <links>
7607                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7608                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
7609                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7610                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7611                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
7612                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7613                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7614                 </links>
7615         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7616             <actions>
7617                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
7618             </actions>
7619         </permacrud>
7620         </class>
7621         <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">
7622                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
7623                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
7624                         <field name="quality" reporter:datatype="int" />
7625                         <field name="source" reporter:datatype="text"/>
7626                         <field name="transcendant" reporter:datatype="bool"/>
7627                         <field name="can_have_copies" reporter:datatype="bool"/>
7628                 </fields>
7629                 <links/>
7630         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7631             <actions>
7632                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
7633                 <retrieve/>
7634                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
7635                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
7636             </actions>
7637         </permacrud>
7638         </class>
7639         <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">
7640                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
7641                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
7642                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7643                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
7644                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
7645                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
7646                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
7647                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7648                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
7649                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
7650                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
7651                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
7652                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
7653                 </fields>
7654                 <links>
7655                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
7656                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7657                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7658                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
7659                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
7660                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
7661                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
7662                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
7663                 </links>
7664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7665                         <actions>
7666                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7667                                         <context link="usr" field="home_ou" />
7668                                 </retrieve>
7669                         </actions>
7670                 </permacrud>
7671         </class>
7672         <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">
7673                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
7674                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7675                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7676                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7677                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
7678                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7679                 </fields>
7680                 <links>
7681                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7682                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7683                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
7684                 </links>
7685         </class>
7686         <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">
7687                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
7688                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
7689                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
7690                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7691                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
7692                 </fields>
7693                 <links>
7694                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7695                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7696                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
7697                 </links>
7698         </class>
7699         <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">
7700                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
7701                         <field name="bucket" reporter:datatype="link"/>
7702                         <field name="id" reporter:datatype="id" />
7703                         <field name="target_user" reporter:datatype="link"/>
7704                         <field name="create_time" reporter:datatype="timestamp" />
7705                         <field name="pos" reporter:datatype="int" />
7706                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7707                 </fields>
7708                 <links>
7709                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
7710                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7711             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
7712                 </links>
7713                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7714                         <actions>
7715                                 <retrieve permission="ADMIN_USER_BUCKET">
7716                     <context link="bucket" field="owning_lib"/>
7717                 </retrieve>
7718             </actions>
7719         </permacrud>
7720         </class>
7721         <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">
7722                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_id_seq">
7723                         <field name="id" reporter:datatype="id" />
7724                         <field name="staff" reporter:datatype="link"/>
7725                         <field name="bucket" reporter:datatype="link"/>
7726                         <field name="target" reporter:datatype="int" />
7727                         <field name="hold_type" reporter:datatype="text" />
7728                         <field name="run_date" reporter:datatype="timestamp" />
7729                         <field name="cancelled" reporter:datatype="timestamp" />
7730                         <field name="mappings" oils_persist:virtual="true" reporter:datatype="link" />
7731                 </fields>
7732                 <links>
7733                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7734                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
7735                         <link field="mappings" reltype="has_many" key="batch_hold_event" map="" class="abhem"/>
7736                 </links>
7737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7738                         <actions>
7739                 <create permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7740                 <retrieve/>
7741                 <update permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7742                 <delete permission="MANAGE_HOLD_GROUPS" global_required="true"/>
7743             </actions>
7744         </permacrud>
7745         </class>
7746         <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">
7747                 <fields oils_persist:primary="id" oils_persist:sequence="action.batch_hold_event_map_id_seq">
7748                         <field name="id" reporter:datatype="id" />
7749                         <field name="batch_hold_event" reporter:datatype="link"/>
7750                         <field name="hold" reporter:datatype="link"/>
7751                 </fields>
7752                 <links>
7753                         <link field="batch_hold_event" reltype="has_a" key="id" map="" class="abhe"/>
7754                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7755                 </links>
7756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7757                         <actions>
7758                 <retrieve/>
7759             </actions>
7760         </permacrud>
7761         </class>
7762         <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">
7763                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
7764                         <field name="id" reporter:datatype="id" />
7765                         <field name="item" reporter:datatype="link"/>
7766                         <field name="note" reporter:datatype="text" />
7767                 </fields>
7768                 <links>
7769                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
7770                 </links>
7771         </class>
7772         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
7773                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7774                         <field name="balance_owed" reporter:datatype="money" />
7775                         <field name="total_owed" reporter:datatype="money" />
7776                         <field name="total_paid" reporter:datatype="money" />
7777                         <field name="usr" reporter:datatype="link"/>
7778                 </fields>
7779                 <links>
7780                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7781                 </links>
7782         </class>
7783         <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">
7784                 <fields oils_persist:primary="code" oils_persist:sequence="">
7785                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
7786                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7787                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7788                 </fields>
7789                 <links/>
7790         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7791             <actions>
7792                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7793                 <retrieve/>
7794                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7795                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7796             </actions>
7797         </permacrud>
7798         </class>
7799         <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">
7800                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7801                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7802                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7803                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7804                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7805                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7806                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7807                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7808                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7809                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7810                 </fields>
7811                 <links>
7812                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7813                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7814                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7815                 </links>
7816         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7817             <actions>
7818                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7819                     <context link="xact" jump="usr" field="home_ou"/>
7820                 </retrieve>
7821                         </actions>
7822                 </permacrud>
7823         </class>
7824         <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">
7825                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7826                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7827                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7828                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7829                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7830                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7831                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7832                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7833                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7834                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7835                 </fields>
7836                 <links>
7837                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7838                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7839                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7840                 </links>
7841         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7842             <actions>
7843                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7844                     <context link="xact" jump="usr" field="home_ou"/>
7845                 </retrieve>
7846                         </actions>
7847                 </permacrud>
7848         </class>
7849         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7850                 <fields oils_persist:primary="id" oils_persist:sequence="">
7851                         <field name="checkin_lib" reporter:datatype="link"/>
7852                         <field name="checkin_staff" reporter:datatype="link"/>
7853                         <field name="checkin_time" reporter:datatype="timestamp"/>
7854                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7855                         <field name="circ_staff" reporter:datatype="link"/>
7856                         <field name="desk_renewal" reporter:datatype="bool"/>
7857                         <field name="due_date" reporter:datatype="timestamp"/>
7858                         <field name="duration" reporter:datatype="interval"/>
7859                         <field name="duration_rule" reporter:datatype="link"/>
7860                         <field name="fine_interval" reporter:datatype="interval"/>
7861                         <field name="id" reporter:datatype="id" />
7862                         <field name="max_fine" reporter:datatype="money" />
7863                         <field name="max_fine_rule" reporter:datatype="link"/>
7864                         <field name="opac_renewal" reporter:datatype="bool"/>
7865                         <field name="phone_renewal" reporter:datatype="bool"/>
7866                         <field name="recurring_fine" reporter:datatype="money" />
7867                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7868                         <field name="renewal_remaining" reporter:datatype="int" />
7869             <field name="grace_period" reporter:datatype="interval" />
7870                         <field name="stop_fines" reporter:datatype="text"/>
7871                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7872                         <field name="target_copy" reporter:datatype="link"/>
7873                         <field name="usr" reporter:datatype="link"/>
7874                         <field name="xact_finish" reporter:datatype="timestamp" />
7875                         <field name="xact_start" reporter:datatype="timestamp" />
7876                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7877                         <field name="auto_renewal" reporter:datatype="bool"/>
7878                         <field name="auto_renewal_remaining" reporter:datatype="int" />
7879                 </fields>
7880                 <links>
7881                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7882                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7883                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7884                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7885                 </links>
7886         </class>
7887         <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">
7888                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7889                         <field name="field" reporter:datatype="link"/>
7890                         <field name="id" reporter:datatype="id" />
7891                         <field name="source" reporter:datatype="link"/>
7892                         <field name="value" reporter:datatype="text"/>
7893                 </fields>
7894                 <links>
7895                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7896                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7897                 </links>
7898         </class>
7899         <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">
7900                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7901                         <field name="high" reporter:datatype="money" />
7902                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7903                         <field name="low" reporter:datatype="money" />
7904                         <field name="name" reporter:datatype="text"/>
7905                         <field name="normal" reporter:datatype="money" />
7906                         <field name="recurrence_interval" reporter:datatype="interval"/>
7907             <field name="grace_period" reporter:datatype="interval" />
7908                 </fields>
7909                 <links/>
7910         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7911             <actions>
7912                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7913                 <retrieve/>
7914                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7915                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7916             </actions>
7917         </permacrud>
7918         </class>
7919         <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">
7920                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7921                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7922                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7923                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7924                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7925                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7926                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7927                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7928                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7929                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7930                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7931                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7932                 </fields>
7933                 <links>
7934                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7935                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7936                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7937                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7938                 </links>
7939         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7940             <actions>
7941                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7942                     <context link="xact" jump="usr" field="home_ou"/>
7943                 </retrieve>
7944                         </actions>
7945                 </permacrud>
7946         </class>
7947         <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">
7948                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7949                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7950                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7951                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7952                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7953                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7954                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7955                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7956                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7957                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7958                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7959                 </fields>
7960                 <links>
7961                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7962                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7963                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7964                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7965                 </links>
7966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7967             <actions>
7968                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7969                     <context link="xact" jump="usr" field="home_ou"/>
7970                 </retrieve>
7971                         </actions>
7972                 </permacrud>
7973         </class>
7974         <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">
7975                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7976                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7977                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7978                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7979                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
7980                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="link"/>
7981                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7982                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
7983                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
7984                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
7985                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
7986                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
7987                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
7988                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
7989                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
7990                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
7991                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
7992                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
7993                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
7994                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
7995                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
7996                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7997                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
7998                         <field reporter:label="Copy ID" name="id" reporter:selector="barcode" reporter:datatype="id"/>
7999                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8000                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
8001                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
8002                         <field reporter:label="Price" name="price" reporter:datatype="money" />
8003                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
8004                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
8005                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
8006                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
8007                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8008                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
8009                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
8010                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8011                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8012                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8013                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
8014                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
8015                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
8016                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
8017                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
8018                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
8019                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
8020                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
8021                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
8022                         <field reporter:label="Latest Inventory" name="latest_inventory" oils_persist:virtual="true" reporter:datatype="link"/>
8023                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
8024                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8025                         <field reporter:label="Copy Alerts" name="copy_alerts" oils_persist:virtual="true" reporter:datatype="link"/>
8026                 </fields>
8027                 <links>
8028                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8029                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
8030                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8031                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8032                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8033                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8034                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8035                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
8036                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
8037                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
8038                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
8039                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
8040                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
8041                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
8042                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
8043                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
8044                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8045                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
8046                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
8047                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
8048                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
8049                         <link field="latest_inventory" reltype="might_have" key="copy" map="" class="alci"/>
8050                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8051                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
8052                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
8053                         <link field="copy_alerts" reltype="has_many" key="copy" map="" class="aca"/>
8054                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8055                 </links>
8056         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8057             <actions>
8058                 <create permission="CREATE_COPY">
8059                     <context link="call_number" field="owning_lib"/>
8060                 </create>
8061                 <retrieve/>
8062                 <update permission="UPDATE_COPY">
8063                     <context link="call_number" field="owning_lib"/>
8064                 </update>
8065                 <delete permission="DELETE_COPY">
8066                     <context link="call_number" field="owning_lib"/>
8067                 </delete>
8068             </actions>
8069         </permacrud>
8070         </class>
8071
8072         <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">
8073                 <fields oils_persist:primary="id" oils_persist:sequence="asset.latest_inventory_id_seq">
8074             <field reporter:label="Latest Inventory ID" name="id" reporter:datatype="id"/>
8075                         <field reporter:label="Latest Inventory Date" name="inventory_date" reporter:datatype="timestamp"/>
8076                         <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="link"/>
8077                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
8078                 </fields>
8079                 <links>
8080                         <link field="inventory_workstation" reltype="has_a" key="id" map="" class="aws"/>
8081                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8082                 </links>
8083         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8084             <actions>
8085                                 <create permission="STAFF_LOGIN"/>
8086                                 <retrieve/>
8087                                 <update permission="STAFF_LOGIN"/>
8088                                 <delete permission="STAFF_LOGIN"/>
8089             </actions>
8090         </permacrud>
8091         </class>
8092
8093         <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">
8094                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
8095                         <field reporter:label="Id" name="id" reporter:selector="name" reporter:datatype="id"/>
8096                         <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
8097                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8098                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8099                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8100                         <field reporter:label="Event" name="event" reporter:datatype="text" />
8101                         <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
8102                         <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
8103                         <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
8104                         <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
8105                         <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
8106                 </fields>
8107                 <links>
8108                         <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
8109                 </links>
8110         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8111             <actions>
8112                 <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8113                 <retrieve/>
8114                 <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
8115                 <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
8116             </actions>
8117         </permacrud>
8118         </class>
8119
8120         <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">
8121                 <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
8122                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8123                         <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
8124                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8125                 </fields>
8126                 <links>
8127                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8128                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8129                 </links>
8130         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8131             <actions>
8132                 <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8133                 <retrieve/>
8134                 <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
8135                 <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
8136             </actions>
8137         </permacrud>
8138         </class>
8139
8140         <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">
8141                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
8142                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8143                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8144                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8145                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8146                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8147                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8148                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8149                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8150                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8151                 </fields>
8152                 <links>
8153                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8154                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8155                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8156                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8157                 </links>
8158         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8159             <actions>
8160                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8161                     <context link="copy" field="circ_lib"/>
8162                 </create>
8163                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8164                     <context link="copy" field="circ_lib"/>
8165                                 </retrieve>
8166                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8167                     <context link="copy" field="circ_lib"/>
8168                                 </update>
8169                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8170                     <context link="copy" field="circ_lib"/>
8171                                 </delete>
8172             </actions>
8173         </permacrud>
8174         </class>
8175
8176         <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">
8177                 <fields oils_persist:primary="id">
8178                         <field reporter:label="Id" name="id" reporter:datatype="id"/>
8179                         <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
8180                         <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
8181                         <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
8182                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
8183                         <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
8184                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8185                         <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
8186                         <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
8187                 </fields>
8188                 <links>
8189                         <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
8190                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
8191                         <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
8192                         <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
8193                 </links>
8194         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8195             <actions>
8196                 <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
8197                     <context link="copy" field="circ_lib"/>
8198                 </create>
8199                 <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
8200                     <context link="copy" field="circ_lib"/>
8201                                 </retrieve>
8202                 <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
8203                     <context link="copy" field="circ_lib"/>
8204                                 </update>
8205                 <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
8206                     <context link="copy" field="circ_lib"/>
8207                                 </delete>
8208             </actions>
8209         </permacrud>
8210         </class>
8211
8212         <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">
8213                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
8214                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
8215                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
8216                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8217                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8218                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8219                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
8220                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8221                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
8222                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
8223                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
8224                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
8225                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
8226                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
8227                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
8228                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
8229                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
8230                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
8231                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
8232                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
8233                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
8234                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
8235                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
8236                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
8237                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
8238                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
8239                 </fields>
8240                 <links>
8241                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8242                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8243                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8244                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8245                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
8246                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8247                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8248                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
8249                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
8250                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
8251                 </links>
8252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8253                         <actions>
8254                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8255                                 <retrieve />
8256                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8257                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
8258                         </actions>
8259                 </permacrud>
8260         </class>
8261
8262         <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">
8263                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
8264                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
8265                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8266                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8267                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
8268                 </fields>
8269                 <links/>
8270         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8271             <actions>
8272                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8273                 <retrieve/>
8274                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8275                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
8276             </actions>
8277         </permacrud>
8278         </class>
8279         <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">
8280                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
8281                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
8282                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8283                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
8284                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
8285                 </fields>
8286                 <links/>
8287         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8288             <actions>
8289                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8290                 <retrieve/>
8291                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8292                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
8293             </actions>
8294         </permacrud>
8295         </class>
8296         <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">
8297                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
8298                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8299                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8300                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8301                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
8302                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8303                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
8304                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
8305                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
8306                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
8307                 </fields>
8308                 <links>
8309                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
8310                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
8311                 </links>
8312         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8313             <actions>
8314                 <create permission="CREATE_PERM" global_required="true"/>
8315                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8316                 <update permission="UPDATE_PERM" global_required="true"/>
8317                 <delete permission="DELETE_PERM" global_required="true"/>
8318             </actions>
8319         </permacrud>
8320         </class>
8321         <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">
8322                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_display_entry_id_seq">
8323                         <field reporter:label="Entry ID" name="id" reporter:selector="name" reporter:datatype="id"/>
8324                         <field reporter:label="Group ID" name="grp" reporter:datatype="link" oils_persist:i18n="true"/>
8325                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
8326                         <field reporter:label="Org Unit" name="org" reporter:datatype="link"/>
8327                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
8328                         <field reporter:label="Child Entries" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
8329                 </fields>
8330                 <links>
8331                         <link field="parent" reltype="has_a" key="id" map="" class="pgtde"/>
8332                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8333                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8334                         <link field="children" reltype="has_many" key="parent" map="" class="pgtde"/>
8335                 </links>
8336                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8337                         <actions>
8338                                 <create permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8339                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8340                                 <update permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8341                                 <delete permission="MANAGE_CUSTOM_PERM_GRP_TREE" global_required="true"/>
8342                         </actions>
8343                 </permacrud>
8344         </class>
8345         <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">
8346                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
8347                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
8348                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
8349                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
8350                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
8351                 </fields>
8352                 <links>
8353                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
8354                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
8355                 </links>
8356         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8357             <actions>
8358                 <create permission="ADMIN_SURVEY">
8359                     <context link="question" jump="survey" field="owner"/>
8360                 </create>
8361                 <retrieve/>
8362                 <update permission="ADMIN_SURVEY">
8363                     <context link="question" jump="survey" field="owner"/>
8364                 </update>
8365                 <delete permission="ADMIN_SURVEY">
8366                     <context link="question" jump="survey" field="owner"/>
8367                 </delete>
8368             </actions>
8369         </permacrud>
8370         </class>
8371         <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">
8372                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
8373                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
8374                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
8375                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
8376                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
8377                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
8378                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
8379                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
8380                 </fields>
8381                 <links>
8382                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
8383                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
8384                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
8385                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8386                 </links>
8387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8388                         <actions>
8389                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
8390                         </actions>
8391                 </permacrud>
8392         </class>
8393         <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">
8394                 <fields oils_persist:primary="usr" oils_persist:sequence="">
8395                         <field name="balance_owed" reporter:datatype="money" />
8396                         <field name="total_owed" reporter:datatype="money" />
8397                         <field name="total_paid" reporter:datatype="money" />
8398                         <field name="usr" reporter:datatype="link"/>
8399                 </fields>
8400                 <links>
8401                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8402                 </links>
8403         </class>
8404         <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">
8405                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
8406                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
8407                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
8408                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
8409                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
8410                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
8411                 </fields>
8412                 <links>
8413                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8414                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
8415                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
8416                 </links>
8417         </class>
8418         <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">
8419                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
8420                         <field name="field" reporter:datatype="link"/>
8421                         <field name="id" reporter:datatype="id" />
8422                         <field name="source" reporter:datatype="link"/>
8423                         <field name="value" reporter:datatype="text"/>
8424                 </fields>
8425                 <links>
8426                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8427                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8428                 </links>
8429         </class>
8430         <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">
8431                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
8432                         <field name="field" reporter:datatype="link"/>
8433                         <field name="id" reporter:datatype="id" />
8434                         <field name="source" reporter:datatype="link"/>
8435                         <field name="value" reporter:datatype="text"/>
8436                 </fields>
8437                 <links>
8438                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
8439                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
8440                 </links>
8441         </class>
8442         <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">
8443                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
8444                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
8445                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
8446                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
8447                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
8448                 </fields>
8449                 <links>
8450                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
8451                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
8452                 </links>
8453         </class>
8454         <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">
8455                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
8456                         <field name="depth" reporter:datatype="int" />
8457                         <field name="grantable" reporter:datatype="bool"/>
8458                         <field name="grp" reporter:datatype="link"/>
8459                         <field name="id" reporter:datatype="id" />
8460                         <field name="perm" reporter:datatype="link"/>
8461                 </fields>
8462                 <links>
8463                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8464                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8465                 </links>
8466         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8467             <actions>
8468                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
8469                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
8470                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
8471                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
8472             </actions>
8473         </permacrud>
8474         </class>
8475         <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">
8476                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
8477                         <field name="items" oils_persist:virtual="true" />
8478                         <field name="btype" reporter:datatype="text"/>
8479                         <field name="id" reporter:datatype="id" />
8480                         <field name="name" reporter:datatype="text"/>
8481                         <field name="description" reporter:datatype="text"/>
8482                         <field name="owner" reporter:datatype="link"/>
8483                         <field name="pub" reporter:datatype="bool"/>
8484                         <field name="create_time" reporter:datatype="timestamp" />
8485                         <field name="owning_lib" reporter:datatype="org_unit" />
8486                 </fields>
8487                 <links>
8488                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8489                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8490                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
8491                 </links>
8492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8493                         <actions>
8494                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8495                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8496                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8497                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context_field="owning_lib" owning_user="owner"/>
8498                         </actions>
8499                 </permacrud>
8500         </class>
8501         <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">
8502                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
8503                         <field name="id" reporter:datatype="id" />
8504                         <field name="bucket" reporter:datatype="link"/>
8505                         <field name="note" reporter:datatype="text" />
8506                 </fields>
8507                 <links>
8508                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
8509                 </links>
8510         </class>
8511         <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">
8512                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
8513                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
8514                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
8515                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
8516                 </fields>
8517                 <links>
8518                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8519                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
8520                 </links>
8521         </class>
8522         <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">
8523                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
8524                         <field name="depth" reporter:datatype="int"/>
8525                         <field name="grantable" reporter:datatype="bool"/>
8526                         <field name="id" reporter:datatype="id" />
8527                         <field name="perm" reporter:datatype="link"/>
8528                         <field name="usr" reporter:datatype="link"/>
8529                 </fields>
8530                 <links>
8531                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8532                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8533                 </links>
8534         </class>
8535         <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">
8536                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
8537                         <field name="object_id" reporter:datatype="text"/>
8538                         <field name="grantable" reporter:datatype="bool"/>
8539                         <field name="id" reporter:datatype="id" />
8540                         <field name="perm" reporter:datatype="link"/>
8541                         <field name="usr" reporter:datatype="link"/>
8542                         <field name="object_type" reporter:datatype="text"/>
8543                 </fields>
8544                 <links>
8545                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8546                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
8547                 </links>
8548         </class>
8549         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:label="Payments">
8550                 <fields oils_persist:primary="id" oils_persist:sequence="">
8551                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8552                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8553                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8554                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8555                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8556                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8557                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8558                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8559                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8560                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8561                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8562                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8563                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8564                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8565                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8566                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8567                 </fields>
8568                 <links>
8569                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8570                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8571                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8572                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8573                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8574                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8575                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8576                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8577                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8578                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8579                 </links>
8580         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8581             <actions>
8582                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8583                     <context link="xact" jump="usr" field="home_ou"/>
8584                 </retrieve>
8585                         </actions>
8586                 </permacrud>
8587         </class>
8588         <class id="map" controller="open-ils.cstore open-ils.pcrud" 
8589                 oils_obj:fieldmapper="money::aged_payment" 
8590                 oils_persist:tablename="money.aged_payment" 
8591                 reporter:label="Payments: Aged">
8592                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8593                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8594                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8595                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8596                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8597                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8598                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8599                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8600                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8601                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8602                         <field name="billing" reporter:datatype="link"/>
8603                 </fields>
8604                 <links>
8605                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8606                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8607                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8608                         <link field="billing" reltype="has_a" key="id" map="" class="mab"/>
8609                 </links>
8610                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8611                         <actions>
8612                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8613                                         <context link="xact" field="usr_home_ou"/>
8614                                 </retrieve>
8615                         </actions>
8616                 </permacrud>
8617         </class>
8618         <class id="mallp" controller="open-ils.cstore" 
8619                 oils_obj:fieldmapper="money::all_payments" 
8620                 oils_persist:tablename="money.all_payments" 
8621                 oils_persist:readonly="true" reporter:core="true"
8622                 reporter:label="Payments: All">
8623                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
8624                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8625                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8626                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8627                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8628                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8629                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8630                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8631                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8632                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8633                         <field name="billing" reporter:datatype="link"/>
8634                 </fields>
8635                 <links>
8636                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8637                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8638                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8639                         <link field="billing" reltype="has_a" key="id" map="" class="mallb"/>
8640                 </links>
8641         </class>
8642
8643         <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">
8644                 <fields oils_persist:primary="id" oils_persist:sequence="">
8645                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8646                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8647                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8648                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8649                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8650                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8651                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8652                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8653                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8654                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8655                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8656                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8657                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8658                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8659                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8660                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8661                         <field reporter:label="Debit Card Payment Detail" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8662                 </fields>
8663                 <links>
8664                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8665                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8666                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8667                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8668                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8669                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8670                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8671                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8672                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8673                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8674                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8675                 </links>
8676                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8677                         <actions>
8678                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8679                                         <context link="xact" jump="usr" field="home_ou"/>
8680                                 </retrieve>
8681                         </actions>
8682                 </permacrud>
8683         </class>
8684         <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">
8685                 <fields oils_persist:primary="id" oils_persist:sequence="">
8686                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8687                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8688                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8689                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8690                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8691                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8692                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8693                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8694                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8695                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8696                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8697                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
8698                 </fields>
8699                 <links>
8700                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
8701                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
8702                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
8703                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
8704                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
8705                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8706                 </links>
8707         </class>
8708         <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">
8709                 <fields oils_persist:primary="id" oils_persist:sequence="">
8710                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8711                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
8712                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8713                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
8714                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
8715                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
8716                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
8717                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
8718                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8719                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8720                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8721                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8722                         <field reporter:label="Debit Card Payment" name="debit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
8723                 </fields>
8724                 <links>
8725                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
8726                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
8727                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
8728                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8729                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
8730                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
8731                         <link field="debit_card_payment" reltype="might_have" key="id" map="" class="mdcp"/>
8732                 </links>
8733         </class>
8734         <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">
8735                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
8736                         <field name="bucket" reporter:datatype="link"/>
8737                         <field name="id" reporter:datatype="id" />
8738                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
8739                         <field name="create_time" reporter:datatype="timestamp" />
8740                         <field name="pos" reporter:datatype="int" />
8741                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8742                 </fields>
8743                 <links>
8744                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
8745                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
8746             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
8747                 </links>
8748                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8749                         <actions>
8750                                 <retrieve permission="ADMIN_COPY_BUCKET">
8751                     <context link="bucket" field="owning_lib"/>
8752                 </retrieve>
8753             </actions>
8754         </permacrud>
8755         </class>
8756         <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">
8757                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
8758                         <field name="id" reporter:datatype="id" />
8759                         <field name="item" reporter:datatype="link"/>
8760                         <field name="note" reporter:datatype="text" />
8761                 </fields>
8762                 <links>
8763                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
8764                 </links>
8765         </class>
8766         <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">
8767                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
8768                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
8769                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
8770                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
8771                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
8772                 </fields>
8773                 <links>
8774                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
8775                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8776                 </links>
8777                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8778                         <actions>
8779                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8780                         </actions>
8781                 </permacrud>
8782         </class>
8783     <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">
8784         <fields oils_persist:primary="field">
8785             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
8786             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
8787             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
8788         </fields>
8789         <links/>
8790         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8791             <actions>
8792                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
8793                 <retrieve />
8794                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
8795                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
8796             </actions>
8797         </permacrud>
8798     </class>
8799         <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">
8800                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
8801                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
8802                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8803                 </fields>
8804                 <links/>
8805         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8806             <actions>
8807                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8808                 <retrieve/>
8809                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8810                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
8811             </actions>
8812         </permacrud>
8813         </class>
8814
8815
8816         <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">
8817                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8818                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8819                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8820                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8821                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
8822                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8823                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8824                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8825                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8826                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8827                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8828                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8829                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8830                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8831                 </fields>
8832                 <links>
8833                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8834                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
8835                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8836                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8837                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8838                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8839                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
8840                 </links>
8841         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8842             <actions>
8843                 <create permission="TRANSIT_COPY">
8844                     <context link="target_copy" field="owner"/>
8845                 </create>
8846                 <retrieve/>
8847                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8848                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8849             </actions>
8850         </permacrud>
8851         </class>
8852         <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">
8853                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
8854                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
8855                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
8856                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
8857                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
8858                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
8859                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
8860                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
8861                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
8862                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
8863                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
8864                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
8865                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
8866                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
8867                 </fields>
8868                 <links>
8869                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
8870                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
8871                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
8872                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
8873                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
8874                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
8875                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
8876                 </links>
8877         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8878             <actions>
8879                 <create permission="TRANSIT_COPY" context_field="owner">
8880                     <context link="target_copy" field="circ_lib"/>
8881                 </create>
8882                 <retrieve/>
8883                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
8884                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
8885             </actions>
8886         </permacrud>
8887         </class>
8888         <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">
8889                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8890                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8891                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8892                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8893                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8894                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8895                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8896                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8897                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8898                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8899                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8900                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8901                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8902                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8903                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
8904                 </fields>
8905                 <links>
8906                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8907                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8908                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8909                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
8910                 </links>
8911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8912             <actions>
8913                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8914                     <context link="xact" jump="usr" field="home_ou"/>
8915                 </retrieve>
8916                         </actions>
8917                 </permacrud>
8918         </class>
8919         <class id="mab" controller="open-ils.cstore open-ils.pcrud" 
8920                 oils_obj:fieldmapper="money::aged_billing" 
8921                 oils_persist:tablename="money.aged_billing" 
8922                 reporter:label="Aged Billing Line Item">
8923                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
8924                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8925                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8926                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8927                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8928                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8929                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8930                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8931                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8932                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8933                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8934                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8935                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8936                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8937                 </fields>
8938                 <links>
8939                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8940                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8941                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8942                 </links>
8943                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8944                         <actions>
8945                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
8946                                         <context link="xact" field="usr_home_ou"/>
8947                                 </retrieve>
8948                         </actions>
8949                 </permacrud>
8950         </class>
8951         <class id="mallb" controller="open-ils.cstore" 
8952                 oils_obj:fieldmapper="money::all_billings" 
8953                 oils_persist:tablename="money.all_billings" 
8954                 oils_persist:readonly="true" reporter:label="All Billing Line Items">
8955                 <fields oils_persist:primary="id" oils_persist:sequence="">
8956                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8957                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
8958                         <field reporter:label="Billing Period Start" name="period_start" reporter:datatype="timestamp"/>
8959                         <field reporter:label="Billing Period End" name="period_end" reporter:datatype="timestamp"/>
8960                         <field reporter:label="Legacy Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
8961                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
8962                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
8963                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8964                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
8965                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
8966                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
8967                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
8968                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
8969                 </fields>
8970                 <links>
8971                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
8972                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
8973                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
8974                 </links>
8975         </class>
8976         <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">
8977                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
8978                         <field name="grp" />
8979                         <field name="id" reporter:datatype="id" />
8980                         <field name="usr" />
8981                 </fields>
8982                 <links>
8983                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
8984                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8985                 </links>
8986         </class>
8987         <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">
8988                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
8989                         <field name="id" reporter:datatype="id" />
8990                         <field name="fq_field" reporter:datatype="text"/>
8991                         <field name="identity_value" reporter:datatype="text"/>
8992                         <field name="translation" reporter:datatype="text"/>
8993                         <field name="string" reporter:datatype="text"/>
8994                 </fields>
8995                 <links>
8996                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
8997                 </links>
8998         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8999             <actions>
9000                 <create permission="CREATE_TRANSLATION" global_required="true"/>
9001                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
9002                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
9003                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
9004             </actions>
9005         </permacrud>
9006         </class>
9007         <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">
9008                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
9009                         <field name="id" reporter:datatype="id" />
9010                         <field name="fm_class" reporter:datatype="text"/>
9011                         <field name="field" reporter:datatype="text"/>
9012                         <field name="owner" reporter:datatype="org_unit"/>
9013                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
9014                 </fields>
9015                 <links>
9016                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9017                 </links>
9018         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9019             <actions>
9020                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9021                 <retrieve/>
9022                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9023                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
9024             </actions>
9025         </permacrud>
9026         </class>
9027         <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">
9028                 <fields oils_persist:primary="code">
9029                         <field name="code" reporter:datatype="id" />
9030                         <field name="marc_code" reporter:datatype="text"/>
9031                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
9032                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
9033                         <field name="rtl" reporter:datatype="bool"/>
9034                 </fields>
9035                 <links/>
9036         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9037             <actions>
9038                 <create permission="CREATE_LOCALE" global_required="true"/>
9039                 <retrieve/>
9040                 <update permission="UPDATE_LOCALE" global_required="true"/>
9041                 <delete permission="DELETE_LOCALE" global_required="true"/>
9042             </actions>
9043         </permacrud>
9044         </class>
9045         <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">
9046                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
9047                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name" oils_obj:required="true"/>
9048                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true" oils_obj:required="true"/>
9049                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" oils_obj:required="true"/>
9050                         <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
9051                 </fields>
9052                 <links>
9053                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9054                 </links>
9055         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9056             <actions>
9057                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
9058                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
9059                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
9060                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
9061             </actions>
9062         </permacrud>
9063         </class>
9064
9065         <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">
9066                 <fields oils_persist:primary="id">
9067                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9068                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9069                 </fields>
9070                 <links/>
9071         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9072             <actions>
9073                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9074                 <retrieve/>
9075                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9076                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
9077             </actions>
9078         </permacrud>
9079         </class>
9080
9081         <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">
9082                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
9083                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9084                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9085                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9086                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9087                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9088                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9089                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9090                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9091                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9092                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9093                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9094                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9095                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9096                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9097                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9098                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9099                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9100                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9101                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9102                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9103                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9104                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9105                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9106                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9107                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9108                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9109                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9110                 </fields>
9111                 <links>
9112                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9113                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9114                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9115                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9116                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9117                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9118                 </links>
9119         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9120             <actions>
9121                 <create permission="user_request.create">
9122                     <context link="usr" field="home_ou"/>
9123                                 </create>
9124                 <retrieve permission="user_request.view">
9125                     <context link="usr" field="home_ou"/>
9126                                 </retrieve>
9127                 <update permission="user_request.update">
9128                     <context link="usr" field="home_ou"/>
9129                                 </update>
9130                 <delete permission="user_request.delete">
9131                     <context link="usr" field="home_ou"/>
9132                                 </delete>
9133             </actions>
9134         </permacrud>
9135         </class>
9136
9137         <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">
9138         <oils_persist:source_definition><![CDATA[
9139             SELECT r.*, CASE
9140                         WHEN r.cancel_reason IS NOT NULL THEN 7 -- Canceled
9141                         WHEN h.fulfillment_time IS NOT NULL THEN 6 -- Fulfilled
9142                         WHEN l.state = 'received' THEN 5 -- Received
9143                         WHEN p.state = 'on-order' AND h.id IS NOT NULL THEN 4 -- Ordered, Hold Placed
9144                         WHEN p.state = 'on-order' AND h.id IS NULL THEN 3 -- Ordered, Hold Not Placed
9145                         WHEN l.id IS NOT NULL THEN 2 -- Pending
9146                         WHEN l.id IS NULL THEN 1 -- New
9147                         ELSE 0 -- Error
9148                     END AS request_status
9149                     ,u.home_ou
9150             FROM      acq.user_request r
9151             JOIN actor.usr u ON (r.usr = u.id)
9152             LEFT JOIN acq.lineitem l ON (r.lineitem = l.id)
9153             LEFT JOIN acq.purchase_order p ON (l.purchase_order = p.id)
9154             LEFT JOIN action.hold_request h ON (h.acq_request = r.id)
9155         ]]></oils_persist:source_definition>
9156                 <fields oils_persist:primary="id">
9157                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9158                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9159                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
9160                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
9161                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
9162                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
9163                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
9164                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
9165                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9166                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
9167                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
9168                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
9169                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
9170                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
9171                         <field reporter:label="UPC" name="upc" reporter:datatype="text" />
9172                         <field reporter:label="Title" name="title" reporter:datatype="text" />
9173                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
9174                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9175                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
9176                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
9177                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
9178                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
9179                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
9180                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
9181                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
9182                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9183                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp" />
9184                         <field reporter:label="Request Status" name="request_status" reporter:datatype="link" />
9185                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="link"/>
9186                 </fields>
9187                 <links>
9188                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9189                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
9190                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9191                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
9192                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
9193                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9194                         <link field="request_status" reltype="has_a" key="id" map="" class="aurst"/>
9195                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
9196                 </links>
9197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9198             <actions>
9199                 <retrieve permission="user_request.view">
9200                     <context link="usr" field="home_ou"/>
9201                                 </retrieve>
9202             </actions>
9203         </permacrud>
9204         </class>
9205
9206         <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">
9207                 <fields oils_persist:primary="id">
9208                         <field reporter:label="Status ID" name="id" reporter:datatype="id" reporter:selector='label'/>
9209                         <field reporter:label="Status" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9210                 </fields>
9211                 <links/>
9212         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9213             <actions>
9214                 <retrieve/>
9215             </actions>
9216         </permacrud>
9217         </class>
9218
9219         <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">
9220                 <fields oils_persist:primary="code">
9221                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
9222                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
9223                 </fields>
9224                 <links/>
9225         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9226             <actions>
9227                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9228                 <retrieve/>
9229                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9230                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9231             </actions>
9232         </permacrud>
9233         </class>
9234
9235         <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">
9236                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
9237                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
9238                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
9239                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
9240                         <field reporter:label="Ratio" name="ratio" />
9241                 </fields>
9242                 <links>
9243                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
9244                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
9245                 </links>
9246                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9247                         <actions>
9248                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9249                                 <retrieve/>
9250                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9251                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
9252                         </actions>
9253                 </permacrud>
9254         </class>
9255
9256         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
9257                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
9258                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9259                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9260                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
9261                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true"/>
9262                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
9263                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
9264                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
9265                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
9266                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
9267                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9268                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
9269                         <field reporter:label="URL" name="url" reporter:datatype="text" />
9270                         <field reporter:label="Email" name="email" reporter:datatype="text" />
9271                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
9272                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
9273                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
9274                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
9275                         <field reporter:label="Primary Contact" name="primary_contact" reporter:datatype="link" />
9276                         <field reporter:label="Contacts" name="contacts" oils_persist:virtual="true" reporter:datatype="link" />
9277                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
9278                         <field reporter:label="Holdings Subfields" name="holdings_subfields" oils_persist:virtual="true" reporter:datatype="link" />
9279                         <field reporter:label="Attribute Definitions" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9280                         <field reporter:label="EDI Accounts" name="edi_accounts" oils_persist:virtual="true" reporter:datatype="link" />
9281                 </fields>
9282                 <links>
9283                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9284                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9285                         <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
9286                         <link field="contacts" reltype="has_many" map="" key="provider" class="acqpc"/>
9287                         <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
9288                         <link field="primary_contact" reltype="has_a" map="" key="id" class="acqpc"/>
9289                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
9290                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
9291                         <link field="holdings_subfields" reltype="has_many" map="" key="provider" class="acqphsm"/>
9292                         <link field="attributes" reltype="has_many" map="" key="provider" class="acqlipad"/>
9293                         <link field="edi_accounts" reltype="has_many" map="" key="provider" class="acqedi"/>
9294                 </links>
9295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9296             <actions>
9297                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
9298                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
9299                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
9300                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
9301             </actions>
9302         </permacrud>
9303         </class>
9304
9305         <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">
9306                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
9307                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
9308                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9309                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9310                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9311                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9312                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9313                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9314                 </fields>
9315                 <links>
9316                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9317                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9318                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9319                 </links>
9320         </class>
9321
9322         <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">
9323                 <fields oils_persist:primary="code">
9324                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
9325                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
9326                 </fields>
9327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9328             <actions>
9329                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9330                 <retrieve/>
9331                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9332                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
9333             </actions>
9334                 </permacrud>
9335         </class>
9336
9337         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
9338                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
9339                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
9340                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
9341                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9342                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
9343                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
9344                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
9345                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
9346                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
9347                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
9348                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
9349                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9350                         <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp" />
9351                         <field reporter:label="Closed By" name="closed_by" reporter:datatype="link" />
9352                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
9353                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
9354                 </fields>
9355                 <links>
9356                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
9357                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9358                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
9359                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
9360                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
9361                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
9362                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
9363                         <link field="closed_by" reltype="has_a" key="id" map="" class="au"/>
9364                 </links>
9365         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9366             <actions>
9367                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
9368                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
9369                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
9370                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
9371             </actions>
9372         </permacrud>
9373         </class>
9374
9375         <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">
9376                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
9377                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9378                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9379                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9380                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
9381                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
9382                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
9383                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9384                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
9385                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9386                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9387                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9388                 </fields>
9389                 <links>
9390                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9391                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9392                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9393                 </links>
9394         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9395             <actions>
9396                 <create   permission="ADMIN_INVOICE">
9397                                         <context link="invoice" field="receiver"/>
9398                                 </create>
9399                 <retrieve permission="ADMIN_INVOICE">
9400                                         <context link="invoice" field="receiver"/>
9401                                 </retrieve>
9402                 <update   permission="ADMIN_INVOICE">
9403                                         <context link="invoice" field="receiver"/>
9404                                 </update>
9405                                 <delete   permission="ADMIN_INVOICE">
9406                                         <context link="invoice" field="receiver"/>
9407                                 </delete>
9408             </actions>
9409         </permacrud>
9410         </class>
9411
9412         <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">
9413                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
9414                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9415                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
9416                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9417                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9418                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
9419                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
9420                         <field reporter:label="Author" name="author" reporter:datatype="text" />
9421                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9422                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
9423                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
9424                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9425                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
9426                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
9427                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9428                 </fields>
9429                 <links>
9430                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
9431                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9432                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9433                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9434                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9435                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
9436                 </links>
9437         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9438             <actions>
9439                 <create   permission="ADMIN_INVOICE">
9440                                         <context link="invoice" field="receiver"/>
9441                                 </create>
9442                 <retrieve permission="ADMIN_INVOICE">
9443                                         <context link="invoice" field="receiver"/>
9444                                 </retrieve>
9445                 <update   permission="ADMIN_INVOICE">
9446                                         <context link="invoice" field="receiver"/>
9447                                 </update>
9448                                 <delete   permission="ADMIN_INVOICE">
9449                                         <context link="invoice" field="receiver"/>
9450                                 </delete>
9451             </actions>
9452         </permacrud>
9453         </class>
9454
9455         <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">
9456                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
9457                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
9458                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9459                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9460                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9461                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9462                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9463                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text" oils_obj:required="true"/>
9464                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9465                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9466                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
9467                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
9468                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9469                 </fields>
9470                 <links>
9471                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9472                 </links>
9473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9474             <actions>
9475                 <create permission="ADMIN_PROVIDER">
9476                     <context link="provider" field="owner"/>
9477                 </create>
9478                 <retrieve permission="ADMIN_PROVIDER">
9479                     <context link="provider" field="owner"/>
9480                 </retrieve>
9481                 <update permission="ADMIN_PROVIDER">
9482                     <context link="provider" field="owner"/>
9483                 </update>
9484                 <delete permission="ADMIN_PROVIDER">
9485                     <context link="provider" field="owner"/>
9486                 </delete>
9487             </actions>
9488         </permacrud>
9489         </class>
9490
9491         <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">
9492                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
9493                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9494                         <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true"/>
9495                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
9496                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
9497                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
9498                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
9499                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
9500         </fields>
9501                 <links>
9502                         <link field="addresses" reltype="has_many" key="contact" map="" class="acqpca"/>
9503                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9504                 </links>
9505         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9506             <actions>
9507                 <create permission="ADMIN_PROVIDER">
9508                     <context link="provider" field="owner"/>
9509                 </create>
9510                 <retrieve permission="ADMIN_PROVIDER">
9511                     <context link="provider" field="owner"/>
9512                 </retrieve>
9513                 <update permission="ADMIN_PROVIDER">
9514                     <context link="provider" field="owner"/>
9515                 </update>
9516                 <delete permission="ADMIN_PROVIDER">
9517                     <context link="provider" field="owner"/>
9518                 </delete>
9519             </actions>
9520         </permacrud>
9521     </class>
9522         <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">
9523                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
9524                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
9525                         <field reporter:label="City" name="city"  reporter:datatype="text" oils_obj:required="true"/>
9526                         <field reporter:label="Country" name="country"  reporter:datatype="text" oils_obj:required="true"/>
9527                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
9528                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
9529                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text" oils_obj:required="true"/>
9530                         <field reporter:label="State" name="state"  reporter:datatype="text" oils_obj:required="true"/>
9531                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text" oils_obj:required="true"/>
9532                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
9533                         <field reporter:label="Contact" name="contact" reporter:datatype="link" oils_obj:required="true"/>
9534                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
9535                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
9536                 </fields>
9537                 <links>
9538                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
9539                 </links>
9540         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9541             <actions>
9542                 <create permission="ADMIN_PROVIDER">
9543                     <context link="contact" jump='provider' field="owner"/>
9544                 </create>
9545                 <retrieve permission="ADMIN_PROVIDER">
9546                     <context link="contact" jump='provider' field="owner"/>
9547                 </retrieve>
9548                 <update permission="ADMIN_PROVIDER">
9549                     <context link="contact" jump='provider' field="owner"/>
9550                 </update>
9551                 <delete permission="ADMIN_PROVIDER">
9552                     <context link="contact" jump='provider' field="owner"/>
9553                 </delete>
9554             </actions>
9555         </permacrud>
9556         </class>
9557
9558         <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">
9559                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
9560                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
9561                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
9562                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
9563                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
9564                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
9565                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
9566                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
9567                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9568                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
9569                 </fields>
9570                 <links>
9571                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
9572                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
9573                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
9574                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9575                 </links>
9576         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9577             <actions>
9578                 <create permission="ADMIN_ACQ_FUND">
9579                     <context link="src_fund" field="org"/>
9580                 </create>
9581                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9582                     <context link="src_fund" field="org"/>
9583                     <context link="dest_fund" field="org"/>
9584                 </retrieve>
9585                 <update permission="ADMIN_ACQ_FUND">
9586                     <context link="src_fund" field="org"/>
9587                 </update>
9588                 <delete permission="ADMIN_ACQ_FUND">
9589                     <context link="src_fund" field="org"/>
9590                 </delete>
9591             </actions>
9592         </permacrud>
9593         </class>
9594
9595         <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">
9596                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
9597                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
9598                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
9599                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
9600                 </fields>
9601                 <links>
9602             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
9603                 </links>
9604                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9605                         <actions>
9606                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9607                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9608                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9609                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9610                         </actions>
9611                 </permacrud>
9612         </class>
9613
9614         <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">
9615                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
9616                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
9617                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
9618                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
9619                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
9620                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
9621                 </fields>
9622                 <links>
9623                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
9624                 </links>
9625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9626                         <actions>
9627                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9628                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
9629                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9630                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
9631                         </actions>
9632                 </permacrud>
9633         </class>
9634
9635         <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">
9636                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
9637                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9638                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
9639                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true" />
9640                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" oils_obj:required="true" />
9641                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9642                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true" />
9643                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9644                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9645                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
9646                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
9647                 </fields>
9648                 <links>
9649                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9650                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9651             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
9652             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
9653                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
9654                 </links>
9655         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9656             <actions>
9657                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9658                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
9659                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9660                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
9661             </actions>
9662         </permacrud>
9663         </class>
9664
9665         <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">
9666                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
9667                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
9668                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
9669                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
9670                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9671                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
9672                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
9673                 </fields>
9674                 <links>
9675                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9676                 </links>
9677                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9678                         <actions>
9679                                 <create permission="ADMIN_FUNDING_SOURCE">
9680                     <context link="funding_source" field="owner"/>
9681                 </create>
9682                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
9683                     <context link="funding_source" field="owner"/>
9684                 </retrieve>
9685                                 <update permission="ADMIN_FUNDING_SOURCE">
9686                     <context link="funding_source" field="owner"/>
9687                 </update>
9688                                 <delete permission="ADMIN_FUNDING_SOURCE">
9689                     <context link="funding_source" field="owner"/>
9690                 </delete>
9691                         </actions>
9692                 </permacrud>
9693         </class>
9694
9695         <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">
9696                 <fields oils_persist:primary="id">
9697                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
9698                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
9699                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
9700                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
9701                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
9702                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9703                 </fields>
9704                 <links>
9705                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9706                 </links>
9707         </class>
9708
9709         <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">
9710                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
9711                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
9712                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9713                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
9714                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
9715                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
9716                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
9717                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
9718                         <field reporter:label="Debit Time" name="create_time" reporter:datatype="timestamp" />
9719                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
9720                         <field reporter:label="Invoice Items" name="invoice_items" reporter:datatype="link" oils_persist:virtual="true"/>
9721                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
9722                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9723                 </fields>
9724                 <links>
9725                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9726                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9727                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
9728                         <link field="invoice_items" reltype="has_many" key="fund_debit" map="" class="acqii"/>
9729                         <link field="po_items" reltype="has_many" key="fund_debit" map="" class="acqpoi"/>
9730                         <link field="lineitem_details" reltype="has_many" key="fund_debit" map="" class="acqlid"/>
9731                 </links>
9732                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9733                         <actions>
9734                                 <create permission="ADMIN_ACQ_FUND">
9735                     <context link="fund" field="org"/>
9736                 </create>
9737                                 <retrieve permission="ADMIN_ACQ_FUND">
9738                     <context link="fund" field="org"/>
9739                 </retrieve>
9740                                 <update permission="ADMIN_ACQ_FUND">
9741                     <context link="fund" field="org"/>
9742                 </update>
9743                                 <delete permission="ADMIN_ACQ_FUND">
9744                     <context link="fund" field="org"/>
9745                 </delete>
9746                         </actions>
9747                 </permacrud>
9748         </class>
9749
9750         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
9751                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9752                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9753                         <field reporter:label="Owner" name="org" reporter:datatype="org_unit" oils_obj:required="true" />
9754                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
9755                         <field reporter:label="Year" name="year" reporter:datatype="int" oils_obj:required="true" />
9756                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" oils_obj:required="true" />
9757                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true" />
9758                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
9759                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
9760                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
9761                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
9762                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
9763                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
9764                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
9765                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
9766                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
9767                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
9768                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
9769                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
9770                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
9771                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9772                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
9773                 </fields>
9774                 <links>
9775                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
9776                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
9777             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
9778             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
9779             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
9780             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
9781             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
9782             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
9783             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
9784             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
9785             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
9786                 </links>
9787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
9788             <actions>
9789                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
9790                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
9791                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
9792                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
9793             </actions>
9794         </permacrud>
9795         </class>
9796
9797         <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">
9798                 <fields oils_persist:primary="fund">
9799                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9800                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9801                 </fields>
9802                 <links>
9803                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9804                 </links>
9805         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9806             <actions>
9807                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9808                                         <context link="fund" field="org" />
9809                 </retrieve>
9810             </actions>
9811         </permacrud>
9812         </class>
9813
9814         <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">
9815                 <fields oils_persist:primary="fund">
9816                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9817                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
9818                 </fields>
9819                 <links>
9820                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9821                 </links>
9822         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9823             <actions>
9824                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9825                                         <context link="fund" field="org" />
9826                 </retrieve>
9827             </actions>
9828         </permacrud>
9829         </class>
9830
9831         <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">
9832                 <fields oils_persist:primary="fund">
9833                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9834                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
9835                 </fields>
9836                 <links>
9837                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9838                 </links>
9839         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9840             <actions>
9841                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9842                                         <context link="fund" field="org" />
9843                 </retrieve>
9844             </actions>
9845         </permacrud>
9846         </class>
9847
9848         <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">
9849                 <fields oils_persist:primary="fund">
9850                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9851                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9852                 </fields>
9853                 <links>
9854                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9855                 </links>
9856         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9857             <actions>
9858                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9859                                         <context link="fund" field="org" />
9860                 </retrieve>
9861             </actions>
9862         </permacrud>
9863         </class>
9864
9865         <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">
9866                 <fields oils_persist:primary="fund">
9867                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9868                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
9869                 </fields>
9870                 <links>
9871                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9872                 </links>
9873         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9874             <actions>
9875                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9876                                         <context link="fund" field="org" />
9877                 </retrieve>
9878             </actions>
9879         </permacrud>
9880         </class>
9881
9882    <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">
9883         <fields oils_persist:primary="fund">
9884             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9885             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
9886         </fields>
9887         <links>
9888             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9889         </links>
9890     </class>
9891
9892    <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">
9893         <fields oils_persist:primary="fund">
9894             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9895             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
9896         </fields>
9897         <links>
9898             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9899         </links>
9900     </class>
9901
9902    <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">
9903         <fields oils_persist:primary="fund">
9904             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9905             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
9906         </fields>
9907         <links>
9908             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9909         </links>
9910     </class>
9911
9912    <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">
9913         <fields oils_persist:primary="fund">
9914             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9915             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
9916         </fields>
9917         <links>
9918             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9919         </links>
9920     </class>
9921
9922    <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">
9923         <fields oils_persist:primary="fund">
9924             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9925             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
9926         </fields>
9927         <links>
9928             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9929         </links>
9930     </class>
9931
9932         <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">
9933                 <fields oils_persist:primary="funding_source">
9934                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9935                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
9936                 </fields>
9937                 <links>
9938                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9939                 </links>
9940         </class>
9941
9942         <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">
9943                 <fields oils_persist:primary="funding_source">
9944                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9945                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
9946                 </fields>
9947                 <links>
9948                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9949                 </links>
9950         </class>
9951
9952         <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">
9953                 <fields oils_persist:primary="funding_source">
9954                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
9955                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
9956                 </fields>
9957                 <links>
9958                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
9959                 </links>
9960         </class>
9961
9962         <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">
9963                 <fields oils_persist:primary="fund">
9964                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
9965                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
9966                 </fields>
9967                 <links>
9968                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9969                 </links>
9970         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9971             <actions>
9972                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
9973                                         <context link="fund" field="org" />
9974                 </retrieve>
9975             </actions>
9976         </permacrud>
9977     </class>
9978     <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">
9979         <oils_persist:source_definition><![CDATA[
9980             SELECT
9981                 acqf.*,
9982                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
9983                 COALESCE(acqfst.amount, 0.00) AS spent_total,
9984                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
9985                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
9986             FROM
9987                 acq.fund acqf
9988                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
9989                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
9990                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
9991                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
9992         ]]></oils_persist:source_definition>
9993         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
9994             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
9995             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
9996             <field reporter:label="Name" name="name" reporter:datatype="text" />
9997             <field reporter:label="Year" name="year" reporter:datatype="int" />
9998             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
9999             <field reporter:label="Code" name="code" reporter:datatype="text" />
10000             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
10001             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
10002             <field reporter:label="Active" name="active" reporter:datatype="bool" />
10003             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
10004             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
10005
10006             <!-- non fund-native fields -->
10007             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
10008             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
10009             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
10010             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
10011         </fields>
10012         <links>
10013             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
10014             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10015             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
10016         </links>
10017         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10018             <actions>
10019                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
10020             </actions>
10021         </permacrud>
10022         </class>
10023         <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">
10024                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
10025                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10026                         <field reporter:label="Fund" name="fund" reporter:datatype="link" oils_obj:required="true" />
10027                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" oils_obj:required="true" />
10028                         <field reporter:label="Amount" name="amount" reporter:datatype="money" oils_obj:required="true" />
10029                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" oils_obj:required="true" />
10030                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10031                         <field reporter:label="Allocation Time" name="create_time" reporter:datatype="timestamp" />
10032                 </fields>
10033                 <links>
10034                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10035                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10036                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10037                 </links>
10038                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10039                         <actions>
10040                                 <create permission="ADMIN_ACQ_FUND">
10041                     <context link="fund" field="org"/>
10042                 </create>
10043                                 <retrieve permission="ADMIN_ACQ_FUND">
10044                     <context link="fund" field="org"/>
10045                 </retrieve>
10046                                 <update permission="ADMIN_ACQ_FUND">
10047                     <context link="fund" field="org"/>
10048                 </update>
10049                                 <delete permission="ADMIN_ACQ_FUND">
10050                     <context link="fund" field="org"/>
10051                 </delete>
10052                         </actions>
10053                 </permacrud>
10054         </class>
10055
10056     <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">
10057         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
10058             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
10059             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
10060             <field reporter:label="Owner" name="org" reporter:datatype="org_unit" />
10061             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
10062             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
10063             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
10064             <field reporter:label="Note" name="note" reporter:datatype="text" />
10065             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
10066         </fields>
10067         <links>
10068             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
10069             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
10070             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
10071         </links>
10072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10073                         <actions>
10074                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10075                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10076                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10077                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
10078                         </actions>
10079                 </permacrud>
10080     </class>
10081
10082         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
10083                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
10084                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
10085                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10086                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
10087                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
10088                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10089                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10090                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
10091                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
10092                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10093                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10094                 </fields>
10095                 <links>
10096                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10097                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10098                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10099                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10100                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
10101                 </links>
10102                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10103                         <actions>
10104                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
10105                         </actions>
10106                 </permacrud>
10107         </class>
10108
10109         <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">
10110                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
10111                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
10112                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
10113                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10114                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
10115                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
10116                 </fields>
10117                 <links>
10118                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10119                 </links>
10120                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10121                         <actions>
10122                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10123                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
10124                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10125                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
10126                         </actions>
10127                 </permacrud>
10128         </class>
10129
10130         <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">
10131                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
10132                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
10133                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
10134                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10135                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10136                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10137                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10138                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
10139                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10140                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10141                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
10142                         <field reporter:label="Name" name="name" reporter:datatype="text" />
10143                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10144                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10145                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
10146                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
10147                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
10148                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
10149                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
10150                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
10151                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
10152                 </fields>
10153                 <links>
10154                         <link field="state" reltype="has_a" key="id" map="" class="acqpostlbl"/>
10155                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10156                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10157                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10158                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
10159                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10160                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
10161                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
10162                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
10163                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10164                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10165                 </links>
10166                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10167                         <actions>
10168                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10169                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10170                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10171                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
10172                         </actions>
10173                 </permacrud>
10174         </class>
10175
10176         <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">
10177                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
10178                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10179                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10180                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10181                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
10182                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10183                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10184                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10185                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
10186                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10187                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10188                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10189                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10190                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
10191                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10192                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10193                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
10194                 </fields>
10195                 <links>
10196                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
10197                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10198                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10199                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10200                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
10201                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10202                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10203                 </links>
10204                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10205             <actions>
10206                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
10207             </actions>
10208                 </permacrud>
10209         </class>
10210
10211         <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">
10212                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
10213                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
10214                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10215                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10216                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10217                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10218                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10219                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
10220                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10221                 </fields>
10222                 <links>
10223                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10224                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10225                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10226                 </links>
10227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10228             <actions>
10229                 <create permission="CREATE_PURCHASE_ORDER">
10230                     <context link="purchase_order" field="ordering_agency"/>
10231                 </create>
10232                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10233                     <context link="purchase_order" field="ordering_agency"/>
10234                 </retrieve>
10235                 <update permission="CREATE_PURCHASE_ORDER">
10236                     <context link="purchase_order" field="ordering_agency"/>
10237                 </update>
10238                 <delete permission="CREATE_PURCHASE_ORDER">
10239                     <context link="purchase_order" field="ordering_agency"/>
10240                 </delete>
10241             </actions>
10242                 </permacrud>
10243         </class>
10244
10245         <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">
10246                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
10247                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10248                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10249                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
10250                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
10251                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
10252                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
10253                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
10254                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
10255                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
10256                         <field reporter:label="Target" name="target" reporter:datatype="int" />
10257                 </fields>
10258                 <links>
10259                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10260                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10261                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
10262                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10263                 </links>
10264                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10265             <actions>
10266                 <create permission="CREATE_PURCHASE_ORDER">
10267                     <context link="purchase_order" field="ordering_agency"/>
10268                 </create>
10269                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10270                     <context link="purchase_order" field="ordering_agency"/>
10271                 </retrieve>
10272                 <update permission="CREATE_PURCHASE_ORDER">
10273                     <context link="purchase_order" field="ordering_agency"/>
10274                 </update>
10275                 <delete permission="CREATE_PURCHASE_ORDER">
10276                     <context link="purchase_order" field="ordering_agency"/>
10277                 </delete>
10278             </actions>
10279                 </permacrud>
10280         </class>
10281
10282         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
10283                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
10284                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
10285                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
10286                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
10287                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
10288                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
10289                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10290                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10291                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
10292                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
10293                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
10294                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
10295                         <field reporter:label="Status" name="state" reporter:datatype="link" />
10296                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10297                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10298                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
10299                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10300                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10301                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10302                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
10303                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
10304                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
10305                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
10306                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
10307                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
10308                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
10309                 </fields>
10310                 <links>
10311                         <link field="state" reltype="has_a" key="id" map="" class="jubstlbl"/>
10312                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10313                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10314                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10315                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10316                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10317                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10318                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10319                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
10320                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
10321                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
10322                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10323                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
10324                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10325                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
10326                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
10327                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10328                 </links>
10329                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10330                         <actions>
10331                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10332                                         <context link="purchase_order" field="ordering_agency"/>
10333                                         <context link="picklist" field="org_unit"/>
10334                                 </retrieve>
10335                         </actions>
10336                 </permacrud>
10337         </class>
10338
10339         <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">
10340                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
10341                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
10342                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
10343                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
10344                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
10345                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10346                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
10347                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
10348                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
10349                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
10350                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
10351                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
10352                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10353                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
10354                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
10355                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
10356                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
10357                         <field reporter:label="Status" name="state" reporter:datatype="text"/>
10358                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
10359                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
10360                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
10361                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
10362                 </fields>
10363                 <links>
10364                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
10365                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10366                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10367                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
10368                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10369                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10370                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
10371                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
10372                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10373                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10374                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
10375                 </links>
10376                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10377                         <actions>
10378                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
10379                                         <context link="purchase_order" field="ordering_agency"/>
10380                                         <context link="picklist" field="org_unit"/>
10381                                 </retrieve>
10382                         </actions>
10383                 </permacrud>
10384         </class>
10385
10386         <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">
10387                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
10388                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
10389                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
10390                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10391                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10392                 </fields>
10393                 <links>
10394                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10395                 </links>
10396                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10397                         <actions>
10398                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10399                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
10400                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10401                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
10402                         </actions>
10403                 </permacrud>
10404         </class>
10405
10406         <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">
10407                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
10408                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
10409                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
10410                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
10411                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
10412                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
10413                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
10414                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
10415                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
10416                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
10417                 </fields>
10418                 <links>
10419                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10420                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
10421                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10422                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
10423                 </links>
10424         </class>
10425
10426         <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">
10427                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
10428                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
10429                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
10430                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
10431                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
10432                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
10433                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
10434                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
10435                 </fields>
10436                 <links>
10437                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10438                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
10439                 </links>
10440         </class>
10441
10442         <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">
10443                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
10444                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
10445                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
10446                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
10447                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
10448                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
10449                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
10450                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
10451                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
10452                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
10453                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10454                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
10455                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
10456                         <field reporter:label="Note" name="note" reporter:datatype="text" />
10457                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
10458                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
10459                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
10460                 </fields>
10461                 <links>
10462                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
10463                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
10464                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
10465                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
10466                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10467                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
10468                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
10469                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
10470                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
10471                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
10472                 </links>
10473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10474             <actions>
10475                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
10476                     <context link="lineitem" jump="purchase_order" field="ordering_agency"/>
10477                     <context link="lineitem" jump="picklist" field="org_unit"/>
10478                 </retrieve>
10479             </actions>
10480         </permacrud>
10481         </class>
10482
10483         <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">
10484                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10485                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10486                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10487                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10488                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10489                 </fields>
10490                 <links/>
10491                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10492                         <actions>
10493                                 <retrieve />
10494                         </actions>
10495                 </permacrud>
10496         </class>
10497
10498         <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">
10499                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10500                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10501                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10502                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10503                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10504                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10505             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10506                 </fields>
10507                 <links/>
10508         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10509             <actions>
10510                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10511                 <retrieve />
10512                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10513                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
10514             </actions>
10515         </permacrud>
10516         </class>
10517
10518         <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">
10519                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10520                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10521                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10522                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10523                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
10524                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10525                 </fields>
10526                 <links/>
10527         </class>
10528         <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">
10529                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10530                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10531                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10532                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10533                         <field reporter:label="User" name="usr" reporter:datatype="link" />
10534                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10535                 </fields>
10536                 <links>
10537                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10538                 </links>
10539         </class>
10540
10541         <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">
10542             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10543                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10544                 <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true" />
10545                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
10546                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true" />
10547                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10548                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10549         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
10550
10551             </fields>
10552             <links>
10553                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10554             </links>
10555             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10556                 <actions>
10557                     <create permission="ADMIN_PROVIDER">
10558                         <context link="provider" field="owner"/>
10559                     </create>
10560                     <retrieve permission="ADMIN_PROVIDER">
10561                         <context link="provider" field="owner"/>
10562                     </retrieve>
10563                     <update permission="ADMIN_PROVIDER">
10564                         <context link="provider" field="owner"/>
10565                     </update>
10566                     <delete permission="ADMIN_PROVIDER">
10567                         <context link="provider" field="owner"/>
10568                     </delete>
10569                 </actions>
10570             </permacrud>
10571         </class>
10572         
10573         <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">
10574             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
10575                 <field reporter:label="ID" name="id" reporter:datatype="id" />
10576                 <field reporter:label="Provider" name="provider" reporter:datatype="link" oils_obj:required="true" />
10577                 <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" />
10578                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" oils_obj:required="true" />
10579             </fields>
10580             <links>
10581                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10582             </links>
10583             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10584                 <actions>
10585                     <create permission="ADMIN_PROVIDER">
10586                         <context link="provider" field="owner"/>
10587                     </create>
10588                     <retrieve permission="ADMIN_PROVIDER">
10589                         <context link="provider" field="owner"/>
10590                     </retrieve>
10591                     <update permission="ADMIN_PROVIDER">
10592                         <context link="provider" field="owner"/>
10593                     </update>
10594                     <delete permission="ADMIN_PROVIDER">
10595                         <context link="provider" field="owner"/>
10596                     </delete>
10597                 </actions>
10598             </permacrud>
10599         </class>
10600         
10601         <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">
10602             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
10603                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
10604                         <field reporter:label="Code" name="code" reporter:datatype="text" />
10605                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
10606                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
10607                 </fields>
10608                 <links/>
10609         </class>
10610
10611         <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">
10612                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
10613                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
10614                         <field name="label"         reporter:datatype="text"      reporter:label="Label" oils_obj:required="true"/>
10615                         <field name="host"          reporter:datatype="text"      reporter:label="Host" oils_obj:required="true"/>
10616                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
10617                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
10618                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
10619                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
10620                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner" oils_obj:required="true"/>
10621                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
10622                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider" oils_obj:required="true"/>
10623                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
10624                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
10625                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
10626                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
10627                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes" oils_obj:required="true"/>
10628                 </fields>
10629                 <links>
10630                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
10631                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10632                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10633                 </links>
10634         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10635             <actions>
10636                 <create permission="ADMIN_PROVIDER">
10637                     <context link="provider" field="owner"/>
10638                 </create>
10639                 <retrieve permission="ADMIN_PROVIDER">
10640                     <context link="provider" field="owner"/>
10641                 </retrieve>
10642                 <update permission="ADMIN_PROVIDER">
10643                     <context link="provider" field="owner"/>
10644                 </update>
10645                 <delete permission="ADMIN_PROVIDER">
10646                     <context link="provider" field="owner"/>
10647                 </delete>
10648             </actions>
10649         </permacrud>
10650         </class>
10651
10652         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
10653                 oils_obj:fieldmapper="acq::edi_attr" 
10654                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
10655                 <fields oils_persist:primary="key">
10656                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
10657                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10658                 </fields>
10659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10660             <actions>
10661                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10662                 <retrieve/>
10663                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10664                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10665             </actions>
10666         </permacrud>
10667         </class>
10668         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
10669                 oils_obj:fieldmapper="acq::edi_attr_set" 
10670                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
10671                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
10672                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10673                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
10674                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
10675                         <field name="edi_accounts" reporter:datatype="link" oils_persist:virtual="true" reporter:label="EDI Accounts"/>
10676                 </fields>
10677                 <links>
10678                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
10679                         <link field="edi_accounts" reltype="has_many" key="attr_set" map="" class="acqedi"/>
10680                 </links>
10681         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10682             <actions>
10683                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10684                 <retrieve/>
10685                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10686                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10687             </actions>
10688         </permacrud>
10689         </class>
10690         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
10691                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
10692                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
10693                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
10694                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
10695                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
10696                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
10697                 </fields>
10698                 <links>
10699                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
10700                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
10701                 </links>
10702         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10703             <actions>
10704                 <create permission="ADMIN_PROVIDER" global_required="true"/>
10705                 <retrieve/>
10706                 <update permission="ADMIN_PROVIDER" global_required="true"/>
10707                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
10708             </actions>
10709         </permacrud>
10710         </class>
10711
10712
10713         <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">
10714                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
10715                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
10716                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
10717                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
10718                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
10719                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
10720                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
10721                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
10722                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
10723                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
10724                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
10725                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
10726                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
10727                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
10728                 </fields>
10729                 <links>
10730                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
10731                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
10732                 </links>
10733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10734             <actions>
10735                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10736                     <context link="account" jump="provider" field="owner"/>
10737                 </retrieve>
10738                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10739                     <context link="account" jump="provider" field="owner"/>
10740                 </update>
10741                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
10742                     <context link="account" jump="provider" field="owner"/>
10743                 </delete>
10744             </actions>
10745         </permacrud>
10746         </class>
10747
10748
10749         <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">
10750                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
10751                         <field name="id" reporter:datatype="id" />
10752                         <field name="parent" reporter:datatype="link"/>
10753                         <field name="owner" reporter:datatype="link"/>
10754                         <field name="create_time" reporter:datatype="timestamp"/>
10755                         <field name="name" reporter:datatype="text"/>
10756                         <field name="shared" reporter:datatype="bool"/>
10757                         <field name="share_with" reporter:datatype="link"/>
10758                         <field name="simple_reporter" reporter:datatype="bool"/>
10759                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10760                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
10761                 </fields>
10762                 <links>
10763                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10764                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
10765                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
10766                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10767                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
10768                 </links>
10769         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10770             <actions>
10771                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10772                     <context link="owner" field="home_ou"/>
10773                 </create>
10774                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10775                     <context link="owner" field="home_ou"/>
10776                 </retrieve>
10777                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10778                     <context link="owner" field="home_ou"/>
10779                 </update>
10780                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10781                     <context link="owner" field="home_ou"/>
10782                 </delete>
10783             </actions>
10784         </permacrud>
10785         </class>
10786         <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">
10787                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
10788                         <field name="id" reporter:datatype="id" />
10789                         <field name="parent" reporter:datatype="link"/>
10790                         <field name="owner" reporter:datatype="link"/>
10791                         <field name="create_time" reporter:datatype="timestamp"/>
10792                         <field name="name" reporter:datatype="text"/>
10793                         <field name="shared" reporter:datatype="bool"/>
10794                         <field name="share_with" reporter:datatype="link"/>
10795                         <field name="simple_reporter" reporter:datatype="bool"/>
10796                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10797                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
10798                 </fields>
10799                 <links>
10800                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10801                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
10802                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
10803                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10804                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
10805                 </links>
10806         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10807             <actions>
10808                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10809                     <context link="owner" field="home_ou"/>
10810                 </create>
10811                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10812                     <context link="owner" field="home_ou"/>
10813                 </retrieve>
10814                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10815                     <context link="owner" field="home_ou"/>
10816                 </update>
10817                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10818                     <context link="owner" field="home_ou"/>
10819                 </delete>
10820             </actions>
10821         </permacrud>
10822         </class>
10823         <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">
10824                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
10825                         <field name="id" reporter:datatype="id" />
10826                         <field name="parent" reporter:datatype="link"/>
10827                         <field name="owner" reporter:datatype="link"/>
10828                         <field name="create_time" reporter:datatype="timestamp"/>
10829                         <field name="name" reporter:datatype="text"/>
10830                         <field name="shared" reporter:datatype="bool"/>
10831                         <field name="share_with" reporter:datatype="link"/>
10832                         <field name="simple_reporter" reporter:datatype="bool"/>
10833                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
10834                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10835                 </fields>
10836                 <links>
10837                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10838                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
10839                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
10840                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
10841                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
10842                 </links>
10843         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10844             <actions>
10845                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10846                     <context link="owner" field="home_ou"/>
10847                 </create>
10848                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10849                     <context link="owner" field="home_ou"/>
10850                 </retrieve>
10851                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10852                     <context link="owner" field="home_ou"/>
10853                 </update>
10854                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10855                     <context link="owner" field="home_ou"/>
10856                 </delete>
10857             </actions>
10858         </permacrud>
10859         </class>
10860         <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">
10861                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
10862                         <field name="id" reporter:datatype="id" />
10863                         <field name="owner" reporter:datatype="link"/>
10864                         <field name="create_time" reporter:datatype="timestamp"/>
10865                         <field name="name" reporter:datatype="text"/>
10866                         <field name="data" reporter:datatype="text"/>
10867                         <field name="folder" reporter:datatype="link"/>
10868                         <field name="description" reporter:datatype="text"/>
10869                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
10870                 </fields>
10871                 <links>
10872                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10873                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
10874                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
10875                 </links>
10876         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10877             <actions>
10878                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10879                     <context link="owner" field="home_ou"/>
10880                 </create>
10881                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10882                     <context link="owner" field="home_ou"/>
10883                 </retrieve>
10884                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10885                     <context link="owner" field="home_ou"/>
10886                 </update>
10887                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10888                     <context link="owner" field="home_ou"/>
10889                 </delete>
10890             </actions>
10891         </permacrud>
10892         </class>
10893         <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">
10894                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
10895                         <field name="id" reporter:datatype="id" />
10896                         <field name="owner" reporter:datatype="link"/>
10897                         <field name="create_time" reporter:datatype="timestamp"/>
10898                         <field name="template" reporter:datatype="link"/>
10899                         <field name="data" reporter:datatype="text"/>
10900                         <field name="folder" reporter:datatype="link"/>
10901                         <field name="recur" reporter:datatype="bool"/>
10902                         <field name="recurrence" reporter:datatype="interval"/>
10903                         <field name="name" reporter:datatype="text"/>
10904                         <field name="description" reporter:datatype="text"/>
10905                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
10906                 </fields>
10907                 <links>
10908                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10909                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10910                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
10911                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
10912                 </links>
10913         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10914             <actions>
10915                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10916                     <context link="owner" field="home_ou"/>
10917                 </create>
10918                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10919                     <context link="owner" field="home_ou"/>
10920                 </retrieve>
10921                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10922                     <context link="owner" field="home_ou"/>
10923                 </update>
10924                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10925                     <context link="owner" field="home_ou"/>
10926                 </delete>
10927             </actions>
10928         </permacrud>
10929         </class>
10930         <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">
10931                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
10932                         <field reporter:label="Id" name="id" reporter:datatype="id" />
10933                         <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
10934                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10935                         <field reporter:label="Finish Time" name="complete_time" reporter:datatype="timestamp"/>
10936                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
10937                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
10938                         <field reporter:label="Excel" name="excel_format" reporter:datatype="bool"/>
10939                         <field reporter:label="CSV" name="csv_format" reporter:datatype="bool"/>
10940                         <field reporter:label="HTML" name="html_format" reporter:datatype="bool"/>
10941                         <field reporter:label="Error Code" name="error_code" reporter:datatype="int"/>
10942                         <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
10943                         <field reporter:label="Report" name="report" reporter:datatype="link"/>
10944                         <field reporter:label="Folder" name="folder" reporter:datatype="link"/>
10945                         <field reporter:label="Pie Chart" name="chart_pie" reporter:datatype="bool"/>
10946                         <field reporter:label="Bar Chart" name="chart_bar" reporter:datatype="bool"/>
10947                         <field reporter:label="Line Chart" name="chart_line" reporter:datatype="bool"/>
10948                 </fields>
10949                 <links>
10950                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
10951                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
10952                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
10953                 </links>
10954         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10955             <actions>
10956                 <create   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10957                     <context link="runner" field="home_ou"/>
10958                 </create>
10959                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10960                     <context link="runner" field="home_ou"/>
10961                 </retrieve>
10962                 <update   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10963                     <context link="runner" field="home_ou"/>
10964                 </update>
10965                 <delete   permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
10966                     <context link="runner" field="home_ou"/>
10967                 </delete>
10968             </actions>
10969         </permacrud>
10970         </class>
10971     <class id="rcr" controller="open-ils.reporter-store open-ils.cstore open-ils.pcrud"
10972            oils_obj:fieldmapper="reporter::completed_reports" oils_persist:tablename="reporter.completed_reports"
10973            reporter:label="Completed Report Runs" oils_persist:readonly="true">
10974                 <fields oils_persist:primary="run">
10975             <field reporter:label="Run" name="run" reporter:datatype="link"/>
10976             <field reporter:label="Report" name="report" reporter:datatype="link"/>
10977             <field reporter:label="Template" name="template" reporter:datatype="link"/>
10978             <field reporter:label="Template Owner" name="template_owner" reporter:datatype="link"/>
10979             <field reporter:label="Report Owner" name="report_owner" reporter:datatype="link"/>
10980             <field reporter:label="Runner" name="runner" reporter:datatype="link"/>
10981             <field reporter:label="Template Folder" name="template_folder" reporter:datatype="link"/>
10982             <field reporter:label="Report Folder" name="report_folder" reporter:datatype="link"/>
10983             <field reporter:label="Output Folder" name="output_folder" reporter:datatype="link"/>
10984             <field reporter:label="Report Name" name="report_name" reporter:datatype="text"/>
10985             <field reporter:label="Template Name" name="template_name" reporter:datatype="text"/>
10986             <field reporter:label="Start Time" name="start_time" reporter:datatype="text"/>
10987             <field reporter:label="Run Time" name="run_time" reporter:datatype="text"/>
10988             <field reporter:label="Finish Time" name="complete_time" reporter:datatype="text"/>
10989             <field reporter:label="Error Code" name="error_code" reporter:datatype="text"/>
10990             <field reporter:label="Error Text" name="error_text" reporter:datatype="text"/>
10991                 </fields>
10992                 <links>
10993             <link field="run" reltype="has_a" key="id" map="" class="rs"/>
10994             <link field="report" reltype="has_a" key="id" map="" class="rr"/>
10995             <link field="template" reltype="has_a" key="id" map="" class="rt"/>
10996             <link field="template_owner" reltype="has_a" key="id" map="" class="au"/>
10997             <link field="report_owner" reltype="has_a" key="id" map="" class="au"/>
10998             <link field="runner" reltype="has_a" key="id" map="" class="au"/>
10999             <link field="template_folder" reltype="has_a" key="id" map="" class="rtf"/>
11000             <link field="report_folder" reltype="has_a" key="id" map="" class="rrf"/>
11001             <link field="output_folder" reltype="has_a" key="id" map="" class="rof"/>
11002                 </links>
11003         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11004             <actions>
11005                 <retrieve permission="RUN_REPORTS RUN_SIMPLE_REPORTS">
11006                     <context link="runner" field="home_ou"/>
11007                 </retrieve>
11008             </actions>
11009         </permacrud>
11010     </class>
11011         <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">
11012                 <fields oils_persist:primary="id">
11013                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11014                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11015                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11016                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11017                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11018                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11019                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11020                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11021                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11022                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11023                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11024                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11025                 </fields>
11026                 <links>
11027                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11028                 </links>
11029                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11030                         <actions>
11031                                 <retrieve />
11032                         </actions>
11033                 </permacrud>
11034         </class>
11035         <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">
11036                 <fields oils_persist:primary="id">
11037                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11038                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
11039                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11040                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11041                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11042                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11043                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11044                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11045                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11046                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11047                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11048                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11049                 </fields>
11050                 <links>
11051                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11052                 </links>
11053         </class>
11054         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
11055                 <fields oils_persist:primary="id">
11056                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
11057                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
11058                         <field reporter:label="Fingerprint" name="fingerprint" />
11059                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
11060                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
11061                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
11062                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
11063                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
11064                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
11065                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
11066                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
11067                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
11068                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
11069                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
11070                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
11071                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
11072                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
11073                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
11074                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
11075                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
11076                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
11077                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
11078                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
11079                 </fields>
11080                 <links>
11081                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
11082                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
11083                 </links>
11084         </class>
11085         <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">
11086                 <fields oils_persist:primary="id">
11087                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
11088                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
11089                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
11090                         <field reporter:label="Detailed Age Division" name="age_division" reporter:datatype="text"/>
11091                 </fields>
11092                 <links>
11093                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
11094                 </links>
11095         </class>
11096         <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">
11097                 <fields oils_persist:primary="id">
11098                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
11099                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
11100                 </fields>
11101                 <links>
11102                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
11103                 </links>
11104         </class>
11105         <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">
11106                 <fields oils_persist:primary="id">
11107                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
11108                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
11109                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
11110                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
11111                 </fields>
11112                 <links>
11113                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
11114                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
11115                 </links>
11116                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11117                         <actions>
11118                                 <retrieve permission="VIEW_HOLD">
11119                                         <context link="id" field="pickup_lib"/>
11120                                 </retrieve>
11121                         </actions>
11122                 </permacrud>
11123         </class>
11124         <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">
11125                 <fields oils_persist:primary="xact">
11126                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11127                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="money" />
11128                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
11129                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
11130                 </fields>
11131                 <links>
11132                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11133                 </links>
11134         </class>
11135         <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">
11136                 <fields oils_persist:primary="xact">
11137                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
11138                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="money" />
11139                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
11140                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
11141                 </fields>
11142                 <links>
11143                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
11144                 </links>
11145         </class>
11146         <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)">
11147                 <fields oils_persist:primary="id">
11148                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
11149                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
11150                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
11151                 </fields>
11152                 <links>
11153                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11154                 </links>
11155         </class>
11156         <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">
11157                 <fields oils_persist:primary="id">
11158                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
11159                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
11160                 </fields>
11161                 <links>
11162                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11163                 </links>
11164                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11165                         <actions>
11166                                 <retrieve permission="STAFF_LOGIN">
11167                                         <context link="id" field="circ_lib"/>
11168                                 </retrieve>
11169                         </actions>
11170                 </permacrud>
11171         </class>
11172         <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">
11173                 <fields oils_persist:primary="bibid">
11174                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
11175                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
11176                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
11177                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
11178                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
11179                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
11180                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
11181                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
11182                 </fields>
11183                 <links>
11184                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
11185                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11186                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11187                 </links>
11188         </class>
11189         <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">
11190                 <fields oils_persist:primary="copy_id">
11191                         <field reporter:label="Item ID" name="copy_id" reporter:datatype="link"/>
11192                         <field reporter:label="Owning Library Link" name="owning_lib_id" reporter:datatype="link"/>
11193                         <field reporter:label="Consortium: Last Circulation Date" name="consortium_last_circ_date" reporter:datatype="timestamp"/>
11194                         <field reporter:label="System: Last Circulation Date" name="system_last_circ_date" reporter:datatype="timestamp"/>
11195                         <field reporter:label="Branch: Last Circulation Date" name="branch_last_circ_date" reporter:datatype="timestamp"/>
11196                         <field reporter:label="Consortium: Last Checkin Date" name="consortium_last_checkin_date" reporter:datatype="timestamp"/>
11197                         <field reporter:label="System: Last Checkin Date" name="system_last_checkin_date" reporter:datatype="timestamp"/>
11198                         <field reporter:label="Branch: Last Checkin Date" name="branch_last_checkin_date" reporter:datatype="timestamp"/>
11199                         <field reporter:label="Consortium: Last Due Date" name="consortium_last_due_date" reporter:datatype="timestamp"/>
11200                         <field reporter:label="System: Last Due Date" name="system_last_due_date" reporter:datatype="timestamp"/>
11201                         <field reporter:label="Branch: Last Due Date" name="branch_last_due_date" reporter:datatype="timestamp"/>
11202                         <field reporter:label="Consortium: Month-to-Date Circulation" name="consortium_month_to_date_circ" reporter:datatype="int"/>
11203                         <field reporter:label="System: Month-to-Date Circulation" name="system_month_to_date_circ" reporter:datatype="int"/>
11204                         <field reporter:label="Branch: Month-to-Date Circulation" name="branch_month_to_date_circ" reporter:datatype="int"/>
11205                         <field reporter:label="Consortium: Year-to-Date Circulation" name="consortium_year_to_date_circ" reporter:datatype="int"/>
11206                         <field reporter:label="System: Year-to-Date Circulation" name="system_year_to_date_circ" reporter:datatype="int"/>
11207                         <field reporter:label="Branch: Year-to-Date Circulation" name="branch_year_to_date_circ" reporter:datatype="int"/>
11208                         <field reporter:label="Consortium: Lifetime Circulation" name="consortium_lifetime_circ" reporter:datatype="int"/>
11209                         <field reporter:label="System: Lifetime Circulation" name="system_lifetime_circ" reporter:datatype="int"/>
11210                         <field reporter:label="Branch: Lifetime Circulation" name="branch_lifetime_circ" reporter:datatype="int"/>
11211                         <field reporter:label="Consortium: Current Title Hold Count" name="consortium_current_title_hold_count" reporter:datatype="int"/>
11212                         <field reporter:label="System: Current Title Hold Count" name="system_current_title_hold_count" reporter:datatype="int"/>
11213                         <field reporter:label="Branch: Current Title Hold Count" name="branch_current_title_hold_count" reporter:datatype="int"/>
11214                         <field reporter:label="Consortium: Lifetime Title Hold Count" name="consortium_lifetime_holds" reporter:datatype="int"/>
11215                         <field reporter:label="System: Lifetime Title Hold Count" name="system_lifetime_holds" reporter:datatype="int"/>
11216                         <field reporter:label="Branch: Lifetime Title Hold Count" name="branch_lifetime_holds" reporter:datatype="int"/>
11217                         <field reporter:label="Consortium: Lifetime Transits" name="consortium_lifetime_transits" reporter:datatype="int"/>
11218                         <field reporter:label="System: Lifetime Outbound Transits" name="system_lifetime_transits" reporter:datatype="int"/>
11219                         <field reporter:label="Branch: Lifetime Outbound Transits" name="branch_lifetime_transits" reporter:datatype="int"/>
11220                 </fields>
11221                 <links>
11222                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11223                         <link field="owning_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11224                 </links>
11225         </class>
11226         <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">
11227                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
11228                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
11229                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
11230                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
11231                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
11232                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
11233                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
11234                 </fields>
11235                 <links>
11236                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11237                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
11238                 </links>
11239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11240                         <actions>
11241                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11242                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11243                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11244                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
11245                         </actions>
11246                 </permacrud>
11247         </class>
11248         <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">
11249                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
11250                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
11251                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
11252                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
11253                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11254                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11255                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
11256                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
11257                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
11258                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
11259                 </fields>
11260                 <links>
11261                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11262                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11263                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
11264                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11265                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
11266                 </links>
11267                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11268                         <actions>
11269                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
11270                                         <context link="formula" field="owner"/>
11271                                 </create>
11272                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
11273                                         <context link="formula" field="owner"/>
11274                                 </retrieve>
11275                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
11276                                         <context link="formula" field="owner"/>
11277                                 </update>
11278                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
11279                                         <context link="formula" field="owner"/>
11280                                 </delete>
11281                         </actions>
11282                 </permacrud>
11283         </class>
11284
11285         <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">
11286                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
11287                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11288                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11289                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11290                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
11291                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11292                 </fields>
11293                 <links>
11294                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11295                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
11296                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11297                 </links>
11298                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11299                         <actions>
11300                                 <create permission="CREATE_PURCHASE_ORDER">
11301                                         <context link="formula" field="owner"/>
11302                 </create>
11303                                 <retrieve permission="CREATE_PURCHASE_ORDER">
11304                                         <context link="formula" field="owner"/>
11305                 </retrieve>
11306                                 <update permission="CREATE_PURCHASE_ORDER">
11307                                         <context link="formula" field="owner"/>
11308                 </update>
11309                                 <delete permission="CREATE_PURCHASE_ORDER">
11310                                         <context link="formula" field="owner"/>
11311                 </delete>
11312                         </actions>
11313                 </permacrud>
11314         </class>
11315
11316         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
11317                 <fields oils_persist:primary="id">
11318                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
11319                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
11320                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
11321                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
11322                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
11323                 </fields>
11324                 <links>
11325                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
11326                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
11327                 </links>
11328         </class>
11329
11330         <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">
11331                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
11332                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11333                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11334                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11335                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11336                 </fields>
11337                 <links>
11338                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11339                 </links>
11340                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11341                         <actions>
11342                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11343                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11344                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11345                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
11346                         </actions>
11347                 </permacrud>
11348         </class>
11349
11350         <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">
11351                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
11352                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
11353                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11354                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
11355                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11356                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
11357                 </fields>
11358                 <links>
11359                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11360                 </links>
11361                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11362                         <actions>
11363                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11364                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
11365                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11366                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
11367                         </actions>
11368                 </permacrud>
11369         </class>
11370
11371         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
11372                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
11373                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11374                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11375                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11376                 </fields>
11377                 <links>
11378                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11379                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11380                 </links>
11381         </class>
11382
11383         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
11384                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
11385                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11386                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11387                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11388                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11389                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11390                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11391                 </fields>
11392                 <links>
11393                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11394                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
11395                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11396                 </links>
11397         </class>
11398
11399         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
11400                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
11401                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
11402                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
11403                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
11404                 </fields>
11405                 <links>
11406                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
11407                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
11408                 </links>
11409         </class>
11410
11411         <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">
11412                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
11413                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
11414                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
11415                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
11416                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
11417                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11418                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
11419                 </fields>
11420                 <links>
11421                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
11422                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
11423                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11424                 </links>
11425         </class>
11426
11427         <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">
11428                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
11429                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
11430                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11431                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
11432                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11433                 </fields>
11434                 <links>
11435                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11436                 </links>
11437                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11438             <actions>
11439                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11440                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
11441                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11442                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
11443             </actions>
11444                 </permacrud>
11445         </class>
11446
11447         <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">
11448                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
11449                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
11450                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
11451                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
11452                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
11453                 </fields>
11454                 <links>
11455                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
11456                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
11457                 </links>
11458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11459                         <actions>
11460                                 <create permission="ADMIN_CLAIM_POLICY">
11461                                         <context link="claim_policy" field="org_unit"/>
11462                 </create>
11463                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
11464                                         <context link="claim_policy" field="org_unit"/>
11465                 </retrieve>
11466                                 <update permission="ADMIN_CLAIM_POLICY">
11467                                         <context link="claim_policy" field="org_unit"/>
11468                 </update>
11469                                 <delete permission="ADMIN_CLAIM_POLICY">
11470                                         <context link="claim_policy" field="org_unit"/>
11471                 </delete>
11472                         </actions>
11473                 </permacrud>
11474         </class>
11475
11476     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
11477         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
11478             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11479             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
11480             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11481             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
11482             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
11483             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
11484             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
11485             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
11486             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
11487             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
11488             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
11489             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
11490             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
11491             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
11492             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11493             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
11494                                                 <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text"/>
11495                                                 <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text"/>
11496                                                 <field reporter:label="Preferred Last Name" name="pref_family_name"  reporter:datatype="text"/>
11497         </fields>
11498         <links>
11499             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
11500             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11501         </links>
11502     </class>
11503
11504     <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">
11505         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
11506             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11507             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11508             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11509             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11510             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11511         </fields>
11512     </class>
11513
11514     <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">
11515         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11516             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11517             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11518             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11519             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11520             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11521             <field reporter:label="City" name="city" reporter:datatype="text"/>
11522             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11523             <field reporter:label="State" name="state" reporter:datatype="text"/>
11524             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11525             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11526             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11527         </fields>
11528     </class>
11529
11530     <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">
11531         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
11532             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11533             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11534             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11535             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
11536             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
11537             <field reporter:label="City" name="city" reporter:datatype="text"/>
11538             <field reporter:label="County" name="county"  reporter:datatype="text"/>
11539             <field reporter:label="State" name="state" reporter:datatype="text"/>
11540             <field reporter:label="Country" name="country" reporter:datatype="text"/>
11541             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
11542             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11543         </fields>
11544     </class>
11545
11546     <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">
11547         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
11548             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11549             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11550             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11551             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
11552             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
11553             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11554         </fields>
11555     </class>
11556
11557     <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">
11558         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
11559             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
11560             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
11561             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
11562             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
11563             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
11564             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
11565         </fields>
11566     </class>
11567
11568         <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">
11569                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
11570                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
11571                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
11572                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
11573                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
11574                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
11575                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
11576                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
11577                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
11578                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11579                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11580                 </fields>
11581                 <links>
11582                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11583                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11584                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
11585                 </links>
11586                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11587                         <actions>
11588                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11589                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11590                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11591                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
11592                         </actions>
11593                 </permacrud>
11594         </class>
11595
11596         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
11597                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
11598                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
11599                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
11600                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
11601                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
11602                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
11603                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
11604                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
11605                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
11606                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
11607                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
11608                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
11609                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
11610                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
11611                 </fields>
11612                 <links>
11613                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
11614                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11615                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11616                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
11617                 </links>
11618                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11619                         <actions>
11620                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11621                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11622                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11623                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
11624                         </actions>
11625                 </permacrud>
11626         </class>
11627
11628         <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">
11629                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
11630                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
11631                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
11632                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
11633                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
11634                 </fields>
11635                 <links>
11636                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
11637                 </links>
11638                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
11639                         <actions>
11640                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11641                     <context link="fieldset" field="owning_lib"/>
11642                 </create>
11643                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11644                     <context link="fieldset" field="owning_lib"/>
11645                 </retrieve>
11646                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11647                     <context link="fieldset" field="owning_lib"/>
11648                 </update>
11649                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
11650                     <context link="fieldset" field="owning_lib"/>
11651                 </delete>
11652                         </actions>
11653                 </permacrud>
11654         </class>
11655
11656     <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">
11657         <fields>
11658             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11659             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11660             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11661         </fields>
11662                 <links>
11663                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11664                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11665                 </links>
11666     </class>
11667
11668     <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">
11669         <fields>
11670             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11671             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
11672         </fields>
11673                 <links>
11674                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11675                 </links>
11676     </class>
11677
11678     <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">
11679         <fields>
11680             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11681             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11682             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11683         </fields>
11684                 <links>
11685                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11686                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11687                 </links>
11688     </class>
11689
11690     <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">
11691         <fields>
11692             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11693             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
11694         </fields>
11695                 <links>
11696                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11697                 </links>
11698     </class>
11699
11700     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
11701                 <oils_persist:source_definition><![CDATA[
11702
11703             SELECT  DISTINCT l.*
11704               FROM  action.unfulfilled_hold_loops l
11705                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
11706               WHERE l.count = m.max
11707
11708                 ]]></oils_persist:source_definition>
11709         <fields>
11710             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
11711             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
11712             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
11713         </fields>
11714                 <links>
11715                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
11716                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11717                 </links>
11718     </class>
11719
11720         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
11721                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
11722                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
11723                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
11724                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
11725                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
11726                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
11727                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
11728                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
11729                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
11730                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
11731                 </fields>
11732                 <links>
11733                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
11734                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
11735                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
11736                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
11737                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
11738                 </links>
11739         </class>
11740
11741         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
11742                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
11743                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
11744                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
11745                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11746                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
11747                 </fields>
11748                 <links>
11749                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
11750                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
11751                 </links>
11752         </class>
11753
11754         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
11755                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
11756                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
11757                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
11758                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
11759                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
11760                 </fields>
11761                 <links>
11762                 </links>
11763         </class>
11764
11765         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
11766                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
11767                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
11768                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
11769                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11770                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
11771                 </fields>
11772                 <links>
11773                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
11774                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
11775                 </links>
11776         </class>
11777         
11778         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
11779                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
11780                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
11781                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
11782                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
11783                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
11784                 </fields>
11785                 <links>
11786                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
11787                 </links>
11788         </class>
11789         
11790         <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">
11791                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
11792                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
11793                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11794                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11795                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
11796                 </fields>
11797                 <links>
11798                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11799                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
11800                 </links>
11801         </class>
11802
11803         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
11804                 <fields oils_persist:primary="name">
11805                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
11806                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
11807                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
11808                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
11809                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
11810                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
11811                 </fields>
11812                 <links>
11813                 </links>
11814         </class>
11815
11816         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
11817                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11818                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11819                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
11820                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11821                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11822                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11823                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11824                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11825                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11826                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11827                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
11828                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
11829                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
11830                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
11831                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11832                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11833                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11834                 </fields>
11835                 <links>
11836                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11837                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11838                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
11839                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
11840                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11841                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11842                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11843                 </links>
11844         </class>
11845
11846         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
11847                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
11848                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
11849                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11850                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11851                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
11852                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
11853                 </fields>
11854                 <links>
11855                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11856                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
11857                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
11858                 </links>
11859         </class>
11860
11861         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
11862                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
11863                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
11864                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
11865                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
11866                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
11867                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
11868                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
11869                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
11870                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
11871                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11872                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
11873                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
11874                 </fields>
11875                 <links>
11876                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
11877                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
11878                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
11879                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
11880                 </links>
11881         </class>
11882
11883         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
11884                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
11885                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
11886                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
11887                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11888                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
11889                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
11890                 </fields>
11891                 <links>
11892                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
11893                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
11894                 </links>
11895         </class>
11896
11897         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
11898                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
11899                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
11900                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11901                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11902                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11903                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
11904                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
11905                 </fields>
11906                 <links>
11907                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11908                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11909                 </links>
11910         </class>
11911
11912         <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">
11913                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
11914                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
11915                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
11916                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11917                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
11918                 </fields>
11919                 <links>
11920                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
11921                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
11922                 </links>
11923         </class>
11924
11925         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
11926                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11927                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11928                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11929                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11930                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11931                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11932                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11933                 </fields>
11934                 <links>
11935                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11936                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11937                 </links>
11938         </class>
11939
11940         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
11941                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11942                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11943                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11944                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11945                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11946                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
11947                 </fields>
11948                 <links>
11949                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11950                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
11951                 </links>
11952         </class>
11953
11954         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
11955                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11956                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11957                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11958                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11959                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11960                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
11961                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11962                 </fields>
11963                 <links>
11964                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11965                 </links>
11966         </class>
11967
11968         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
11969                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11970                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11971                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11972                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11973                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11974                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11975                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11976                 </fields>
11977                 <links>
11978                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11979                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11980                 </links>
11981         </class>
11982
11983         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
11984                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
11985                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
11986                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
11987                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
11988                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
11989                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
11990                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
11991                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
11992                 </fields>
11993                 <links>
11994                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
11995                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
11996                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
11997                 </links>
11998         </class>
11999
12000         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
12001                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12002                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12003                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12004                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12005                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12006                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
12007                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12008                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12009                 </fields>
12010                 <links>
12011                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12012                 </links>
12013         </class>
12014
12015         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
12016                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12017                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12018                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12019                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12020                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12021                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12022                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12023                 </fields>
12024                 <links>
12025                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12026                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12027                 </links>
12028         </class>
12029
12030         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
12031                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12032                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12033                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12034                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12035                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12036                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
12037                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
12038                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12039                 </fields>
12040                 <links>
12041                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12042                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
12043                 </links>
12044         </class>
12045
12046         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
12047                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12048                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12049                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12050                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12051                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12052                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12053                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12054                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12055                 </fields>
12056                 <links>
12057                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12058                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12059                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12060                 </links>
12061         </class>
12062
12063         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
12064                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12065                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12066                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12067                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12068                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12069                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12070                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12071                 </fields>
12072                 <links>
12073                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12074                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12075                 </links>
12076         </class>
12077
12078         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
12079                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12080                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12081                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12082                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12083                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12084                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12085                 </fields>
12086                 <links>
12087                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12088                 </links>
12089         </class>
12090
12091         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
12092                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12093                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12094                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12095                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12096                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12097                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12098                 </fields>
12099                 <links>
12100                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12101                 </links>
12102         </class>
12103
12104         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
12105                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12106                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12107                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12108                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12109                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12110                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
12111                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12112                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
12113                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12114                 </fields>
12115                 <links>
12116                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12117                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
12118                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
12119                 </links>
12120         </class>
12121
12122         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
12123                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12124                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12125                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12126                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12127                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12128                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
12129                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
12130                 </fields>
12131                 <links>
12132                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12133                 </links>
12134         </class>
12135
12136         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
12137                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12138                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12139                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12140                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12141                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12142                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
12143                 </fields>
12144                 <links>
12145                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12146                 </links>
12147         </class>
12148
12149         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
12150                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
12151                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
12152                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
12153                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
12154                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
12155                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
12156                 </fields>
12157                 <links>
12158                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
12159                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
12160                 </links>
12161         </class>
12162
12163         <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">
12164                 <fields oils_persist:primary="id">
12165                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
12166                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
12167                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
12168                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
12169                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
12170                 </fields>
12171                 <links>
12172                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
12173                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12174                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
12175                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
12176                 </links>
12177         </class>
12178
12179         <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">
12180                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
12181                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12182                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
12183                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12184                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
12185                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12186                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12187                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
12188                 </fields>
12189                 <links/>
12190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12191                         <actions>
12192                                 <retrieve/>
12193                         </actions>
12194                 </permacrud>
12195         </class>
12196
12197         <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">
12198                 <fields oils_persist:primary="ptype_key">
12199                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
12200                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12201                 </fields>
12202                 <links/>
12203                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12204                         <actions>
12205                                 <retrieve/>
12206                         </actions>
12207                 </permacrud>
12208         </class>
12209
12210         <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">
12211                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
12212                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12213                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
12214                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12215                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
12216                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12217                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12218                 </fields>
12219                 <links>
12220                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
12221                 </links>
12222                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12223                         <actions>
12224                                 <retrieve/>
12225                         </actions>
12226                 </permacrud>
12227         </class>
12228
12229         <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">
12230                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
12231                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12232                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12233                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
12234                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12235                 </fields>
12236                 <links>
12237                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
12238                 </links>
12239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12240                         <actions>
12241                                 <retrieve/>
12242                         </actions>
12243                 </permacrud>
12244         </class>
12245
12246     <class
12247         id="uvs"
12248         controller="open-ils.cstore open-ils.pcrud"
12249         oils_obj:fieldmapper="url_verify::session"
12250         oils_persist:tablename="url_verify.session"
12251         reporter:label="URL Verification Session"
12252     >
12253         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
12254             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
12255             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
12256                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
12257             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
12258             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
12259             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12260             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
12261             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
12262             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
12263         </fields>
12264
12265         <links>
12266             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12267             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12268             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
12269             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
12270             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
12271         </links>
12272
12273         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12274             <actions>
12275                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
12276             </actions>
12277         </permacrud>
12278
12279     </class>
12280
12281     <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">
12282         <oils_persist:source_definition><![CDATA[
12283             SELECT
12284                 cbrebi.id AS id,  -- so we can have a pkey in our view
12285                 uvs.id AS session,
12286                 uvs.owning_lib,
12287                 cbrebi.target_biblio_record_entry
12288             FROM url_verify.session uvs
12289             JOIN container.biblio_record_entry_bucket cbreb
12290                 ON (uvs.container = cbreb.id)
12291             JOIN container.biblio_record_entry_bucket_item cbrebi
12292                 ON (cbrebi.bucket = cbreb.id)
12293         ]]></oils_persist:source_definition>
12294         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
12295             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
12296             <field reporter:label="Session" name="session" reporter:datatype="link" />
12297             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
12298             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
12299         </fields>
12300         <links>
12301             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
12302             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
12303             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
12304         </links>
12305         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12306             <actions>
12307                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
12308             </actions>
12309         </permacrud>
12310     </class>
12311
12312     <class
12313         id="uvus"
12314         controller="open-ils.cstore open-ils.pcrud"
12315         oils_obj:fieldmapper="url_verify::url_selector"
12316         oils_persist:tablename="url_verify.url_selector"
12317         reporter:label="URL Verification URL Selector"
12318     >
12319         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
12320             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
12321             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
12322                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12323             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
12324         </fields>
12325
12326         <links>
12327             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12328             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
12329         </links>
12330
12331         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12332             <actions>
12333                 <create permission="URL_VERIFY">
12334                     <context link="session" field="owning_lib"/>
12335                 </create>
12336                 <retrieve permission="URL_VERIFY">
12337                     <context link="session" field="owning_lib"/>
12338                 </retrieve>
12339                 <update permission="URL_VERIFY">
12340                     <context link="session" field="owning_lib"/>
12341                 </update>
12342                 <delete permission="URL_VERIFY">
12343                     <context link="session" field="owning_lib"/>
12344                 </delete>
12345             </actions>
12346         </permacrud>
12347
12348     </class>
12349
12350     <class
12351         id="uvu"
12352         controller="open-ils.cstore open-ils.pcrud"
12353         oils_obj:fieldmapper="url_verify::url"
12354         oils_persist:tablename="url_verify.url"
12355         reporter:label="URL Verification URL"
12356     >
12357         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
12358             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
12359                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
12360                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
12361                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
12362                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
12363             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
12364             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
12365             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
12366             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
12367             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
12368             <field reporter:label="Host" name="host" reporter:datatype="text"/>
12369             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
12370             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
12371             <field reporter:label="Path" name="path" reporter:datatype="text"/>
12372             <field reporter:label="Page" name="page" reporter:datatype="text"/>
12373             <field reporter:label="Query" name="query" reporter:datatype="text"/>
12374             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
12375             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
12376         </fields>
12377
12378         <links>
12379             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
12380             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
12381             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12382             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
12383             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
12384         </links>
12385
12386         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12387             <actions>
12388                 <create permission="URL_VERIFY">
12389                     <context link="session" field="owning_lib"/>
12390                 </create>
12391                 <retrieve permission="URL_VERIFY">
12392                     <context link="session" field="owning_lib"/>
12393                 </retrieve>
12394                 <update permission="URL_VERIFY">
12395                     <context link="session" field="owning_lib"/>
12396                 </update>
12397                 <delete permission="URL_VERIFY">
12398                     <context link="session" field="owning_lib"/>
12399                 </delete>
12400             </actions>
12401         </permacrud>
12402
12403     </class>
12404
12405     <class
12406         id="uvva"
12407         controller="open-ils.cstore open-ils.pcrud"
12408         oils_obj:fieldmapper="url_verify::verification_attempt"
12409         oils_persist:tablename="url_verify.verification_attempt"
12410         reporter:label="URL Verification Attempt"
12411     >
12412         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
12413             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
12414                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
12415                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
12416             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
12417             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
12418         </fields>
12419
12420         <links>
12421             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
12422             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
12423         </links>
12424
12425         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12426             <actions>
12427                 <create permission="URL_VERIFY">
12428                     <context link="session" field="owning_lib"/>
12429                 </create>
12430                 <retrieve permission="URL_VERIFY">
12431                     <context link="session" field="owning_lib"/>
12432                 </retrieve>
12433                 <update permission="URL_VERIFY">
12434                     <context link="session" field="owning_lib"/>
12435                 </update>
12436                 <delete permission="URL_VERIFY">
12437                     <context link="session" field="owning_lib"/>
12438                 </delete>
12439             </actions>
12440         </permacrud>
12441
12442     </class>
12443
12444     <class
12445         id="uvuv"
12446         controller="open-ils.cstore open-ils.pcrud"
12447         oils_obj:fieldmapper="url_verify::url_verification"
12448         oils_persist:tablename="url_verify.url_verification"
12449         reporter:label="URL Verification"
12450     >
12451         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
12452             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
12453                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
12454                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
12455             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
12456             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
12457             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
12458             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
12459                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
12460         </fields>
12461
12462         <links>
12463             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
12464             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
12465             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
12466         </links>
12467
12468         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12469             <actions>
12470                 <create permission="URL_VERIFY">
12471                     <context link="attempt" jump="session" field="owning_lib"/>
12472                 </create>
12473                 <retrieve permission="URL_VERIFY">
12474                     <context link="attempt" jump="session" field="owning_lib"/>
12475                 </retrieve>
12476                 <update permission="URL_VERIFY">
12477                     <context link="attempt" jump="session" field="owning_lib"/>
12478                 </update>
12479                 <delete permission="URL_VERIFY">
12480                     <context link="attempt" jump="session" field="owning_lib"/>
12481                 </delete>
12482             </actions>
12483         </permacrud>
12484
12485     </class>
12486
12487         <class
12488                 id="cfdi"
12489                 controller="open-ils.cstore open-ils.pcrud"
12490                 oils_obj:fieldmapper="config::filter_dialog_interface"
12491                 oils_persist:tablename="config.filter_dialog_interface"
12492                 reporter:label="FilterDialog Interface">
12493                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
12494                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
12495                         <field reporter:label="Description" name="description" reporter:datatype="text" />
12496                 </fields>
12497                 <links>
12498                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
12499                 </links>
12500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12501                         <actions>
12502                                 <retrieve />
12503                         </actions>
12504                 </permacrud>
12505         </class>
12506
12507         <class
12508                 id="cfdfs"
12509                 controller="open-ils.cstore open-ils.pcrud"
12510                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
12511                 oils_persist:tablename="config.filter_dialog_filter_set"
12512                 reporter:label="FilterDialog Filter Set">
12513                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
12514                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12515                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12516                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
12517                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
12518                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
12519                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
12520                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
12521                 </fields>
12522                 <links>
12523                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
12524                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
12525                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
12526                 </links>
12527                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12528                         <actions>
12529                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12530                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12531                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12532                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
12533                         </actions>
12534                 </permacrud>
12535
12536         </class>
12537
12538         <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">
12539                 <fields oils_persist:primary="code">
12540                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
12541                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
12542                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
12543                 </fields>
12544                 <links/>
12545                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12546                         <actions>
12547                                 <retrieve/>
12548                         </actions>
12549                 </permacrud>
12550         </class>
12551
12552         <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">
12553                 <oils_persist:source_definition><![CDATA[
12554
12555             SELECT  b.id,
12556                     MAX(dcp.edit_date) AS last_delete_date
12557              FROM   biblio.record_entry b
12558                     JOIN asset.call_number cn ON (cn.record = b.id)
12559                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
12560              WHERE  NOT b.deleted
12561              GROUP BY b.id
12562              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
12563
12564                 ]]></oils_persist:source_definition>
12565                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12566                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12567                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
12568                 </fields>
12569                 <links>
12570                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12571                 </links>
12572                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12573                         <actions>
12574                                 <retrieve/>
12575                         </actions>
12576                 </permacrud>
12577         </class>
12578
12579         <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">
12580                 <fields oils_persist:primary="id">
12581                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12582                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12583                 </fields>
12584                 <links/>
12585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12586                         <actions>
12587                                 <retrieve/>
12588                         </actions>
12589                 </permacrud>
12590         </class>
12591
12592         <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">
12593                 <fields oils_persist:primary="id">
12594                         <field reporter:label="State ID" reporter:selector="label" name="id" reporter:datatype="text"/>
12595                         <field reporter:label="State Label" name="label" oils_persist:i18n="true" reporter:datatype="text"/>
12596                 </fields>
12597                 <links/>
12598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12599                         <actions>
12600                                 <retrieve/>
12601                         </actions>
12602                 </permacrud>
12603         </class>
12604
12605
12606         <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">
12607                 <oils_persist:source_definition><![CDATA[
12608                 SELECT
12609                     x.id,
12610                     COALESCE( y.copy_count, 0 ) AS copy_count,
12611                     x.hold_count AS hold_count,
12612                     CASE WHEN y.copy_count = 0 THEN 'Infinity'::FLOAT ELSE x.hold_count::FLOAT/y.copy_count::FLOAT END AS hold_copy_ratio
12613                 FROM
12614                     (SELECT bib_record as id, count(DISTINCT ahr.id) AS hold_count
12615                         FROM
12616                             action.hold_request ahr
12617                             JOIN reporter.hold_request_record rhrr USING (id)
12618                         WHERE
12619                             ahr.cancel_time IS NULL
12620                             AND ahr.fulfillment_time IS NULL
12621                         GROUP BY bib_record
12622                     )x
12623                     JOIN
12624                     (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count
12625                         FROM
12626                             action.hold_request ahr
12627                             JOIN reporter.hold_request_record rhrr USING (id)
12628                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12629                         WHERE
12630                             ahr.cancel_time IS NULL
12631                             AND ahr.fulfillment_time IS NULL
12632                             AND ahr.capture_time IS NULL
12633                             AND ahr.frozen IS FALSE
12634                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12635                             AND ahr.hold_type != 'M'
12636                            GROUP BY bib_record
12637                     )y
12638                     USING (id)
12639                 ]]></oils_persist:source_definition>
12640                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12641                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
12642                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
12643                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
12644                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
12645                 </fields>
12646                 <links>
12647                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12648                 </links>
12649                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12650                         <actions>
12651                                 <retrieve/>
12652                         </actions>
12653                 </permacrud>
12654         </class>
12655
12656         <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">
12657                 <oils_persist:source_definition><![CDATA[
12658             SELECT *,
12659                 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,
12660                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12661             FROM
12662                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library
12663                     FROM
12664                         action.hold_request ahr
12665                         JOIN reporter.hold_request_record rhrr USING (id)
12666                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12667                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12668                     WHERE
12669                         ahr.cancel_time IS NULL
12670                         AND ahr.fulfillment_time IS NULL
12671                     GROUP BY bib_record, pickup_lib
12672                 )x
12673                 JOIN
12674                 (SELECT bib_record as id, pickup_lib, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
12675                     FROM
12676                         action.hold_request ahr
12677                         JOIN reporter.hold_request_record rhrr USING (id)
12678                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12679                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
12680                     WHERE
12681                         ahr.cancel_time IS NULL
12682                         AND ahr.fulfillment_time IS NULL
12683                         AND ahr.capture_time IS NULL
12684                         AND ahr.frozen IS FALSE
12685                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12686                         AND ahr.hold_type != 'M'
12687                     GROUP BY bib_record, pickup_lib
12688                 )y
12689                 USING(id,pickup_lib)
12690                 JOIN
12691                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12692                     FROM
12693                         action.hold_request ahr
12694                         JOIN reporter.hold_request_record rhrr USING (id)
12695                     WHERE
12696                         ahr.cancel_time IS NULL
12697                         AND ahr.fulfillment_time IS NULL
12698                     GROUP BY bib_record
12699                 )z
12700                 USING (id)
12701                 JOIN
12702                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12703                     FROM
12704                         action.hold_request ahr
12705                         JOIN reporter.hold_request_record rhrr USING (id)
12706                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12707                     WHERE
12708                         ahr.cancel_time IS NULL
12709                         AND ahr.fulfillment_time IS NULL
12710                         AND ahr.capture_time IS NULL
12711                         AND ahr.frozen IS FALSE
12712                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12713                         AND ahr.hold_type != 'M'
12714                         GROUP BY bib_record
12715                 )u
12716                 USING (id)
12717                 ]]></oils_persist:source_definition>
12718                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12719                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12720                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
12721                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
12722                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
12723                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12724                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12725                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
12726                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12727                 </fields>
12728                 <links>
12729                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12730                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
12731                 </links>
12732                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12733                         <actions>
12734                                 <retrieve/>
12735                         </actions>
12736                 </permacrud>
12737         </class>
12738
12739         <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">
12740                 <oils_persist:source_definition><![CDATA[
12741             SELECT *,
12742                 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,
12743                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
12744             FROM
12745                 (SELECT bib_record as id, home_ou, count(DISTINCT ahr.id) AS holds_at_home_library
12746                     FROM
12747                         action.hold_request ahr
12748                         JOIN actor.usr au ON (ahr.usr = au.id)
12749                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12750                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12751                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12752                     WHERE
12753                         ahr.cancel_time IS NULL
12754                         AND ahr.fulfillment_time IS NULL
12755                     GROUP BY bib_record, home_ou
12756                 )x
12757                 JOIN
12758                 (SELECT bib_record as id, home_ou, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_home_library
12759                     FROM
12760                         action.hold_request ahr
12761                         JOIN actor.usr au ON (ahr.usr = au.id)
12762                         JOIN reporter.hold_request_record rhrr ON (rhrr.id = ahr.id)
12763                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12764                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND au.home_ou = ac.circ_lib)
12765                     WHERE
12766                         ahr.cancel_time IS NULL
12767                         AND ahr.fulfillment_time IS NULL
12768                         AND ahr.capture_time IS NULL
12769                         AND ahr.frozen IS FALSE
12770                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12771                         AND ahr.hold_type != 'M'
12772                     GROUP BY bib_record, home_ou
12773                 )y
12774                 USING (id,home_ou)
12775                 JOIN
12776                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12777                     FROM
12778                         action.hold_request ahr
12779                         JOIN reporter.hold_request_record rhrr USING (id)
12780                     WHERE
12781                         ahr.cancel_time IS NULL
12782                         AND ahr.fulfillment_time IS NULL
12783                     GROUP BY bib_record
12784                 )z
12785                 USING (id)
12786                 JOIN
12787                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12788                     FROM
12789                         action.hold_request ahr
12790                         JOIN reporter.hold_request_record rhrr USING (id)
12791                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12792                     WHERE
12793                         ahr.cancel_time IS NULL
12794                         AND ahr.fulfillment_time IS NULL
12795                         AND ahr.capture_time IS NULL
12796                         AND ahr.frozen IS FALSE
12797                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12798                         AND ahr.hold_type != 'M'
12799                     GROUP BY bib_record
12800                 )u
12801                 USING (id)
12802         ]]></oils_persist:source_definition>
12803         <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12804                 <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12805                 <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
12806                 <field reporter:label="Active Holds at Home Library" name="holds_at_home_library" reporter:datatype="int"/>
12807                 <field reporter:label="Holdable Copy Count at Home Library" name="copy_count_at_home_library" reporter:datatype="int"/>
12808                 <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12809                 <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12810                 <field reporter:label="Hold/Copy Ratio at Home Library" name="home_library_ratio" reporter:datatype="float"/>
12811                 <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12812         </fields>
12813         <links>
12814                 <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12815                 <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
12816         </links>
12817         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12818                 <actions>
12819                         <retrieve/>
12820                 </actions>
12821         </permacrud>
12822 </class>
12823
12824         <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) ">
12825                 <oils_persist:source_definition><![CDATA[
12826                 WITH counts_at_ou AS (
12827                 SELECT a.id, a.pickup_lib_or_desc, a.holds_at_or_below, b.copy_count_at_or_below
12828                 FROM
12829                     (SELECT rhrr.bib_record AS id,
12830                             aou.id AS pickup_lib_or_desc,
12831                             COUNT(DISTINCT ahr.id) AS holds_at_or_below
12832                        FROM actor.org_unit aou
12833                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12834                             action.hold_request ahr
12835                             JOIN reporter.hold_request_record rhrr USING (id)
12836                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12837                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12838                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
12839                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12840                             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
12841                       GROUP BY 1, 2
12842                 ) a
12843                 JOIN
12844                     (SELECT rhrr.bib_record AS id,
12845                             aou.id AS pickup_lib_or_desc,
12846                             COALESCE(COUNT(DISTINCT ahcm.target_copy),0) AS copy_count_at_or_below
12847                        FROM actor.org_unit aou
12848                             JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
12849                             action.hold_request ahr
12850                             JOIN reporter.hold_request_record rhrr USING (id)
12851                             LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12852                             LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
12853                       WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL AND ahr.capture_time IS NULL AND NOT ahr.frozen
12854                             -- Comment out the next line to count copies included from other bibs by metarecord holds
12855                             AND ahr.hold_type != 'M'
12856                             AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
12857                             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
12858                       GROUP BY 1, 2
12859                 ) b
12860                 USING (id,pickup_lib_or_desc)
12861             )
12862             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
12863                    y.holds_everywhere, z.copy_count_everywhere,
12864                 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,
12865                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/z.copy_count_everywhere END AS everywhere_ratio
12866             FROM counts_at_ou x
12867                 JOIN
12868                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere
12869                     FROM
12870                         action.hold_request ahr
12871                         JOIN reporter.hold_request_record rhrr USING (id)
12872                     WHERE
12873                         ahr.cancel_time IS NULL
12874                         AND ahr.fulfillment_time IS NULL
12875                     GROUP BY bib_record
12876                 )y
12877                 USING (id)
12878                 JOIN
12879                 (SELECT bib_record as id, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
12880                     FROM
12881                         action.hold_request ahr
12882                         JOIN reporter.hold_request_record rhrr USING (id)
12883                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
12884                     WHERE
12885                         ahr.cancel_time IS NULL
12886                         AND ahr.fulfillment_time IS NULL
12887                         AND ahr.capture_time IS NULL
12888                         AND ahr.frozen IS FALSE
12889                         -- Comment out the next line to count copies included from other bibs by metarecord holds
12890                         AND ahr.hold_type != 'M'
12891                         GROUP BY bib_record
12892                 )z
12893                 USING (id)
12894                 ]]></oils_persist:source_definition>
12895                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12896                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
12897                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
12898                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
12899                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
12900                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
12901                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
12902                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
12903                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
12904                 </fields>
12905                 <links>
12906                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
12907                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
12908                 </links>
12909                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12910                         <actions>
12911                                 <retrieve/>
12912                         </actions>
12913                 </permacrud>
12914         </class>
12915
12916         <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">
12917                 <oils_persist:source_definition><![CDATA[
12918             SELECT
12919                 ac.id,
12920                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
12921                 MAX(actac.xact_start) AS last_circ
12922             FROM asset.copy ac
12923                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12924             GROUP BY ac.id
12925
12926             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
12927             --SELECT
12928             --    ac.id,
12929             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
12930             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
12931             --FROM asset.copy ac
12932             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
12933             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
12934             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
12935                 ]]></oils_persist:source_definition>
12936                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
12937                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
12938                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
12939                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
12940                 </fields>
12941                 <links>
12942                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
12943                 </links>
12944                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12945                         <actions>
12946                                 <retrieve/>
12947                         </actions>
12948                 </permacrud>
12949         </class>
12950
12951         <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">
12952                 <fields oils_persist:primary="id">
12953                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
12954                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
12955                 </fields>
12956                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12957                         <actions>
12958                                 <retrieve/>
12959                         </actions>
12960                 </permacrud>
12961         </class>
12962
12963         <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">
12964                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
12965                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
12966                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
12967                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
12968                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
12969                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
12970                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
12971                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
12972                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
12973                 </fields>
12974                 <links>
12975                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
12976                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
12977                 </links>
12978                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12979                         <actions>
12980                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12981                                 <retrieve/>
12982                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12983                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
12984                         </actions>
12985                 </permacrud>
12986         </class>
12987
12988         <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">
12989                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
12990                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
12991                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
12992                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
12993                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
12994                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
12995                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
12996                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
12997                 </fields>
12998                 <links>
12999                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
13000                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
13001                 </links>
13002                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13003                         <actions>
13004                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13005                                 <retrieve/>
13006                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13007                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
13008                         </actions>
13009                 </permacrud>
13010         </class>
13011
13012
13013         <!-- ********************************************************************************************************************* -->
13014         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
13015         <!-- ********************************************************************************************************************* -->
13016         <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">
13017                 <fields oils_persist:primary="id">
13018                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
13019                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
13020                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
13021                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13022                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
13023                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
13024                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13025                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
13026                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
13027                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
13028                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
13029                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
13030                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
13031                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
13032                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13033                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
13034                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
13035                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
13036                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
13037                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
13038                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
13039                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
13040                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
13041                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
13042                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
13043                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
13044                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
13045                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
13046                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
13047                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13048                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13049                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13050                 </fields>
13051                 <links>
13052                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13053                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
13054                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
13055                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
13056                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
13057                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
13058                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
13059                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
13060                 </links>
13061         </class>
13062
13063         <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">
13064                 <fields oils_persist:primary="id">
13065                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13066                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13067                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13068                 </fields>
13069                 <links>
13070                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13071                 </links>
13072         </class>
13073
13074         <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">
13075                 <fields oils_persist:primary="id">
13076                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
13077                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
13078                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13079                 </fields>
13080                 <links>
13081                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13082                 </links>
13083         </class>
13084
13085         <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">
13086                 <fields oils_persist:primary="id">
13087                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
13088
13089                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
13090                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
13091                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
13092
13093                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
13094                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
13095                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
13096
13097                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
13098                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
13099
13100                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
13101                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
13102                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
13103
13104                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
13105                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
13106
13107                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
13108                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
13109                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
13110
13111                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
13112                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
13113                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
13114
13115                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
13116                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
13117                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
13118                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
13119
13120                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
13121                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
13122
13123                 </fields>
13124                 <links>
13125                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
13126                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13127                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
13128                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
13129                 </links>
13130         </class>
13131
13132         <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">
13133                 <oils_persist:source_definition><![CDATA[
13134
13135             SELECT
13136                 po.ordering_agency AS ordering_agency,
13137                 po.id AS purchase_order,
13138                 li.id AS lineitem,
13139                 lid.id AS lineitem_detail,
13140                 cpa.id AS claim_policy_action
13141             FROM
13142                 acq.lineitem_detail lid
13143                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
13144                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
13145                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
13146                 JOIN acq.claim_policy_action cpa ON (
13147                     cpa.claim_policy = cp.id
13148
13149                     -- we only care about claim policy actions whose claim
13150                     -- interval we'd reached or exceeded
13151                     AND (NOW() - cpa.action_interval) > po.order_date
13152
13153                     -- filter out all claim policy actions where claim events
13154                     -- have occurred on or after the action's action_interval
13155                     AND NOT EXISTS (
13156                         SELECT 1
13157                         FROM
13158                             acq.claim_event evt
13159                             JOIN acq.claim claim ON (
13160                                 claim.id = evt.claim
13161                                 AND claim.lineitem_detail = lid.id
13162                             )
13163                         WHERE
13164                             evt.event_date >= (po.order_date + cpa.action_interval)
13165                     )
13166                 )
13167             WHERE
13168                 lid.cancel_reason IS NULL
13169                 AND li.cancel_reason IS NULL -- belt/suspenders
13170                 AND po.cancel_reason IS NULL -- belt/suspenders
13171                 AND lid.recv_time IS NULL
13172                 AND po.state = 'on-order'
13173             ORDER BY 1, 2, 3, 4, 5
13174
13175                 ]]></oils_persist:source_definition>
13176                 <fields>
13177                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
13178                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
13179                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13180                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
13181                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
13182                 </fields>
13183                 <links>
13184                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
13185                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
13186                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13187                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
13188                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
13189                 </links>
13190         </class>
13191         <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">
13192                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13193                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13194                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13195                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13196                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13197                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13198                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13199                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13200                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13201                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13202                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13203                 </fields>
13204                 <links>
13205                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13206                 </links>
13207     </class>
13208         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
13209                 <oils_persist:source_definition><![CDATA[
13210             SELECT * FROM acq.lineitem_summary 
13211                                 WHERE item_count > (invoice_count + cancel_count)
13212         ]]></oils_persist:source_definition>
13213                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
13214                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
13215                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
13216                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
13217                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
13218                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
13219                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
13220                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
13221                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
13222                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
13223                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
13224                 </fields>
13225                 <links>
13226                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
13227                 </links>
13228     </class>
13229         <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">
13230                 <oils_persist:source_definition><![CDATA[
13231
13232                         SELECT  t.*
13233                           FROM  action.transit_copy t
13234                                 JOIN actor.org_unit AS s ON (t.source = s.id)
13235                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
13236                           WHERE s.parent_ou <> d.parent_ou
13237
13238                 ]]></oils_persist:source_definition>
13239                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
13240                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
13241                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
13242                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
13243                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
13244                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
13245                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
13246                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
13247                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
13248                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
13249                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
13250                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
13251                 </fields>
13252                 <links>
13253                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
13254                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
13255                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
13256                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
13257                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13258                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
13259                 </links>
13260         </class>
13261
13262     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
13263                 <oils_persist:source_definition><![CDATA[
13264
13265         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
13266                 SELECT
13267                         cp.id as copy,
13268                         COUNT(circ.id),
13269                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13270                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13271                 FROM
13272                         asset.copy cp
13273                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
13274                 GROUP BY 1, 3, 4
13275                 UNION ALL
13276                 SELECT
13277                         cp.id as copy,
13278                         COUNT(circ.id),
13279                         EXTRACT(YEAR FROM circ.xact_start) AS year,
13280                         (phone_renewal OR desk_renewal OR opac_renewal OR auto_renewal) as is_renewal
13281                 FROM
13282                         asset.copy cp
13283                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
13284                 GROUP BY 1, 3, 4
13285                 UNION ALL
13286                 SELECT
13287                         id as copy,
13288                         circ_count,
13289                         -1 AS year,
13290                         false as is_renewal
13291                 FROM
13292                         extend_reporter.legacy_circ_count
13293         )x GROUP BY 1, 3, 4
13294
13295                 ]]></oils_persist:source_definition>
13296         <fields>
13297             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
13298             <field reporter:label="Count" name="count" reporter:datatype="int"/>
13299             <field reporter:label="Year" name="year" reporter:datatype="int"/>
13300             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
13301         </fields>
13302                 <links>
13303                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13304                 </links>
13305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13306                         <actions>
13307                                 <retrieve/>
13308                         </actions>
13309                 </permacrud>
13310     </class>
13311
13312         <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">
13313                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
13314                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
13315                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
13316                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
13317                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
13318                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
13319                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
13320                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
13321                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
13322                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
13323                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
13324                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
13325                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
13326                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
13327                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
13328                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
13329                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
13330                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
13331                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
13332                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
13333                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
13334                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
13335                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
13336                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
13337                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
13338                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
13339                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
13340                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
13341                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
13342                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
13343                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
13344                         <field reporter:label="Auto Renewal" name="auto_renewal" reporter:datatype="bool"/>
13345                         <field reporter:label="Remaining Auto Renewals" name="auto_renewal_remaining" reporter:datatype="int" />
13346                 </fields>
13347                 <links>
13348                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
13349                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
13350                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
13351                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
13352                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
13353                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
13354                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13355                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
13356                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
13357                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
13358                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
13359                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
13360                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
13361                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
13362                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
13363                 </links>
13364         </class>
13365
13366     <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">
13367         <fields oils_persist:primary="id">
13368             <field reporter:label="Title" name="title" reporter:datatype="text"/>
13369             <field reporter:label="Author" name="author" reporter:datatype="text"/>
13370             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
13371             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13372             <field reporter:label="Price" name="price" reporter:datatype="money"/>
13373             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
13374             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
13375             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
13376             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
13377             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
13378             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
13379             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
13380             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
13381             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
13382             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
13383             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
13384             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
13385             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
13386             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
13387             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
13388             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
13389             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
13390             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
13391             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
13392             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
13393             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
13394             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
13395             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
13396             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
13397             <field reporter:label="Status" name="status" reporter:datatype="link"/>
13398             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
13399             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
13400             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
13401             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
13402         </fields>
13403         <links>
13404             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13405             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
13406             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13407             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13408             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
13409             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
13410             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
13411             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
13412         </links>
13413     </class>
13414
13415     <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">
13416         <fields oils_persist:primary="id">
13417             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13418             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13419             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13420             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13421         </fields>
13422         <links>
13423             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13424             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13425         </links>
13426     </class>
13427
13428     <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">
13429         <fields oils_persist:primary="owning_lib">
13430             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13431             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13432             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13433         </fields>
13434         <links>
13435             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13436         </links>
13437     </class>
13438
13439     <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">
13440         <fields oils_persist:primary="id">
13441             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13442             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13443             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13444             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13445             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13446         </fields>
13447         <links>
13448             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13449             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13450             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13451         </links>
13452     </class>
13453
13454     <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">
13455         <fields oils_persist:primary="circ_lib">
13456             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
13457             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13458             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13459             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13460         </fields>
13461         <links>
13462             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13463             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
13464         </links>
13465     </class>
13466
13467     <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">
13468         <fields oils_persist:primary="id">
13469             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
13470             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13471             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13472             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
13473             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
13474         </fields>
13475         <links>
13476             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
13477             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13478             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13479         </links>
13480     </class>
13481
13482     <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">
13483         <fields oils_persist:primary="home_ou">
13484             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
13485             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
13486             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
13487             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
13488         </fields>
13489         <links>
13490             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
13491             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
13492         </links>
13493     </class>
13494         <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">
13495                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
13496                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
13497                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13498                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13499                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
13500                 </fields>
13501                 <links>
13502                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13503                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
13504                 </links>
13505                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13506                         <actions>
13507                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13508                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
13509                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13510                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
13511                         </actions>
13512                 </permacrud>
13513         </class>
13514         <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">
13515                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
13516                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
13517                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
13518                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
13519                 </fields>
13520                 <links>
13521                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
13522                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
13523                         </links>
13524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13525                 <actions>
13526                                 <create permission="ADMIN_ACQ_FUND_TAG">
13527                                         <context link="tag" field="owner"/>
13528                                 </create>
13529                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
13530                                         <context link="tag" field="owner"/>
13531                                 </retrieve>
13532                                 <update permission="ADMIN_ACQ_FUND_TAG">
13533                                         <context link="tag" field="owner"/>
13534                                 </update>
13535                                 <delete permission="ADMIN_ACQ_FUND_TAG">
13536                                         <context link="tag" field="owner"/>
13537                                 </delete>
13538                         </actions>
13539                 </permacrud>
13540         </class>
13541         <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">
13542                 <oils_persist:source_definition><![CDATA[
13543                 SELECT
13544                         poi.purchase_order AS purchase_order,
13545                         ii.invoice AS invoice,
13546                         NULL AS lineitem,
13547                         poi.id AS po_item,
13548                         NULL AS picklist
13549                 FROM
13550                         acq.po_item poi
13551                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
13552                 UNION SELECT
13553                         jub.purchase_order AS purchase_order,
13554                         ie.invoice AS invoice,
13555                         jub.id AS lineitem,
13556                         NULL AS po_item,
13557                         jub.picklist AS picklist
13558                 FROM
13559                         acq.lineitem jub
13560                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
13561                 UNION SELECT
13562                         ii.purchase_order AS purchase_order,
13563                         ii.invoice AS invoice,
13564                         NULL AS lineitem,
13565                         NULL AS po_item,
13566                         NULL AS picklist
13567                 FROM
13568                         acq.invoice_item ii
13569                 WHERE ii.po_item IS NULL
13570                 UNION SELECT
13571                         ie.purchase_order AS purchase_order,
13572                         ie.invoice AS invoice,
13573                         NULL AS lineitem,
13574                         NULL AS po_item,
13575                         NULL AS picklist
13576                 FROM
13577                         acq.invoice_entry ie
13578                 WHERE ie.lineitem IS NULL
13579                 UNION SELECT
13580                         NULL AS purchase_order,
13581                         NULL AS invoice,
13582                         jub.id AS lineitem,
13583                         NULL AS po_item,
13584                         jub.picklist AS picklist
13585                 FROM
13586                         acq.lineitem jub
13587                 WHERE jub.purchase_order IS NULL
13588                 ]]></oils_persist:source_definition>
13589                 <fields>
13590                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
13591                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
13592                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
13593                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
13594                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
13595                 </fields>
13596                 <links>
13597                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
13598                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
13599                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
13600                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
13601                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
13602                 </links>
13603         </class>
13604         <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">
13605                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
13606                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13607                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13608                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
13609                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
13610                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
13611                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
13612                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
13613                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
13614                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
13615                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
13616                 </fields>
13617                 <links>
13618                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13619                 </links>
13620                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13621                         <actions>
13622                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13623                                 <retrieve/>
13624                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13625                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
13626                         </actions>
13627                 </permacrud>
13628         </class>
13629
13630         <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">
13631                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
13632                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13633                         <field name="date_applied" reporter:datatype="timestamp"/>
13634                         <field name="org" reporter:datatype="org_unit"/>
13635                         <field name="original_value" reporter:datatype="text"/>
13636                         <field name="new_value" reporter:datatype="text"/>
13637                         <field name="field_name" reporter:datatype="link"/>
13638                 </fields>
13639                 <links>
13640                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
13641                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
13642                 </links>
13643         </class>
13644         <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">
13645                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13646                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13647                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13648                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13649                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13650                 </fields>
13651                 <links>
13652                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13653                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
13654                 </links>
13655         </class>
13656         <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">
13657                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
13658                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13659                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
13660                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
13661                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
13662                 </fields>
13663                 <links>
13664                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
13665                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
13666                 </links>
13667         </class>
13668         <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">
13669                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
13670                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
13671                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
13672                         <field reporter:label="Manual" name="manual" reporter:datatype="bool" oils_obj:required="true"/>
13673                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
13674                 </fields>
13675                 <links>
13676                         <link field="members" reltype="has_many" key="floating_group" map="" class="cfgm"/>
13677                 </links>
13678                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13679                         <actions>
13680                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13681                                 <retrieve/>
13682                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13683                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13684                         </actions>
13685                 </permacrud>
13686         </class>
13687         <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">
13688                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
13689                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13690                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link" oils_obj:required="true"/>
13691                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link" oils_obj:required="true"/>
13692                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int" oils_obj:required="true"/>
13693                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
13694                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool" oils_obj:required="true"/>
13695                 </fields>
13696                 <links>
13697                         <link field="floating_group" reltype="has_a" key="id" map="" class="cfg"/>
13698                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13699                 </links>
13700                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13701                         <actions>
13702                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13703                                 <retrieve/>
13704                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13705                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
13706                         </actions>
13707                 </permacrud>
13708         </class>
13709         <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">
13710                 <fields oils_persist:primary="code">
13711                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
13712                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
13713                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13714                 </fields>
13715                 <links>
13716                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13717                 </links>
13718                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13719                         <actions>
13720                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13721                                 <retrieve/>
13722                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13723                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
13724                         </actions>
13725                 </permacrud>
13726         </class>
13727         <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">
13728                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
13729                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13730                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
13731                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
13732                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13733                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
13734                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
13735                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
13736                         <field reporter:label="URL" name="url" reporter:datatype="text"/>
13737                 </fields>
13738                 <links>
13739                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
13740                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13741                 </links>
13742                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13743                         <actions>
13744                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
13745                                 <retrieve/>
13746                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
13747                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
13748                         </actions>
13749                 </permacrud>
13750         </class>
13751         <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">
13752                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
13753                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
13754                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
13755                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
13756                 </fields>
13757                 <links>
13758                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
13759                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
13760                 </links>
13761                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13762                         <actions>
13763                                 <create permission="UPDATE_COPY">
13764                     <context link="copy" field="circ_lib"/>
13765                 </create>
13766                                 <retrieve/>
13767                                 <update permission="UPDATE_COPY">
13768                     <context link="copy" field="circ_lib"/>
13769                 </update>
13770                                 <delete permission="UPDATE_COPY">
13771                     <context link="copy" field="circ_lib"/>
13772                 </delete>
13773                         </actions>
13774                 </permacrud>
13775         </class>
13776         <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">
13777         <oils_persist:source_definition><![CDATA[
13778         SELECT ahcm.target_copy AS id,count(*) AS count
13779          FROM
13780          action.hold_request ahr,
13781          action.hold_copy_map ahcm
13782          WHERE
13783          ahr.cancel_time IS NULL AND
13784          ahr.fulfillment_time IS NULL AND
13785          ahr.capture_time IS NULL AND
13786          ahr.id = ahcm.hold
13787          GROUP BY ahcm.target_copy
13788         ]]></oils_persist:source_definition>
13789         <fields oils_persist:primary="id">
13790             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
13791             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
13792         </fields>
13793         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13794             <actions>
13795                <retrieve/>
13796             </actions>
13797         </permacrud>
13798         </class>
13799
13800         <class id="cwst" controller="open-ils.cstore open-ils.pcrud"
13801                 oils_obj:fieldmapper="config::workstation_setting_type" 
13802                 oils_persist:tablename="config.workstation_setting_type" 
13803                 reporter:label="Workstation Setting Type">
13804                 <fields oils_persist:primary="name">
13805                         <field name="name" reporter:datatype="text"/>
13806                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
13807                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
13808                         <field name="datatype" reporter:datatype="text"/>
13809                         <field name="fm_class" reporter:datatype="text"/>
13810                         <field name="grp" reporter:datatype="link"/>
13811                 </fields>
13812                 <links>
13813                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
13814                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
13815                 </links>
13816                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13817                         <actions>
13818                                 <create permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13819                                 <retrieve/>
13820                                 <update permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13821                                 <delete permission="ADMIN_WORKSTATION_SETTING_TYPE" global_required="true"/>
13822                         </actions>
13823                 </permacrud>
13824         </class>
13825
13826         <!-- no pcrud access is granted for now, because it's assumed these
13827                          setting values will be applied and retrived via the API. -->
13828         <class id="awss" 
13829                 controller="open-ils.cstore"
13830                 oils_obj:fieldmapper="actor::workstation_setting" 
13831                 oils_persist:tablename="actor.workstation_setting" 
13832                 reporter:label="Workstation Setting">
13833                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_setting_id_seq">
13834                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
13835                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
13836                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
13837                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
13838                 </fields>
13839                 <links>
13840                         <link field="name" reltype="has_a" key="name" map="" class="cwst"/>
13841                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
13842                 </links>
13843         </class>
13844
13845         <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">
13846         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_type_id_seq">
13847                 <field name="id" reporter:selector="name" reporter:datatype="id"/>
13848                 <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
13849                 <field name="hold_type"  reporter:datatype="text" oils_persist:i18n="true"/>
13850         </fields>
13851         </class>
13852
13853         <class id="cpt" controller="open-ils.cstore open-ils.pcrud"
13854                 oils_obj:fieldmapper="config::print_template" 
13855                 oils_persist:tablename="config.print_template" 
13856                 reporter:label="Print Templates">
13857                 <fields oils_persist:primary="id" oils_persist:sequence="config.print_template_id_seq">
13858                         <field name="id" reporter:datatype="id"  reporter:selector="label"/>
13859                         <field name="name" reporter:datatype="text" oils_obj:required="true"/>
13860                         <field name="label" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13861                         <field reporter:label="Owner" name="owner" oils_obj:required="true" reporter:datatype="link"/>
13862                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
13863                         <field reporter:label="Locale" name="locale" reporter:datatype="link"/>
13864                         <field name="content_type" reporter:datatype="text"/>
13865                         <field name="template" reporter:datatype="text" oils_obj:required="true"/>
13866                 </fields>
13867                 <links>
13868                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13869                         <link field="locale" reltype="has_a" key="id" map="" class="i18n_l"/>
13870                 </links>
13871                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13872                         <actions>
13873                                 <create permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13874                                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
13875                                 <update permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13876                                 <delete permission="ADMIN_PRINT_TEMPLATE" context_field="owner"/>
13877                         </actions>
13878                 </permacrud>
13879         </class>
13880
13881         <class id="cct" 
13882                 controller="open-ils.cstore open-ils.pcrud"
13883                 oils_obj:fieldmapper="config::carousel_type" 
13884                 oils_persist:tablename="config.carousel_type" 
13885                 reporter:label="Carousel Types">
13886                 <fields oils_persist:primary="id" oils_persist:sequence="config.carousel_type_id_seq">
13887                         <field reporter:label="Carousel Type ID" reporter:selector="name" name="id" reporter:datatype="id" />
13888                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13889                         <field reporter:label="Automatically Managed?" name="automatic" reporter:datatype="bool"/>
13890                         <field reporter:label="Filter By Age?" name="filter_by_age" reporter:datatype="bool"/>
13891                         <field reporter:label="Filter By Item Owning Library?" name="filter_by_copy_owning_lib" reporter:datatype="bool"/>
13892                         <field reporter:label="Filter By Item Location?" name="filter_by_copy_location" reporter:datatype="bool"/>
13893                 </fields>
13894                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13895                         <actions>
13896                                 <create permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13897                                 <retrieve/>
13898                                 <update permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13899                                 <delete permission="ADMIN_CAROUSEL_TYPE" global_required="true"/>
13900                         </actions>
13901                 </permacrud>
13902         </class>
13903
13904         <class id="cc" 
13905                 controller="open-ils.cstore open-ils.pcrud"
13906                 oils_obj:fieldmapper="container::carousel" 
13907                 oils_persist:tablename="container.carousel" 
13908                 reporter:label="Carousels">
13909                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_id_seq">
13910                         <field reporter:label="Carousel ID" name="id" reporter:datatype="id" reporter:selector="name"/>
13911                         <field reporter:label="Carousel Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
13912                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
13913                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true" oils_persist:i18n="true"/>
13914                         <field reporter:label="Bucket" name="bucket" reporter:datatype="link"/>
13915                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
13916                         <field reporter:label="Editing User" name="editor" reporter:datatype="link"/>
13917                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
13918                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
13919                         <field reporter:label="Age Limit" name="age_filter"  reporter:datatype="interval"/>
13920                         <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 -->
13921                         <field reporter:label="Shelving Locations" name="copy_location_filter" reporter:datatype="text" /> <!-- ditto -->
13922                         <field reporter:label="Last Refresh Time" name="last_refresh_time" reporter:datatype="timestamp"/>
13923                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
13924                         <field reporter:label="Maximum Items" name="max_items" reporter:datatype="int" oils_obj:required="true"/>
13925                 </fields>
13926                 <links>
13927                         <link field="type" reltype="has_a" key="id" map="" class="cct"/>
13928                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
13929                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
13930                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
13931                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
13932                 </links>
13933                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13934                         <actions>
13935                                 <create permission="ADMIN_CAROUSEL" context_field="owner"/>
13936                                 <retrieve permission="ADMIN_CAROUSEL" context_field="owner"/>
13937                                 <update permission="ADMIN_CAROUSEL" context_field="owner"/>
13938                                 <delete permission="ADMIN_CAROUSEL" context_field="owner"/>
13939                         </actions>
13940                 </permacrud>
13941         </class>
13942
13943         <class id="ccou" 
13944                 controller="open-ils.cstore open-ils.pcrud"
13945                 oils_obj:fieldmapper="container::carousel_org_unit" 
13946                 oils_persist:tablename="container.carousel_org_unit" 
13947                 reporter:label="Carousels Visible at Library">
13948                 <fields oils_persist:primary="id" oils_persist:sequence="container.carousel_org_unit_id_seq">
13949                         <field reporter:label="ID" name="id" reporter:datatype="id" />
13950                         <field reporter:label="Carousel" name="carousel" reporter:datatype="link"/>
13951                         <field reporter:label="Override Name" name="override_name" reporter:datatype="text"/>
13952                         <field reporter:label="Library" name="org_unit" reporter:datatype="link"/>
13953                         <field reporter:label="Sequence Number" name="seq" reporter:datatype="int"/>
13954                 </fields>
13955                 <links>
13956                         <link field="carousel" reltype="has_a" key="id" map="" class="cc"/>
13957                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
13958                 </links>
13959                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13960                         <actions>
13961                                 <create permission="ADMIN_CAROUSEL">
13962                                     <context link="carousel" field="owner" />
13963                                 </create>
13964                                 <retrieve permission="ADMIN_CAROUSEL">
13965                                     <context link="carousel" field="owner" />
13966                                 </retrieve>
13967                                 <update permission="ADMIN_CAROUSEL">
13968                                     <context link="carousel" field="owner" />
13969                                 </update>
13970                                 <delete permission="ADMIN_CAROUSEL">
13971                                     <context link="carousel" field="owner" />
13972                                 </delete>
13973                         </actions>
13974                 </permacrud>
13975         </class>
13976
13977         <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">
13978                 <fields oils_persist:primary="name">
13979                         <field name="name"              reporter:datatype="text"     reporter:label="Name" oils_obj:required="true"/>
13980                         <field name="description"       reporter:datatype="text"     reporter:label="Description"/>
13981                         <field name="context_org"       reporter:datatype="org_unit" reporter:label="Context Org" oils_obj:required="true"/>
13982                         <field name="enabled"           reporter:datatype="bool"     reporter:label="Enabled"/>
13983                         <field name="perm"              reporter:datatype="link"     reporter:label="Permission Required by User" oils_obj:required="true"/>
13984                         <field name="restrict_to_org"   reporter:datatype="bool"     reporter:label="Restrict by Home Library"/>
13985                         <field name="allow_inactive"    reporter:datatype="bool"     reporter:label="Allow Inactive Users"/>
13986                         <field name="allow_expired"     reporter:datatype="bool"     reporter:label="Allow Expired Users"/>
13987                         <field name="block_list"        reporter:datatype="text"     reporter:label="Block List"/>
13988                         <field name="usr_activity_type" reporter:datatype="link"     reporter:label="User Activity Type"/>
13989                 </fields>
13990                 <links>
13991                         <link field="context_org" reltype="has_a" key="id" map="" class="aou"/>
13992                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
13993                         <link field="usr_activity_type" reltype="has_a" key="id" map="" class="cuat"/>
13994                 </links>
13995                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
13996                         <actions>
13997                                 <create permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
13998                                 <retrieve permission="STAFF_LOGIN" context_field="context_org"/>
13999                                 <update permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14000                                 <delete permission="ADMIN_REMOTEAUTH" context_field="context_org"/>
14001                         </actions>
14002                 </permacrud>
14003         </class>
14004         <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">
14005                 <fields oils_persist:primary="id" oils_persist:sequence="config.geolocation_service_id_seq">
14006                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
14007                         <field reporter:label="Active" name="active" reporter:datatype="bool" oils_obj:required="true"/>
14008                         <field reporter:label="Owner" name="owner" reporter:datatype="link" oils_obj:required="true"/>
14009                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true" reporter:label="Name"/>
14010                         <field reporter:label="Service Code" name="service_code" reporter:datatype="text"/>
14011                         <field reporter:label="API Key" name="api_key" reporter:datatype="text"/>
14012                 </fields>
14013                 <links>
14014                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14015                 </links>
14016                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14017                         <actions>
14018                                 <create permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14019                                 <retrieve permission="VIEW_GEOLOCATION_SERVICES" global_required="true"/>
14020                                 <update permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14021                                 <delete permission="ADMIN_GEOLOCATION_SERVICES" global_required="true"/>
14022                         </actions>
14023                 </permacrud>
14024         </class>
14025
14026     <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">
14027         <fields oils_persist:primary="code">
14028             <field name="code" reporter:label="Entry Type Code" reporter:datatype="text" reporter:selector="label" oils_obj:required="true"/>
14029             <field name="label" reporter:label="Entry Type Label" reporter:datatype="text" oils_obj:required="true"/>
14030         </fields>
14031                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14032                         <actions>
14033                                 <retrieve/>
14034                         </actions>
14035                 </permacrud>
14036         </class>
14037
14038     <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">
14039         <fields oils_persist:primary="id" oils_persist:sequence="config.ui_staff_portal_page_entry_id_seq">
14040             <field name="id" reporter:label="ID" reporter:datatype="id" reporter:selector="label"/>
14041             <field name="page_col" reporter:label="Page Column" reporter:datatype="int" oils_obj:required="true"/>
14042             <field name="col_pos" reporter:label="Column Position" reporter:datatype="int" oils_obj:required="true"/>
14043             <field name="entry_type" reporter:label="Entry Type" reporter:datatype="link" oils_obj:required="true"/>
14044             <field name="label" reporter:label="Entry Label" reporter:datatype="text"/>
14045             <field name="image_url" reporter:label="Entry Image URL" reporter:datatype="text"/>
14046             <field name="target_url" reporter:label="Entry Target URL" reporter:datatype="text"/>
14047             <field name="entry_text" reporter:label="Entry Text" reporter:datatype="text"/>
14048                         <field name="owner" reporter:label="Owner" reporter:datatype="link" oils_obj:required="true"/>
14049         </fields>
14050                 <links>
14051                         <link field="entry_type" reltype="has_a" key="code" map="" class="cusppet"/>
14052                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
14053                 </links>
14054         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
14055             <actions>
14056                 <create permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14057                 <retrieve permission="STAFF_LOGIN" context_field="owner"/>
14058                 <update permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14059                 <delete permission="ADMIN_STAFF_PORTAL_PAGE" context_field="owner"/>
14060             </actions>
14061         </permacrud>
14062     </class>
14063
14064         <!-- Simple Reporter classes are currently used only by the SR UI -->
14065     <class id="srcirc" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Circulation">
14066         <oils_persist:source_definition><![CDATA[
14067             SELECT
14068               -- Circ id; just for counting
14069               combcirc.id AS circ_id,
14070
14071               -- User info, currently limiting to what's available from action.all_circulation
14072               combcirc.usr_post_code AS usr_post_code,
14073               combcirc.usr_birth_year AS usr_bith_year,
14074               combcirc.usr_profile AS usr_profile_id,
14075               pgtu.name AS usr_profile,
14076               combcirc.usr_home_ou AS usr_home_ou_id,
14077               aouuh.shortname AS usr_home_ou_shortname,
14078               aouuh.name AS usr_home_ou_name,
14079               (actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id AS usr_sys_id,
14080               aouus.shortname AS usr_sys_shortname,
14081               aouus.name AS usr_sys_name,
14082
14083               -- Circ info
14084               -- Checkout
14085               combcirc.xact_start AS xact_start,
14086               CAST(TO_CHAR(combcirc.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
14087               TO_CHAR(combcirc.xact_start, 'YYYY-MM') AS xact_start_year_mon,
14088               TO_CHAR(combcirc.xact_start, 'YYYY-MM-DD') AS xact_start_date,
14089               combcirc.circ_lib AS circ_lib_id,
14090               aouco.shortname AS circ_lib_shortname,
14091               aouco.name AS circ_lib_name,
14092               (actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id AS circ_sys_id,
14093               aoucos.shortname AS circ_sys_shortname,
14094               aoucos.name AS circ_sys_name,
14095               auco.usrname AS circ_staff,
14096               awso.name AS checkout_workstation,
14097
14098               combcirc.due_date AS due_date,
14099               CAST(TO_CHAR(combcirc.due_date, 'YYYY') AS INTEGER) AS due_date_year,
14100               TO_CHAR(combcirc.due_date, 'YYYY-MM') AS due_date_year_mon,
14101               TO_CHAR(combcirc.due_date, 'YYYY-MM-DD') AS due_date_date,
14102
14103               -- Checkin
14104               combcirc.xact_finish AS xact_finish,
14105               CAST(TO_CHAR(combcirc.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
14106               TO_CHAR(combcirc.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
14107               TO_CHAR(combcirc.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
14108               aouci.shortname AS checkin_lib_shortname,
14109               aouci.name AS checkin_lib_name,
14110               auci.usrname AS checkin_staff,
14111               awsi.name AS checkin_workstation,
14112               aoucis.shortname AS checkin_sys_shortname,
14113               aoucis.name AS checkin_sys_name,
14114
14115               combcirc.checkin_time AS checkin_time,
14116
14117               -- Misc circ info
14118               combcirc.renewal_remaining AS renewal_remaining,
14119               combcirc.auto_renewal_remaining AS auto_renewal_remaining,
14120               combcirc.grace_period AS grace_period,
14121
14122               combcirc.stop_fines AS stop_fines,
14123               combcirc.stop_fines_time AS stop_fines_time,
14124
14125               combcirc.duration AS duration,
14126               combcirc.fine_interval AS fine_interval,
14127               combcirc.recurring_fine AS recurring_fine,
14128               combcirc.max_fine AS max_fine,
14129               combcirc.duration_rule AS duration_rule,
14130               combcirc.recurring_fine_rule AS recurring_fine_rule,
14131               combcirc.max_fine_rule AS max_fine_rule,
14132               CASE WHEN combcirc.parent_circ IS NULL THEN 'circ' ELSE 'renew' END AS circ_renew,
14133               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,
14134               CASE WHEN COALESCE(combcirc.checkin_time, now()) > combcirc.due_date THEN true ELSE false END AS is_overdue,
14135
14136               -- Copy info
14137               acp.barcode AS copy_barcode,
14138               acp.circ_modifier AS copy_circ_modifier_code,
14139               ccm.name AS copy_circ_modifier_name,
14140               acp.circ_lib AS copy_circ_lib_id,
14141               acp.location AS location_id,
14142               acpl.name AS location_name,
14143               aoucp.shortname AS copy_circ_lib_shortname,
14144               aoucp.name AS copy_circ_lib_name,
14145               (actor.org_unit_ancestor_at_depth(copy_circ_lib, 1)).id AS copy_sys_id,
14146               aoucps.shortname AS copy_sys_shortname,
14147               aoucps.name AS copy_sys_name,
14148               combcirc.copy_owning_lib AS copy_owning_lib_id,
14149               aoucpo.shortname AS copy_owning_lib_shortname,
14150               aoucpo.name AS copy_owning_lib_name,
14151               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14152               acnp.label AS copy_call_number_prefix,
14153               acn.label AS copy_call_number_label,
14154               acns.label AS copy_call_number_suffix,
14155               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14156               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14157               acn.label_sortkey AS copy_call_number_label_sortkey,
14158               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14159               COALESCE(rmsr.title, acp.dummy_title) AS title,
14160               COALESCE(rmsr.author, acp.dummy_author) AS author,
14161               rmsr.publisher AS publisher,
14162               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14163               array_to_string(rmsr.isbn, ', ') AS isbn,
14164               array_to_string(rmsr.issn, ', ') AS issn,
14165               part.label AS part_label,
14166               part.label_sortkey AS part_label_sortkey,
14167               acn.record AS bib_id,
14168               rmsr.tcn_value AS tcn_value
14169
14170             FROM
14171               action.all_circulation combcirc
14172
14173               -- User
14174               INNER JOIN actor.org_unit aouuh ON (combcirc.usr_home_ou = aouuh.id)
14175               LEFT JOIN actor.org_unit aouus ON ((actor.org_unit_ancestor_at_depth(combcirc.usr_home_ou, 1)).id = aouus.id)
14176               LEFT JOIN permission.grp_tree pgtu ON (combcirc.usr_profile = pgtu.id)
14177
14178               -- Circ
14179               LEFT JOIN actor.workstation awso ON (combcirc.workstation = awso.id)
14180               LEFT JOIN actor.workstation awsi ON (combcirc.checkin_workstation = awsi.id)
14181               INNER JOIN actor.org_unit aouco ON (combcirc.circ_lib = aouco.id)
14182               LEFT JOIN actor.org_unit aouci ON (combcirc.checkin_lib = aouci.id)
14183               LEFT JOIN actor.org_unit aoucos ON ((actor.org_unit_ancestor_at_depth(combcirc.circ_lib, 1)).id = aoucos.id)
14184               LEFT JOIN actor.org_unit aoucis ON ((actor.org_unit_ancestor_at_depth(combcirc.checkin_lib, 1)).id = aouci.id)
14185               LEFT JOIN actor.usr auco ON (combcirc.circ_staff = auco.id)
14186               LEFT JOIN actor.usr auci ON (combcirc.checkin_staff = auci.id)
14187
14188               -- Copy / call / title
14189               INNER JOIN asset.copy acp ON (combcirc.target_copy = acp.id)
14190                                                         INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14191               INNER JOIN actor.org_unit aoucp ON (acp.circ_lib = aoucp.id)
14192               LEFT JOIN actor.org_unit aoucps ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_circ_lib, 1)).id = aoucps.id)
14193               LEFT JOIN actor.org_unit aoucpo ON (combcirc.copy_owning_lib = aoucpo.id)
14194               LEFT JOIN actor.org_unit aoucpos ON ((actor.org_unit_ancestor_at_depth(combcirc.copy_owning_lib, 1)).id = aoucpos.id)
14195               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14196               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14197               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14198               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14199               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14200               LEFT JOIN (
14201                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14202                 FROM biblio.monograph_part bmp
14203                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14204                 WHERE NOT bmp.deleted
14205               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14206         ]]></oils_persist:source_definition>
14207         <field_groups>
14208             <group name="common" reporter:label="Common Fields"/>
14209             <group name="item" reporter:label="Item Fields"/>
14210             <group name="user" reporter:label="Patron Fields"/>
14211             <group name="title" reporter:label="Call Number and Title Fields"/>
14212             <group name="org" reporter:label="Libraries"/>
14213         </field_groups>
14214         <fields oils_persist:primary="circ_id">
14215             <field reporter:label="Circulation ID" name="circ_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14216             <field reporter:label="Patron Post Code" name="usr_post_code" reporter:datatype="text" field_groups="user"/>
14217             <field reporter:label="Patron Birth Year" name="usr_bith_year" reporter:datatype="int" field_groups="user"/>
14218             <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"/>
14219             <field reporter:label="Patron Profile Group" name="usr_profile" sr:hide_from="filter" reporter:datatype="text" field_groups="user,common"/>
14220             <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"/>
14221             <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"/>
14222             <field reporter:label="Patron Home Library Name" name="usr_home_ou_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user,common"/>
14223             <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"/>
14224             <field reporter:label="Patron System Library Short (Policy) Name" name="usr_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14225             <field reporter:label="Patron System Library Name" name="usr_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,user"/>
14226             <field reporter:label="Circulation Start Date/Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="common"/>
14227             <field reporter:label="Circulation Start Year" name="xact_start_year" reporter:datatype="int"/>
14228             <field reporter:label="Circulation Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="common"/>
14229             <field reporter:label="Circulation Start Date" name="xact_start_date" reporter:datatype="timestamp"/>
14230             <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"/>
14231             <field reporter:label="Checkout Library Short (Policy) Name" name="circ_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14232             <field reporter:label="Checkout Library Name" name="circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,common"/>
14233             <field reporter:label="Checkout System" name="circ_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org" sr:suggest_filter="true"/>
14234             <field reporter:label="Checkout System Short (Policy) Name" name="circ_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14235             <field reporter:label="Checkout System Name" name="circ_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14236             <field reporter:label="Checkout Staff" name="circ_staff" reporter:datatype="text"/>
14237             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
14238             <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14239             <field reporter:label="Due Date Year" name="due_date_year" reporter:datatype="int"/>
14240             <field reporter:label="Due Date Year and Month" name="due_date_year_mon" reporter:datatype="text" field_groups="common"/>
14241             <field reporter:label="Due Date" name="due_date_date" reporter:datatype="text"/>
14242             <field reporter:label="Circulation Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
14243             <field reporter:label="Circulation Finish Year" name="xact_finish_year" reporter:datatype="int"/>
14244             <field reporter:label="Circulation Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text"/>
14245             <field reporter:label="Circulation Finish Date" name="xact_finish_date" reporter:datatype="text"/>
14246             <field reporter:label="Checkin Library Short (Policy) Name" name="checkin_lib_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14247             <field reporter:label="Checkin Library Name" name="checkin_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14248             <field reporter:label="Checkin Staff" name="checkin_staff" reporter:datatype="text"/>
14249             <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="text"/>
14250             <field reporter:label="Checkin System Short (Policy) Name" name="checkin_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14251             <field reporter:label="Checkin System Name" name="checkin_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org"/>
14252             <field reporter:label="Checkin Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
14253             <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14254             <field reporter:label="Remaining Autorenewals" name="auto_renewal_remaining" reporter:datatype="int" sr:suggest_transform="sum"/>
14255             <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval"/>
14256             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
14257             <field reporter:label="Stop Fines Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
14258             <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
14259             <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
14260             <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money"/>
14261             <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
14262             <field reporter:label="Circulation Duration Rule" name="duration_rule" reporter:datatype="text"/>
14263             <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="text"/>
14264             <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="text"/>
14265             <field reporter:label="Circulation or Renewal" name="circ_renew" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14266             <field reporter:label="Renewal Type" name="renewal_type" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
14267             <field reporter:label="Overdue?" name="is_overdue" reporter:datatype="bool" field_groups="common" sr:suggest_filter="true"/>
14268             <field reporter:label="Item Barcode" name="copy_barcode" reporter:datatype="text" field_groups="item"/>
14269             <field reporter:label="Shelving Location" name="location_id" sr:hide_from="display" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14270             <field reporter:label="Shelving Location" name="location_name" sr:hide_from="filter" reporter:datatype="text" field_groups="item,common"/>
14271             <field reporter:label="Item Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="item,common" sr:suggest_filter="true"/>
14272             <field reporter:label="Item Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" field_groups="item"/>
14273             <field reporter:label="Item Circulating Library" name="copy_circ_lib_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14274             <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"/>
14275             <field reporter:label="Item Circulation Library Name" name="copy_circ_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14276             <field reporter:label="Item System Library" name="copy_sys_id" sr:hide_from="display" reporter:datatype="org_unit" field_groups="org,item"/>
14277             <field reporter:label="Item System Short (Policy) Name" name="copy_sys_shortname" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14278             <field reporter:label="Item System Name" name="copy_sys_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item"/>
14279             <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"/>
14280             <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"/>
14281             <field reporter:label="Item Owning Library Name" name="copy_owning_lib_name" sr:hide_from="filter" reporter:datatype="text" field_groups="org,item,common"/>
14282             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title"/>
14283             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14284             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14285             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14286             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14287             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14288             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14289             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14290             <field reporter:label="Call Number Dewey" name="copy_call_number_dewey" reporter:datatype="text" field_groups="title"/>
14291             <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"/>
14292             <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"/>
14293             <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"/>
14294             <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"/>
14295             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14296             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14297             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title"/>
14298             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title"/>
14299             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title"/>
14300             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title"/>
14301             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14302             <field reporter:label="Publication Date" name="pubdate" reporter:datatype="int" field_groups="title"/>
14303             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14304             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14305         </fields>
14306         <links>
14307             <link field="usr_profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14308             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14309             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14310         </links>
14311     </class>
14312
14313     <class id="srusr" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Patrons">
14314         <oils_persist:source_definition><![CDATA[
14315             SELECT
14316               au.home_ou AS home_ou_filter,
14317               au.id AS user_id,
14318               cardp.barcode AS barcode_primary,
14319               au.usrname AS usrname,
14320               au.email AS email,
14321               CONCAT_WS(' ', au.prefix, au.first_given_name, au.second_given_name, au.family_name, au.suffix) AS full_name,
14322               au.prefix AS prefix,
14323               au.first_given_name AS first_given_name,
14324               au.second_given_name AS second_given_name,
14325               au.family_name AS family_name,
14326               au.suffix AS suffix,
14327               CONCAT_WS(' ', COALESCE(au.pref_prefix, au.prefix), COALESCE(au.pref_first_given_name, au.first_given_name),
14328               COALESCE(au.pref_second_given_name, au.second_given_name), COALESCE(au.pref_family_name, au.family_name),
14329               COALESCE(au.pref_suffix, au.suffix)) AS pref_full_name,
14330               COALESCE(au.pref_prefix, au.prefix) AS pref_prefix,
14331               COALESCE(au.pref_first_given_name, au.first_given_name) AS pref_first_given_name,
14332               COALESCE(au.pref_second_given_name, au.second_given_name) AS pref_second_given_name,
14333               COALESCE(au.pref_family_name, au.family_name) AS pref_family_name,
14334               COALESCE(au.pref_suffix, au.suffix) AS pref_suffix,
14335               au.profile AS profile_id,
14336               pgt.name AS profile,
14337               au.alias AS alias,
14338               CONCAT_WS(', ', au.day_phone, au.evening_phone, au.other_phone) AS all_phone,
14339               au.day_phone AS day_phone,
14340               au.evening_phone AS evening_phone,
14341               au.other_phone AS other_phone,
14342               au.dob AS dob,
14343               CAST(TO_CHAR(au.dob, 'YYYY') AS INTEGER) AS dob_year,
14344               TO_CHAR(au.dob, 'YYYY-MM') AS dob_year_month,
14345               EXTRACT('year' FROM DATE_TRUNC('year', AGE(au.dob))) AS dob_age_years,
14346               au.active AS active,
14347               au.barred AS barred,
14348               au.deleted AS deleted,
14349               au.juvenile AS juvenile,
14350               au.claims_returned_count AS claims_returned_count,
14351               au.credit_forward_balance AS credit_forward_balance,
14352               au.create_date AS create_date,
14353               CAST(TO_CHAR(au.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14354               TO_CHAR(au.create_date, 'YYYY-MM') AS create_date_year_mon,
14355               TO_CHAR(au.create_date, 'YYYY-MM-DD') AS create_date_date,
14356               au.expire_date AS expire_date,
14357               CAST(TO_CHAR(au.expire_date, 'YYYY') AS INTEGER) AS expire_date_year,
14358               TO_CHAR(au.expire_date, 'YYYY-MM') AS expire_date_year_mon,
14359               TO_CHAR(au.expire_date, 'YYYY-MM-DD') AS expire_date_date,
14360               au.claims_never_checked_out_count AS claims_never_checked_out_count,
14361               au.last_update_time AS last_update_time,
14362               au.home_ou AS home_ou_id,
14363               aouh.shortname AS home_ou_shortname,
14364               aouh.name AS home_ou_name,
14365               (actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id AS home_sys_id,
14366               aous.shortname AS home_sys_shortname,
14367               aous.name AS home_sys_name,
14368               auam.valid AS mailing_valid,
14369               auam.address_type AS mailing_address_type,
14370               auam.street1 AS mailing_street1,
14371               auam.street2 AS mailing_street2,
14372               auam.city AS mailing_city,
14373               auam.state AS mailing_state,
14374               auam.country AS mailing_country,
14375               auam.post_code AS mailing_post_code,
14376               auam.county AS mailing_county,
14377               auam.within_city_limits AS mailing_within_city_limits,
14378               auam.pending AS mailing_pending,
14379               CONCAT_WS(' ', CONCAT_WS(', ', auam.street1, auam.street2), CONCAT_WS(', ', auam.city, auam.state), auam.post_code) AS mailing_full,
14380               auap.valid AS physical_valid,
14381               auap.address_type AS physical_address_type,
14382               auap.street1 AS physical_street1,
14383               auap.street2 AS physical_street2,
14384               auap.city AS physical_city,
14385               auap.state AS physical_state,
14386               auap.country AS physical_country,
14387               auap.post_code AS physical_post_code,
14388               auap.county AS physical_county,
14389               auap.within_city_limits AS physical_within_city_limits,
14390               auap.pending AS physical_pending,
14391               CONCAT_WS(' ', CONCAT_WS(', ', auap.street1, auap.street2), CONCAT_WS(', ', auap.city, auap.state), auap.post_code) AS physical_full,
14392               CASE WHEN aus_hold.value ~ 'phone' THEN TRUE ELSE FALSE END AS phone_notify,
14393               CASE WHEN aus_hold.value ~ 'sms' THEN TRUE ELSE FALSE END AS sms_notify,
14394               CASE WHEN aus_hold.value ~ 'email' THEN TRUE ELSE FALSE END AS email_notify,
14395               CASE WHEN aus_coll.value ILIKE 'true' THEN TRUE ELSE FALSE END AS collections_exempt,
14396               CASE WHEN aus_noti.value ILIKE 'true' THEN TRUE ELSE FALSE END AS notice_optin,
14397               asceum1.stat_cat_entry AS legacy_stat_cat1,
14398               asceum2.stat_cat_entry AS legacy_stat_cat2,
14399
14400               -- Pile up aggregates at the bottom to make the GROUP BY more manageable.
14401               STRING_AGG(DISTINCT carda.barcode, ', ') AS barcode_active,
14402               STRING_AGG(DISTINCT cards.barcode, ', ') AS barcode_all,
14403               STRING_AGG(DISTINCT pgts.name, ', ') AS secondary_groups,
14404               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,
14405               COUNT(DISTINCT CASE WHEN circ.checkin_time IS NULL AND circ.xact_finish IS NULL THEN circ.id ELSE NULL END) AS circs_open
14406
14407             FROM
14408               actor.usr au
14409               INNER JOIN actor.org_unit aouh ON (au.home_ou = aouh.id)
14410               INNER JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(au.home_ou, 1)).id = aous.id)
14411               LEFT JOIN actor.card cardp ON (au.card = cardp.id)
14412               LEFT JOIN actor.card carda ON (au.id = carda.usr AND carda.active)
14413               LEFT JOIN actor.card cards ON (au.id = cards.usr)
14414               INNER JOIN permission.grp_tree pgt ON (au.profile = pgt.id)
14415               LEFT JOIN permission.usr_grp_map pugm ON (au.id = pugm.usr)
14416               LEFT JOIN permission.grp_tree pgts ON (pugm.grp = pgts.id)
14417               LEFT JOIN actor.usr_address auam ON (au.mailing_address = auam.id)
14418               LEFT JOIN actor.usr_address auap ON (au.billing_address = auap.id)
14419               LEFT JOIN action.circulation circ ON (au.id = circ.usr)
14420               LEFT JOIN actor.usr_setting aus_hold ON (au.id = aus_hold.usr AND aus_hold.name = 'opac.hold_notify')
14421               LEFT JOIN actor.usr_setting aus_coll ON (au.id = aus_coll.usr AND aus_coll.name = 'circ.collections.exempt')
14422               LEFT JOIN actor.usr_setting aus_noti ON (au.id = aus_noti.usr AND aus_noti.name = 'circ.default_overdue_notices_enabled')
14423               LEFT JOIN actor.stat_cat_entry_usr_map asceum1 ON (au.id = asceum1.target_usr AND asceum1.stat_cat = 1)
14424               LEFT JOIN actor.stat_cat_entry_usr_map asceum2 ON (au.id = asceum2.target_usr AND asceum2.stat_cat = 2)
14425
14426             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14427               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14428               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14429               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14430               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14431               76,77,78,79,80,81
14432         ]]></oils_persist:source_definition>
14433         <field_groups>
14434             <group name="common" reporter:label="Common Fields"/>
14435             <group name="name" reporter:label="Name Fields"/>
14436             <group name="contact" reporter:label="Contact Fields"/>
14437             <group name="address" reporter:label="Address Related Fields"/>
14438             <group name="org" reporter:label="Libraries"/>
14439         </field_groups>
14440         <fields oils_persist:primary="user_id">
14441             <field reporter:label="VIEW_USER Permission Verification" name="home_ou_filter" reporter:datatype="int"
14442                 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"/>
14443             <field reporter:label="User ID" name="user_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14444             <field reporter:label="Primary Barcode" name="barcode_primary" reporter:datatype="text" field_groups="common"/>
14445             <field reporter:label="OPAC/Staff Client User Name" name="usrname" reporter:datatype="text" field_groups="common"/>
14446             <field reporter:label="Email" name="email" reporter:datatype="text" field_groups="contact,common"/>
14447             <field reporter:label="Full Name" name="full_name" reporter:datatype="text" field_groups="name,common"/>
14448             <field reporter:label="Prefix" name="prefix" reporter:datatype="text" field_groups="name"/>
14449             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text" field_groups="name,common"/>
14450             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text" field_groups="name"/>
14451             <field reporter:label="Last Name" name="family_name" reporter:datatype="text" field_groups="name,common"/>
14452             <field reporter:label="Suffix" name="suffix" reporter:datatype="text" field_groups="name"/>
14453             <field reporter:label="Full Preferred Name" name="pref_full_name" reporter:datatype="text" field_groups="name,common"/>
14454             <field reporter:label="Preferred Prefix" name="pref_prefix" reporter:datatype="text" field_groups="name"/>
14455             <field reporter:label="Preferred First Name" name="pref_first_given_name" reporter:datatype="text" field_groups="name,common"/>
14456             <field reporter:label="Preferred Middle Name" name="pref_second_given_name" reporter:datatype="text" field_groups="name"/>
14457             <field reporter:label="Preferred Last Name" name="pref_family_name" reporter:datatype="text" field_groups="name,common"/>
14458             <field reporter:label="Preferred Suffix" name="pref_suffix" reporter:datatype="text" field_groups="name"/>
14459             <field reporter:label="Main (Profile) Permission Group" name="profile_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14460             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14461             <field reporter:label="OPAC/Staff Client Holds Alias" name="alias" reporter:datatype="text" field_groups="common,name"/>
14462             <field reporter:label="All Phone Numbers" name="all_phone" reporter:datatype="text" field_groups="contact"/>
14463             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text" field_groups="contact,common"/>
14464             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text" field_groups="contact"/>
14465             <field reporter:label="Other Phone" name="other_phone" reporter:datatype="text" field_groups="contact"/>
14466             <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
14467             <field reporter:label="Birth Year" name="dob_year" reporter:datatype="int"/>
14468             <field reporter:label="Birth Year and Month" name="dob_year_month" reporter:datatype="text"/>
14469             <field reporter:label="Age" name="dob_age_years" reporter:datatype="int"/>
14470             <field reporter:label="Active?" name="active" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14471             <field reporter:label="Barred?" name="barred" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14472             <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14473             <field reporter:label="Juvenile?" name="juvenile" reporter:datatype="bool" sr:suggest_filter="true" field_groups="common"/>
14474             <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14475             <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money"/>
14476             <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
14477             <field reporter:label="Record Creation Year" name="create_date_year" reporter:datatype="int"/>
14478             <field reporter:label="Record Creation Year and Month" name="create_date_year_mon" reporter:datatype="text"/>
14479             <field reporter:label="Record Creation Date" name="create_date_date" reporter:datatype="text"/>
14480             <field reporter:label="Privilege Expiration Date/Time" name="expire_date" reporter:datatype="timestamp" field_groups="common" sr:suggest_filter="true"/>
14481             <field reporter:label="Privilege Expiration Year" name="expire_date_year" reporter:datatype="int"/>
14482             <field reporter:label="Privilege Expiration Year and Month" name="expire_date_year_mon" sr:suggest_filter="true" reporter:datatype="text"/>
14483             <field reporter:label="Privilege Expiration Date" name="expire_date_date" reporter:datatype="text"/>
14484             <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" sr:suggest_transform="sum"/>
14485             <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
14486             <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"/>
14487             <field reporter:label="Home Library Short (Policy) Name" name="home_ou_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14488             <field reporter:label="Home Library Name" name="home_ou_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14489             <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"/>
14490             <field reporter:label="Home System Short (Policy) Name" name="home_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14491             <field reporter:label="Home System Name" name="home_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14492             <field reporter:label="Mailing Address Valid?" name="mailing_valid" reporter:datatype="bool" field_groups="address"/>
14493             <field reporter:label="Mailing Address Type" name="mailing_address_type" reporter:datatype="text" field_groups="address"/>
14494             <field reporter:label="Mailing Address Street1" name="mailing_street1" reporter:datatype="text" field_groups="address"/>
14495             <field reporter:label="Mailing Address Street2" name="mailing_street2" reporter:datatype="text" field_groups="address"/>
14496             <field reporter:label="Mailing Address City" name="mailing_city" reporter:datatype="text" field_groups="address"/>
14497             <field reporter:label="Mailing Address State" name="mailing_state" reporter:datatype="text" field_groups="address"/>
14498             <field reporter:label="Mailing Address Country" name="mailing_country" reporter:datatype="text" field_groups="address"/>
14499             <field reporter:label="Mailing Address Postal Code" name="mailing_post_code" reporter:datatype="text" field_groups="address"/>
14500             <field reporter:label="Mailing Address County" name="mailing_county" reporter:datatype="text" field_groups="address"/>
14501             <field reporter:label="Mailing Address Within City Limits?" name="mailing_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14502             <field reporter:label="Mailing Address Pending?" name="mailing_pending" reporter:datatype="bool" field_groups="address"/>
14503             <field reporter:label="Full Mailing Address" name="mailing_full" reporter:datatype="text" field_groups="address,common"/>
14504             <field reporter:label="Physical Address Valid?" name="physical_valid" reporter:datatype="bool" field_groups="address"/>
14505             <field reporter:label="Physical Address Type" name="physical_address_type" reporter:datatype="text" field_groups="address"/>
14506             <field reporter:label="Physical Address Street1" name="physical_street1" reporter:datatype="text" field_groups="address"/>
14507             <field reporter:label="Physical Address Street2" name="physical_street2" reporter:datatype="text" field_groups="address"/>
14508             <field reporter:label="Physical Address City" name="physical_city" reporter:datatype="text" field_groups="address"/>
14509             <field reporter:label="Physical Address State" name="physical_state" reporter:datatype="text" field_groups="address"/>
14510             <field reporter:label="Physical Address Country" name="physical_country" reporter:datatype="text" field_groups="address"/>
14511             <field reporter:label="Physical Address Postal Code" name="physical_post_code" reporter:datatype="text" field_groups="address"/>
14512             <field reporter:label="Physical Address Country" name="physical_county" reporter:datatype="text" field_groups="address"/>
14513             <field reporter:label="Physical Address Within City Limits?" name="physical_within_city_limits" reporter:datatype="bool" field_groups="address"/>
14514             <field reporter:label="Physical Address Pending?" name="physical_pending" reporter:datatype="bool" field_groups="address"/>
14515             <field reporter:label="Full Physical Address" name="physical_full" reporter:datatype="text" field_groups="address,common"/>
14516             <field reporter:label="Hold Notifications: Phone?" name="phone_notify" reporter:datatype="bool" field_groups="contact"/>
14517             <field reporter:label="Hold Notifications: SMS?" name="sms_notify" reporter:datatype="bool" field_groups="contact"/>
14518             <field reporter:label="Hold Notifications: Email?" name="email_notify" reporter:datatype="bool" field_groups="contact"/>
14519             <field reporter:label="Collections Exempt?" name="collections_exempt" reporter:datatype="bool"/>
14520             <field reporter:label="Email Notice Opt-in?" name="notice_optin" reporter:datatype="bool"/>
14521             <field reporter:label="Legacy Stat Cat 1" name="legacy_stat_cat1" reporter:datatype="text"/>
14522             <field reporter:label="Legacy Stat Cat 2" name="legacy_stat_cat2" reporter:datatype="text"/>
14523             <field reporter:label="All Active Barcodes" name="barcode_active" reporter:datatype="text" sr:suggest_operator="contains"/>
14524             <field reporter:label="All Barcodes" name="barcode_all" reporter:datatype="text" sr:suggest_operator="contains"/>
14525             <field reporter:label="Secondary Permission Groups" name="secondary_groups" reporter:datatype="text" sr:suggest_operator="contains"/>
14526             <field reporter:label="Overdue Circulations" name="circs_overdue" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14527             <field reporter:label="Open Circulations" name="circs_open" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
14528         </fields>
14529         <links>
14530             <link field="profile_id" reltype="has_a" key="id" map="" class="pgt"/>
14531         </links>
14532     </class>
14533
14534     <class id="srcp" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Collections">
14535         <oils_persist:source_definition><![CDATA[
14536             SELECT
14537               -- ids
14538               acp.id AS copy_id,
14539               acp.floating AS floating_id,
14540               acn.id AS acn_id,
14541               acp.circ_lib AS circ_lib_id,
14542               acp.status AS status_id,
14543               acp.location AS location_id,
14544               acp.age_protect AS age_protect_id,
14545               aous.id AS circ_sys_id,
14546               acn.owning_lib AS owning_lib_id,
14547               aouos.id AS owning_sys_id,
14548               awsi.id AS inv_workstation_id,
14549
14550               -- OUs
14551               aou.shortname AS circ_lib_shortname,
14552               aou.name AS circ_lib_name,
14553               aous.shortname AS circ_sys_shortname,
14554               aous.name AS circ_sys_name,
14555               aouo.shortname AS owning_lib_shortname,
14556               aouo.name AS owning_lib_name,
14557               aouos.shortname AS owning_sys_shortname,
14558               aouos.name AS owning_sys_name,
14559
14560               -- dates
14561               acp.create_date AS create_date_time,
14562               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14563               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14564               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14565               acp.active_date AS active_date_time,
14566               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14567               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14568               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14569               acp.edit_date AS edit_date_time,
14570               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14571               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14572               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14573               acp.status_changed_time AS status_changed_time_time,
14574               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14575               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14576               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14577               ali.inventory_date AS latest_inv_date,
14578               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS latest_inv_date_year,
14579               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS latest_inv_date_year_mon,
14580               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS latest_inv_date_date,
14581
14582               -- acp
14583               acp.barcode AS barcode,
14584               ccs.name AS status,
14585               acpl.name AS location_name,
14586                                                         acp.circ_modifier AS copy_circ_modifier_code,
14587                                                         ccm.name AS copy_circ_modifier_name,
14588               acp.price AS price,
14589               acp.cost AS acq_price,
14590               acp.deleted AS copy_deleted,
14591               acp.ref AS reference,
14592               acp.circulate AS copy_circulate,
14593               (acp.circulate AND acpl.circulate) AS circulate,
14594               acp.holdable AS copy_holdable,
14595               acp.deposit AS deposit,
14596               acp.deposit_amount AS deposit_amount,
14597               acp.alert_message AS alert_message,
14598               acp.opac_visible AS copy_opac_visible,
14599               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14600               crahp.name AS age_protect,
14601               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14602               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14603               acp.copy_number AS copy_number,
14604               acp.circ_as_type AS circ_as_type,
14605               acp.loan_duration AS loan_duration_int,
14606               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14607               acp.fine_level AS fine_level_int,
14608               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14609
14610               -- Call Number
14611               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14612               acnp.label AS copy_call_number_prefix,
14613               acn.label AS copy_call_number_label,
14614               acns.label AS copy_call_number_suffix,
14615               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14616               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14617               acn.label_sortkey AS copy_call_number_label_sortkey,
14618               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14619               racnd.dewey AS call_number_dewey,
14620               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14621               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14622               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14623               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14624
14625               -- Misc
14626               COALESCE(rmsr.title, acp.dummy_title) AS title,
14627               COALESCE(rmsr.author, acp.dummy_author) AS author,
14628               rmsr.publisher AS publisher,
14629               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14630               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14631               array_to_string(rmsr.issn, ', ') AS issn,
14632               part.label AS part_label,
14633               part.label_sortkey AS part_label_sortkey,
14634               acn.record AS bib_id,
14635               rmsr.tcn_value AS tcn_value,
14636               acn.deleted AS call_deleted,
14637               bre.deleted AS bib_deleted,
14638               ccs.holdable AS status_holdable,
14639               acpl.holdable AS location_holdable,
14640               acp.circulate AS location_circulate,
14641               awsi.name AS inventory_workstation,
14642               aucr.usrname AS creating_user,
14643               aued.usrname AS editing_user,
14644
14645               -- Aggregates
14646               -- may decide these price games aren't worth it, but estimated collection value is useful and missing prices are not.
14647               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,
14648               COUNT(DISTINCT combcirc.id) AS circ_total,
14649               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects
14650
14651             FROM
14652               asset.copy acp
14653               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14654               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14655               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14656               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14657               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14658               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14659               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14660               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14661               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14662               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14663               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14664               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14665               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14666               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14667               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14668               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14669               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14670               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14671               INNER JOIN actor.usr aucr ON (acp.creator = aucr.id)
14672               INNER JOIN actor.usr aued ON (acp.editor = aued.id)
14673               LEFT JOIN (
14674                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14675                 FROM biblio.monograph_part bmp
14676                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14677                 WHERE NOT bmp.deleted
14678               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14679
14680             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14681               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14682               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14683               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14684               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14685               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14686               91,92,93,94,95,96
14687
14688         ]]></oils_persist:source_definition>
14689         <field_groups>
14690             <group name="common" reporter:label="Common Fields"/>
14691             <group name="dates" reporter:label="Date Fields"/>
14692             <group name="title" reporter:label="Call Number and Title Fields"/>
14693             <group name="org" reporter:label="Libraries"/>
14694         </field_groups>
14695         <fields oils_persist:primary="copy_id">
14696             <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct"/>
14697             <field reporter:label="Floating Group" name="floating_id" reporter:datatype="link" sr:hide_from="display"/>
14698             <field reporter:label="Call Number" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14699             <field reporter:label="Circulating Library" name="circ_lib_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org" sr:suggest_filter="true"/>
14700             <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14701             <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14702             <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14703             <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org"/>
14704             <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"/>
14705             <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"/>
14706             <field reporter:label="Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display"/>
14707             <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14708             <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14709             <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14710             <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14711             <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14712             <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
14713             <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14714             <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
14715             <field reporter:label="Item Create Date/Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14716             <field reporter:label="Item Create Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
14717             <field reporter:label="Item Create Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14718             <field reporter:label="Item Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
14719             <field reporter:label="Item Active Date/Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14720             <field reporter:label="Item Active Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
14721             <field reporter:label="Item Active Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14722             <field reporter:label="Item Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
14723             <field reporter:label="Item Edit Date/Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
14724             <field reporter:label="Item Edit Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
14725             <field reporter:label="Item Edit Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14726             <field reporter:label="Item Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
14727             <field reporter:label="Item Status Changed Date/Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
14728             <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
14729             <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
14730             <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
14731             <field reporter:label="Item Latest Inventory Date/Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="dates"/>
14732             <field reporter:label="Item Latest Inventory Year" name="latest_inv_date_year" reporter:datatype="int" field_groups="dates"/>
14733             <field reporter:label="Item Latest Inventory Year and Month" name="latest_inv_date_year_mon" reporter:datatype="text" field_groups="dates"/>
14734             <field reporter:label="Item Latest Inventory Date" name="latest_inv_date_date" reporter:datatype="text" field_groups="dates"/>
14735             <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
14736             <field reporter:label="Item Status" name="status" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14737             <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14738             <field reporter:label="Circulation Modifier Code" name="copy_circ_modifier_code" reporter:datatype="link" field_groups="common" sr:suggest_filter="true"/>
14739             <field reporter:label="Circulation Modifier Name" name="copy_circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
14740             <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
14741             <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14742             <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14743             <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
14744             <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
14745             <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
14746             <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
14747             <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
14748             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
14749             <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
14750             <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
14751             <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
14752             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
14753             <field reporter:label="Currently Age Protected?" name="under_age_protection" reporter:datatype="bool" field_groups="common"/>
14754             <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool" field_groups="common"/>
14755             <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
14756             <field reporter:label="Circ as Type" name="circ_as_type" reporter:datatype="text"/>
14757             <field reporter:label="Loan Duration Value" name="loan_duration_int" reporter:datatype="int"/>
14758             <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
14759             <field reporter:label="Fine Level Value" name="fine_level_int" reporter:datatype="int"/>
14760             <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
14761             <field reporter:label="Creating User" name="creating_user" reporter:datatype="text"/>
14762             <field reporter:label="Editing User" name="editing_user" reporter:datatype="text"/>
14763             <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
14764             <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
14765             <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title"/>
14766             <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
14767             <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
14768             <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
14769             <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
14770             <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
14771             <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
14772             <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
14773             <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
14774             <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
14775             <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
14776             <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
14777             <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
14778             <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
14779             <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
14780             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
14781             <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14782             <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
14783             <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
14784             <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
14785             <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
14786             <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text"/>
14787             <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
14788             <field reporter:label="Total Circulations" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" field_groups="common"/>
14789             <field reporter:label="All Bibliographic Record Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
14790         </fields>
14791         <links>
14792             <link field="floating_id" reltype="might_have" key="id" map="" class="cfg"/>
14793             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
14794             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
14795             <link field="copy_circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
14796             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
14797             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
14798         </links>
14799     </class>
14800
14801     <class id="srwd" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Weeding">
14802         <oils_persist:source_definition><![CDATA[
14803
14804             SELECT
14805               -- ids
14806               acp.id AS copy_id,
14807               acn.id AS acn_id,
14808               acp.circ_lib AS circ_lib_id,
14809               acp.status AS status_id,
14810               acp.location AS location_id,
14811               acp.age_protect AS age_protect_id,
14812               aous.id AS circ_sys_id,
14813               acn.owning_lib AS owning_lib_id,
14814               aouos.id AS owning_sys_id,
14815               awsi.id AS inv_workstation_id,
14816
14817               -- OUs
14818               aou.shortname AS circ_lib_shortname,
14819               aou.name AS circ_lib_name,
14820               aous.shortname AS circ_sys_shortname,
14821               aous.name AS circ_sys_name,
14822               aouo.shortname AS owning_lib_shortname,
14823               aouo.name AS owning_lib_name,
14824               aouos.shortname AS owning_sys_shortname,
14825               aouos.name AS owning_sys_name,
14826
14827               -- dates
14828               acp.create_date AS create_date_time,
14829               (EXTRACT(EPOCH FROM AGE(acp.create_date)) / 86400) AS item_age_days,
14830               (EXTRACT(YEAR FROM AGE(acp.create_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.create_date)) AS item_age_months,
14831               EXTRACT(YEAR FROM AGE(acp.create_date)) AS item_age_years,
14832               CAST(TO_CHAR(acp.create_date, 'YYYY') AS INTEGER) AS create_date_year,
14833               TO_CHAR(acp.create_date, 'YYYY-MM') AS create_date_year_mon,
14834               TO_CHAR(acp.create_date, 'YYYY-MM-DD') AS create_date_date,
14835               acp.active_date AS active_date_time,
14836               (EXTRACT(EPOCH FROM AGE(acp.active_date)) / 86400) AS item_active_days,
14837               EXTRACT(YEAR FROM AGE(acp.active_date)) * 12 + EXTRACT(MONTH FROM AGE(acp.active_date)) AS item_active_months,
14838               EXTRACT(YEAR FROM AGE(acp.active_date)) AS item_active_years,
14839               CAST(TO_CHAR(acp.active_date, 'YYYY') AS INTEGER) AS active_date_year,
14840               TO_CHAR(acp.active_date, 'YYYY-MM') AS active_date_year_mon,
14841               TO_CHAR(acp.active_date, 'YYYY-MM-DD') AS active_date_date,
14842               acp.edit_date AS edit_date_time,
14843               (EXTRACT(EPOCH FROM AGE(acp.edit_date)) / 86400) AS item_edit_age_days,
14844               (EXTRACT(YEAR FROM AGE(acp.edit_date)) * 12) + EXTRACT(MONTH FROM AGE(acp.edit_date)) AS item_edit_age_months,
14845               EXTRACT(YEAR FROM AGE(acp.edit_date)) AS item_edit_age_years,
14846               CAST(TO_CHAR(acp.edit_date, 'YYYY') AS INTEGER) AS edit_date_year,
14847               TO_CHAR(acp.edit_date, 'YYYY-MM') AS edit_date_year_mon,
14848               TO_CHAR(acp.edit_date, 'YYYY-MM-DD') AS edit_date_date,
14849               acp.status_changed_time AS status_changed_time_time,
14850               CAST(TO_CHAR(acp.status_changed_time, 'YYYY') AS INTEGER) AS status_changed_year,
14851               TO_CHAR(acp.status_changed_time, 'YYYY-MM') AS status_changed_year_mon,
14852               TO_CHAR(acp.status_changed_time, 'YYYY-MM-DD') AS status_changed_date,
14853               ali.inventory_date AS latest_inv_date,
14854               (EXTRACT(EPOCH FROM AGE(ali.inventory_date)) / 86400) AS inventory_age_days,
14855               EXTRACT(YEAR FROM AGE(ali.inventory_date)) * 12 + EXTRACT(MONTH FROM AGE(ali.inventory_date)) AS inventory_age_months,
14856               EXTRACT(YEAR FROM AGE(ali.inventory_date)) AS inventory_age_years,
14857               CAST(TO_CHAR(ali.inventory_date, 'YYYY') AS INTEGER) AS inv_date_year,
14858               TO_CHAR(ali.inventory_date, 'YYYY-MM') AS inv_date_year_mon,
14859               TO_CHAR(ali.inventory_date, 'YYYY-MM-DD') AS inv_date_date,
14860
14861               -- acp
14862               acp.barcode AS barcode,
14863               ccs.name AS status,
14864               acpl.name AS location_name,
14865               acp.circ_modifier AS circ_modifier_code,
14866               ccm.name AS circ_modifier_name,
14867               acp.price AS price,
14868               acp.cost AS acq_price,
14869               acp.deleted AS copy_deleted,
14870               acp.ref AS reference,
14871               acp.circulate AS copy_circulate,
14872               (acp.circulate AND acpl.circulate) AS circulate,
14873               acp.holdable AS copy_holdable,
14874               acp.deposit AS deposit,
14875               acp.deposit_amount AS deposit_amount,
14876               acp.alert_message AS alert_message,
14877               acp.opac_visible AS copy_opac_visible,
14878               (acp.opac_visible AND ccs.opac_visible) AS opac_visible,
14879               crahp.name AS age_protect,
14880               CASE WHEN acp.age_protect IS NULL THEN FALSE ELSE (now() - crahp.age) < acp.active_date END AS under_age_protection,
14881               (acp.holdable AND ccs.holdable AND acpl.holdable) AS holdable,
14882               acp.copy_number AS copy_number,
14883               acp.circ_as_type AS circ_as_type,
14884               acp.loan_duration AS loan_duration_int,
14885               CASE acp.loan_duration WHEN 1 THEN 'short' WHEN 2 THEN 'medium' ELSE 'long' END AS loan_duration,
14886               acp.fine_level AS fine_level_int,
14887               CASE acp.fine_level WHEN 1 THEN 'low' WHEN 2 THEN 'medium' ELSE 'high' END AS fine_level,
14888
14889               -- Call Number
14890               TRIM(BOTH ' ' FROM CONCAT_WS(' ', acnp.label, acn.label, acns.label)) AS copy_call_number_full,
14891               acnp.label AS copy_call_number_prefix,
14892               acn.label AS copy_call_number_label,
14893               acns.label AS copy_call_number_suffix,
14894               TRIM(BOTH ' ' FROM concat_ws(' ', acnp.label_sortkey, acn.label_sortkey, acns.label_sortkey)) AS copy_call_number_sortkey_full,
14895               acnp.label_sortkey AS copy_call_number_prefix_sortkey,
14896               acn.label_sortkey AS copy_call_number_label_sortkey,
14897               acns.label_sortkey AS copy_call_number_suffix_sortkey,
14898               racnd.dewey AS call_number_dewey,
14899               racnd.dewey_block_tens AS call_number_dewey_block_tens,
14900               racnd.dewey_block_hundreds AS call_number_dewey_block_hundreds,
14901               racnd.dewey_range_tens AS call_number_dewey_range_tens,
14902               racnd.dewey_range_hundreds AS call_number_dewey_range_hundreds,
14903
14904               -- Misc
14905               COALESCE(rmsr.title, acp.dummy_title) AS title,
14906               COALESCE(rmsr.author, acp.dummy_author) AS author,
14907               rmsr.publisher AS publisher,
14908               public.approximate_date(rmsr.pubdate, '0') AS pubdate,
14909               COALESCE(array_to_string(rmsr.isbn, ', '), acp.dummy_isbn) AS isbn,
14910               array_to_string(rmsr.issn, ', ') AS issn,
14911               part.label AS part_label,
14912               part.label_sortkey AS part_label_sortkey,
14913               acn.record AS bib_id,
14914               rmsr.tcn_value AS tcn_value,
14915               acn.deleted AS call_deleted,
14916               bre.deleted AS bib_deleted,
14917               ccs.holdable AS status_holdable,
14918               acpl.holdable AS location_holdable,
14919               acp.circulate AS location_circulate,
14920               awsi.name AS inventory_workstation,
14921
14922               -- Aggregates
14923               -- may decide these price games aren't worth it, but estimated collection value is useful
14924               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,
14925               STRING_AGG(mfde_subj.value, ', ') AS bib_subjects,
14926               MAX(combcirc.xact_start) AS last_circ_datetime,
14927               (EXTRACT(EPOCH FROM AGE(MAX(combcirc.xact_start))) / 86400) AS last_circ_age_days,
14928               (EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) * 12) + EXTRACT(MONTH FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_months,
14929               EXTRACT(YEAR FROM AGE(MAX(combcirc.xact_start))) AS last_circ_age_years,
14930               CAST(TO_CHAR(MAX(combcirc.xact_start), 'YYYY') AS INTEGER) AS last_circ_year,
14931               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM') AS last_circ_year_mon,
14932               TO_CHAR(MAX(combcirc.xact_start), 'YYYY-MM-DD') AS last_circ_date,
14933               COALESCE(MAX(combcirc.xact_start), acp.create_date) AS last_circ_create_datetime,
14934               (EXTRACT(EPOCH FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) / 86400) AS last_circ_create_age_days,
14935               (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,
14936               EXTRACT(YEAR FROM AGE(COALESCE(MAX(combcirc.xact_start), acp.create_date))) AS last_circ_create_age_years,
14937               CAST(TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY') AS INTEGER) AS last_circ_create_year,
14938               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM') AS last_circ_create_year_mon,
14939               TO_CHAR(COALESCE(MAX(combcirc.xact_start), acp.create_date), 'YYYY-MM-DD') AS last_circ_create_date,
14940               COUNT(DISTINCT combcirc.id) AS circ_total, -- good for finding low performers to lose or ragged copies to replace
14941               COUNT(DISTINCT CASE WHEN date_part('year', now()) = date_part('year', combcirc.xact_start) THEN combcirc.id ELSE NULL END) AS circ_ytd,
14942               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,
14943               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,
14944               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,
14945               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
14946
14947             FROM
14948               asset.copy acp
14949               LEFT JOIN config.circ_modifier ccm ON (acp.circ_modifier = ccm.code)
14950               INNER JOIN asset.call_number acn ON (acp.call_number = acn.id)
14951               LEFT JOIN reporter.asset_call_number_dewey racnd ON (acn.id = racnd.call_number)
14952               INNER JOIN config.copy_status ccs ON (acp.status = ccs.id)
14953               LEFT JOIN config.rule_age_hold_protect crahp ON (acp.age_protect = crahp.id)
14954               INNER JOIN asset.copy_location acpl ON (acp.location = acpl.id)
14955               INNER JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
14956               INNER JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
14957               LEFT JOIN asset.latest_inventory ali ON (acp.id = ali.copy)
14958               LEFT JOIN actor.workstation awsi ON (ali.inventory_workstation = awsi.id)
14959               LEFT JOIN reporter.materialized_simple_record rmsr ON (acn.record = rmsr.id)
14960               INNER JOIN actor.org_unit aou ON (acp.circ_lib = aou.id)
14961               LEFT JOIN actor.org_unit aous ON ((actor.org_unit_ancestor_at_depth(acp.circ_lib, 1)).id = aous.id)
14962               INNER JOIN actor.org_unit aouo ON (acn.owning_lib = aouo.id)
14963               LEFT JOIN actor.org_unit aouos ON ((actor.org_unit_ancestor_at_depth(acn.owning_lib, 1)).id = aouos.id)
14964               INNER JOIN biblio.record_entry bre ON (acn.record = bre.id)
14965               LEFT JOIN metabib.flat_display_entry mfde_subj ON (acn.record = mfde_subj.source AND mfde_subj.name = 'subject')
14966               LEFT JOIN action.all_circulation combcirc ON (acp.id = combcirc.target_copy)
14967               LEFT JOIN (
14968                 SELECT bmp.record, bmp.label, bmp.label_sortkey, acmp.target_copy
14969                 FROM biblio.monograph_part bmp
14970                 INNER JOIN asset.copy_part_map acmp ON (acmp.part = bmp.id)
14971                 WHERE NOT bmp.deleted
14972               ) part ON (part.record = acn.record AND part.target_copy = acp.id)
14973
14974             GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
14975               16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
14976               31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,
14977               46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
14978               61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,
14979               76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
14980               91,92,93,94,95,96,97,98,99,100,101,102,103,104,105
14981
14982         ]]></oils_persist:source_definition>
14983         <field_groups>
14984             <group name="common" reporter:label="Common Fields"/>
14985             <group name="dates" reporter:label="Date Fields"/>
14986             <group name="inv" reporter:label="Inventory Fields"/>
14987             <group name="title" reporter:label="Call Number and Title Fields"/>
14988             <group name="org" reporter:label="Libraries"/>
14989         </field_groups>
14990         <fields oils_persist:primary="copy_id">
14991              <field reporter:label="Item ID" name="copy_id" reporter:datatype="int" sr:suggest_transform="count_distinct" field_groups="common"/>
14992              <field reporter:label="Call Number ID" name="acn_id" reporter:datatype="int" sr:hide_from="display"/>
14993              <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"/>
14994              <field reporter:label="Item Status" name="status_id" reporter:datatype="link" sr:hide_from="display" sr:suggest_filter="true"/>
14995              <field reporter:label="Shelving Location" name="location_id" reporter:datatype="link" sr:hide_from="display" field_groups="common" sr:suggest_filter="true"/>
14996              <field reporter:label="Age Protection" name="age_protect_id" reporter:datatype="link" sr:hide_from="display"/>
14997              <field reporter:label="Circulating System" name="circ_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
14998              <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"/>
14999              <field reporter:label="Owning System" name="owning_sys_id" reporter:datatype="org_unit" sr:hide_from="display" field_groups="org,common"/>
15000              <field reporter:label="Last Inventory Workstation" name="inv_workstation_id" reporter:datatype="link" sr:hide_from="display" field_groups="inv"/>
15001              <field reporter:label="Circulating Library Short (Policy) Name" name="circ_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15002              <field reporter:label="Circulating Library Name" name="circ_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15003              <field reporter:label="Circulating System Short (Policy) Name" name="circ_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15004              <field reporter:label="Circulating System Name" name="circ_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15005              <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15006              <field reporter:label="Owning Library Name" name="owning_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15007              <field reporter:label="Owning System Short (Policy) Name" name="owning_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15008              <field reporter:label="Owning System Name" name="owning_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15009              <field reporter:label="Last Circulated Date / Time" name="last_circ_datetime" reporter:datatype="timestamp" field_groups="dates,common" sr:suggest_filter="true"/>
15010              <field reporter:label="Last Circulated Days Ago" name="last_circ_age_days" reporter:datatype="int" field_groups="dates"/>
15011              <field reporter:label="Last Circluated Months Ago" name="last_circ_age_months" reporter:datatype="int" field_groups="dates"/>
15012              <field reporter:label="Last Circulated Years Ago" name="last_circ_age_years" reporter:datatype="int" field_groups="dates"/>
15013              <field reporter:label="Last Circulated Year" name="last_circ_year" reporter:datatype="int" field_groups="dates"/>
15014              <field reporter:label="Last Circulated Year and Month" name="last_circ_year_mon" reporter:datatype="text" field_groups="dates"/>
15015              <field reporter:label="Last Circulated Date" name="last_circ_date" reporter:datatype="text" field_groups="dates"/>
15016              <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"/>
15017              <field reporter:label="Last Circulated or Item Created Days Ago" name="last_circ_create_age_days" reporter:datatype="int" field_groups="dates"/>
15018              <field reporter:label="Last Circulated or Item Created Months Ago" name="last_circ_create_age_months" reporter:datatype="int" field_groups="dates"/>
15019              <field reporter:label="Last Circulated or Item Created Years Ago" name="last_circ_create_age_years" reporter:datatype="int" field_groups="dates"/>
15020              <field reporter:label="Last Circulated or Item Created Year" name="last_circ_create_year" reporter:datatype="int" field_groups="dates"/>
15021              <field reporter:label="Last Circulated or Item Created Year and Month" name="last_circ_create_year_mon" reporter:datatype="text" field_groups="dates"/>
15022              <field reporter:label="Last Circulated or Item Created Date" name="last_circ_create_date" reporter:datatype="text" field_groups="dates"/>
15023              <field reporter:label="Create Date / Time" name="create_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15024              <field reporter:label="Item Age (Days)" name="item_age_days" reporter:datatype="int" field_groups="dates"/>
15025              <field reporter:label="Item Age (Months)" name="item_age_months" reporter:datatype="int" field_groups="dates"/>
15026              <field reporter:label="Item Age (Years)" name="item_age_years" reporter:datatype="int" field_groups="dates"/>
15027              <field reporter:label="Create Date Year" name="create_date_year" reporter:datatype="int" field_groups="dates"/>
15028              <field reporter:label="Create Date Year and Month" name="create_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15029              <field reporter:label="Create Date" name="create_date_date" reporter:datatype="text" field_groups="dates"/>
15030              <field reporter:label="Active Date / Time" name="active_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15031              <field reporter:label="Active For (Days)" name="item_active_days" reporter:datatype="int" field_groups="dates"/>
15032              <field reporter:label="Active For (Months)" name="item_active_months" reporter:datatype="int" field_groups="dates"/>
15033              <field reporter:label="Active For (Years)" name="item_active_years" reporter:datatype="int" field_groups="dates"/>
15034              <field reporter:label="Active Date Year" name="active_date_year" reporter:datatype="int" field_groups="dates"/>
15035              <field reporter:label="Active Date Year and Month" name="active_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15036              <field reporter:label="Active Date" name="active_date_date" reporter:datatype="text" field_groups="dates"/>
15037              <field reporter:label="Last Edit Date / Time" name="edit_date_time" reporter:datatype="timestamp" field_groups="dates"/>
15038              <field reporter:label="Last Edited Days Ago" name="item_edit_age_days" reporter:datatype="int" field_groups="dates"/>
15039              <field reporter:label="Last Edited Months Ago" name="item_edit_age_months" reporter:datatype="int" field_groups="dates"/>
15040              <field reporter:label="Last Edited Years Ago" name="item_edit_age_years" reporter:datatype="int" field_groups="dates"/>
15041              <field reporter:label="Last Edit Date Year" name="edit_date_year" reporter:datatype="int" field_groups="dates"/>
15042              <field reporter:label="Last Edit Date Year and Month" name="edit_date_year_mon" reporter:datatype="text" field_groups="dates"/>
15043              <field reporter:label="Last Edit Date" name="edit_date_date" reporter:datatype="text" field_groups="dates"/>
15044              <field reporter:label="Item Status Changed Date / Time" name="status_changed_time_time" reporter:datatype="timestamp" field_groups="dates"/>
15045              <field reporter:label="Item Status Changed Year" name="status_changed_year" reporter:datatype="int" field_groups="dates"/>
15046              <field reporter:label="Item Status Changed Year and Month" name="status_changed_year_mon" reporter:datatype="text" field_groups="dates"/>
15047              <field reporter:label="Item Status Changed Date" name="status_changed_date" reporter:datatype="text" field_groups="dates"/>
15048              <field reporter:label="Last Inventoried Date / Time" name="latest_inv_date" reporter:datatype="timestamp" field_groups="inv,dates"/>
15049              <field reporter:label="Last Inventoried Days Ago" name="inventory_age_days" reporter:datatype="int" field_groups="inv,dates"/>
15050              <field reporter:label="Last Inventoried Months Ago" name="inventory_age_months" reporter:datatype="int" field_groups="inv,dates"/>
15051              <field reporter:label="Last Inventoried Years Ago" name="inventory_age_years" reporter:datatype="int" field_groups="inv,dates"/>
15052              <field reporter:label="Last Inventoried Year" name="inv_date_year" reporter:datatype="int" field_groups="inv,dates"/>
15053              <field reporter:label="Last Inventoried Year and Month" name="inv_date_year_mon" reporter:datatype="text" field_groups="inv,dates"/>
15054              <field reporter:label="Last Inventoried Date" name="inv_date_date" reporter:datatype="text" field_groups="inv,dates"/>
15055              <field reporter:label="Barcode" name="barcode" reporter:datatype="text" field_groups="common"/>
15056              <field reporter:label="Item Status" name="status" reporter:datatype="text" field_groups="common"/>
15057              <field reporter:label="Shelving Location" name="location_name" reporter:datatype="text" field_groups="common"/>
15058              <field reporter:label="Circulation Modifier Code" name="circ_modifier_code" reporter:datatype="text" field_groups="common" sr:suggest_filter="true"/>
15059              <field reporter:label="Circulation Modifier Name" name="circ_modifier_name" reporter:datatype="text" sr:hide_from="filter" field_groups="common"/>
15060              <field reporter:label="Price" name="price" reporter:datatype="money" sr:suggest_transform="sum"/>
15061              <field reporter:label="Acquisition Cost" name="acq_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15062              <field reporter:label="Item Deleted?" name="copy_deleted" reporter:datatype="bool" sr:suggest_filter="true"/>
15063              <field reporter:label="Reference?" name="reference" reporter:datatype="bool"/>
15064              <field reporter:label="Item Circulate?" name="copy_circulate" reporter:datatype="bool"/>
15065              <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
15066              <field reporter:label="Item Holdable?" name="copy_holdable" reporter:datatype="bool"/>
15067              <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
15068              <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" sr:suggest_transform="sum"/>
15069              <field reporter:label="Alert Messge" name="alert_message" reporter:datatype="text"/>
15070              <field reporter:label="Item OPAC Visible?" name="copy_opac_visible" reporter:datatype="bool"/>
15071              <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
15072              <field reporter:label="Age Protection Rule" name="age_protect" reporter:datatype="text" sr:hide_from="filter"/>
15073              <field reporter:label="Under Age Protection?" name="under_age_protection" reporter:datatype="bool"/>
15074              <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
15075              <field reporter:label="Item Number" name="copy_number" reporter:datatype="int"/>
15076              <field reporter:label="Item Circ As Type" name="circ_as_type" reporter:datatype="text"/>
15077              <field reporter:label="Loan Duration (Int)" name="loan_duration_int" reporter:datatype="int"/>
15078              <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="text"/>
15079              <field reporter:label="Fine Level (Int)" name="fine_level_int" reporter:datatype="int"/>
15080              <field reporter:label="Fine Level" name="fine_level" reporter:datatype="text"/>
15081              <field reporter:label="Full Call Number" name="copy_call_number_full" reporter:datatype="text" field_groups="title,common"/>
15082              <field reporter:label="Call Number Prefix" name="copy_call_number_prefix" reporter:datatype="text" field_groups="title"/>
15083              <field reporter:label="Call Number Label" name="copy_call_number_label" reporter:datatype="text" field_groups="title,common"/>
15084              <field reporter:label="Call Number Suffix" name="copy_call_number_suffix" reporter:datatype="text" field_groups="title"/>
15085              <field reporter:label="Call Number Dewey" name="call_number_dewey" reporter:datatype="text" field_groups="title"/>
15086              <field reporter:label="Full Call Number Sortkey" name="copy_call_number_sortkey_full" reporter:datatype="text" field_groups="title"/>
15087              <field reporter:label="Call Number Prefix Sortkey" name="copy_call_number_prefix_sortkey" reporter:datatype="text"/>
15088              <field reporter:label="Call Number Label Sortkey" name="copy_call_number_label_sortkey" reporter:datatype="text"/>
15089              <field reporter:label="Call Number Suffix Sortkey" name="copy_call_number_suffix_sortkey" reporter:datatype="text"/>
15090              <field reporter:label="Call Number Dewey Block Tens" name="call_number_dewey_block_tens" reporter:datatype="text" field_groups="title,common"/>
15091              <field reporter:label="Call Number Dewey Block Hundreds" name="call_number_dewey_block_hundreds" reporter:datatype="text" field_groups="title,common"/>
15092              <field reporter:label="Call Number Dewey Range Tens" name="call_number_dewey_range_tens" reporter:datatype="text" field_groups="title"/>
15093              <field reporter:label="Call Number Dewey Range Hundreds" name="call_number_dewey_range_hundreds" reporter:datatype="text" field_groups="title"/>
15094              <field reporter:label="Title" name="title" reporter:datatype="text" field_groups="title,common"/>
15095              <field reporter:label="Author" name="author" reporter:datatype="text" field_groups="title,common"/>
15096              <field reporter:label="Publisher" name="publisher" reporter:datatype="text" field_groups="title"/>
15097              <field reporter:label="Publication Year" name="pubdate" reporter:datatype="int" field_groups="title"/>
15098              <field reporter:label="ISBN" name="isbn" reporter:datatype="text" field_groups="title"/>
15099              <field reporter:label="ISSN" name="issn" reporter:datatype="text" field_groups="title"/>
15100              <field reporter:label="Monographic Part" name="part_label" reporter:datatype="text" field_groups="item,title"/>
15101              <field reporter:label="Monographic Part Sortkey" name="part_label_sortkey" reporter:datatype="text" field_groups="item,title"/>
15102              <field reporter:label="Bibliographic Record ID" name="bib_id" reporter:datatype="int" field_groups="title,common"/>
15103              <field reporter:label="TCN" name="tcn_value" reporter:datatype="text" field_groups="title,common"/>
15104              <field reporter:label="Call Number Deleted?" name="call_deleted" reporter:datatype="bool"/>
15105              <field reporter:label="Bibliographic Record Deleted?" name="bib_deleted" reporter:datatype="bool"/>
15106              <field reporter:label="Item Status Holdable?" name="status_holdable" reporter:datatype="bool"/>
15107              <field reporter:label="Shelving Location Holdable?" name="location_holdable" reporter:datatype="bool"/>
15108              <field reporter:label="Shelving Location Circulate?" name="location_circulate" reporter:datatype="bool"/>
15109              <field reporter:label="Latest Inventory Workstation" name="inventory_workstation" reporter:datatype="text" field_groups="inv"/>
15110              <field reporter:label="Estimated Price" name="est_price" reporter:datatype="money" sr:suggest_transform="sum"/>
15111              <field reporter:label="All Subjects" name="bib_subjects" reporter:datatype="text" sr:suggest_operator="contains"/>
15112              <field reporter:label="Circulation Total" name="circ_total" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15113              <field reporter:label="Circulation Year To Date" name="circ_ytd" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15114              <field reporter:label="Circulation Last Year" name="circ_last_year" reporter:datatype="int" sr:suggest_transform="sum" sr:suggest_filter="true" field_groups="common"/>
15115              <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"/>
15116              <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"/>
15117              <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"/>
15118         </fields>
15119         <links>
15120             <link field="status_id" reltype="has_a" key="id" map="" class="ccs"/>
15121             <link sr:org_filter_field="owning_lib" field="location_id" reltype="has_a" key="id" map="" class="acpl"/>
15122             <link field="circ_modifier_code" reltype="might_have" key="code" map="" class="ccm"/>
15123             <link field="age_protect_id" reltype="might_have" key="id" map="" class="crahp"/>
15124             <link field="inv_workstation_id" reltype="might_have" key="id" map="" class="aws"/>
15125         </links>
15126     </class>
15127
15128     <class id="srbps" controller="simple-reporter.ui" oils_persist:virtual="true" reporter:label="Simple Reporter Billing and Payments Transaction Summary">
15129         <oils_persist:source_definition><![CDATA[
15130
15131             SELECT
15132               -- ids
15133               xact.id AS xact_id,
15134               COALESCE(circ.circ_lib, mg.billing_location) AS billing_lib_id,
15135               COALESCE(aoubs.id, aougbs.id) AS billing_sys_id,
15136
15137               -- OUs
15138               COALESCE(aoub.shortname, aougb.shortname) AS billing_lib_shortname,
15139               COALESCE(aoub.name, aougb.shortname) AS billing_lib_name,
15140               COALESCE(aoubs.shortname, aougbs.shortname) AS billing_sys_shortname,
15141               COALESCE(aoubs.name, aougbs.name) AS billing_sys_name,
15142
15143               -- billings
15144               billings.total_amount AS billing_grand_total,
15145               billings.total_unvoided_amount AS billing_total,
15146
15147               billings.voided_billing_count AS billing_voided_count,
15148               billings.all_billing_types AS all_billing_types,
15149               billings.billing_types AS billing_types,
15150
15151               billings.total_voided_amount AS billing_total_voided,
15152               billings.total_overdue_amount AS billing_overdue_amount,
15153               billings.total_lost_amount AS billing_lost_amount,
15154               billings.total_long_od_amount AS billing_long_od_amount,
15155               billings.total_damaged_amount AS billing_damaged_amount,
15156               billings.total_deposit_amount AS billing_deposit_amount,
15157               billings.total_rental_amount AS billing_rental_amount,
15158
15159               -- payments
15160               payments.total_amount AS payment_grand_total,
15161               payments.total_unvoided_amount AS payment_total,
15162
15163               payments.voided_payment_count AS payment_voided_count,
15164               payments.all_payment_types AS all_payment_types,
15165               payments.payment_types AS payment_types,
15166
15167               payments.total_voided_amount AS payment_total_voided,
15168               payments.total_account_adjustment AS payment_account_adjustment_amount,
15169               payments.total_cash_payment AS payment_cash_amount,
15170               payments.total_check_payment AS payment_check_amount,
15171               payments.total_credit_card_payment AS payment_credit_card_amount,
15172               payments.total_debit_card_payment AS payment_debit_card_amount,
15173               payments.total_credit_payment AS payment_credit_amount,
15174               payments.total_forgive_payment AS payment_forgive_amount,
15175               payments.total_work_payment AS payment_work_amount,
15176               payments.total_goods_payment AS payment_goods_amount,
15177               payments.total_currency_payment AS payment_currency_amount,
15178               payments.total_non_currency_payment AS payment_non_currency_amount,
15179
15180               -- dates
15181               xact.xact_start AS xact_start,
15182               CAST(TO_CHAR(xact.xact_start, 'YYYY') AS INTEGER) AS xact_start_year,
15183               TO_CHAR(xact.xact_start, 'YYYY-MM') AS xact_start_year_mon,
15184               TO_CHAR(xact.xact_start, 'YYYY-MM-DD') AS xact_start_date,
15185               xact.xact_finish AS xact_finish,
15186               CAST(TO_CHAR(xact.xact_finish, 'YYYY') AS INTEGER) AS xact_finish_year,
15187               TO_CHAR(xact.xact_finish, 'YYYY-MM') AS xact_finish_year_mon,
15188               TO_CHAR(xact.xact_finish, 'YYYY-MM-DD') AS xact_finish_date,
15189               billings.earliest_billing_ts AS earliest_billing_ts,
15190               CAST(TO_CHAR(billings.earliest_billing_ts, 'YYYY') AS INTEGER) AS earliest_billing_year,
15191               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM') AS earliest_billing_year_mon,
15192               TO_CHAR(billings.earliest_billing_ts, 'YYYY-MM-DD') AS earliest_billing_date,
15193               billings.latest_billing_ts AS latest_billing_ts,
15194               CAST(TO_CHAR(billings.latest_billing_ts, 'YYYY') AS INTEGER) AS latest_billing_year,
15195               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM') AS latest_billing_year_mon,
15196               TO_CHAR(billings.latest_billing_ts, 'YYYY-MM-DD') AS latest_billing_date,
15197               payments.earliest_payment_ts AS earliest_payment_ts,
15198               CAST(TO_CHAR(payments.earliest_payment_ts, 'YYYY') AS INTEGER) AS earliest_payment_year,
15199               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM') AS earliest_payment_year_mon,
15200               TO_CHAR(payments.earliest_payment_ts, 'YYYY-MM-DD') AS earliest_payment_date,
15201               payments.latest_payment_ts AS latest_payment_ts,
15202               CAST(TO_CHAR(payments.latest_payment_ts, 'YYYY') AS INTEGER) AS latest_payment_year,
15203               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM') AS latest_payment_year_mon,
15204               TO_CHAR(payments.latest_payment_ts, 'YYYY-MM-DD') AS latest_payment_date,
15205
15206               -- Misc
15207               CASE WHEN circ.id IS NOT NULL THEN 'circulation' WHEN mg.id IS NOT NULL THEN 'grocery' ELSE 'aged' END AS xact_type,
15208               (xact.xact_finish IS NOT NULL) AS xact_closed
15209
15210             FROM
15211               money.billable_xact xact
15212               LEFT JOIN action.circulation circ ON (xact.id = circ.id)
15213               LEFT JOIN money.grocery mg ON (xact.id = mg.id)
15214               LEFT JOIN actor.org_unit aoub ON (circ.circ_lib = aoub.id)
15215               LEFT JOIN actor.org_unit aougb ON (mg.billing_location = aougb.id)
15216               LEFT JOIN actor.org_unit aoubs ON ((actor.org_unit_ancestor_at_depth(circ.circ_lib, 1)).id = aoubs.id)
15217               LEFT JOIN actor.org_unit aougbs ON ((actor.org_unit_ancestor_at_depth(mg.billing_location, 1)).id = aougbs.id)
15218
15219               -- oohh nooo.... If not done this way you encounter situations
15220               -- like multiplying billing totals x number of payments and
15221               -- payment totals x number of billings and other fabulous fiduciary fantasies.
15222               LEFT JOIN (
15223                 SELECT
15224                   xact,
15225                   MIN(billing_ts) AS earliest_billing_ts,
15226                   MAX(billing_ts) AS latest_billing_ts,
15227
15228                   STRING_AGG(DISTINCT billing_type, ', ') AS all_billing_types,
15229                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN billing_type ELSE NULL END, ', ') AS billing_types,
15230                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_billing_count,
15231
15232                   SUM(amount) AS total_amount,
15233                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15234                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount,
15235                   SUM(CASE WHEN NOT voided AND btype = 1 THEN amount ELSE NULL END) AS total_overdue_amount,
15236                   SUM(CASE WHEN NOT voided AND btype IN (3,4) THEN amount ELSE NULL END) AS total_lost_amount,
15237                   SUM(CASE WHEN NOT voided AND btype IN (10,11) THEN amount ELSE NULL END) AS total_long_od_amount,
15238                   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.
15239                   SUM(CASE WHEN NOT voided AND btype = 5 THEN amount ELSE NULL END) AS total_deposit_amount,
15240                   SUM(CASE WHEN NOT voided AND btype = 6 THEN amount ELSE NULL END) AS total_rental_amount
15241
15242                 FROM
15243                   money.all_billings
15244                 GROUP BY 1
15245               ) billings ON (xact.id = billings.xact)
15246               -- Can't include accepting user or cash_drawer because that will "duplicate"
15247               -- rows if multiple staff accept payments on a single xact...
15248               LEFT JOIN (
15249                 SELECT
15250                   xact,
15251                   MIN(payment_ts) AS earliest_payment_ts,
15252                   MAX(payment_ts) AS latest_payment_ts,
15253
15254                   STRING_AGG(DISTINCT payment_type, ', ') AS all_payment_types,
15255                   STRING_AGG(DISTINCT CASE WHEN NOT voided THEN payment_type ELSE NULL END, ', ') AS payment_types,
15256                   COUNT(DISTINCT CASE WHEN voided THEN id ELSE NULL END) AS voided_payment_count,
15257
15258                   SUM(amount) AS total_amount,
15259                   SUM(CASE WHEN NOT voided THEN amount ELSE NULL END) AS total_unvoided_amount,
15260                   SUM(CASE WHEN voided THEN amount ELSE NULL END) AS total_voided_amount, -- almost certainly 0 in every database, but...
15261                   SUM(CASE WHEN NOT voided AND payment_type = 'account_adjustment' THEN amount ELSE NULL END) AS total_account_adjustment,
15262                   SUM(CASE WHEN NOT voided AND payment_type = 'cash_payment' THEN amount ELSE NULL END) AS total_cash_payment,
15263                   SUM(CASE WHEN NOT voided AND payment_type = 'check_payment' THEN amount ELSE NULL END) AS total_check_payment,
15264                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_card_payment' THEN amount ELSE NULL END) AS total_credit_card_payment,
15265                   SUM(CASE WHEN NOT voided AND payment_type = 'debit_card_payment' THEN amount ELSE NULL END) AS total_debit_card_payment,
15266                   SUM(CASE WHEN NOT voided AND payment_type = 'credit_payment_payment' THEN amount ELSE NULL END) AS total_credit_payment,
15267                   SUM(CASE WHEN NOT voided AND payment_type = 'forgive_payment' THEN amount ELSE NULL END) AS total_forgive_payment,
15268                   SUM(CASE WHEN NOT voided AND payment_type = 'work_payment' THEN amount ELSE NULL END) AS total_work_payment,
15269                   SUM(CASE WHEN NOT voided AND payment_type = 'goods_payment' THEN amount ELSE NULL END) AS total_goods_payment,
15270                   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,
15271                   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
15272
15273                 FROM
15274                   money.all_payments
15275                 GROUP BY 1
15276               ) payments ON (xact.id = payments.xact)
15277
15278         ]]></oils_persist:source_definition>
15279         <field_groups>
15280             <group name="common" reporter:label="Common Fields"/>
15281             <group name="bill" reporter:label="Billing Fields"/>
15282             <group name="pay" reporter:label="Payment Fields"/>
15283             <group name="dates" reporter:label="Date Fields"/>
15284             <group name="org" reporter:label="Libraries"/>
15285         </field_groups>
15286         <fields oils_persist:primary="xact_id">
15287              <field reporter:label="Transaction ID" name="xact_id" reporter:datatype="text" sr:suggest_transform="count_distinct" field_groups="common"/>
15288              <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"/>
15289              <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"/>
15290              <field reporter:label="Billing Library Short (Policy) Name" name="billing_lib_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15291              <field reporter:label="Billing Library Name" name="billing_lib_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15292              <field reporter:label="Billing System Short (Policy) Name" name="billing_sys_shortname" reporter:datatype="text" sr:hide_from="filter" field_groups="org,common"/>
15293              <field reporter:label="Billing System Name" name="billing_sys_name" reporter:datatype="text" sr:hide_from="filter" field_groups="org"/>
15294              <field reporter:label="Billing Grand Total (Includes Voids)" name="billing_grand_total" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15295              <field reporter:label="Billing Total" name="billing_total" reporter:datatype="money" sr:suggest_filter="true" field_groups="bill,common" sr:suggest_transform="sum"/>
15296              <field reporter:label="Voided Billings" name="billing_voided_count" reporter:datatype="text" field_groups="bill,common"/>
15297              <field reporter:label="Billing Types (Include Voids)" name="all_billing_types" reporter:datatype="text" field_groups="bill" sr:suggest_operator="contains"/>
15298              <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text" field_groups="bill,common" sr:suggest_operator="contains"/>
15299              <field reporter:label="Billing Amount Voided" name="billing_total_voided" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15300              <field reporter:label="Billing Total (Overdue)" name="billing_overdue_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15301              <field reporter:label="Billing Total (Lost)" name="billing_lost_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15302              <field reporter:label="Billing Total (Long Overdue)" name="billing_long_od_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15303              <field reporter:label="Billing Total (Damaged)" name="billing_damaged_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15304              <field reporter:label="Billing Total (Deposit)" name="billing_deposit_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15305              <field reporter:label="Billing Total (Rental)" name="billing_rental_amount" reporter:datatype="money" field_groups="bill" sr:suggest_transform="sum"/>
15306              <field reporter:label="Payment Grand Total (Includes Voids)" name="payment_grand_total" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15307              <field reporter:label="Payment Total" name="payment_total" reporter:datatype="money" field_groups="pay,common" sr:suggest_transform="sum"/>
15308              <field reporter:label="Voided Payments" name="payment_voided_count" reporter:datatype="text" field_groups="pay,common"/>
15309              <field reporter:label="All Payment Types (Includes Voids)" name="all_payment_types" reporter:datatype="text" field_groups="pay" sr:suggest_operator="contains"/>
15310              <field reporter:label="Payment Types" name="payment_types" reporter:datatype="text" field_groups="pay,common" sr:suggest_operator="contains"/>
15311              <field reporter:label="Payment Amount Voided" name="payment_total_voided" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15312              <field reporter:label="Payment Total (Account Adjustment)" name="payment_account_adjustment_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15313              <field reporter:label="Payment Total (Cash)" name="payment_cash_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15314              <field reporter:label="Payment Total (Check)" name="payment_check_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15315              <field reporter:label="Payment Total (Credit Card)" name="payment_credit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15316              <field reporter:label="Payment Total (Debit Card)" name="payment_debit_card_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15317              <field reporter:label="Payment Total (Patron Credit)" name="payment_credit_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15318              <field reporter:label="Payment Total (Forgiven)" name="payment_forgive_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15319              <field reporter:label="Payment Total (Work)" name="payment_work_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15320              <field reporter:label="Payment Total (Goods)" name="payment_goods_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15321              <field reporter:label="Payment Total (Currency)" name="payment_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15322              <field reporter:label="Paymnt Total (Non-Currency)" name="payment_non_currency_amount" reporter:datatype="money" field_groups="pay" sr:suggest_transform="sum"/>
15323              <field reporter:label="Transaction Start Date / Time" name="xact_start" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="dates,common"/>
15324              <field reporter:label="Transaction Start Year" name="xact_start_year" reporter:datatype="int" field_groups="dates"/>
15325              <field reporter:label="Transaction Start Year and Month" name="xact_start_year_mon" reporter:datatype="text" field_groups="dates,common"/>
15326              <field reporter:label="Transaction Start Date" name="xact_start_date" reporter:datatype="text" field_groups="dates"/>
15327              <field reporter:label="Transaction Finish Date / Time" name="xact_finish" reporter:datatype="timestamp" field_groups="dates"/>
15328              <field reporter:label="Transaction Finish Year" name="xact_finish_year" reporter:datatype="int" field_groups="dates"/>
15329              <field reporter:label="Transaction Finish Year and Month" name="xact_finish_year_mon" reporter:datatype="text" field_groups="dates"/>
15330              <field reporter:label="Transaction Finish Date" name="xact_finish_date" reporter:datatype="text" field_groups="dates"/>
15331              <field reporter:label="First Billing Date / Time" name="earliest_billing_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="bill,dates,common"/>
15332              <field reporter:label="First Billing Year" name="earliest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15333              <field reporter:label="First Billing Year and Month" name="earliest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15334              <field reporter:label="First Billing Date" name="earliest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15335              <field reporter:label="Last Billing Date / Time" name="latest_billing_ts" reporter:datatype="timestamp" field_groups="bill,dates,common"/>
15336              <field reporter:label="Last Billing Year" name="latest_billing_year" reporter:datatype="int" field_groups="bill,dates"/>
15337              <field reporter:label="Last Billing Year and Month" name="latest_billing_year_mon" reporter:datatype="text" field_groups="bill,dates"/>
15338              <field reporter:label="Last Billing Date" name="latest_billing_date" reporter:datatype="text" field_groups="bill,dates"/>
15339              <field reporter:label="First Payment Date / Time" name="earliest_payment_ts" reporter:datatype="timestamp" sr:suggest_filter="true" field_groups="pay,dates,common"/>
15340              <field reporter:label="First Payment Year" name="earliest_payment_year" reporter:datatype="int" field_groups="dates"/>
15341              <field reporter:label="First Payment Year and Month" name="earliest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15342              <field reporter:label="First Payment Date" name="earliest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15343              <field reporter:label="Last Payment Date / Time" name="latest_payment_ts" reporter:datatype="timestamp" field_groups="pay,dates,common"/>
15344              <field reporter:label="Last Payment Year" name="latest_payment_year" reporter:datatype="int" field_groups="pay,dates"/>
15345              <field reporter:label="Last Payment Year and Month" name="latest_payment_year_mon" reporter:datatype="text" field_groups="pay,dates,common"/>
15346              <field reporter:label="Last Payment Date" name="latest_payment_date" reporter:datatype="text" field_groups="pay,dates"/>
15347              <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text" sr:suggest_filter="true" field_groups="common"/>
15348              <field reporter:label="Transaction Closed?" name="xact_closed" sr:suggest_filter="true" reporter:datatype="bool"/>
15349         </fields>
15350     </class>
15351
15352         <!-- ********************************************************************************************************************* -->
15353 </IDL>
15354
15355 <!--
15356     vim:noet:ts=4:sw=4:
15357 -->