]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1177794 - remove "Keep" field from Vandelay Import Item Attributes.
[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: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                 </fields>
98                 <links>
99                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
100                 </links>
101         </class>
102
103         <class id="brn" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_node" oils_persist:virtual="true" reporter:label="Record Node">
104                 <fields>
105                         <field name="id" oils_persist:virtual="true" />
106                         <field name="children" oils_persist:virtual="true" />
107                         <field name="owner_doc" oils_persist:virtual="true" />
108                         <field name="intra_doc_id" oils_persist:virtual="true" />
109                         <field name="parent_node" oils_persist:virtual="true" />
110                         <field name="node_type" oils_persist:virtual="true" />
111                         <field name="namespace_uri" oils_persist:virtual="true" />
112                         <field name="name" oils_persist:virtual="true" />
113                         <field name="value" oils_persist:virtual="true" />
114                 </fields>
115         </class>
116
117         <class id="mvr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::virtual_record" oils_persist:virtual="true" reporter:label="Virtual Record">
118                 <fields>
119                         <field name="title" oils_persist:virtual="true" />
120                         <field name="author" oils_persist:virtual="true" />
121                         <field name="doc_id" oils_persist:virtual="true" />
122                         <field name="doc_type" oils_persist:virtual="true" />
123                         <field name="pubdate" oils_persist:virtual="true" />
124                         <field name="isbn" oils_persist:virtual="true" />
125                         <field name="publisher" oils_persist:virtual="true" />
126                         <field name="tcn" oils_persist:virtual="true" />
127                         <field name="subject" oils_persist:virtual="true" />
128                         <field name="types_of_resource" oils_persist:virtual="true" />
129                         <field name="call_numbers" oils_persist:virtual="true" />
130                         <field name="edition" oils_persist:virtual="true" />
131                         <field name="online_loc" oils_persist:virtual="true" />
132                         <field name="synopsis" oils_persist:virtual="true" />
133                         <field name="physical_description" oils_persist:virtual="true" />
134                         <field name="toc" oils_persist:virtual="true" />
135                         <field name="copy_count" oils_persist:virtual="true" />
136                         <field name="series" oils_persist:virtual="true" />
137                         <field name="serials" oils_persist:virtual="true" />
138                         <field name="foreign_copy_maps" oils_persist:virtual="true" />
139                 </fields>
140         </class>
141
142         <class id="ex" controller="open-ils.cstore" oils_obj:fieldmapper="ex" oils_persist:virtual="true">
143                 <fields>
144                         <field name="err_msg" oils_persist:virtual="true" />
145                         <field name="type" oils_persist:virtual="true" />
146                 </fields>
147         </class>
148
149         <class id="perm_ex" controller="open-ils.cstore" oils_obj:fieldmapper="perm_ex" oils_persist:virtual="true">
150                 <fields>
151                         <field name="err_msg" oils_persist:virtual="true" />
152                         <field name="type" oils_persist:virtual="true" />
153                 </fields>
154         </class>
155
156         <class id="amtr" controller="open-ils.cstore" oils_obj:fieldmapper="action::matrix_test_result" oils_persist:virtual="true" reporter:label="Matrix Test Result">
157                 <fields oils_persist:primary="matchpoint">
158                         <field reporter:label="Matchpoint ID" name="matchpoint" reporter:datatype="id"/>
159                         <field reporter:label="Success" name="success" reporter:datatype="bool"/>
160                         <field reporter:label="Failure Part" name="fail_part" reporter:datatype="text"/>
161                 </fields>
162                 <links>
163                         <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
164                 </links>
165         </class>
166
167         <class id="accs" controller="open-ils.cstore" oils_obj:fieldmapper="action::circ_chain_summary" oils_persist:virtual="true" reporter:label="Circulation Chain Summary">
168         <!-- when the time is right, turn me into a view.  -->
169                 <fields>
170             <field reporter:label="Total Circs" name="num_circs" reporter:datatype="int"/>
171             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
172             <field reporter:label="Checkout Workstation" name="checkout_workstation" reporter:datatype="text"/>
173             <field reporter:label="Last Renewal Time" name="last_renewal_time" reporter:datatype="timestamp"/>
174             <field reporter:label="Last Stop Fines" name="last_stop_fines" reporter:datatype="text"/>
175             <field reporter:label="Last Stop Fines Time" name="last_stop_fines_time" reporter:datatype="timestamp"/>
176             <field reporter:label="Last Renewal Workstation" name="last_renewal_workstation" reporter:datatype="text"/>
177             <field reporter:label="Last Checkin Workstation" name="last_checkin_workstation" reporter:datatype="text"/>
178             <field reporter:label="Last Checkin Time" name="last_checkin_time" reporter:datatype="timestamp"/>
179             <field reporter:label="Last Checkin Scan Time" name="last_checkin_scan_time" reporter:datatype="timestamp"/>
180                 </fields>
181         </class>
182
183         <class id="rhr" oils_obj:fieldmapper="resolver::holdings_record" oils_persist:virtual="true">
184                 <fields>
185                         <field name="public_name" oils_persist:virtual="true" />
186                         <field name="target_url" oils_persist:virtual="true" />
187                         <field name="target_coverage" oils_persist:virtual="true" />
188                         <field name="target_embargo" oils_persist:virtual="true" />
189                 </fields>
190         </class>
191
192         <!-- Actually in the DB -->
193         <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">
194                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.merge_profile_id_seq">
195                         <field reporter:label="Field ID" name="id" reporter:selector="name" reporter:datatype="id"/>
196                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
197                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
198                         <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
199                         <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
200                         <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
201                         <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
202                         <field reporter:label="Min. Quality Ratio" name="lwm_ratio" reporter:datatype="float"/>
203                         <field reporter:label="Update Bib. Source" name="update_bib_source" reporter:datatype="bool"/>
204                 </fields>
205                 <links>
206                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
207                 </links>
208                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
209                         <actions>
210                                 <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
211                                 <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE VIEW_MERGE_PROFILE" context_field="owner"/>
212                                 <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
213                                 <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
214                         </actions>
215                 </permacrud>
216         </class>
217
218         <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">
219                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
220                         <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
221                         <field reporter:label="Group" name="grp" reporter:datatype="link"/>
222                         <field reporter:label="Field" name="field" reporter:datatype="text"/>
223                 </fields>
224                 <links>
225                         <link field="grp" reltype="has_a" key="id" map="" class="vibtg"/>
226                 </links>
227                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
228                         <actions>
229                                 <create permission="CREATE_IMPORT_TRASH_FIELD">
230                     <context link="grp" field="owner"/>
231                 </create>
232                                 <retrieve/>
233                                 <update permission="UPDATE_IMPORT_TRASH_FIELD">
234                     <context link="grp" field="owner"/>
235                 </update>
236                                 <delete permission="DELETE_IMPORT_TRASH_FIELD">
237                     <context link="grp" field="owner"/>
238                 </delete>
239                         </actions>
240                 </permacrud>
241         </class>
242
243         <class  id="rrbs" 
244             controller="open-ils.cstore open-ils.pcrud" 
245             oils_obj:fieldmapper="rating::record_badge_score" 
246             oils_persist:tablename="rating.record_badge_score" 
247             reporter:label="Statistical Popularity Badge">
248                 <fields oils_persist:primary="id" 
249                 oils_persist:sequence="rating.record_badge_score_id_seq">
250                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
251                         <field reporter:label="Badge" name="badge" reporter:datatype="link"/>
252                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
253                         <field reporter:label="Score" name="score" reporter:datatype="int"/>
254                 </fields>
255         <links>
256             <link field="badge" reltype="has_a" key="id" map="" class="rb"/>
257             <link field="record" reltype="has_a" key="id" map="" class="bre"/>
258         </links>
259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
260                         <actions>
261                                 <retrieve/>
262                         </actions>
263                 </permacrud>
264         </class>
265
266         <class  id="rp" 
267             controller="open-ils.cstore open-ils.pcrud" 
268             oils_obj:fieldmapper="rating::popularity_parameter" 
269             oils_persist:tablename="rating.popularity_parameter" 
270             reporter:label="Statistical Popularity Parameter">
271                 <fields oils_persist:primary="id" 
272                 oils_persist:sequence="rating.popularity_parameter_id_seq">
273                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
274                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
275                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
276                         <field reporter:label="Population Function" name="func" reporter:datatype="text"/>
277                         <field reporter:label="Require Horizon" name="require_horizon" reporter:datatype="bool"/>
278                         <field reporter:label="Require Percentile" name="require_percentile" reporter:datatype="bool"/>
279                         <field reporter:label="Require Importance" name="require_importance" reporter:datatype="bool"/>
280                 </fields>
281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
282                         <actions>
283                                 <create permission="CREATE_POP_PARAMETER" global_required="true"/>
284                                 <retrieve/>
285                                 <update permission="UPDATE_POP_PARAMETER" global_required="true"/>
286                                 <delete permission="DELETE_POP_PARAMETER" global_required="true"/>
287                         </actions>
288                 </permacrud>
289         </class>
290
291         <class  id="rb" 
292             controller="open-ils.cstore open-ils.pcrud" 
293             oils_obj:fieldmapper="rating::badge" 
294             oils_persist:tablename="rating.badge" 
295             reporter:label="Statistical Popularity Badge">
296                 <fields oils_persist:primary="id" 
297                 oils_persist:sequence="rating.badge_id_seq">
298                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
299                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
300                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
301                         <field reporter:label="Scope" name="scope" reporter:datatype="org_unit"/>
302                         <field reporter:label="Weight" name="weight" reporter:datatype="int"/>
303                         <field reporter:label="Age Horizon" name="horizon_age" reporter:datatype="text"/>
304                         <field reporter:label="Importance Horizon" name="importance_age" reporter:datatype="text"/>
305                         <field reporter:label="Importance Interval" name="importance_interval" reporter:datatype="text"/>
306                         <field reporter:label="Importance Scale" name="importance_scale" reporter:datatype="text"/>
307                         <field reporter:label="Percentile" name="percentile" reporter:datatype="float"/>
308                         <field reporter:label="Attribute Filter" name="attr_filter" reporter:datatype="text"/>
309                         <field reporter:label="Circ Mod Filter" name="circ_mod_filter" reporter:datatype="link"/>
310                         <field reporter:label="Bib Source Filter" name="src_filter" reporter:datatype="link"/>
311                         <field reporter:label="Location Group Filter" name="loc_grp_filter" reporter:datatype="link"/>
312                         <field reporter:label="Recalculation Interval" name="recalc_interval" reporter:datatype="text"/>
313                         <field reporter:label="Fixed Rating" name="fixed_rating" reporter:datatype="int"/>
314                         <field reporter:label="Discard Value Count" name="discard" reporter:datatype="int"/>
315                         <field reporter:label="Last Refresh Time" name="last_calc" reporter:datatype="timestamp"/>
316                         <field reporter:label="Popularity Parameter" name="popularity_parameter" reporter:datatype="link"/>
317                 </fields>
318                 <links>
319                         <link field="scope" reltype="has_a" key="id" map="" class="aou"/>
320                         <link field="popularity_parameter" reltype="has_a" key="id" map="" class="rp"/>
321                         <link field="src_filter" reltype="has_a" key="id" map="" class="cbs"/>
322                         <link field="circ_mod_filter" reltype="has_a" key="code" map="" class="ccm"/>
323                         <link field="loc_grp_filter" reltype="has_a" key="id" map="" class="acplg"/>
324                 </links>
325                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
326                         <actions>
327                                 <create permission="CREATE_POP_BADGE" global_required="true"/>
328                                 <retrieve/>
329                                 <update permission="UPDATE_POP_BADGE" global_required="true"/>
330                                 <delete permission="DELETE_POP_BADGE" global_required="true"/>
331                         </actions>
332                 </permacrud>
333         </class>
334
335         <class  id="vibtg" 
336             controller="open-ils.cstore open-ils.pcrud" 
337             oils_obj:fieldmapper="vandelay::import_bib_trash_group" 
338             oils_persist:tablename="vandelay.import_bib_trash_group" 
339             reporter:label="Import/Overlay Field Groups for Removal">
340                 <fields oils_persist:primary="id" 
341                 oils_persist:sequence="vandelay.import_bib_trash_group_id_seq">
342                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
343                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
344                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
345                         <field reporter:label="Always Apply" name="always_apply" reporter:datatype="bool"/>
346                 </fields>
347                 <links>
348                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
349                 </links>
350                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
351                         <actions>
352                                 <create permission="CREATE_IMPORT_TRASH_FIELD" context_field="owner"/>
353                                 <retrieve/>
354                                 <update permission="UPDATE_IMPORT_TRASH_FIELD" context_field="owner"/>
355                                 <delete permission="DELETE_IMPORT_TRASH_FIELD" context_field="owner"/>
356                         </actions>
357                 </permacrud>
358         </class>
359
360
361         <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">
362                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_id_seq">
363                         <field reporter:label="Import Item ID" name="id" reporter:datatype="id"/>
364                         <field reporter:label="Import Record" name="record" reporter:datatype="link"/>
365                         <field reporter:label="Attribute Definition" name="definition" reporter:datatype="link"/>
366                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
367                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
368                         <field reporter:label="Final Target Copy" name="imported_as" reporter:datatype="link"/>
369                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
370                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="int"/>
371                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="int"/>
372                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
373                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="int"/>
374                         <field reporter:label="Status" name="status" reporter:datatype="int"/>
375                         <field reporter:label="Shelving Location" name="location" reporter:datatype="int"/>
376                         <field reporter:label="Circulate" name="circulate" reporter:datatype="bool"/>
377                         <field reporter:label="Deposit" name="deposit" reporter:datatype="bool"/>
378                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
379                         <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
380                         <field reporter:label="Holdable" name="holdable" reporter:datatype="bool"/>
381                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
382                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
383                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
384                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
385                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
386                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
387                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
388                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
389                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="int"/>
390                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
391                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
392                 </fields>
393                 <links>
394                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
395                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
396                         <link field="definition" reltype="has_a" key="id" map="" class="viiad"/>
397                         <link field="imported_as" reltype="has_a" key="id" map="" class="acp"/>
398                 </links>
399                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
400                         <actions>
401                                 <create permission="CREATE_IMPORT_ITEM">
402                     <context link="definition" field="owner"/>
403                                 </create>
404                                 <retrieve permission="CREATE_IMPORT_ITEM UPDATE_IMPORT_ITEM DELETE_IMPORT_ITEM">
405                     <context link="definition" field="owner"/>
406                                 </retrieve>
407                                 <update permission="UPDATE_IMPORT_ITEM">
408                     <context link="definition" field="owner"/>
409                                 </update>
410                                 <delete permission="DELETE_IMPORT_ITEM">
411                     <context link="definition" field="owner"/>
412                                 </delete>
413                         </actions>
414                 </permacrud>
415         </class>
416
417         <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">
418                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_item_attr_definition_id_seq">
419                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
420                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
421                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
422                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
423                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
424                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
425                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
426                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
427                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
428                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
429                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
430                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
431                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
432                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
433                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
434                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
435                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
436                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
437                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
438                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
439                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
440                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
441                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
442                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
443                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
444                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
445                 </fields>
446                 <links>
447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
448                 </links>
449                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
450                         <actions>
451                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
452                                 <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"/>
453                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
454                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                         </actions>
456                 </permacrud>
457         </class>
458
459         <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">
460                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
461                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
462                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
463                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
464                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
465                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
466                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
467                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
468                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
469                 </fields>
470                 <links>
471                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
472                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
473                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
474                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
475                 </links>
476                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
477                         <actions>
478                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
479                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
482                         </actions>
483                 </permacrud>
484         </class>
485
486         <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">
487                 <fields oils_persist:primary="code">
488                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
489                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
490                 </fields>
491                 <links>
492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
493                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
494                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
495                 </links>
496                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
497                         <actions>
498                                 <retrieve/>
499                         </actions>
500                 </permacrud>
501         </class>
502
503         <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">
504                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
505                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
506                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
507                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
509                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
510                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
511                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
512                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
513                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
514                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
515                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
516                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
519                 </fields>
520                 <links>
521                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
522                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
523                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
524                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
525             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
526             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
527             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
528                 </links>
529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
530                         <actions>
531                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
532                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
535                         </actions>
536                 </permacrud>
537         </class>
538
539         <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">
540                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
541                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
542                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
543                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
544                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
545                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
546                 </fields>
547                 <links/>
548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
549                         <actions>
550                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
551                 <retrieve/>
552                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
553                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                         </actions>
555                 </permacrud>
556         </class>
557
558         <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">
559                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
560                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
561                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
562                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
563                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
564                 </fields>
565                 <links>
566                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
567                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
568                 </links>
569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
570                         <actions>
571                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
572                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
575                         </actions>
576                 </permacrud>
577         </class>
578
579         <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">
580                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
581                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
582                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
583                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
584                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
585                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
586                 </fields>
587                 <links>
588                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
589                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
590                 </links>
591                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
592                         <actions>
593                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
594                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
597                         </actions>
598                 </permacrud>
599         </class>
600
601         <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">
602                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
603                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
604                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
605                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
606                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
607                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
608                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
609                 </fields>
610                 <links>
611                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
612                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
613                 </links>
614                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
615                         <actions>
616                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
617                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                         </actions>
621                 </permacrud>
622         </class>
623
624         <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">
625                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
626                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
627                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
628                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
630                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
631                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
632                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
633                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
634                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
635                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
636                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
638                 </fields>
639                 <links>
640                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
641                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
642                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
643             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
644             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
645                 </links>
646                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
647                         <actions>
648                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
649                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                         </actions>
653                 </permacrud>
654         </class>
655
656         <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">
657                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
658                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
659                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
660                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
661                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
662                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
663                 </fields>
664                 <links/>
665                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
666                         <actions>
667                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
668                 <retrieve/>
669                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
670                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                         </actions>
672                 </permacrud>
673         </class>
674
675         <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">
676                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
677                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
678                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
679                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
680                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
681                 </fields>
682                 <links>
683                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
684                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
685                 </links>
686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
687                         <actions>
688                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
689                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                         </actions>
693                 </permacrud>
694         </class>
695
696         <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">
697                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
698                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
699                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
700                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
701                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
702                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
703                 </fields>
704                 <links>
705                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
706                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
707                 </links>
708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
709                         <actions>
710                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
711                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                         </actions>
715                 </permacrud>
716         </class>
717
718         <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">
719                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
720                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
721                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
722                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
723                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
724                 </fields>
725                 <links>
726                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
727                 </links>
728                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
729                         <actions>
730                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
731                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                         </actions>
735                 </permacrud>
736         </class>
737
738         <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">
739                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
740                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
741                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
742                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
743                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
744                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
745                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
746                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
747             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
748                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
749                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
750                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
751                 </fields>
752                 <links>
753                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
754                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
755                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
756                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
757                 </links>
758                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
759                         <actions>
760                                 <create permission="ADMIN_IMPORT_MATCH_SET">
761                     <context link="match_set" field="owner"/>
762                                 </create>
763                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
764                     <context link="match_set" field="owner"/>
765                                 </retrieve>
766                                 <update permission="ADMIN_IMPORT_MATCH_SET">
767                     <context link="match_set" field="owner"/>
768                                 </update>
769                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
770                     <context link="match_set" field="owner"/>
771                                 </delete>
772                         </actions>
773                 </permacrud>
774         </class>
775
776         <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">
777                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
778                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
779                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
780                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
781                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
782                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
783                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
784                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
785                 </fields>
786                 <links>
787                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
788                 </links>
789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
790                         <actions>
791                                 <create permission="ADMIN_IMPORT_MATCH_SET">
792                     <context link="match_set" field="owner"/>
793                                 </create>
794                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
795                     <context link="match_set" field="owner"/>
796                                 </retrieve>
797                                 <update permission="ADMIN_IMPORT_MATCH_SET">
798                     <context link="match_set" field="owner"/>
799                                 </update>
800                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
801                     <context link="match_set" field="owner"/>
802                                 </delete>
803                         </actions>
804                 </permacrud>
805         </class>
806
807         <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">
808                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
809                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
810                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
811                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
812                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
813                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
814                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
815                 </fields>
816                 <links>
817                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
818                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
819                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
820                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
821                 </links>
822         </class>
823
824     <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">
825         <fields oils_persist:primary="name">
826             <field reporter:label="Name" name="name" reporter:datatype="text"/>
827             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
828             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
829             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
830         </fields>
831         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
832             <actions>
833                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
834                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
835                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
836                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
837             </actions>
838         </permacrud>
839     </class>
840
841     <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">
842         <fields oils_persist:primary="id">
843             <field reporter:label="ID" name="id" reporter:datatype="id"/>
844             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
845             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
846             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
847             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
848         </fields>
849         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
850             <actions>
851                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
852                 <retrieve/>
853                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
854                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
855             </actions>
856         </permacrud>
857     </class>
858
859         <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">
860                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
861                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
862                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
863                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
864                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
865                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
866                 </fields>
867                 <links>
868                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
869                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
870                 </links>
871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
872             <actions>
873                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
874                 <retrieve/>
875                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
876                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
877             </actions>
878         </permacrud>
879         </class>
880
881         <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">
882                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
883                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
884                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
885                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
886         </fields>
887         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
888             <actions>
889                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
890                 <retrieve/>
891                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
892                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
893             </actions>
894         </permacrud>
895         </class>
896
897         <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">
898                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
899                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
900                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
901                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
902                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
903                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
904                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
905                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
906                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
907                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
908                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
909                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
910         </fields>
911                 <links>
912                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
913                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
914         </links>
915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
916             <actions>
917                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
918                 <retrieve/>
919                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
920                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
921             </actions>
922         </permacrud>
923         </class>
924
925         <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:subfield_safe="true">
926                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
927                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
928                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
929                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
930                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
931                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
932                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
933                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
934                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
935                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
936                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
937         </fields>
938                 <links>
939                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
940                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
941         </links>
942         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
943             <actions>
944                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
945                 <retrieve/>
946                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
947                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
948             </actions>
949         </permacrud>
950         </class>
951
952         <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">
953                 <fields oils_persist:primary="name">
954                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
955                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
956                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
957                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
958                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
959                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
960                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
961                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
962                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
963                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
964                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
965                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
966                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
967                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
968                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
969                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
970                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
971                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
972                 </fields>
973                 <links>
974                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
975                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
976                 </links>
977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
978             <actions>
979                 <create permission="ADMIN_SVF" global_required="true"/>
980                 <retrieve/>
981                 <update permission="ADMIN_SVF" global_required="true"/>
982                 <delete permission="ADMIN_SVF" global_required="true"/>
983             </actions>
984         </permacrud>
985         </class>
986
987         <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">
988                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
989                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
990                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
991                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
992             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
993                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
994                 </fields>
995                 <links/>
996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
997             <actions>
998                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
999                 <retrieve/>
1000                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1001                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1002             </actions>
1003         </permacrud>
1004         </class>
1005
1006         <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">
1007                 <fields oils_persist:primary="coded_value">
1008                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1009                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1010                 </fields>
1011                 <links>
1012                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1013                 </links>
1014         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1015             <actions>
1016                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1017                 <retrieve/>
1018                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1019                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1020             </actions>
1021         </permacrud>
1022         </class>
1023
1024         <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">
1025                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1026                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1027                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1028                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1029                 </fields>
1030                 <links>
1031                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1032                 </links>
1033         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1034             <actions>
1035                 <retrieve/>
1036             </actions>
1037         </permacrud>
1038         </class>
1039
1040
1041         <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">
1042                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1043                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1044                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1045                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1046                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1047                 </fields>
1048                 <links>
1049                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1050                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1051                 </links>
1052         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1053             <actions>
1054                 <retrieve/>
1055             </actions>
1056         </permacrud>
1057         </class>
1058
1059
1060         <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">
1061                 <fields oils_persist:primary="source">
1062                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1063                         <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 -->
1064                 </fields>
1065                 <links>
1066                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1067                 </links>
1068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1069             <actions>
1070                 <retrieve/>
1071             </actions>
1072         </permacrud>
1073         </class>
1074
1075         <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">
1076                 <fields>
1077                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1078                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1079                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <retrieve/>
1087             </actions>
1088         </permacrud>
1089         </class>
1090
1091         <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">
1092                 <fields oils_persist:primary="id">
1093                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1094                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1095                 </fields>
1096                 <links>
1097                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1098                 </links>
1099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1100             <actions>
1101                 <retrieve/>
1102             </actions>
1103         </permacrud>
1104         </class>
1105
1106         <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">
1107                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1108                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1109                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1110                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1111                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1112                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1113                 </fields>
1114                 <links>
1115                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1116                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1117                 </links>
1118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1119             <actions>
1120                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1121                 <retrieve/>
1122                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1123                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1124             </actions>
1125         </permacrud>
1126         </class>
1127
1128         <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">
1129                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1130                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1131                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1132                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1133                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1134                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1135                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1136                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1137             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1138             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1139             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1140                 </fields>
1141                 <links>
1142                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1143                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1144                 </links>
1145         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1146             <actions>
1147                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1148                 <retrieve/>
1149                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1150                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1151             </actions>
1152         </permacrud>
1153         </class>
1154
1155         <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">
1156                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1157                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1158                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1159                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1160                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1161                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1162                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1163                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1164                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1165                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1166                 </fields>
1167                 <links>
1168                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1169                 </links>
1170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1171             <actions>
1172                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1173                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1174                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1175                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1176             </actions>
1177         </permacrud>
1178         </class>
1179
1180     <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">
1181         <fields oils_persist:primary="name">
1182             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1183             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1184             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1185             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1186             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1187             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1188             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1189             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1190             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1191             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1192         </fields>
1193         <links>
1194             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1195             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1196         </links>
1197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1198             <actions>
1199                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1200                 <retrieve/>
1201                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1202                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1203             </actions>
1204         </permacrud>
1205     </class>
1206
1207     <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">
1208         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1209             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1210             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1211             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1212             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1213             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1214             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1215             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1216         </fields>
1217         <links>
1218             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1219         </links>
1220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1221             <actions>
1222                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1223                 <retrieve/>
1224                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1225                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1226             </actions>
1227         </permacrud>
1228     </class>
1229
1230     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1231                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1232                         oils_persist:tablename="config.z3950_index_field_map" 
1233                         reporter:label="Z39.50 Index Field Map">
1234         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1235             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1236             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1237             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1238             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1239             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1240             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1241         </fields>
1242         <links>
1243             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1244             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1245             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1246         </links>
1247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1248             <actions>
1249                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1250                 <retrieve/>
1251                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1252                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1253             </actions>
1254         </permacrud>
1255     </class>
1256
1257
1258         <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">
1259                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1260                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1261                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1262                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1263                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1264                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1265                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1266                 </fields>
1267                 <links>
1268             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1269             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1270                 </links>
1271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1272                         <actions>
1273                                 <retrieve/>
1274                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1275                         </actions>
1276                 </permacrud>
1277         </class>
1278
1279         <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">
1280                 <fields oils_persist:primary="key">
1281                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1282                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1283                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1284                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1285                 </fields>
1286                 <links/>
1287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1288                         <actions>
1289                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1290                                 <retrieve/>
1291                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1292                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1293                         </actions>
1294                 </permacrud>
1295         </class>
1296
1297         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1298                 <fields oils_persist:primary="module">
1299                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1300                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1301                 </fields>
1302                 <links/>
1303         </class>
1304
1305         <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">
1306                 <fields oils_persist:primary="module">
1307                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1308                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1309                 </fields>
1310                 <links/>
1311                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1312                         <actions>
1313                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1314                                 <retrieve/>
1315                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1316                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1317                         </actions>
1318                 </permacrud>
1319         </class>
1320
1321         <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">
1322                 <fields oils_persist:primary="module">
1323                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1325                 </fields>
1326                 <links/>
1327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1328                         <actions>
1329                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1330                                 <retrieve/>
1331                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1332                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1333                         </actions>
1334                 </permacrud>
1335         </class>
1336
1337         <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">
1338                 <fields oils_persist:primary="module">
1339                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1340                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1341                 </fields>
1342                 <links/>
1343                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1344                         <actions>
1345                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1346                                 <retrieve/>
1347                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1348                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1349                         </actions>
1350                 </permacrud>
1351         </class>
1352
1353         <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">
1354                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1355                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1356                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1357                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1358                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1359                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1360                 </fields>
1361                 <links>
1362                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1363                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1364                 </links>
1365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1366                         <actions>
1367                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1368                     <context link="event_def" field="owner"/>
1369                 </create>
1370                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1371                     <context link="event_def" field="owner"/>
1372                 </retrieve>
1373                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1374                     <context link="event_def" field="owner"/>
1375                 </update>
1376                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1377                     <context link="event_def" field="owner"/>
1378                 </delete>
1379                         </actions>
1380                 </permacrud>
1381         </class>
1382
1383         <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">
1384                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1385                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1386                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1387                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1388                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1389                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1390                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1391                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1392                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1393                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1394                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1395                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1396                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1397                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1398                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1399                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1400                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1401                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1402                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1403                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1404                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1405                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1406                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1407                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1408                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1409                 </fields>
1410                 <links>
1411                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1412                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1413                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1414                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1415                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1416                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1417                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1418                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1419                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1420                 </links>
1421                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1422                         <actions>
1423                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1424                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1425                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1426                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1427                         </actions>
1428                 </permacrud>
1429         </class>
1430
1431         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1432                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1433                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1434                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1435                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1436                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1437                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1438                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1439                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1440                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1441                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1442                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1443                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1444                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1445                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1446                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1447                 </fields>
1448                 <links>
1449                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1450                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1451                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1452                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1453                 </links>
1454         </class>
1455
1456         <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">
1457                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1458                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1459                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1460                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1461                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1462                 </fields>
1463                 <links>
1464                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1465                 </links>
1466                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1467                         <actions>
1468                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1469                     <context link="event_def" field="owner"/>
1470                 </create>
1471                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1472                     <context link="event_def" field="owner"/>
1473                 </retrieve>
1474                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1475                     <context link="event_def" field="owner"/>
1476                 </update>
1477                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1478                     <context link="event_def" field="owner"/>
1479                 </delete>
1480                         </actions>
1481                 </permacrud>
1482         </class>
1483
1484         <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">
1485                 <oils_persist:source_definition><![CDATA[
1486                 SELECT  atevdef.hook,
1487                         atevdef.name,
1488                         atevdef.reactor,
1489                         atev.id,
1490                         atev.event_def,
1491                         atev.add_time,
1492                         atev.run_time,
1493                         atev.start_time,
1494                         atev.update_time,
1495                         atev.complete_time,
1496                         atev.update_process,
1497                         atev.state,
1498                         atev.user_data,
1499                         atev.template_output,
1500                         atev.error_output,
1501                         atev.async_output,
1502                         targ_circ.id AS target_circ,
1503                         targ_ahr.id AS target_hold,
1504                         COALESCE(
1505                                 targ_circ.circ_lib,
1506                                 targ_ahr.pickup_lib
1507                         ) AS perm_lib
1508                 FROM action_trigger.event atev
1509                 JOIN action_trigger.event_definition atevdef ON
1510                         (atevdef.id = atev.event_def)
1511                 JOIN action_trigger.hook ath ON
1512                         (ath.key = atevdef.hook)
1513                 LEFT JOIN action.circulation targ_circ ON
1514                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1515                 LEFT JOIN action.hold_request targ_ahr ON
1516                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1517                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1518                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1519                                 'circ.staff.max_visible_event_age',
1520                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1521                         ) UNION
1522                         SELECT '1000 YEARS'::INTERVAL AS value
1523                 ) ous)
1524                 ]]></oils_persist:source_definition>
1525                 <fields oils_persist:primary="id">
1526                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1527                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1528                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1529                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1530                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1531                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1532                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1533                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1534                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1535                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1536                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1537                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1538                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1539                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1540                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1541                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1542                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1543                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1544                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1545                 </fields>
1546                 <links>
1547                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1548                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1549                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1550                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1551                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1552                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1553                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1554                 </links>
1555                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1556                         <actions>
1557                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1558                         </actions>
1559                 </permacrud>
1560         </class>
1561
1562         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1563                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1564                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1565                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1566                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1567                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1568                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1569                 </fields>
1570                 <links>
1571                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1572                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1573                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1574                 </links>
1575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1576                         <actions>
1577                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1578                         </actions>
1579                 </permacrud>
1580         </class>
1581
1582         <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">
1583                 <fields oils_persist:primary="code">
1584                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1585                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1586                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1587                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1588                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1589                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1590                 </fields>
1591                 <links/>
1592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1593             <actions>
1594                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1595                 <retrieve/>
1596                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1597                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1598             </actions>
1599         </permacrud>
1600         </class>
1601
1602         <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">
1603                 <fields oils_persist:primary="code">
1604                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1605                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1606                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1607                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1608                 </fields>
1609                 <links/>
1610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1611             <actions>
1612                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1613                 <retrieve/>
1614                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1615                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1616             </actions>
1617         </permacrud>
1618         </class>
1619
1620         <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">
1621                 <fields oils_persist:primary="code">
1622                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1623                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1624                 </fields>
1625                 <links/>
1626         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1627             <actions>
1628                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1629                 <retrieve/>
1630                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1631                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1632             </actions>
1633         </permacrud>
1634         </class>
1635
1636         <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">
1637                 <fields oils_persist:primary="code">
1638                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1639                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1640                 </fields>
1641                 <links/>
1642         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1643             <actions>
1644                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1645                 <retrieve/>
1646                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1647                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1648             </actions>
1649         </permacrud>
1650         </class>
1651
1652         <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">
1653                 <fields oils_persist:primary="code">
1654                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1655                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1656                 </fields>
1657                 <links/>
1658         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1659             <actions>
1660                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1661                 <retrieve/>
1662                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1663                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1664             </actions>
1665         </permacrud>
1666         </class>
1667
1668         <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">
1669                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1670                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1671                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1672                 </fields>
1673                 <links/>
1674         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1675             <actions>
1676                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1677                 <retrieve/>
1678                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1679                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1680             </actions>
1681         </permacrud>
1682         </class>
1683
1684         <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">
1685                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1686                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1687                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1688                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1689                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1690                 </fields>
1691         <links>
1692             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1693             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1694             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1695         </links>
1696         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1697             <actions>
1698                 <create permission="UPDATE_COPY">
1699                     <context link="target_copy" field="circ_lib"/>
1700                 </create>
1701                 <retrieve/>
1702                 <update permission="UPDATE_COPY">
1703                     <context link="target_copy" field="circ_lib"/>
1704                 </update>
1705                 <delete permission="UPDATE_COPY">
1706                     <context link="target_copy" field="circ_lib"/>
1707                 </delete>
1708             </actions>
1709         </permacrud>
1710         </class>
1711
1712         <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">
1713                 <fields oils_persist:primary="code">
1714                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1715                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1716                 </fields>
1717                 <links/>
1718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1719             <actions>
1720                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1721                 <retrieve/>
1722                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1723                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1724             </actions>
1725         </permacrud>
1726         </class>
1727
1728         <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">
1729                 <fields oils_persist:primary="code">
1730                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1731                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1732                 </fields>
1733                 <links/>
1734         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1735             <actions>
1736                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1737                 <retrieve/>
1738                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1739                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1740             </actions>
1741         </permacrud>
1742         </class>
1743
1744         <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">
1745                 <fields oils_persist:primary="code">
1746                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1747                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1748                 </fields>
1749                 <links/>
1750         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1751             <actions>
1752                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1753                 <retrieve/>
1754                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1755                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1756             </actions>
1757         </permacrud>
1758         </class>
1759
1760     <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">
1761         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1762             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1763             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1764             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1765             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1766             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1767             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1768             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1769             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1770             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1771             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1772             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1773             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1774             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1775             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1776             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1777             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1778             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1779         </fields>
1780         <links/>
1781         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1782             <actions>
1783                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1784                 <retrieve/>
1785                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1786                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1787             </actions>
1788         </permacrud>
1789     </class>
1790
1791     <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">
1792         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1793             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1794             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1795             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1796             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1797             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1798             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1799             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1800             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1801             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1802             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1803             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1804             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1805             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1806             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1807             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1808             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1809             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1810             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1811             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1812         </fields>
1813         <links/>
1814         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1815             <actions>
1816                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1817                 <retrieve/>
1818                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1819                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1820             </actions>
1821         </permacrud>
1822     </class>
1823
1824     <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">
1825         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1826             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1827             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1828             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1829             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1830             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1831         </fields>
1832         <links>
1833             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1834             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1835             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1836         </links>
1837         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1838             <actions>
1839                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1840                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1841                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1842                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1843             </actions>
1844         </permacrud>
1845     </class>
1846
1847         <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">
1848                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1849                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1850                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1851                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1852                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1853                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1854                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1855                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1856                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1857                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1858                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1859                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1860                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1861                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1862                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1863                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1864                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1865             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1866                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1867                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1868                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1869                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1870                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1871                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1872                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1873                 </fields>
1874                 <links>
1875                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1876                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1878                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1879                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1880                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1881                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1882                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1883                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1884                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1885                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1886                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1887                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1888             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1889                 </links>
1890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1891             <actions>
1892                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1893                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1894                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1895                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1896             </actions>
1897         </permacrud>
1898         </class>
1899
1900         <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">
1901                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1902                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1903                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1904                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1905                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1906                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1907                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1908                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1909                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1910                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1911                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1912                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1913                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1914                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1915                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1916                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1917             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1918                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1919                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1920             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1921                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1922                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1923                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1924                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1925             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1926             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1927             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1928                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1929                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1930                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1931                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1932                 </fields>
1933                 <links>
1934                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1935                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1936                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1937                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1938                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1939                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1940                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1941                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1942                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1943                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1944                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1945                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1946                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1947                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1948             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1949                 </links>
1950         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1951             <actions>
1952                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1953                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1954                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1955                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1956             </actions>
1957         </permacrud>
1958         </class>
1959
1960     <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">
1961         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1962             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1963             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1964             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1965         </fields>
1966         <links/>
1967         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1968             <actions>
1969                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1970                 <retrieve/>
1971                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1972                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1973             </actions>
1974         </permacrud>
1975     </class>
1976
1977     <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">
1978         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1979             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1980             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1981             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1982             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1983             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1984             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1985             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1986         </fields>
1987         <links>
1988             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1989         </links>
1990         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1991             <actions>
1992                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1993                 <retrieve/>
1994                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1995                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1996             </actions>
1997         </permacrud>
1998     </class>
1999
2000     <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">
2001         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2002             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2003             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2004             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2005             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2006             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2007         </fields>
2008         <links>
2009             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2010             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2011         </links>
2012         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2013             <actions>
2014                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2015                     <context link="matchpoint" field="org_unit"/>
2016                 </create>
2017                 <retrieve/>
2018                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2019                     <context link="matchpoint" field="org_unit"/>
2020                 </update>
2021                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2022                     <context link="matchpoint" field="org_unit"/>
2023                 </delete>
2024             </actions>
2025         </permacrud>
2026     </class>
2027
2028     <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">
2029         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2030             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2031             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2032             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2033         </fields>
2034         <links>
2035             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2036             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2037         </links>
2038         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2039             <actions>
2040                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2041                     <context link="limit_set" field="owning_lib"/>
2042                 </create>
2043                 <retrieve/>
2044                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2045                     <context link="limit_set" field="owning_lib"/>
2046                 </update>
2047                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2048                     <context link="limit_set" field="owning_lib"/>
2049                 </delete>
2050             </actions>
2051         </permacrud>
2052     </class>
2053     <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">
2054         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2055             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2056             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2057             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2058         </fields>
2059         <links>
2060             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2061             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2062         </links>
2063         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2064             <actions>
2065                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2066                     <context link="limit_set" field="owning_lib"/>
2067                 </create>
2068                 <retrieve/>
2069                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2070                     <context link="limit_set" field="owning_lib"/>
2071                 </update>
2072                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2073                     <context link="limit_set" field="owning_lib"/>
2074                 </delete>
2075             </actions>
2076         </permacrud>
2077     </class>
2078
2079     <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">
2080         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2081             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2082             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2083             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2084             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2085         </fields>
2086         <links>
2087             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2088             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2089         </links>
2090         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2091             <actions>
2092                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2093                     <context link="limit_set" field="owning_lib"/>
2094                 </create>
2095                 <retrieve/>
2096                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2097                     <context link="limit_set" field="owning_lib"/>
2098                 </update>
2099                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2100                     <context link="limit_set" field="owning_lib"/>
2101                 </delete>
2102             </actions>
2103         </permacrud>
2104     </class>
2105
2106         <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">
2107                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2108                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2109                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2110                 </fields>
2111                 <links/>
2112         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2113             <actions>
2114                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2115                 <retrieve/>
2116                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2117                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2118             </actions>
2119         </permacrud>
2120         </class>
2121
2122         <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">
2123                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2124                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2125                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2126                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2127                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2128                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2129                 </fields>
2130                 <links>
2131                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2132                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2133                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2134                 </links>
2135         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2136             <actions>
2137                 <create permission="ADMIN_SURVEY">
2138                     <context link="survey" field="owner"/>
2139                 </create>
2140                 <retrieve/>
2141                 <update permission="ADMIN_SURVEY">
2142                     <context link="survey" field="owner"/>
2143                 </update>
2144                 <delete permission="ADMIN_SURVEY">
2145                     <context link="survey" field="owner"/>
2146                 </delete>
2147             </actions>
2148         </permacrud>
2149         </class>
2150         <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">
2151                 <fields oils_persist:primary="id" oils_persist:sequence="">
2152                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2153                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2154                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2155                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2156                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2157                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2158                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2159                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2160                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2161                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2162                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2163                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2164                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2165                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2166                 </fields>
2167                 <links>
2168                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2169                 </links>
2170                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2171                         <actions>
2172                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2173                                         <context link="usr" field="home_ou" />
2174                                 </retrieve>
2175                         </actions>
2176                 </permacrud>
2177         </class>
2178         <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">
2179                 <fields oils_persist:primary="id" oils_persist:sequence="">
2180                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2181                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2182                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2183                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2184                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2185                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2186                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2187                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2188                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2189                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2190                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2191                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2192                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2193                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2194                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2195                 </fields>
2196                 <links>
2197                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2198                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2199                 </links>
2200         </class>
2201         <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">
2202                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2203                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2204                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2205                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2206                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2207                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2208                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2209                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2210                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2211                 </fields>
2212                 <links>
2213                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2214                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2215                 </links>
2216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2217                         <actions> <!-- created magically, so no create action -->
2218                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2219                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2220                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2221                         </actions>
2222                 </permacrud>
2223         </class>
2224         <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)">
2225                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2226                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2227                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2228                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2229                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2230                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2231                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2232                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2233                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2234                 </fields>
2235                 <links>
2236                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2237                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2238                 </links>
2239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2240                         <actions> <!-- created magically, so no create action -->
2241                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2242                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2243                         </actions>
2244                 </permacrud>
2245         </class>
2246         <class id="aun" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
2247                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2248                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2249                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2250                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2251                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2252                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2253                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2254                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2255                 </fields>
2256                 <links>
2257                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2258                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2259                 </links>
2260         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2261             <actions>
2262                 <create permission="UPDATE_USER" context_field="owner">
2263                     <context link="usr" field="home_ou"/>
2264                 </create>
2265                                 <!-- note: public notes are still accessible via API -->
2266                 <retrieve permission="UPDATE_USER">
2267                     <context link="usr" field="home_ou"/>
2268                                 </retrieve>
2269                 <update permission="UPDATE_USER">
2270                     <context link="usr" field="home_ou"/>
2271                                 </update>
2272                 <delete permission="UPDATE_USER">
2273                     <context link="usr" field="home_ou"/>
2274                                 </delete>
2275             </actions>
2276         </permacrud>
2277         </class>
2278         <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">
2279                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2280                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2281                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2282                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2283                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2284                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2285                 </fields>
2286                 <links>
2287                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2288                 </links>
2289         </class>
2290         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2291                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2292                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2293                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2294                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2295                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2296                 </fields>
2297                 <links>
2298                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2299                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2300                 </links>
2301         </class>
2302         <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">
2303                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2304                         <field name="field" reporter:datatype="link"/>
2305                         <field name="id" reporter:datatype="id" />
2306                         <field name="source" reporter:datatype="link"/>
2307                         <field name="value" reporter:datatype="text"/>
2308                 </fields>
2309                 <links>
2310                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2311                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2312                 </links>
2313         </class>
2314         <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">
2315                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2316                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2317                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2318                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2319                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2320                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2321                 </fields>
2322                 <links>
2323                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2324                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2325                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2326                 </links>
2327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2328                         <actions>
2329                                 <retrieve/>
2330                         </actions>
2331                 </permacrud>
2332         </class>
2333         <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">
2334                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2335                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2336                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2337                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2338                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2339                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2340                 </fields>
2341                 <links>
2342                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2343                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2344                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2345                 </links>
2346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2347                         <actions>
2348                                 <retrieve/>
2349                         </actions>
2350                 </permacrud>
2351         </class>
2352         <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">
2353                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2354                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2355                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2356                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2357                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2358                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2359                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2360                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2361                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2362                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2363                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2364                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2365                 </fields>
2366                 <links>
2367                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2368                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2369                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2370                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2371                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2372                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2373                 </links>
2374         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2375             <actions>
2376                 <create permission="TRANSIT_COPY" context_field="owner">
2377                     <context link="target_copy" field="circ_lib"/>
2378                 </create>
2379                 <retrieve/>
2380                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2381                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2382             </actions>
2383         </permacrud>
2384         </class>
2385         <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">
2386                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2387                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2388                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2389                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2390                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2391                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2392                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2393                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2394                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2395                 </fields>
2396                 <links>
2397                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2398                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2399                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2400                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2401                 </links>
2402         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2403             <actions>
2404                 <create permission="ADMIN_SURVEY">
2405                     <context link="survey" field="owner"/>
2406                 </create>
2407                 <retrieve permission="VIEW_USER">
2408                     <context link="usr" field="home_ou"/>
2409                 </retrieve>
2410                 <update permission="ADMIN_SURVEY">
2411                     <context link="survey" field="owner"/>
2412                 </update>
2413                 <delete permission="ADMIN_SURVEY">
2414                     <context link="survey" field="owner"/>
2415                 </delete>
2416             </actions>
2417         </permacrud>
2418         </class>
2419         <class id="ccbi" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2420                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2421                         <field name="bucket" />
2422                         <field name="id" reporter:datatype="id" />
2423                         <field name="target_copy" reporter:datatype="link"/>
2424                         <field name="create_time" reporter:datatype="timestamp" />
2425                         <field name="pos" reporter:datatype="int" />
2426                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2427                 </fields>
2428                 <links>
2429                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2430                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2431             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2432                 </links>
2433         </class>
2434         <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">
2435                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2436                         <field name="id" reporter:datatype="id" />
2437                         <field name="item" reporter:datatype="link"/>
2438                         <field name="note" reporter:datatype="text" />
2439                 </fields>
2440                 <links>
2441                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2442                 </links>
2443         </class>
2444
2445         <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">
2446                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2447                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2448                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2449                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2450                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2451                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2452                 </fields>
2453                 <links>
2454                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2455                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2456                 </links>
2457                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2458                         <actions>
2459                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2460                                 <retrieve/>
2461                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2462                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2463                         </actions>
2464                 </permacrud>
2465         </class>
2466
2467         <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">
2468                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2469                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2470                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2471                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2472                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2473                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2474                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2475                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2476                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2477                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2478                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2479                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2480                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2481                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2482                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2483                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2484                 </fields>
2485                 <links>
2486                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2487                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2488                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2489                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2490                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2491                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2492                 </links>
2493                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2494                         <actions>
2495                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2496                                 <retrieve/>
2497                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2498                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2499                         </actions>
2500                 </permacrud>
2501         </class>
2502
2503         <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">
2504                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2505                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2506                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2507                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2508                 </fields>
2509                 <links>
2510                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2511                 </links>
2512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2513                         <actions>
2514                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2515                                 <retrieve/>
2516                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2517                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2518                         </actions>
2519                 </permacrud>
2520         </class>
2521
2522         <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">
2523                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2524                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2525                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2526                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2527                 </fields>
2528                 <links>
2529                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2530                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2531                 </links>
2532                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2533                         <actions>
2534                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2535                                 <retrieve/>
2536                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2537                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2538                         </actions>
2539                 </permacrud>
2540         </class>
2541
2542         <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">
2543                 <fields oils_persist:primary="code">
2544                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2545                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2546                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2547                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2548                 </fields>
2549                 <links>
2550                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2551                 </links>
2552                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2553                         <actions>
2554                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2555                                 <retrieve/>
2556                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2557                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2558                         </actions>
2559                 </permacrud>
2560         </class>
2561
2562         <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">
2563                 <fields oils_persist:primary="code">
2564                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2565                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2566                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2567                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2568                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2569                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2570                 </fields>
2571                 <links>
2572                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2573                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2574                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2575                 </links>
2576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2577                         <actions>
2578                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2579                                 <retrieve/>
2580                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2581                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2582                         </actions>
2583                 </permacrud>
2584         </class>
2585
2586     <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">
2587         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2588             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2589             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2590             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2591         </fields>
2592         <links>
2593             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2594             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2595         </links>
2596         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2597             <actions>
2598                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2599                 <retrieve/>
2600                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2601                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2602             </actions>
2603         </permacrud>
2604     </class>
2605
2606         <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">
2607                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2608                         <field name="active" reporter:datatype="bool"/>
2609                         <field name="create_date" reporter:datatype="timestamp"/>
2610                         <field name="creator" />
2611                         <field name="deleted" reporter:datatype="bool"/>
2612                         <field name="edit_date" reporter:datatype="timestamp"/>
2613                         <field name="editor" />
2614                         <field name="id" reporter:datatype="id" />
2615                         <field name="last_xact_id" />
2616                         <field name="marc" />
2617                         <field name="source" />
2618                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2619                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2620                         <field name="heading" />
2621                         <field name="simple_heading" />
2622                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2623                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2624                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2625                 </fields>
2626                 <links>
2627                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2628                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2629                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2630                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2631                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2632                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2633                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2634                 </links>
2635                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2636                         <actions>
2637                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2638                                 <retrieve/>
2639                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2640                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2641                         </actions>
2642                 </permacrud>
2643         </class>
2644         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2645                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2646                         <field name="char_encoding" />
2647                         <field name="id" />
2648                         <field name="record" />
2649                         <field name="record_status" />
2650                         <field name="thesaurus" />
2651                 </fields>
2652                 <links>
2653                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2654                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2655                 </links>
2656         </class>
2657         <class id="abl" controller="open-ils.cstore" oils_obj:fieldmapper="authority::bib_linking" oils_persist:tablename="authority.bib_linking" reporter:label="Authority-Bibliographic Record Link">
2658                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2659                         <field name="id" reporter:datatype="id" />
2660                         <field name="bib" reporter:datatype="link" />
2661                         <field name="authority" reporter:datatype="link" />
2662                 </fields>
2663                 <links>
2664                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2665                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2666                 </links>
2667         </class>
2668         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2669                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2670                         <field name="id" reporter:datatype="id" />
2671                         <field name="record" reporter:datatype="link" />
2672                         <field name="atag" reporter:datatype="link" />
2673                         <field name="value" reporter:datatype="text" />
2674                 </fields>
2675                 <links>
2676                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2677                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2678                 </links>
2679         </class>
2680         <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">
2681                 <fields oils_persist:primary="code" oils_persist:sequence="">
2682                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2683                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2684                 </fields>
2685                 <links/>
2686         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2687             <actions>
2688                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2689                 <retrieve/>
2690                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2691                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2692             </actions>
2693         </permacrud>
2694         </class>
2695         <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">
2696                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2697                         <field name="accepting_usr" />
2698                         <field name="amount" reporter:datatype="money" />
2699                         <field name="amount_collected" reporter:datatype="money" />
2700                         <field name="approval_code" reporter:datatype="text"/>
2701                         <field name="cash_drawer" reporter:datatype="link"/>
2702                         <field name="cc_number" reporter:datatype="text"/>
2703                         <field name="cc_order_number" reporter:datatype="text"/>
2704                         <field name="cc_processor" reporter:datatype="text"/>
2705                         <field name="id" reporter:datatype="id" />
2706                         <field name="note" reporter:datatype="text"/>
2707                         <field name="payment_ts" reporter:datatype="timestamp"/>
2708                         <field name="xact" reporter:datatype="link"/>
2709                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2710                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2711                 </fields>
2712                 <links>
2713                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2714                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2715                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2716                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2717                 </links>
2718         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2719             <actions>
2720                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2721                     <context link="xact" jump="usr" field="home_ou"/>
2722                 </retrieve>
2723                         </actions>
2724                 </permacrud>
2725         </class>
2726         <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">
2727                 <fields oils_persist:primary="name">
2728                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2729                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2730                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2731                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2732                 </fields>
2733                 <links/>
2734         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2735             <actions>
2736                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2737                 <retrieve/>
2738                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2739                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2740             </actions>
2741         </permacrud>
2742         </class>
2743
2744         <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">
2745                 <fields oils_persist:primary="alias">
2746                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2747                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2748                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2749                 </fields>
2750                 <links>
2751                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2752                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2753                 </links>
2754         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2755             <actions>
2756                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2757                 <retrieve/>
2758                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2759                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2760             </actions>
2761         </permacrud>
2762         </class>
2763
2764         <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">
2765                 <fields oils_persist:primary="name">
2766                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2767                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2768                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2769                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2770                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2771                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2772                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2773                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2774                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2775                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2776                 </fields>
2777                 <links>
2778                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2779                 </links>
2780         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2781             <actions>
2782                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2783                 <retrieve/>
2784                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2785                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2786             </actions>
2787         </permacrud>
2788         </class>
2789
2790         <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">
2791                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2792                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2793                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2794                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2795                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2796                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2797                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2798                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2799                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2800                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2801                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2802                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2803                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2804                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2805                 </fields>
2806                 <links>
2807                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2808                 </links>
2809         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2810             <actions>
2811                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2812                 <retrieve/>
2813                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2814                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2815             </actions>
2816         </permacrud>
2817         </class>
2818         <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">
2819                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2820                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2821                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2822                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2823                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2824                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2825                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2826                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2827                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2828                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2829                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2830                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2831                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2832                 </fields>
2833                 <links>
2834                 </links>
2835                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2836                         <actions>
2837                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2838                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2839                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2840                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2841                         </actions>
2842                 </permacrud>
2843         </class>
2844         <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">
2845                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2846                         <field name="id" reporter:datatype="id" />
2847                         <field name="name" reporter:datatype="text"/>
2848                         <field name="xpath" reporter:datatype="text"/>
2849                         <field name="format" reporter:datatype="link"/>
2850                         <field name="first_word" reporter:datatype="bool" />
2851                 </fields>
2852                 <links/>
2853         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2854             <actions>
2855                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2856                 <retrieve/>
2857                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2858                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2859             </actions>
2860         </permacrud>
2861         </class>
2862         <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">
2863                 <fields oils_persist:primary="code" oils_persist:sequence="">
2864                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2865                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2866                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2867                 </fields>
2868                 <links/>
2869         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2870             <actions>
2871                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2872                 <retrieve/>
2873                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2874                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2875             </actions>
2876         </permacrud>
2877         </class>
2878         <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">
2879                 <fields oils_persist:primary="code" oils_persist:sequence="">
2880                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2881                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2882                 </fields>
2883                 <links/>
2884         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2885             <actions>
2886                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2887                 <retrieve/>
2888                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2889                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2890             </actions>
2891         </permacrud>
2892         </class>
2893     <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">
2894         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2895             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2896             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2897             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2898             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2899         </fields>
2900         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2901             <actions>
2902                 <retrieve/>
2903             </actions>
2904         </permacrud>
2905     </class>
2906         <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">
2907                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2908                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2909                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2910                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2911                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2912                 </fields>
2913                 <links>
2914                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2915                 </links>
2916         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2917             <actions>
2918                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2919                 <retrieve/>
2920                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2921                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2922             </actions>
2923         </permacrud>
2924         </class>
2925         <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">
2926                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2927                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2928                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2929                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2930                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2931                 </fields>
2932                 <links>
2933                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2934                 </links>
2935         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2936             <actions>
2937                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2938                 <retrieve/>
2939                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2940                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2941             </actions>
2942         </permacrud>
2943         </class>
2944         <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">
2945                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2946                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2947                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2948                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2949                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2950                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2951                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2952                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2953                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2954                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2955                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2956                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2957                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2958                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2959                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2960                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2961                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2962                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2963                 </fields>
2964                 <links>
2965                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2966                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2967                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2968                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2969                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2970                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2971                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2972                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2973                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2974                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2975                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2976                 </links>
2977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2978             <actions>
2979                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2980                 <retrieve/>
2981                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2982                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2983             </actions>
2984         </permacrud>
2985         </class>
2986         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2987                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2988                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2989                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2990                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2991                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2992                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2993                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2994                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2995                 </fields>
2996                 <links>
2997                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2998                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2999         </links>
3000         </class>
3001         <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">
3002                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3003                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3004                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3005                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3006                 </fields>
3007                 <links>
3008                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3009                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3010                 </links>
3011         </class>
3012         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3013                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3014                         <field name="id" reporter:datatype="id" />
3015                         <field name="value" oils_persist:i18n="true" />
3016                 </fields>
3017                 <links/>
3018         </class>
3019         <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">
3020                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3021                         <field name="balance_owed" reporter:datatype="money" />
3022                         <field name="total_owed" reporter:datatype="money" />
3023                         <field name="total_paid" reporter:datatype="money" />
3024                         <field name="usr" reporter:datatype="link"/>
3025                 </fields>
3026                 <links>
3027                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3028         </links>
3029         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3030             <actions>
3031                 <retrieve permission="VIEW_USER">
3032                     <context link="usr" field="home_ou"/>
3033                 </retrieve>
3034             </actions>
3035         </permacrud>
3036         </class>
3037         <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">
3038                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3039                         <field name="collector" />
3040                         <field name="enter_time" reporter:datatype="timestamp"/>
3041                         <field name="id" reporter:datatype="id" />
3042                         <field name="location" reporter:datatype="link"/>
3043                         <field name="usr" reporter:datatype="link"/>
3044                 </fields>
3045                 <links>
3046                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3047                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3048                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3049                 </links>
3050         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3051             <actions>
3052                 <create permission="money.collections_tracker.create" context_field="location"/>
3053                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3054                 <delete permission="money.collections_tracker.create" context_field="location"/>
3055             </actions>
3056         </permacrud>
3057         </class>
3058         <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">
3059                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3060                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3061                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3062                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3063                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3064                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3065                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3066                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3067                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3068                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3069                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3070                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3071                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3072                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3073                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3074                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3075                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3076                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3077                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3078                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3079                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3080                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3081                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3082                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3083                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3084                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3085                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3086                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3087                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3088                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3089                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3090                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3092                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3093                 </fields>
3094                 <links>
3095                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3096                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3097                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3098                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3099                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3100                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3101                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3102                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3103                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3104                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3105                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3106                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3107                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3108                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3109                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3110                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3111                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3112                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3113                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3114                         <link field="mattrs" reltype="might_have" key="id" map="" class="mraf"/>
3115                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3116                 </links>
3117         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3118             <actions>
3119                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3120                 <retrieve/>
3121                 <update permission="UPDATE_MARC" global_required="true"/>
3122                 <!-- 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. -->
3123                 <delete permission="DELETE_RECORD" global_required="true"/>
3124             </actions>
3125         </permacrud>
3126         </class>
3127         <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">
3128                 <fields oils_persist:primary="id">
3129                         <field name="dow_0_close" />
3130                         <field name="dow_0_open" />
3131                         <field name="dow_1_close" />
3132                         <field name="dow_1_open" />
3133                         <field name="dow_2_close" />
3134                         <field name="dow_2_open" />
3135                         <field name="dow_3_close" />
3136                         <field name="dow_3_open" />
3137                         <field name="dow_4_close" />
3138                         <field name="dow_4_open" />
3139                         <field name="dow_5_close" />
3140                         <field name="dow_5_open" />
3141                         <field name="dow_6_close" />
3142                         <field name="dow_6_open" />
3143                         <field name="id" reporter:datatype="id" />
3144                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3145                 </fields>
3146                 <links>
3147                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3148                 </links>
3149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3150             <actions>
3151                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3152                 <retrieve/>
3153                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3154                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3155             </actions>
3156         </permacrud>
3157         </class>
3158         <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">
3159                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3160                         <field name="id" reporter:datatype="id" />
3161                         <field name="record" reporter:datatype="link"/>
3162                         <field name="label" reporter:datatype="text"/>
3163                         <field name="label_sortkey" reporter:datatype="text"/>
3164                         <field name="deleted" reporter:datatype="bool"/>
3165                 </fields>
3166                 <links>
3167                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3168                 </links>
3169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3170             <actions>
3171                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3172                 <retrieve/>
3173                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3174                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3175             </actions>
3176         </permacrud>
3177         </class>
3178         <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">
3179                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3180                         <field name="id" reporter:datatype="id" />
3181                         <field name="target_copy" reporter:datatype="link" />
3182                         <field name="part" reporter:datatype="link"/>
3183                 </fields>
3184                 <links>
3185                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3186                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3187                 </links>
3188         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3189             <actions>
3190                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3191                 <retrieve/>
3192                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3193                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3194             </actions>
3195         </permacrud>
3196         </class>
3197         <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">
3198                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3199                         <field name="close_end" reporter:datatype="timestamp" />
3200                         <field name="close_start" reporter:datatype="timestamp" />
3201                         <field name="id" reporter:datatype="id" />
3202                         <field name="org_unit" reporter:datatype="org_unit"/>
3203                         <field name="reason" reporter:datatype="text"/>
3204                 </fields>
3205                 <links>
3206                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3207                 </links>
3208         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3209             <actions>
3210                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3211                 <retrieve/>
3212                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3213                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3214             </actions>
3215         </permacrud>
3216         </class>
3217         <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">
3218                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3219                         <field name="extended" reporter:datatype="interval"/>
3220                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3221                         <field name="max_renewals" reporter:datatype="int" />
3222                         <field name="name" reporter:datatype="text"/>
3223                         <field name="normal" reporter:datatype="interval"/>
3224                         <field name="shrt" reporter:datatype="interval"/>
3225                 </fields>
3226                 <links>
3227                 </links>
3228         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3229             <actions>
3230                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3231                 <retrieve/>
3232                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3233                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3234             </actions>
3235         </permacrud>
3236         </class>
3237
3238         <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">
3239                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3240                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3241                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3242             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3243                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3244             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3245                 </fields>
3246                 <links>
3247             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3248                 </links>
3249                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3250             <actions>
3251                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3252                 <retrieve/>
3253                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3254                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3255             </actions>
3256                 </permacrud>
3257         </class>
3258
3259         <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">
3260                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3261                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3262                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3263                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3264             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3265                 </fields>
3266                 <links>
3267                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3268                 </links>
3269                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3270             <actions>
3271                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3272                 <retrieve/>
3273                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3274                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3275             </actions>
3276                 </permacrud>
3277         </class>
3278
3279         <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">
3280                 <fields oils_persist:primary="id" oils_persist:sequence="">
3281                         <field name="balance_owed" reporter:datatype="money"/>
3282                         <field name="id" reporter:datatype="id" />
3283                         <field name="last_billing_note" reporter:datatype="text"/>
3284                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3285                         <field name="last_billing_type" reporter:datatype="text"/>
3286                         <field name="last_payment_note" reporter:datatype="text"/>
3287                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3288                         <field name="last_payment_type" reporter:datatype="text"/>
3289                         <field name="total_owed" reporter:datatype="money"/>
3290                         <field name="total_paid" reporter:datatype="money"/>
3291                         <field name="usr" reporter:datatype="link"/>
3292                         <field name="xact_finish" reporter:datatype="timestamp" />
3293                         <field name="xact_start" reporter:datatype="timestamp" />
3294                         <field name="xact_type" reporter:datatype="text"/>
3295                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3296                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3297                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3298                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3299                         <field name="billing_location" reporter:datatype="link"/>
3300                 </fields>
3301                 <links>
3302                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3303                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3304                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3305                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3306                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3307                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3308                 </links>
3309                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3310                         <actions>
3311                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3312                                         <context link="usr" field="home_ou" />
3313                                 </retrieve>
3314                         </actions>
3315                 </permacrud>
3316         </class>
3317         <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">
3318                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3319                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3320                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3321                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3322                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3323                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3324                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3325                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3326                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3327                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3328                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3329                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3330                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3331                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3332                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3333                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3334                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3335                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3336                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3337                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3338                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3339                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3340                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3341                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3342                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3343                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3344                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3345                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3346                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3347                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3348                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3349                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3350                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3351                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3352                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3353                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3354                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3355                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3356                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3357                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3358                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3359                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3360                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3361                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3362                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3363                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3364                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3365                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3366                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3367                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3368                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3369                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3370                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3371                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3372                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3373                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3374                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3375                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3376                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3377                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3378                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3379                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3380                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3381                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3382                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
3383                 </fields>
3384                 <links>
3385                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3386                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3387                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3388                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3389                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3390                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3391                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3392                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3393                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3394                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3395                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3396                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3397                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3398                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3399                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3400                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3401                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3402                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3403                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3404                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3405                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3406                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3407                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3408                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3409                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3410                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3411                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3412                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3413                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3414                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3415                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
3416                 </links>
3417                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3418                         <actions>
3419                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3420                         </actions>
3421                 </permacrud>
3422         </class>
3423         <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">
3424                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3425                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3426                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3427                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3428                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3429                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3430                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3431                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3432                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3433         </fields>
3434                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3435                         <actions>
3436                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3437                                 <retrieve/>
3438                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3439                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3440                         </actions>
3441                 </permacrud>
3442         </class>
3443         <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">
3444                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3445                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3446                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3447                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3448                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3449         </fields>
3450         <links>
3451                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3452                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3453                 </links>
3454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3455                         <actions>
3456                                 <retrieve permission="RUN_REPORTS">
3457                                         <context link="usr" field="home_ou" />
3458                                 </retrieve>
3459                         </actions>
3460                 </permacrud>
3461         </class>
3462         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3463                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3464                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3465                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3466                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3467                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3468                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3469                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3470         </fields>
3471         <links>
3472                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3473                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3474                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3475                 </links>
3476                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3477                         <actions>
3478                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3479                                         <context link="usr" field="home_ou" />
3480                                         <context link="ws" field="owning_lib" />
3481                                 </retrieve>
3482                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3483                                         <context link="usr" field="home_ou" />
3484                                         <context link="ws" field="owning_lib" />
3485                                 </create>
3486                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3487                                         <context link="usr" field="home_ou" />
3488                                         <context link="ws" field="owning_lib" />
3489                                 </update>
3490                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3491                                         <context link="usr" field="home_ou" />
3492                                         <context link="ws" field="owning_lib" />
3493                                 </delete>
3494                         </actions>
3495                 </permacrud>
3496         </class>
3497         <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">
3498                 <fields oils_persist:primary="name">
3499                         <field name="name" reporter:datatype="text"/>
3500                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3501                 </fields>
3502                 <links/>
3503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3504                         <actions>
3505                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3506                                 <retrieve/>
3507                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3508                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3509                         </actions>
3510                 </permacrud>
3511         </class>
3512         <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">
3513                 <fields oils_persist:primary="name">
3514                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3515                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3516                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3517                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3518                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3519                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3520                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3521                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3522                 </fields>
3523                 <links>
3524                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3525                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3526                 </links>
3527                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3528                         <actions>
3529                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3530                                 <retrieve/>
3531                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3532                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3533                         </actions>
3534                 </permacrud>
3535         </class>
3536         <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">
3537                 <fields oils_persist:primary="name">
3538                         <field name="name" reporter:datatype="text"/>
3539                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3540                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3541                         <field name="datatype" reporter:datatype="text"/>
3542                         <field name="view_perm" reporter:datatype="link"/>
3543                         <field name="update_perm" reporter:datatype="link"/>
3544                         <field name="fm_class" reporter:datatype="text"/>
3545                         <field name="grp" reporter:datatype="link"/>
3546                 </fields>
3547                 <links>
3548                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3549                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3550                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3551                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3552                 </links>
3553                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3554                         <actions>
3555                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3556                                 <retrieve/>
3557                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3558                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3559                         </actions>
3560                 </permacrud>
3561         </class>
3562         <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">
3563                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3564                         <field name="id" />
3565                         <field name="name"  reporter:datatype="text"/>
3566                         <field name="org_unit" reporter:datatype="org_unit"/>
3567                         <field name="value"  reporter:datatype="text"/>
3568                 </fields>
3569                 <links>
3570                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3571                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3572                 </links>
3573         </class>
3574         <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">
3575                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3576                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3577                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3578                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3579                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3580                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3581                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3582                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3583                 </fields>
3584                 <links>
3585                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3586                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3587                 </links>
3588         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3589             <actions>
3590                 <create permission="CREATE_COPY_NOTE">
3591                     <context link="owning_copy" field="circ_lib"/>
3592                 </create>
3593                 <retrieve permission="VIEW_COPY_NOTES">
3594                     <context link="owning_copy" field="circ_lib"/>
3595                 </retrieve>
3596                 <update permission="UPDATE_COPY_NOTE">
3597                     <context link="owning_copy" field="circ_lib"/>
3598                 </update>
3599                 <delete permission="DELETE_COPY_NOTE">
3600                     <context link="owning_copy" field="circ_lib"/>
3601                 </delete>
3602             </actions>
3603         </permacrud>
3604         </class>
3605         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3606                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3607                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3608                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3609                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3610                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3611                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3612                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3613                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3614                 </fields>
3615                 <links>
3616                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3617                 </links>
3618         </class>
3619         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3620                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3621                         <field name="fingerprint"  reporter:datatype="text"/>
3622                         <field name="id" reporter:datatype="id" />
3623                         <field name="master_record" reporter:datatype="link"/>
3624                         <field name="mods"  reporter:datatype="text"/>
3625                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3626                 </fields>
3627                 <links>
3628                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3629                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3630                 </links>
3631         </class>
3632         <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">
3633                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3634                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3635                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3636                 </fields>
3637                 <links/>
3638         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3639             <actions>
3640                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3641                 <retrieve/>
3642                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3643                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3644             </actions>
3645         </permacrud>
3646         </class>
3647         <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">
3648                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3649                         <field name="code"  reporter:datatype="text"/>
3650                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3651                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3652                 </fields>
3653                 <links/>
3654         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3655             <actions>
3656                 <create permission="CREATE_PERM" global_required="true"/>
3657                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3658                 <update permission="UPDATE_PERM" global_required="true"/>
3659                 <delete permission="DELETE_PERM" global_required="true"/>
3660             </actions>
3661         </permacrud>
3662         </class>
3663         <class id="mmrsm" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord_source_map" oils_persist:tablename="metabib.metarecord_source_map" oils_persist:field_safe="true" reporter:label="Metarecord Source Map">
3664                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3665                         <field name="id" reporter:datatype="id" />
3666                         <field name="metarecord" reporter:datatype="link"/>
3667                         <field name="source" reporter:datatype="link"/>
3668                 </fields>
3669                 <links>
3670                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3671                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3672                 </links>
3673         </class>
3674         <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">
3675                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3676                         <field name="id" reporter:datatype="id" />
3677                         <field name="field" reporter:datatype="link"/>
3678                         <field name="source" reporter:datatype="link"/>
3679                         <field name="value"  reporter:datatype="text"/>
3680                 </fields>
3681                 <links>
3682                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3683                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3684                 </links>
3685         </class>
3686         <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">
3687                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3688                         <field name="id" reporter:datatype="id" />
3689                         <field name="value" reporter:datatype="text"/>
3690                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3691                 </fields>
3692                 <links>
3693                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3694                 </links>
3695         </class>
3696         <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">
3697                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3698                         <field name="id" reporter:datatype="id" />
3699                         <field name="entry" reporter:datatype="link"/>
3700                         <field name="def" reporter:datatype="link"/>
3701                         <field name="source" reporter:datatype="link"/>
3702                 </fields>
3703                 <links>
3704                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3705                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3706                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3707                 </links>
3708         </class>
3709         <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">
3710                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3711                         <field name="id" reporter:datatype="id" />
3712                         <field name="entry" reporter:datatype="link"/>
3713                         <field name="simple_heading" reporter:datatype="link"/>
3714                 </fields>
3715                 <links>
3716                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3717                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3718                 </links>
3719         </class>
3720         <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">
3721                 <oils_persist:source_definition>
3722                         SELECT * FROM metabib.author_field_entry
3723                                                 UNION ALL
3724                         SELECT * FROM metabib.keyword_field_entry
3725                                                 UNION ALL
3726                         SELECT * FROM metabib.identifier_field_entry
3727                                                 UNION ALL
3728                         SELECT * FROM metabib.title_field_entry
3729                                                 UNION ALL
3730                         SELECT * FROM metabib.subject_field_entry
3731                                                 UNION ALL
3732                         SELECT * FROM metabib.series_field_entry
3733                 </oils_persist:source_definition>
3734                 <fields>
3735                         <field name="field" reporter:datatype="link"/>
3736                         <field name="id" reporter:datatype="id" />
3737                         <field name="source" reporter:datatype="link"/>
3738                         <field name="value"  reporter:datatype="text"/>
3739                 </fields>
3740                 <links>
3741                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3742                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3743                 </links>
3744         </class>
3745         <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">
3746                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3747                         <field name="field" reporter:datatype="link"/>
3748                         <field name="id" reporter:datatype="id" />
3749                         <field name="source" reporter:datatype="link"/>
3750                         <field name="value"  reporter:datatype="text"/>
3751                 </fields>
3752                 <links>
3753                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3754                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3755                 </links>
3756         </class>
3757         <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">
3758                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3759                         <field name="accepting_usr" reporter:datatype="link"/>
3760                         <field name="amount" reporter:datatype="money" />
3761                         <field name="amount_collected" reporter:datatype="money" />
3762                         <field name="cash_drawer" reporter:datatype="link"/>
3763                         <field name="id" reporter:datatype="id" />
3764                         <field name="note"  reporter:datatype="text"/>
3765                         <field name="payment_ts" reporter:datatype="timestamp"/>
3766                         <field name="xact" reporter:datatype="link"/>
3767                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3768                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3769                 </fields>
3770                 <links>
3771                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3772                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3773                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3774                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3775                 </links>
3776         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3777             <actions>
3778                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3779                     <context link="xact" jump="usr" field="home_ou"/>
3780                 </retrieve>
3781                         </actions>
3782                 </permacrud>
3783         </class>
3784         <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">
3785                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3786                         <field name="accepting_usr" reporter:datatype="link"/>
3787                         <field name="amount" reporter:datatype="money" />
3788                         <field name="amount_collected" reporter:datatype="money" />
3789                         <field name="id" reporter:datatype="id" />
3790                         <field name="note"  reporter:datatype="text"/>
3791                         <field name="payment_ts" reporter:datatype="timestamp"/>
3792                         <field name="xact" reporter:datatype="link"/>
3793                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3794                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3795                 </fields>
3796                 <links>
3797                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3798                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3799                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3800                 </links>
3801         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3802             <actions>
3803                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3804                     <context link="xact" jump="usr" field="home_ou"/>
3805                 </retrieve>
3806                         </actions>
3807                 </permacrud>
3808         </class>
3809         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
3810                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3811                         <field name="accepting_usr" reporter:datatype="link"/>
3812                         <field name="amount" reporter:datatype="money" />
3813                         <field name="amount_collected" reporter:datatype="money" />
3814                         <field name="id" reporter:datatype="id" />
3815                         <field name="note"  reporter:datatype="text"/>
3816                         <field name="payment_ts" reporter:datatype="timestamp"/>
3817                         <field name="xact" reporter:datatype="link"/>
3818                         <field name="billing" reporter:datatype="link"/>
3819                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3820                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3821                 </fields>
3822                 <links>
3823                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3824                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3825                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3826                         <link field="billing" reltype="might_have" key="id" class="mb"/>
3827                 </links>
3828         </class>
3829         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3830                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3831                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3832                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3833                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3834                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3835                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3836                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3837                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3838                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3839                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3840                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3841                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3842                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3843                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3844                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3845                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3846                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3847                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3848                 </fields>
3849                 <links>
3850                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3851                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3852                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3853                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3854                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3855                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3856                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3857                 </links>
3858         </class>
3859
3860         <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">
3861                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3862                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3863                         <field name="name"  reporter:datatype="text"/>
3864                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3865                         <field name="block_list" reporter:datatype="text"/>
3866                         <field name="staff_alert" reporter:datatype="bool"/>
3867                         <field name="org_depth" reporter:datatype="int"/>
3868                         <field name="ignore_proximity" reporter:datatype="int"/>
3869                 </fields>
3870                 <links/>
3871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3872             <actions>
3873                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3874                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3875                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3876                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3877             </actions>
3878         </permacrud>
3879         </class>
3880         <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">
3881                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3882                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3883                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3884                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3885                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3886                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3887                 </fields>
3888                 <links>
3889                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3890                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3891                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3892         </links>
3893         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3894             <actions>
3895                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3896                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3897                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3898                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3899             </actions>
3900         </permacrud>
3901         </class>
3902         <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="Copy Status" oils_persist:field_safe="true">
3903                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3904                         <field name="holdable" reporter:datatype="bool"/>
3905                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3906                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3907                         <field name="opac_visible" reporter:datatype="bool"/>
3908             <field name="copy_active" reporter:datatype="bool"/>
3909             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3910             <field name="is_available" reporter:datatype="bool"/>
3911                 </fields>
3912                 <links/>
3913         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3914             <actions>
3915                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3916                 <retrieve/>
3917                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3918                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3919             </actions>
3920         </permacrud>
3921         </class>
3922         <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">
3923                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3924                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3925                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3926                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3927                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3928                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3929                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3930                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3931                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3932                 </fields>
3933                 <links>
3934                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3935                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3936                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3937                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3938                 </links>
3939                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3940                         <actions>
3941                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3942                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3943                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3944                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3945                         </actions>
3946                 </permacrud>
3947         </class>
3948         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3949                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3950                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3951                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3952                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3953                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3954                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3955                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3956                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3957                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3958                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3959                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3960                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3961                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3962                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3963                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3964                 </fields>
3965                 <links>
3966                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3967                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3968                 </links>
3969         </class>
3970         <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">
3971                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3972                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3973                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3974                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3975                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3976                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3977                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3978                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3979                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3980                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3981                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3982                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3983                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3984                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3985                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3986                 </fields>
3987                 <links>
3988                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3989                 </links>
3990                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3991                         <actions>
3992                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3993                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3994                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3995                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3996                         </actions>
3997                 </permacrud>
3998         </class>
3999
4000
4001         <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">
4002                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4003                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4004                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4005                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4006                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4007                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4008                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4009                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4010                 </fields>
4011                 <links>
4012                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4013                 </links>
4014         </class>
4015
4016         <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">
4017                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4018                         <field name="call_number" />
4019                         <field name="create_date" reporter:datatype="timestamp"/>
4020                         <field name="creator" reporter:datatype="link"/>
4021                         <field name="id" reporter:datatype="id" />
4022                         <field name="pub" reporter:datatype="bool"/>
4023                         <field name="title"  reporter:datatype="text"/>
4024                         <field name="value"  reporter:datatype="text"/>
4025                 </fields>
4026                 <links>
4027                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4028                 </links>
4029         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4030             <actions>
4031                 <create permission="CREATE_VOLUME_NOTE">
4032                     <context link="call_number" field="owning_lib"/>
4033                 </create>
4034                 <retrieve permission="VIEW_VOLUME_NOTES">
4035                     <context link="call_number" field="owning_lib"/>
4036                 </retrieve>
4037                 <update permission="UPDATE_VOLUME_NOTE">
4038                     <context link="call_number" field="owning_lib"/>
4039                 </update>
4040                 <delete permission="DELETE_VOLUME_NOTE">
4041                     <context link="call_number" field="owning_lib"/>
4042                 </delete>
4043             </actions>
4044         </permacrud>
4045         </class>
4046         <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">
4047                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4048                         <field name="create_date" reporter:datatype="timestamp"/>
4049                         <field name="creator" reporter:datatype="link"/>
4050                         <field name="edit_date" reporter:datatype="timestamp"/>
4051                         <field name="editor" reporter:datatype="link"/>
4052                         <field name="id" reporter:datatype="id" />
4053                         <field name="record" reporter:datatype="link"/>
4054                         <field name="value" reporter:datatype="text"/>
4055                 </fields>
4056                 <links>
4057                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4058                 </links>
4059         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4060             <actions>
4061                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4062                 <retrieve/>
4063                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4064                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4065             </actions>
4066         </permacrud>
4067         </class>
4068         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4069         <oils_persist:source_definition>
4070 SELECT  usr,
4071         SUM(
4072             CASE
4073                 WHEN (
4074                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4075                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4076                 ) THEN 1
4077                 ELSE 0
4078             END
4079         ) AS out,
4080
4081         SUM(
4082             CASE
4083                 WHEN (
4084                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4085                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4086                 ) THEN 1
4087                 ELSE 0
4088             END
4089         ) AS overdue,
4090
4091         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4092         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4093         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4094   FROM  action.circulation
4095   WHERE checkin_time IS NULL
4096   GROUP BY 1
4097         </oils_persist:source_definition>
4098         <fields oils_persist:primary="usr">
4099             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4100             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4101             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4102             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4103             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4104             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4105         </fields>
4106         <links>
4107             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4108         </links>
4109         </class>
4110         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4111         <oils_persist:source_definition>
4112 SELECT  usr,
4113         STRING_AGG(
4114             CASE
4115                 WHEN (
4116                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4117                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4118                 ) THEN id::TEXT
4119                 ELSE '0'
4120             END
4121         ,',') AS out,
4122
4123         STRING_AGG(
4124             CASE
4125                 WHEN (
4126                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4127                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4128                 ) THEN id::TEXT
4129                 ELSE '0'
4130             END
4131         ,',') AS overdue,
4132
4133         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4134         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4135         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4136   FROM  action.circulation
4137   WHERE checkin_time IS NULL
4138   GROUP BY 1
4139         </oils_persist:source_definition>
4140         <fields oils_persist:primary="usr">
4141             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4142             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4143             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4144             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4145             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4146             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4147         </fields>
4148         <links>
4149             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4150         </links>
4151         </class>
4152         <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">
4153                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4154                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4155                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4156                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4157                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4158                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4159                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4160                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4161                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4162                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4163                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4164                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4165                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4166                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4167                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4168                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4169                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4170                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4171                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4172                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4173                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4174                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4175                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4176                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4177                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4178                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4179                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4180                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4181                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4182                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4183                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4184                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4185                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4186                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4187                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4188                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4189                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4190                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4191                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4192                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4193                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4194                 </fields>
4195                 <links>
4196                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4197                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4198                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4199                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4200                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4201                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4202                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4203                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4204                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4205                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4206                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4207                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4208                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4209                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4210                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4211                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4212                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4213                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4214                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4215                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4216                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4217                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4218                 </links>
4219                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4220                         <actions>
4221                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4222                         </actions>
4223                 </permacrud>
4224         </class>
4225         <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">
4226                 <fields>
4227                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
4228                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4229                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
4230                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4231                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
4232                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
4233                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
4234                 </fields>
4235                 <links>
4236                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4237                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4238                 </links>
4239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4240                         <actions>
4241                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4242                         </actions>
4243                 </permacrud>
4244         </class>
4245         <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">
4246                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4247                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4248                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4249                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4250                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4251                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4252                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4253                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4254                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4255                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4256                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4257                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4258                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4259                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4260                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4261                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4262                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4263                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4264                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4265                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4266                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4267                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4268                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4269                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4270                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4271                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4272                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4273                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4274                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4275                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4276                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4277                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4278                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4279                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4280                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4281                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4282                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4283                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4284                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4285                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4286                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4287                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4288                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4289                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4290                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4291                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4292                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4293                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4294                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4295                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4296                 </fields>
4297                 <links>
4298                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4299                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4300                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4301                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4302                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4303                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4304                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4305                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4306                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4307                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4308                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4309                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4310                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4311                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4312                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4313                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4314                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4315                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4316                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4317                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4318                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4319                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4320                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4321                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4322                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4323                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4324                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4325                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4326                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4327                 </links>
4328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4329                         <actions>
4330                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4331                         </actions>
4332                 </permacrud>
4333         </class>
4334         <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">
4335                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4336                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4337                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4338                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4339                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4340                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4341                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4342                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4343                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4344                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4345                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4346                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4347                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4348                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4349                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4350                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4351                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4352                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4353                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4354                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4355                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4356                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4357                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4358                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4359                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4360                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4361                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4362                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4363                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4364                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4365                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4366                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4367                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4368                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4369                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4370                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4371                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4372                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4373                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4374                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4375                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4376                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4377                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4378                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4379                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4380                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4381                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4382                 </fields>
4383                 <links>
4384                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4385                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4386                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4387                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4388                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4389                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4390                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4391                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4392                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4393                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4394                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4395                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4396                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4397                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4398                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4399                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4400                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4401                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4402                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4403                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4404                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4405                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4406                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4407                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4408                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4409                 </links>
4410         </class>
4411         <class id="auch" 
4412                 controller="open-ils.cstore" 
4413                 oils_obj:fieldmapper="action::user_circ_history" 
4414                 oils_persist:tablename="action.usr_circ_history" 
4415                 reporter:label="User Checkout History">
4416                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4417                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4418                         <!-- prevent reporting on the user that owns the checkout history -->
4419                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4420                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4421                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4422                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4423                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4424                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4425                 </fields>
4426                 <links>
4427                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4428                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4429                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4430                 </links>
4431         </class>
4432         <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">
4433                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4434                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4435                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4436                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4437                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4438                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4439                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4440                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4441                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4442                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4443                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4444                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4445                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4446                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4447                 </fields>
4448                 <links>
4449                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4450                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4451                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4452                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4453                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4454                 </links>
4455                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4456                         <actions>
4457                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4458                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4459                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4460                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4461                         </actions>
4462                 </permacrud>
4463         </class>
4464
4465         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4466                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4467                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4468                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4469                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4470                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4471                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4472                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4473                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4474                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4475                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4476                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4477                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4478                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4479                 </fields>
4480                 <links>
4481                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4482                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4483                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4484                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4485                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4486                 </links>
4487                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4488                         <actions>
4489                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4490                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4491                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4492                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4493                         </actions>
4494                 </permacrud>
4495         </class>
4496         
4497         <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">
4498                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4499                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4500                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4501                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4502                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4503                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4504                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4505                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4506                 </fields>
4507                 <links>
4508                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4509                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4510                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4511                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4512                 </links>
4513                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4514                         <actions>
4515                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4516                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4517                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4518                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4519                         </actions>
4520                 </permacrud>
4521         </class>
4522         
4523         <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">
4524                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4525                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4526                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4527                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4528                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4529                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4530                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4531                 </fields>
4532                 <links>
4533                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4534                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4535                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4536                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4537                 </links>
4538                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4539                         <actions>
4540                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4541                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4542                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4543                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4544                         </actions>
4545                 </permacrud>
4546         </class>
4547         
4548         <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">
4549                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4550                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4551                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4552                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4553                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4554                 </fields>
4555                 <links>
4556                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4557                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4558                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4559                 </links>
4560                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4561                         <actions>
4562                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4563                     <context link="resource" field="owner" />
4564                 </create>
4565                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4566                     <context link="resource" field="owner" />
4567                 </retrieve>
4568                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4569                     <context link="resource" field="owner" />
4570                 </update>
4571                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4572                     <context link="resource" field="owner" />
4573                 </delete>
4574                         </actions>
4575                 </permacrud>
4576         </class>
4577         
4578         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4579                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4580                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4581                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4582                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4583                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4584                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4585                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4586                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4587                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4588                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4589                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4590                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4591                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4592                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4593                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4594                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4595                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4596                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4597                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4598                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4599                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4600                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4601                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4602                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4603                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4604                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4605                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4606                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4607                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4608                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4609                 </fields>
4610                 <links>
4611                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4612                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4613                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4614                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4615                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4616                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4617                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4618                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4619                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4620                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4621                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4622                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4623                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4624                 </links>
4625                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4626                         <actions>
4627                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4628                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4629                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4630                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4631                         </actions>
4632                 </permacrud>
4633         </class>
4634         
4635         <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">
4636                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4637                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4638                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4639                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4640                 </fields>
4641                 <links>
4642                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4643                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4644                 </links>
4645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4646                         <actions>
4647                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4648                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4649                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4650                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4651                         </actions>
4652                 </permacrud>
4653         </class>
4654
4655         <class id="ccnbi" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
4656                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4657                         <field name="bucket" reporter:datatype="link"/>
4658                         <field name="id" reporter:datatype="id" />
4659                         <field name="target_call_number" reporter:datatype="link" />
4660                         <field name="create_time" reporter:datatype="timestamp" />
4661                         <field name="pos" reporter:datatype="int" />
4662                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4663                 </fields>
4664                 <links>
4665                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4666                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4667             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4668                 </links>
4669         </class>
4670         <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">
4671                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4672                         <field name="id" reporter:datatype="id" />
4673                         <field name="item" reporter:datatype="link"/>
4674                         <field name="note" reporter:datatype="text" />
4675                 </fields>
4676                 <links>
4677                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4678                 </links>
4679         </class>
4680         <class id="cbreb" controller="open-ils.cstore" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
4681                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4682                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4683                         <field name="btype" reporter:datatype="text"/>
4684                         <field name="id" reporter:datatype="id" />
4685                         <field name="name" reporter:datatype="text"/>
4686                         <field name="description" reporter:datatype="text"/>
4687                         <field name="owner" reporter:datatype="link"/>
4688                         <field name="pub" reporter:datatype="bool"/>
4689                         <field name="create_time" reporter:datatype="timestamp" />
4690                 </fields>
4691                 <links>
4692                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4693                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4694                 </links>
4695         </class>
4696         <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">
4697                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4698                         <field name="id" reporter:datatype="id" />
4699                         <field name="bucket" reporter:datatype="link"/>
4700                         <field name="note" reporter:datatype="text" />
4701                 </fields>
4702                 <links>
4703                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4704                 </links>
4705         </class>
4706         <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">
4707                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4708                         <field name="hold" reporter:datatype="link"/>
4709                         <field name="id" reporter:datatype="id" />
4710                         <field name="target_copy" reporter:datatype="link"/>
4711                         <field name="proximity" reporter:datatype="number"/>
4712                 </fields>
4713                 <links>
4714                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4715                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4716                 </links>
4717         </class>
4718         <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">
4719                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4720                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4721                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4722                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4723                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4724                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4725                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4726                 </fields>
4727                 <links>
4728                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4729                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4730                 </links>
4731         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4732             <actions>
4733                 <create permission="CREATE_HOLD_NOTIFICATION">
4734                                         <context link="hold" jump="usr" field="home_ou" />
4735                                 </create>
4736                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4737                                         <context link="hold" jump="usr" field="home_ou" />
4738                                 </retrieve>
4739                 <update permission="CREATE_HOLD_NOTIFICATION">
4740                                         <context link="hold" jump="usr" field="home_ou" />
4741                                 </update>
4742                 <delete permission="CREATE_HOLD_NOTIFICATION">
4743                                         <context link="hold" jump="usr" field="home_ou" />
4744                                 </delete>
4745             </actions>
4746         </permacrud>
4747         </class>
4748         <class id="acpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_location" oils_persist:tablename="asset.copy_location" reporter:label="Copy/Shelving Location"  oils_persist:field_safe="true">
4749                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4750                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4751                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4752                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4753                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4754                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4755                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4756                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4757                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4758                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4759                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4760                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4761                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4762                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
4763                 </fields>
4764                 <links>
4765                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4766                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4767                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4768                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4769                 </links>
4770         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4771             <actions>
4772                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4773                 <retrieve/>
4774                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4775                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4776             </actions>
4777         </permacrud>
4778         </class>
4779         <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">
4780                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4781                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4782                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4783                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4784                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4785             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4786             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4787             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4788                 </fields>
4789                 <links>
4790                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4791                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4792                 </links>
4793         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4794             <actions>
4795                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4796                 <retrieve/>
4797                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4798                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4799             </actions>
4800         </permacrud>
4801         </class>
4802         <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">
4803                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4804                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4805             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4806             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4807                 </fields>
4808                 <links>
4809                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4810                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4811                 </links>
4812         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4813             <actions>
4814                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4815                                         <context link="lgroup" field="owner" />
4816                 </create>
4817                 <retrieve/>
4818                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4819                                         <context link="lgroup" field="owner" />
4820                 </update>
4821                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4822                                         <context link="lgroup" field="owner" />
4823                 </delete>
4824             </actions>
4825         </permacrud>
4826         </class>
4827
4828     <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">
4829         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4830             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4831             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4832             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4833             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4834         </fields>
4835         <links>
4836             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4837             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4838         </links>
4839         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4840             <actions>
4841                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4842                 <retrieve/>
4843                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4844                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4845             </actions>
4846         </permacrud>
4847     </class>
4848
4849         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4850                 <fields>
4851                         <field name="sre_id" oils_persist:virtual="true" />
4852                         <field name="location" oils_persist:virtual="true" />
4853                         <field name="owning_lib" oils_persist:virtual="true" />
4854                         <field name="basic_holdings" oils_persist:virtual="true" />
4855                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4856                         <field name="supplement_holdings" oils_persist:virtual="true" />
4857                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4858                         <field name="index_holdings" oils_persist:virtual="true" />
4859                         <field name="index_holdings_add" oils_persist:virtual="true" />
4860                         <field name="online" oils_persist:virtual="true" />
4861                         <field name="missing" oils_persist:virtual="true" />
4862                         <field name="incomplete" oils_persist:virtual="true" />
4863                 </fields>
4864         </class>
4865
4866         <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">
4867                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4868                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4869                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4870                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4871                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4872                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4873                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4874                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4875                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4876                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4877                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4878                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4879                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4880                 </fields>
4881                 <links>
4882                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4883                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4884                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4885                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4886                 </links>
4887                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4888                         <actions>
4889                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4890                                 <retrieve/>
4891                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4892                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4893                         </actions>
4894                 </permacrud>
4895         </class>
4896
4897         <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">
4898                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4899                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4900                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4901                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4902                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4903                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4904                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4905                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4906                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4907                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4908                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4909                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4910                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4911                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4912                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4913                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4914                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4915                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4916                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4917                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4918                 </fields>
4919                 <links>
4920                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4921                 </links>
4922                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4923                         <actions>
4924                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4925                                         <context link="subscription" field="owning_lib" />
4926                                 </create>
4927                                 <retrieve />
4928                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4929                                         <context link="subscription" field="owning_lib" />
4930                                 </update>
4931                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4932                                         <context link="subscription" field="owning_lib" />
4933                                 </delete>
4934                         </actions>
4935                 </permacrud>
4936         </class>
4937
4938         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4939                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4940                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4941                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4942                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4943                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4944                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4945                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4946                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4947                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4948                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4949                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4950                 </fields>
4951                 <links>
4952                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4953                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4954                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4955                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4956                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4957                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4958                 </links>
4959                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4960                         <actions>
4961                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4962                                 <retrieve />
4963                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4964                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4965                         </actions>
4966                 </permacrud>
4967         </class>
4968
4969         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4970                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4971                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4972                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4973                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4974                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4975                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4976                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4977                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4978                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4979                 </fields>
4980                 <links>
4981                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4982                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4983                 </links>
4984         </class>
4985
4986         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4987                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4988                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4989                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4990                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4991                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4992                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4993                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4994                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4995                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4996                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4997                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4998                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4999                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
5000                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
5001                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
5002                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5003                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5004                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5005                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5006                 </fields>
5007                 <links>
5008                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
5009                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5010                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
5011                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
5012                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
5013                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
5014                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
5015                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
5016                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
5017                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
5018                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
5019                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
5020                 </links>
5021                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5022                         <actions>
5023                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5024                                 <retrieve />
5025                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5026                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5027                         </actions>
5028                 </permacrud>
5029         </class>
5030
5031         <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">
5032                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5033                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5034                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5035                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5036                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5037                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5038                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5039                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5040                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5041                 </fields>
5042                 <links>
5043                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5044                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5045                 </links>
5046                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5047                         <actions>
5048                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5049                                         <context link="distribution" field="holding_lib" />
5050                                 </create>
5051                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5052                                         <context link="distribution" field="holding_lib" />
5053                                 </retrieve>
5054                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5055                                         <context link="distribution" field="holding_lib" />
5056                                 </update>
5057                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5058                                         <context link="distribution" field="holding_lib" />
5059                                 </delete>
5060                         </actions>
5061                 </permacrud>
5062         </class>
5063
5064         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5065                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
5066                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5067                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5068                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
5069                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5070                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5071                 </fields>
5072                 <links>
5073                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5074                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
5075                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5076                 </links>
5077                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5078                         <actions>
5079                                 <create permission="ADMIN_SERIAL_STREAM">
5080                                         <context link="distribution" field="holding_lib" />
5081                                 </create>
5082                                 <retrieve />
5083                                 <update permission="ADMIN_SERIAL_STREAM">
5084                                         <context link="distribution" field="holding_lib" />
5085                                 </update>
5086                                 <delete permission="ADMIN_SERIAL_STREAM">
5087                                         <context link="distribution" field="holding_lib" />
5088                                 </delete>
5089                         </actions>
5090                 </permacrud>
5091         </class>
5092
5093         <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">
5094                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5095                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5096                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5097                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5098                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5099                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5100                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5101                 </fields>
5102                 <links>
5103                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5104                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5105                 </links>
5106                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5107                         <actions>
5108                                 <create permission="ADMIN_SERIAL_STREAM">
5109                                         <context link="stream" jump="distribution" field="holding_lib" />
5110                                 </create>
5111                                 <retrieve permission="RECEIVE_SERIAL">
5112                                         <context link="stream" jump="distribution" field="holding_lib" />
5113                                 </retrieve>
5114                                 <update permission="ADMIN_SERIAL_STREAM">
5115                                         <context link="stream" jump="distribution" field="holding_lib" />
5116                                 </update>
5117                                 <delete permission="ADMIN_SERIAL_STREAM">
5118                                         <context link="stream" jump="distribution" field="holding_lib" />
5119                                 </delete>
5120                         </actions>
5121                 </permacrud>
5122         </class>
5123
5124         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5125                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5126                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5127                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5128                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5129                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5130                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5131                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5132                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5133                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5134                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5135                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5136                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5137                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5138                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5139                 </fields>
5140                 <links>
5141                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5142                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5143                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5144                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5145                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5146                 </links>
5147                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5148                         <actions>
5149                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5150                                         <context link="subscription" field="owning_lib" />
5151                                 </create>
5152                                 <retrieve/>
5153                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5154                                         <context link="subscription" field="owning_lib" />
5155                                 </update>
5156                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5157                                         <context link="subscription" field="owning_lib" />
5158                                 </delete>
5159                         </actions>
5160                 </permacrud>
5161         </class>
5162
5163         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5164                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5165                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5166                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5167                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5168                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5169                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5170                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5171                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5172                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5173                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5174                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5175                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5176                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5177                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5178                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5179                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5180                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5181                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5182                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5183                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5184                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5185                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5186                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5187                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5188                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5189                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5190                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5191                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5192                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5193                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5194                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5195                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5196                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5197                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5198                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5199                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5200                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5201                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5202                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5203                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5204                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5205                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5206                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5207                 </fields>
5208                 <links>
5209                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5210                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5211                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5212                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5213                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5214                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5215                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5216                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5217                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5218                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5219                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5220                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5221                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5222                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5223                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5224                 </links>
5225                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5226                         <actions>
5227                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5228                                 <retrieve/>
5229                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5230                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5231                         </actions>
5232                 </permacrud>
5233         </class>
5234
5235         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5236                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5237                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5238                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5239                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5240                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5241                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5242                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5243                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5244                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5245                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5246                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5247                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5248                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5249                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5250                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5251                 </fields>
5252                 <links>
5253                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5254                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5255                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5256                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5257                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5258                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5259                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5260                 </links>
5261                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5262                         <actions>
5263                                 <create permission="ADMIN_SERIAL_ITEM">
5264                                         <context link="stream" jump="distribution" field="holding_lib" />
5265                                 </create>
5266                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5267                                         <context link="stream" jump="distribution" field="holding_lib" />
5268                                 </retrieve>
5269                                 <update permission="ADMIN_SERIAL_ITEM">
5270                                         <context link="stream" jump="distribution" field="holding_lib" />
5271                                 </update>
5272                                 <delete permission="ADMIN_SERIAL_ITEM">
5273                                         <context link="stream" jump="distribution" field="holding_lib" />
5274                                 </delete>
5275                         </actions>
5276                 </permacrud>
5277         </class>
5278
5279         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
5280                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5281                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5282                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5283                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5284                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5285                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5286                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5287                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5288                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5289                 </fields>
5290                 <links>
5291                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5292                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5293                 </links>
5294                 <!-- Not available via PCRUD at this time -->
5295         </class>
5296         <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">
5297                 <fields>
5298                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5299                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5300                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5301                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5302                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5303                 </fields>
5304                 <links>
5305                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5306                 </links>
5307         </class>
5308         <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">
5309                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5310                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5311                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5312                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5313                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5314                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5315                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5316                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5317                 </fields>
5318                 <links>
5319                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5320                 </links>
5321         </class>
5322         <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">
5323                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5324                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5325                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5326                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5327                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5328                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5329                 </fields>
5330                 <links>
5331                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5332                 </links>
5333                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5334                         <actions>
5335                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5336                                         <context link="distribution" field="holding_lib" />
5337                                 </create>
5338                                 <retrieve/>
5339                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5340                                         <context link="distribution" field="holding_lib" />
5341                                 </update>
5342                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5343                                         <context link="distribution" field="holding_lib" />
5344                                 </delete>
5345                         </actions>
5346                 </permacrud>
5347         </class>
5348
5349         <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">
5350                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5351                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5352                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5353                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5354                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5355                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5356                 </fields>
5357                 <links>
5358                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5359                 </links>
5360                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5361                         <actions>
5362                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5363                                         <context link="distribution" field="holding_lib" />
5364                                 </create>
5365                                 <retrieve/>
5366                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5367                                         <context link="distribution" field="holding_lib" />
5368                                 </update>
5369                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5370                                         <context link="distribution" field="holding_lib" />
5371                                 </delete>
5372                         </actions>
5373                 </permacrud>
5374         </class>
5375
5376         <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">
5377                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5378                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5379                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5380                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5381                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5382                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5383                 </fields>
5384                 <links>
5385                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5386                 </links>
5387                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5388                         <actions>
5389                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5390                                         <context link="distribution" field="holding_lib" />
5391                                 </create>
5392                                 <retrieve/>
5393                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5394                                         <context link="distribution" field="holding_lib" />
5395                                 </update>
5396                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5397                                         <context link="distribution" field="holding_lib" />
5398                                 </delete>
5399                         </actions>
5400                 </permacrud>
5401         </class>
5402
5403         <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">
5404                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5405                         <field name="id" reporter:datatype="id" />
5406                         <field name="owning_copy" reporter:datatype="link"/>
5407                         <field name="stat_cat" reporter:datatype="link"/>
5408                         <field name="stat_cat_entry" reporter:datatype="link"/>
5409                 </fields>
5410                 <links>
5411                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5412                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5413                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5414                 </links>
5415                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5416                         <actions>
5417                                 <retrieve/>
5418                         </actions>
5419                 </permacrud>
5420         </class>
5421         <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">
5422                 <fields oils_persist:primary="code">
5423                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5424                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5425                 </fields>
5426                 <links/>
5427         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5428             <actions>
5429                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5430                 <retrieve/>
5431                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5432                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5433             </actions>
5434         </permacrud>
5435         </class>
5436         <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">
5437                 <fields oils_persist:primary="code">
5438                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5439                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5440                 </fields>
5441                 <links/>
5442         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5443             <actions>
5444                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5445                 <retrieve/>
5446                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5447                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5448             </actions>
5449         </permacrud>
5450         </class>
5451         <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">
5452                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5453                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5454                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5455                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5456                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5457                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5458                 </fields>
5459                 <links>
5460             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5461         </links>
5462         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5463             <actions>
5464                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5465                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5466                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5467                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5468             </actions>
5469         </permacrud>
5470         </class>
5471         <class id="lasso" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_lasso" oils_persist:tablename="actor.org_lasso" reporter:label="Org Lasso">
5472                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5473                         <field name="id" reporter:datatype="id" />
5474                         <field name="name" reporter:datatype="text"/>
5475                 </fields>
5476                 <links/>
5477         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5478             <actions>
5479                 <create permission="CREATE_LASSO" global_required="true"/>
5480                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5481                 <update permission="UPDATE_LASSO" global_required="true"/>
5482                 <delete permission="DELETE_LASSO" global_required="true"/>
5483             </actions>
5484         </permacrud>
5485         </class>
5486         <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="Org Lasso Map">
5487                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5488                         <field name="id" reporter:datatype="id" />
5489                         <field name="lasso" reporter:datatype="link"/>
5490                         <field name="org_unit" reporter:datatype="org_unit"/>
5491                 </fields>
5492                 <links>
5493                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5494                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5495                 </links>
5496         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5497             <actions>
5498                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5499                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5500                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5501                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5502             </actions>
5503         </permacrud>
5504         </class>
5505         <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">
5506                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5507                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5508                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5509                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5510                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5511                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5512                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5513                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5514                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5515                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5516                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5517                 </fields>
5518                 <links>
5519                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5520                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5521                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5522                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5523                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5524                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5525                 </links>
5526         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5527             <actions>
5528                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5529                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5530                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5531                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5532             </actions>
5533         </permacrud>
5534         </class>
5535         <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">
5536                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5537                         <field name="id" reporter:datatype="id" />
5538                         <field name="from_org" reporter:datatype="org_unit"/>
5539                         <field name="to_org" reporter:datatype="org_unit"/>
5540                         <field name="prox" reporter:datatype="int" />
5541                 </fields>
5542                 <links>
5543                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5544                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5545                 </links>
5546         </class>
5547         <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">
5548                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5549                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5550                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5551                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5552                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5553                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5554                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5555                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5556                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5557                 </fields>
5558                 <links/>
5559         </class>
5560         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5561                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5562                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5563                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5564                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5565                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5566                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5567                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5568                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5569                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5570                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5571                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5572                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5573                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5574                 </fields>
5575                 <links>
5576                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5577                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5578                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5579                 </links>
5580         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5581             <actions>
5582                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5583                 <retrieve/>
5584                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5585                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5586             </actions>
5587         </permacrud>
5588         </class>
5589         <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">
5590                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5591                         <field name="address_type"  reporter:datatype="text"/>
5592                         <field name="city"  reporter:datatype="text"/>
5593                         <field name="country"  reporter:datatype="text"/>
5594                         <field name="county"  reporter:datatype="text"/>
5595                         <field name="id" reporter:datatype="id" />
5596                         <field name="org_unit" reporter:datatype="org_unit"/>
5597                         <field name="post_code"  reporter:datatype="text"/>
5598                         <field name="state"  reporter:datatype="text"/>
5599                         <field name="street1"  reporter:datatype="text"/>
5600                         <field name="street2"  reporter:datatype="text"/>
5601                         <field name="valid" reporter:datatype="bool"/>
5602                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5603                 </fields>
5604                 <links>
5605                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5606                 </links>
5607         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5608             <actions>
5609                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5610                 <retrieve/>
5611                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5612                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5613             </actions>
5614         </permacrud>
5615         </class>
5616         <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">
5617                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5618                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5619                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5620                         <field name="query_text" reporter:datatype="text"/>
5621                 </fields>
5622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5623             <actions>
5624                 <retrieve/>
5625             </actions>
5626         </permacrud>
5627         </class>
5628
5629         <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">
5630                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5631                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5632                         <field name="owner" reporter:datatype="org_unit"/>
5633                         <field name="code" reporter:datatype="text"/>
5634                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5635                         <field name="create_date" reporter:datatype="timestamp"/>
5636                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5637                 </fields>
5638                 <links>
5639                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5640                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5641                 </links>
5642         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5643             <actions>
5644                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5645                 <retrieve/>
5646                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5647                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5648             </actions>
5649         </permacrud>
5650         </class>
5651         <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">
5652                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5653                         <field name="id" reporter:datatype="id"/>
5654                         <field name="grp" reporter:datatype="link"/>
5655                         <field name="pos" reporter:datatype="int"/>
5656                         <field name="query" reporter:datatype="link"/>
5657                 </fields>
5658                 <links>
5659                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5660                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5661                 </links>
5662         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5663             <actions>
5664                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5665                     <context link="grp" field="owner"/>
5666                 </create>
5667                 <retrieve/>
5668                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5669                     <context link="grp" field="owner"/>
5670                 </update>
5671                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5672                     <context link="grp" field="owner"/>
5673                 </delete>
5674             </actions>
5675         </permacrud>
5676         </class>
5677
5678         <!-- A note: Please update alhr and ahopl when updating ahr -->
5679         <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">
5680                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5681                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5682                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5683                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5684                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5685                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5686                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5687                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5688                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5689                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5690                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5691                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5692                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5693                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5694                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5695                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5696                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5697                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5698                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5699                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5700                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5701                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5702                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5703                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5704                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5705                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5706                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5707                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5708                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5709                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5710                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5711                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5712                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5713                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5714                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5715                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5716                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5717                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5718                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5719                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5720                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5721                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5722                 </fields>
5723                 <links>
5724                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5725                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5726                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5727                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5728                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5729                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5730                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5731                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5732                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5733                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5734                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5735                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5736                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5737                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5738                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5739                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5740                 </links>
5741                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5742                         <actions>
5743                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5744                         </actions>
5745                 </permacrud>
5746         </class>
5747         <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">
5748                 <oils_persist:source_definition><![CDATA[
5749                 SELECT
5750                         ahr.*,
5751                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5752                                 copy_location_order_position,
5753                         CASE WHEN au.alias IS NOT NULL THEN
5754                                 au.alias
5755                         ELSE
5756                                 au.first_given_name
5757                         END AS usr_alias_or_first_given_name,
5758                         au.first_given_name AS usr_first_given_name,
5759                         au.second_given_name AS usr_second_given_name,
5760                         au.family_name AS usr_family_name,
5761                         au.prefix AS usr_prefix,
5762                         au.suffix AS usr_suffix,
5763                         au.alias AS usr_alias,
5764                         CASE WHEN au.alias IS NOT NULL THEN
5765                                 au.alias
5766                         ELSE
5767                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5768                                         COALESCE(au.family_name, ''),
5769                                         COALESCE(au.suffix, ''),
5770                                         ', ',
5771                                         COALESCE(au.prefix, ''),
5772                                         COALESCE(au.first_given_name, ''),
5773                                         COALESCE(au.second_given_name, '')
5774                                 ], ' '), E'\\s+,', ',')
5775                         END AS usr_alias_or_display_name,
5776                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5777                                 COALESCE(au.family_name, ''),
5778                                 COALESCE(au.suffix, ''),
5779                                 ', ',
5780                                 COALESCE(au.prefix, ''),
5781                                 COALESCE(au.first_given_name, ''),
5782                                 COALESCE(au.second_given_name, '')
5783                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5784                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5785                                 AS call_number_label,
5786                         siss.label AS issuance_label,
5787                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5788                         ahcm_1.copy_count AS potential_copies
5789                 FROM action.hold_request ahr
5790                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5791                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5792                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5793                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5794                 JOIN actor.usr au ON (au.id = ahr.usr)
5795                 JOIN (
5796                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5797                         FROM asset.copy_location
5798                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5799                 LEFT JOIN actor.usr_standing_penalty ausp 
5800                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5801                 LEFT JOIN config.standing_penalty csp
5802                         ON (
5803                                 csp.id = ausp.standing_penalty AND 
5804                                 csp.block_list LIKE '%CAPTURE%' AND (
5805                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5806                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5807                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5808                                         )
5809                                 )
5810                         )
5811                 JOIN (
5812                         SELECT COUNT(target_copy) AS copy_count, hold
5813                         FROM action.hold_copy_map
5814                         GROUP BY 2
5815                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5816                 LEFT JOIN serial.issuance siss
5817                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5818                 LEFT JOIN asset.copy_location_order acplo
5819                         ON (acp.location = acplo.location AND
5820                                 acp.circ_lib = acplo.org)
5821                 WHERE
5822                         ahr.capture_time IS NULL AND
5823                         ahr.cancel_time IS NULL AND
5824                         csp.id IS NULL AND
5825                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5826                         acp.status IN (0,7)
5827                 ]]></oils_persist:source_definition>
5828                 <fields oils_persist:primary="id">
5829                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5830                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5831                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5832                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5833                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5834                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5835                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5836                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5837                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5838                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5839                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5840                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5841                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5842                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5843                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5844                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5845                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5846                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5847                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5848                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5849                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5850                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5851                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5852                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5853                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5854                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5855                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5856                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5857                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5858                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5859                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5860                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5861                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5862                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5863                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5864                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5865                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5866                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5867                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5868                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5869                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5870                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5871                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5872                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5873                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5874                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5875                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5876                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5877                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5878                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5879                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5880                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5881                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5882                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5883                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5884                 </fields>
5885                 <links>
5886                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5887                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5888                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5889                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5890                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5891                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5892                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5893                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5894                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5895                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5896                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5897                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5898                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5899                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5900                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5901                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5902                 </links>
5903                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5904                         <actions>
5905                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5906                         </actions>
5907                 </permacrud>
5908         </class>
5909         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5910                 <oils_persist:source_definition>
5911                         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)
5912                 </oils_persist:source_definition>
5913                 <fields oils_persist:primary="id">
5914                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5915                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5916                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5917                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5918                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5919                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5920                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5921                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5922                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5923                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5924                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5925                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5926                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5927                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5928                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5929                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5930                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5931                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5932                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5933                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5934                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5935                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5936                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5937                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5938                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5939                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5940                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5941                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5942                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5943                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5944                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5945                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5946                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5947                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5948                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5949                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5950                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5951                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5952                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5953                 </fields>
5954                 <links>
5955                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5956                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5957                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5958                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5959                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5960                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5961                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5962                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5963                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5964                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5965                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5966                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5967                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5968                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5969                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5970                 </links>
5971         </class>
5972
5973         <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">
5974                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5975                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5976                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5977                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5978                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5979                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5980                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5981                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5982                 </fields>
5983                 <links>
5984                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5985                 </links>
5986                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5987                         <actions>
5988                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5989                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5990                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5991                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5992                         </actions>
5993                 </permacrud>
5994         </class>
5995         <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">
5996                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5997                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5998                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5999                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6000                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6001                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6002                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6003                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6004                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6005                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6006                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6007                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6008                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6009                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6010                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6011                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6012                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6013                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6014                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6015                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6016                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6017                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6018                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6019                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6020                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6021                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6022                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6023                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6024                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6025                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6026                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6027                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6028                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6029                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6030                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6031                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6032                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6033                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6034                 </fields>
6035                 <links>
6036                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6037                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6038                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6039                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6040                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6041                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6042                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6043                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6044                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6045                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6046                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6047                 </links>
6048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6049                         <actions>
6050                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6051                         </actions>
6052                 </permacrud>
6053         </class>
6054         <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">
6055                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6056                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6057                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6058                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6059                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6060                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6061                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6062                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6063                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6064                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6065                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6066                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6067                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6068                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6069                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6070                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6071                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6072                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6073                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6074                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6075                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6076                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6077                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6078                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6079                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6080                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6081                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6082                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6083                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6084                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6085                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6086                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6087                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6088                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6089                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6090                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6091                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6092                 </fields>
6093                 <links>
6094                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6095                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6096                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6097                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6098                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6099                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6100                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6101                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6102                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6103                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6104                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6105                 </links>
6106                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6107                         <actions>
6108                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6109                         </actions>
6110                 </permacrud>
6111         </class>
6112
6113         <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">
6114                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6115                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6116                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6117                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6118                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6119                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6120                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6121                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6122                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
6123                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6124                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6125                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6126                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6127                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6128                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
6129                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6130                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6131                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6132                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6133                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6134                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6135                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6136                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6137                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6138                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6139                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6140                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6141                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6142                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6143                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6144                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6145                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6146                 </fields>
6147                 <links>
6148                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6149                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6150                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6151                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6152                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6153                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6154                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6155                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6156                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6157                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6158                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6159                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6160                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6161                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6162                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6163                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6164                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6165                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6166                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6167                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6168                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6169                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6170                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6171                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6172                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6173                 </links>
6174         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6175             <actions>
6176                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6177                 <retrieve />
6178                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6179                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6180             </actions>
6181         </permacrud>
6182         </class>
6183         <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">
6184                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6185                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6186                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6187                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6188                 </fields>
6189                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6190                         <actions>
6191                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6192                                 <retrieve/>
6193                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6194                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6195                         </actions>
6196                 </permacrud>
6197         </class>
6198         <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">
6199                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6200                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6201                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6202                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6203                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6204                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6205                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6206                 </fields>
6207                 <links>
6208                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6209                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6210                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6211                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6212                 </links>
6213                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6214                         <actions>
6215                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6216                                 <retrieve/>
6217                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6218                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6219                         </actions>
6220                 </permacrud>
6221         </class>
6222         <class id="ccnb" controller="open-ils.cstore" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
6223                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6224                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6225                         <field name="btype" reporter:datatype="text"/>
6226                         <field name="id" reporter:datatype="id" />
6227                         <field name="name"  reporter:datatype="text"/>
6228                         <field name="description" reporter:datatype="text"/>
6229                         <field name="owner" reporter:datatype="link"/>
6230                         <field name="pub" reporter:datatype="bool"/>
6231                         <field name="create_time" reporter:datatype="timestamp" />
6232                 </fields>
6233                 <links>
6234                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6235                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6236                 </links>
6237         </class>
6238         <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">
6239                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6240                         <field name="id" reporter:datatype="id" />
6241                         <field name="bucket" reporter:datatype="link"/>
6242                         <field name="note" reporter:datatype="text" />
6243                 </fields>
6244                 <links>
6245                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6246                 </links>
6247         </class>
6248         <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">
6249                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6250                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6251                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6252                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6253                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6254                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6255                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6256                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6257                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6258                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6259                 </fields>
6260                 <links>
6261                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6262                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6263                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6264                 </links>
6265                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6266                         <actions>
6267                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6268                         </actions>
6269                 </permacrud>
6270         </class>
6271         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6272                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6273                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6274                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6275                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6276                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6277                 </fields>
6278                 <links>
6279                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6280                 </links>
6281                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6282                         <actions>
6283                                 <retrieve permission="VIEW_USER">
6284                                         <context link="usr" field="home_ou" />
6285                                 </retrieve>
6286                         </actions>
6287                 </permacrud>
6288         </class>
6289     <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">
6290         <fields oils_persist:primary="field">
6291             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6292             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6293             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6294         </fields>
6295         <links/>
6296         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6297             <actions>
6298                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6299                 <retrieve />
6300                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6301                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6302             </actions>
6303         </permacrud>
6304     </class>
6305         <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">
6306                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6307                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6308                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6309                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6310                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6311                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6312                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6313                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6314                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6315                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6316                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6317                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6318                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6319                 </fields>
6320                 <links>
6321                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6322                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6323                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6324                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6325                 </links>
6326         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6327             <actions>
6328                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6329                 <retrieve />
6330                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6331                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6332             </actions>
6333         </permacrud>
6334         </class>
6335         <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">
6336                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6337                         <field name="field" reporter:datatype="link"/>
6338                         <field name="id" reporter:datatype="id" />
6339                         <field name="source" reporter:datatype="link"/>
6340                         <field name="value"  reporter:datatype="text"/>
6341                 </fields>
6342                 <links>
6343                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6344                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6345                 </links>
6346         </class>
6347         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6348                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6349                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6350                         <field name="btype" reporter:datatype="text"/>
6351                         <field name="id" reporter:datatype="id" />
6352                         <field name="name"  reporter:datatype="text"/>
6353                         <field name="description" reporter:datatype="text"/>
6354                         <field name="owner" reporter:datatype="link"/>
6355                         <field name="pub" reporter:datatype="bool"/>
6356                         <field name="create_time" reporter:datatype="timestamp" />
6357                 </fields>
6358                 <links>
6359                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6360                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6361                 </links>
6362         </class>
6363         <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">
6364                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6365                         <field name="id" reporter:datatype="id" />
6366                         <field name="bucket" reporter:datatype="link"/>
6367                         <field name="note" reporter:datatype="text" />
6368                 </fields>
6369                 <links>
6370                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6371                 </links>
6372         </class>
6373         <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">
6374                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6375                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6376                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6377                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6378                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6379                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6380                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6381                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6382                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6383                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6384                 </fields>
6385                 <links>
6386                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6387                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6388                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6389                 </links>
6390         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6391             <actions>
6392                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6393                     <context link="xact" jump="usr" field="home_ou"/>
6394                 </retrieve>
6395                         </actions>
6396                 </permacrud>
6397         </class>
6398         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6399                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6400                         <field name="id" reporter:datatype="id" />
6401                         <field name="ind1" />
6402                         <field name="ind2" />
6403                         <field name="record" />
6404                         <field name="subfield" />
6405                         <field name="tag" />
6406                         <field name="value" />
6407                 </fields>
6408                 <links>
6409                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6410                 </links>
6411         </class>
6412         <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">
6413                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6414                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6415                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6416                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6417                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6418                 </fields>
6419                 <links>
6420                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6421                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6422                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6423                 </links>
6424         </class>
6425         <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">
6426                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6427                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6428                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6429                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6430                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6431                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6432                 </fields>
6433                 <links>
6434                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6435                 </links>
6436         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6437             <actions>
6438                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6439                 <retrieve/>
6440                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6441                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6442             </actions>
6443         </permacrud>
6444
6445         </class>
6446         <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">
6447                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6448                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6449                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6450                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6451                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6452                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6453                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6454                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6455                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6456                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6457                 </fields>
6458                 <links>
6459                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6460                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6461                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6462                 </links>
6463         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6464             <actions>
6465                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6466                 <retrieve/>
6467                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6468                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6469             </actions>
6470         </permacrud>
6471         </class>
6472         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6473                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6474                         <field name="create_date" reporter:datatype="timestamp"/>
6475                         <field name="creator" reporter:datatype="link"/>
6476                         <field name="edit_date" reporter:datatype="timestamp"/>
6477                         <field name="editor" reporter:datatype="link"/>
6478                         <field name="id" reporter:datatype="id" />
6479                         <field name="pub" reporter:datatype="bool"/>
6480                         <field name="record" reporter:datatype="link"/>
6481                         <field name="value"  reporter:datatype="text"/>
6482                 </fields>
6483                 <links>
6484                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6485                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6486                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6487                 </links>
6488         </class>
6489         <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">
6490                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6491                         <field name="balance_owed" reporter:datatype="money" />
6492                         <field name="total_owed" reporter:datatype="money" />
6493                         <field name="total_paid" reporter:datatype="money" />
6494                         <field name="usr" reporter:datatype="link"/>
6495                 </fields>
6496                 <links>
6497                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6498                 </links>
6499         </class>
6500         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6501                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6502                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6503                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6504                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6505                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6506                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6507                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6508                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6509                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6510                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6511                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6512                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6513                 </fields>
6514                 <links>
6515                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6516                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6517                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6518                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6519                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6520                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6521                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6522                 </links>
6523         </class>
6524         <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">
6525                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6526                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6527                         <field name="quality" reporter:datatype="int" />
6528                         <field name="source" reporter:datatype="text"/>
6529                         <field name="transcendant" reporter:datatype="bool"/>
6530                         <field name="can_have_copies" reporter:datatype="bool"/>
6531                 </fields>
6532                 <links/>
6533         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6534             <actions>
6535                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6536                 <retrieve/>
6537                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6538                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6539             </actions>
6540         </permacrud>
6541         </class>
6542         <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">
6543                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6544                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6545                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6546                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6547                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6548                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6549                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6550                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6551                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6552                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6553                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6554                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6555                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6556                 </fields>
6557                 <links>
6558                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6559                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6560                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6561                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6562                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6563                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6564                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6565                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6566                 </links>
6567                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6568                         <actions>
6569                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6570                                         <context link="usr" field="home_ou" />
6571                                 </retrieve>
6572                         </actions>
6573                 </permacrud>
6574         </class>
6575         <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">
6576                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6577                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6578                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6579                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6580                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6581                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6582                 </fields>
6583                 <links>
6584                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6585                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6586                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6587                 </links>
6588         </class>
6589         <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">
6590                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6591                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6592                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6593                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6594                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6595                 </fields>
6596                 <links>
6597                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6598                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6599                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6600                 </links>
6601         </class>
6602         <class id="cubi" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
6603                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6604                         <field name="bucket" reporter:datatype="link"/>
6605                         <field name="id" reporter:datatype="id" />
6606                         <field name="target_user" reporter:datatype="link"/>
6607                         <field name="create_time" reporter:datatype="timestamp" />
6608                         <field name="pos" reporter:datatype="int" />
6609                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6610                 </fields>
6611                 <links>
6612                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6613                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6614             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6615                 </links>
6616         </class>
6617         <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">
6618                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6619                         <field name="id" reporter:datatype="id" />
6620                         <field name="item" reporter:datatype="link"/>
6621                         <field name="note" reporter:datatype="text" />
6622                 </fields>
6623                 <links>
6624                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6625                 </links>
6626         </class>
6627         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6628                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6629                         <field name="balance_owed" reporter:datatype="money" />
6630                         <field name="total_owed" reporter:datatype="money" />
6631                         <field name="total_paid" reporter:datatype="money" />
6632                         <field name="usr" reporter:datatype="link"/>
6633                 </fields>
6634                 <links>
6635                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6636                 </links>
6637         </class>
6638         <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">
6639                 <fields oils_persist:primary="code" oils_persist:sequence="">
6640                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6641                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6642                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6643                 </fields>
6644                 <links/>
6645         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6646             <actions>
6647                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6648                 <retrieve/>
6649                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6650                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6651             </actions>
6652         </permacrud>
6653         </class>
6654         <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">
6655                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6656                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6657                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6658                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6659                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6660                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6661                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6662                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6663                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6664                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6665                 </fields>
6666                 <links>
6667                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6668                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6669                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6670                 </links>
6671         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6672             <actions>
6673                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6674                     <context link="xact" jump="usr" field="home_ou"/>
6675                 </retrieve>
6676                         </actions>
6677                 </permacrud>
6678         </class>
6679         <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">
6680                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6681                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6682                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6683                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6684                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6685                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6686                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6687                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6688                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6689                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6690                 </fields>
6691                 <links>
6692                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6693                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6694                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6695                 </links>
6696         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6697             <actions>
6698                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6699                     <context link="xact" jump="usr" field="home_ou"/>
6700                 </retrieve>
6701                         </actions>
6702                 </permacrud>
6703         </class>
6704         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6705                 <fields oils_persist:primary="id" oils_persist:sequence="">
6706                         <field name="checkin_lib" reporter:datatype="link"/>
6707                         <field name="checkin_staff" reporter:datatype="link"/>
6708                         <field name="checkin_time" reporter:datatype="timestamp"/>
6709                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6710                         <field name="circ_staff" reporter:datatype="link"/>
6711                         <field name="desk_renewal" reporter:datatype="bool"/>
6712                         <field name="due_date" reporter:datatype="timestamp"/>
6713                         <field name="duration" reporter:datatype="interval"/>
6714                         <field name="duration_rule" reporter:datatype="link"/>
6715                         <field name="fine_interval" reporter:datatype="interval"/>
6716                         <field name="id" reporter:datatype="id" />
6717                         <field name="max_fine" reporter:datatype="money" />
6718                         <field name="max_fine_rule" reporter:datatype="link"/>
6719                         <field name="opac_renewal" reporter:datatype="bool"/>
6720                         <field name="phone_renewal" reporter:datatype="bool"/>
6721                         <field name="recurring_fine" reporter:datatype="money" />
6722                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6723                         <field name="renewal_remaining" reporter:datatype="int" />
6724             <field name="grace_period" reporter:datatype="interval" />
6725                         <field name="stop_fines" reporter:datatype="text"/>
6726                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6727                         <field name="target_copy" reporter:datatype="link"/>
6728                         <field name="usr" reporter:datatype="link"/>
6729                         <field name="xact_finish" reporter:datatype="timestamp" />
6730                         <field name="xact_start" reporter:datatype="timestamp" />
6731                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6732                 </fields>
6733                 <links>
6734                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6735                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6736                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6737                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6738                 </links>
6739         </class>
6740         <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">
6741                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6742                         <field name="field" reporter:datatype="link"/>
6743                         <field name="id" reporter:datatype="id" />
6744                         <field name="source" reporter:datatype="link"/>
6745                         <field name="value" reporter:datatype="text"/>
6746                 </fields>
6747                 <links>
6748                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6749                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6750                 </links>
6751         </class>
6752         <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">
6753                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6754                         <field name="high" reporter:datatype="money" />
6755                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6756                         <field name="low" reporter:datatype="money" />
6757                         <field name="name" reporter:datatype="text"/>
6758                         <field name="normal" reporter:datatype="money" />
6759                         <field name="recurrence_interval" reporter:datatype="interval"/>
6760             <field name="grace_period" reporter:datatype="interval" />
6761                 </fields>
6762                 <links/>
6763         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6764             <actions>
6765                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6766                 <retrieve/>
6767                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6768                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6769             </actions>
6770         </permacrud>
6771         </class>
6772         <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">
6773                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6774                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6775                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6776                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6777                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6778                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6779                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6780                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6781                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6782                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6783                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6784                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6785                 </fields>
6786                 <links>
6787                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6788                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6789                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6790                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6791                 </links>
6792         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6793             <actions>
6794                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6795                     <context link="xact" jump="usr" field="home_ou"/>
6796                 </retrieve>
6797                         </actions>
6798                 </permacrud>
6799         </class>
6800         <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">
6801                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6802                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6803                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6804                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6805                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6806                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6807                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6808                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6809                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6810                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6811                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6812                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6813                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6814                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6815                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6816                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6817                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6818                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6819                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6820                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6821                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6822                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6823                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6824                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6825                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6826                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6827                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6828                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6829                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6830                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6831                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6832                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6833                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6834                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6835                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6836                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6837                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6838                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6839                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6840                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6841                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6842                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6843                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6844                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6845                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6846                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6847                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6848                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
6849                 </fields>
6850                 <links>
6851                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6852                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6853                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6854                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6855                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6856                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6857                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6858                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6859                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6860                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6861                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6862                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6863                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
6864                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6865                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6866                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6867                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6868                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6869                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6870                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6871                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6872                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6873                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
6874                 </links>
6875         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6876             <actions>
6877                 <create permission="CREATE_COPY">
6878                     <context link="call_number" field="owning_lib"/>
6879                 </create>
6880                 <retrieve/>
6881                 <update permission="UPDATE_COPY">
6882                     <context link="call_number" field="owning_lib"/>
6883                 </update>
6884                 <delete permission="DELETE_COPY">
6885                     <context link="call_number" field="owning_lib"/>
6886                 </delete>
6887             </actions>
6888         </permacrud>
6889         </class>
6890
6891         <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">
6892                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6893                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6894                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6895                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6896                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6897                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6898                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6899                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6900                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6901                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6902                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6903                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6904                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6905                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6906                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6907                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6908                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6909                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6910                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6911                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6912                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6913                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6914                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6915                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6916                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6917                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6918                 </fields>
6919                 <links>
6920                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6921                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6922                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6923                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6924                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6925                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6926                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6927                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6928                 </links>
6929                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6930                         <actions>
6931                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6932                                 <retrieve />
6933                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6934                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6935                         </actions>
6936                 </permacrud>
6937         </class>
6938
6939         <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">
6940                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6941                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6942                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6943                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6944                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6945                 </fields>
6946                 <links/>
6947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6948             <actions>
6949                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6950                 <retrieve/>
6951                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6952                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6953             </actions>
6954         </permacrud>
6955         </class>
6956         <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">
6957                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6958                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6959                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6960                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6961                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6962                 </fields>
6963                 <links/>
6964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6965             <actions>
6966                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6967                 <retrieve/>
6968                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6969                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6970             </actions>
6971         </permacrud>
6972         </class>
6973         <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">
6974                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6975                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6976                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6977                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6978                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6979                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6980                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6981                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6982                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6983                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6984                 </fields>
6985                 <links>
6986                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6987                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6988                 </links>
6989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6990             <actions>
6991                 <create permission="CREATE_PERM" global_required="true"/>
6992                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6993                 <update permission="UPDATE_PERM" global_required="true"/>
6994                 <delete permission="DELETE_PERM" global_required="true"/>
6995             </actions>
6996         </permacrud>
6997         </class>
6998         <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">
6999                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
7000                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
7001                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
7002                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
7003                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
7004                 </fields>
7005                 <links>
7006                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
7007                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
7008                 </links>
7009         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7010             <actions>
7011                 <create permission="ADMIN_SURVEY">
7012                     <context link="question" jump="survey" field="owner"/>
7013                 </create>
7014                 <retrieve/>
7015                 <update permission="ADMIN_SURVEY">
7016                     <context link="question" jump="survey" field="owner"/>
7017                 </update>
7018                 <delete permission="ADMIN_SURVEY">
7019                     <context link="question" jump="survey" field="owner"/>
7020                 </delete>
7021             </actions>
7022         </permacrud>
7023         </class>
7024         <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">
7025                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7026                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7027                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7028                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7029                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7030                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7031                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7032                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7033                 </fields>
7034                 <links>
7035                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7036                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7037                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7038                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7039                 </links>
7040                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7041                         <actions>
7042                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7043                         </actions>
7044                 </permacrud>
7045         </class>
7046         <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">
7047                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7048                         <field name="balance_owed" reporter:datatype="money" />
7049                         <field name="total_owed" reporter:datatype="money" />
7050                         <field name="total_paid" reporter:datatype="money" />
7051                         <field name="usr" reporter:datatype="link"/>
7052                 </fields>
7053                 <links>
7054                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7055                 </links>
7056         </class>
7057         <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">
7058                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7059                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7060                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7061                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7062                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7063                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7064                 </fields>
7065                 <links>
7066                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7067                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7068                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7069                 </links>
7070         </class>
7071         <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">
7072                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7073                         <field name="field" reporter:datatype="link"/>
7074                         <field name="id" reporter:datatype="id" />
7075                         <field name="source" reporter:datatype="link"/>
7076                         <field name="value" reporter:datatype="text"/>
7077                 </fields>
7078                 <links>
7079                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7080                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7081                 </links>
7082         </class>
7083         <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">
7084                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7085                         <field name="field" reporter:datatype="link"/>
7086                         <field name="id" reporter:datatype="id" />
7087                         <field name="source" reporter:datatype="link"/>
7088                         <field name="value" reporter:datatype="text"/>
7089                 </fields>
7090                 <links>
7091                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7092                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7093                 </links>
7094         </class>
7095         <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">
7096                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7097                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7098                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7099                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7100                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7101                 </fields>
7102                 <links>
7103                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7104                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7105                 </links>
7106         </class>
7107         <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">
7108                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7109                         <field name="depth" reporter:datatype="int" />
7110                         <field name="grantable" reporter:datatype="bool"/>
7111                         <field name="grp" reporter:datatype="link"/>
7112                         <field name="id" reporter:datatype="id" />
7113                         <field name="perm" reporter:datatype="link"/>
7114                 </fields>
7115                 <links>
7116                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7117                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7118                 </links>
7119         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7120             <actions>
7121                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7122                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7123                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7124                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7125             </actions>
7126         </permacrud>
7127         </class>
7128         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
7129                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7130                         <field name="items" oils_persist:virtual="true" />
7131                         <field name="btype" reporter:datatype="text"/>
7132                         <field name="id" reporter:datatype="id" />
7133                         <field name="name" reporter:datatype="text"/>
7134                         <field name="description" reporter:datatype="text"/>
7135                         <field name="owner" reporter:datatype="link"/>
7136                         <field name="pub" reporter:datatype="bool"/>
7137                         <field name="create_time" reporter:datatype="timestamp" />
7138                 </fields>
7139                 <links>
7140                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7141                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
7142                 </links>
7143         </class>
7144         <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">
7145                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
7146                         <field name="id" reporter:datatype="id" />
7147                         <field name="bucket" reporter:datatype="link"/>
7148                         <field name="note" reporter:datatype="text" />
7149                 </fields>
7150                 <links>
7151                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
7152                 </links>
7153         </class>
7154         <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">
7155                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
7156                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
7157                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7158                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
7159                 </fields>
7160                 <links>
7161                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7162                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
7163                 </links>
7164         </class>
7165         <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">
7166                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
7167                         <field name="depth" reporter:datatype="int"/>
7168                         <field name="grantable" reporter:datatype="bool"/>
7169                         <field name="id" reporter:datatype="id" />
7170                         <field name="perm" reporter:datatype="link"/>
7171                         <field name="usr" reporter:datatype="link"/>
7172                 </fields>
7173                 <links>
7174                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7175                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7176                 </links>
7177         </class>
7178         <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">
7179                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
7180                         <field name="object_id" reporter:datatype="text"/>
7181                         <field name="grantable" reporter:datatype="bool"/>
7182                         <field name="id" reporter:datatype="id" />
7183                         <field name="perm" reporter:datatype="link"/>
7184                         <field name="usr" reporter:datatype="link"/>
7185                         <field name="object_type" reporter:datatype="text"/>
7186                 </fields>
7187                 <links>
7188                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7189                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7190                 </links>
7191         </class>
7192         <class id="mp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::payment" oils_persist:tablename="money.payment_view" reporter:core="true" reporter:label="Payments: All">
7193                 <fields oils_persist:primary="id" oils_persist:sequence="">
7194                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7195                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7196                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7197                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7198                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7199                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7200                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7201                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7208                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7209                 </fields>
7210                 <links>
7211                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7212                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7213                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7214                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7215                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7216                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7217                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7218                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7219                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7220                 </links>
7221         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7222             <actions>
7223                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7224                     <context link="xact" jump="usr" field="home_ou"/>
7225                 </retrieve>
7226                         </actions>
7227                 </permacrud>
7228         </class>
7229         <class id="mbp" controller="open-ils.cstore" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
7230                 <fields oils_persist:primary="id" oils_persist:sequence="">
7231                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7232                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7233                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7234                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7235                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7236                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7237                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7238                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7239                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7240                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7241                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7242                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7243                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7244                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7245                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7246                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7247                 </fields>
7248                 <links>
7249                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7250                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7251                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7252                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7253                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7254                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7255                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7256                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7257                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7258                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7259                 </links>
7260         </class>
7261         <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">
7262                 <fields oils_persist:primary="id" oils_persist:sequence="">
7263                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7264                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7265                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7266                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7267                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7268                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7269                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7270                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7271                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7272                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7273                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7274                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7275                 </fields>
7276                 <links>
7277                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7278                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7279                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7280                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7281                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7282                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7283                 </links>
7284         </class>
7285         <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">
7286                 <fields oils_persist:primary="id" oils_persist:sequence="">
7287                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7288                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7289                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7290                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7291                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7292                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7293                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7294                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
7295                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7296                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7297                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7298                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7299                 </fields>
7300                 <links>
7301                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7302                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7303                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7304                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7305                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7306                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7307                 </links>
7308         </class>
7309         <class id="cbrebi" controller="open-ils.cstore" 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">
7310                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7311                         <field name="bucket" reporter:datatype="link"/>
7312                         <field name="id" reporter:datatype="id" />
7313                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7314                         <field name="create_time" reporter:datatype="timestamp" />
7315                         <field name="pos" reporter:datatype="int" />
7316                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7317                 </fields>
7318                 <links>
7319                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7320                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7321             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7322                 </links>
7323         </class>
7324         <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">
7325                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7326                         <field name="id" reporter:datatype="id" />
7327                         <field name="item" reporter:datatype="link"/>
7328                         <field name="note" reporter:datatype="text" />
7329                 </fields>
7330                 <links>
7331                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7332                 </links>
7333         </class>
7334         <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">
7335                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7336                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7337                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7338                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7339                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7340                 </fields>
7341                 <links>
7342                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7343                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7344                 </links>
7345                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7346                         <actions>
7347                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7348                         </actions>
7349                 </permacrud>
7350         </class>
7351     <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">
7352         <fields oils_persist:primary="field">
7353             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7354             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7355             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7356         </fields>
7357         <links/>
7358         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7359             <actions>
7360                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7361                 <retrieve />
7362                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7363                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7364             </actions>
7365         </permacrud>
7366     </class>
7367         <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">
7368                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7369                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7370                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7371                 </fields>
7372                 <links/>
7373         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7374             <actions>
7375                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7376                 <retrieve/>
7377                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7378                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7379             </actions>
7380         </permacrud>
7381         </class>
7382
7383
7384         <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">
7385                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7386                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7387                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7388                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7389                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7390                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7391                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7392                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7393                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7394                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7395                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7396                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7397                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7398                 </fields>
7399                 <links>
7400                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7401                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7402                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7403                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7404                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7405                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7406                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7407                 </links>
7408         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7409             <actions>
7410                 <create permission="TRANSIT_COPY">
7411                     <context link="target_copy" field="owner"/>
7412                 </create>
7413                 <retrieve/>
7414                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7415                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7416             </actions>
7417         </permacrud>
7418         </class>
7419         <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">
7420                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7421                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7422                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7423                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7424                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7425                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7426                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7427                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7428                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7429                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7430                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7431                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7432                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7433                 </fields>
7434                 <links>
7435                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7436                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7437                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7438                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7439                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7440                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7441                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7442                 </links>
7443         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7444             <actions>
7445                 <create permission="TRANSIT_COPY" context_field="owner">
7446                     <context link="target_copy" field="circ_lib"/>
7447                 </create>
7448                 <retrieve/>
7449                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7450                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7451             </actions>
7452         </permacrud>
7453         </class>
7454         <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">
7455                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7456                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7457                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7458                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7459                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7460                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7461                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7462                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7463                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7464                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7465                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7466                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
7467                 </fields>
7468                 <links>
7469                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7470                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7471                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7472                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
7473                 </links>
7474         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7475             <actions>
7476                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7477                     <context link="xact" jump="usr" field="home_ou"/>
7478                 </retrieve>
7479                         </actions>
7480                 </permacrud>
7481         </class>
7482         <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">
7483                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7484                         <field name="grp" />
7485                         <field name="id" reporter:datatype="id" />
7486                         <field name="usr" />
7487                 </fields>
7488                 <links>
7489                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7490                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7491                 </links>
7492         </class>
7493         <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">
7494                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7495                         <field name="id" reporter:datatype="id" />
7496                         <field name="fq_field" reporter:datatype="text"/>
7497                         <field name="identity_value" reporter:datatype="text"/>
7498                         <field name="translation" reporter:datatype="text"/>
7499                         <field name="string" reporter:datatype="text"/>
7500                 </fields>
7501                 <links>
7502                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7503                 </links>
7504         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7505             <actions>
7506                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7507                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7508                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7509                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7510             </actions>
7511         </permacrud>
7512         </class>
7513         <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">
7514                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7515                         <field name="id" reporter:datatype="id" />
7516                         <field name="fm_class" reporter:datatype="text"/>
7517                         <field name="field" reporter:datatype="text"/>
7518                         <field name="owner" reporter:datatype="org_unit"/>
7519                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7520                 </fields>
7521                 <links>
7522                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7523                 </links>
7524         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7525             <actions>
7526                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7527                 <retrieve/>
7528                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7529                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7530             </actions>
7531         </permacrud>
7532         </class>
7533         <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">
7534                 <fields oils_persist:primary="code">
7535                         <field name="code" reporter:datatype="id" />
7536                         <field name="marc_code" reporter:datatype="text"/>
7537                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7538                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7539                         <field name="rtl" reporter:datatype="bool"/>
7540                 </fields>
7541                 <links/>
7542         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7543             <actions>
7544                 <create permission="CREATE_LOCALE" global_required="true"/>
7545                 <retrieve/>
7546                 <update permission="UPDATE_LOCALE" global_required="true"/>
7547                 <delete permission="DELETE_LOCALE" global_required="true"/>
7548             </actions>
7549         </permacrud>
7550         </class>
7551         <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">
7552                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7553                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7554                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7555                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7556             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7557                 </fields>
7558                 <links>
7559                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7560                 </links>
7561         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7562             <actions>
7563                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7564                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7565                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7566                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7567             </actions>
7568         </permacrud>
7569         </class>
7570
7571         <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">
7572                 <fields oils_persist:primary="id">
7573                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7574                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7575                 </fields>
7576                 <links/>
7577         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7578             <actions>
7579                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7580                 <retrieve/>
7581                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7582                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7583             </actions>
7584         </permacrud>
7585         </class>
7586
7587         <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">
7588                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7589                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7590                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7591                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7592                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7593                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7594                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7595                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7596                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7597                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7598                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7599                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7600                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7601                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7602                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7603                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7604                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7605                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7606                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7607                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7608                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7609                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7610                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7611                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7612                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7613                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7614                 </fields>
7615                 <links>
7616                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7617                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7618                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7619                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7620                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7621                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7622                 </links>
7623         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7624             <actions>
7625                 <create permission="user_request.create">
7626                     <context link="usr" field="home_ou"/>
7627                                 </create>
7628                 <retrieve permission="user_request.view">
7629                     <context link="usr" field="home_ou"/>
7630                                 </retrieve>
7631                 <update permission="user_request.update">
7632                     <context link="usr" field="home_ou"/>
7633                                 </update>
7634                 <delete permission="user_request.delete">
7635                     <context link="usr" field="home_ou"/>
7636                                 </delete>
7637             </actions>
7638         </permacrud>
7639         </class>
7640
7641         <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">
7642                 <fields oils_persist:primary="code">
7643                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7644                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7645                 </fields>
7646                 <links/>
7647         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7648             <actions>
7649                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7650                 <retrieve/>
7651                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7652                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7653             </actions>
7654         </permacrud>
7655         </class>
7656
7657         <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">
7658                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7659                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7660                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7661                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7662                         <field reporter:label="Ratio" name="ratio" />
7663                 </fields>
7664                 <links>
7665                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7666                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7667                 </links>
7668                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7669                         <actions>
7670                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7671                                 <retrieve/>
7672                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7673                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7674                         </actions>
7675                 </permacrud>
7676         </class>
7677
7678         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7679                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7680                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7681                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7682                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7683                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7684                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7685                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7686                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7687                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7688                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7689                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7690                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7691                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7692                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7693                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7694                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7695                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7696                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7697                 </fields>
7698                 <links>
7699                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7700                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7701             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7702             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7703             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7704                 </links>
7705         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7706             <actions>
7707                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7708                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7709                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7710                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7711             </actions>
7712         </permacrud>
7713         </class>
7714
7715         <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">
7716                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7717                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7718                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7719                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7720                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7721                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7722                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7723                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7724                 </fields>
7725                 <links>
7726                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7727                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7728                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7729                 </links>
7730         </class>
7731
7732         <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">
7733                 <fields oils_persist:primary="code">
7734                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7735                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7736                 </fields>
7737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7738             <actions>
7739                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7740                 <retrieve/>
7741                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7742                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7743             </actions>
7744                 </permacrud>
7745         </class>
7746
7747         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7748                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7749                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7750                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7751                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7752                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7753                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7754                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7755                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7756                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7757                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7758                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7759                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7760                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7761                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7762                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7763                 </fields>
7764                 <links>
7765                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7766                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7767                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7768                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7769                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7770                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7771                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7772                 </links>
7773         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7774             <actions>
7775                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7776                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7777                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7778                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7779             </actions>
7780         </permacrud>
7781         </class>
7782
7783         <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">
7784                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7785                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7786                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7787                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7788                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7789                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7790                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7791                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7792                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7793                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7794                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7795                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7796                 </fields>
7797                 <links>
7798                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7799                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7800                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7801                 </links>
7802         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7803             <actions>
7804                 <create   permission="ADMIN_INVOICE">
7805                                         <context link="invoice" field="receiver"/>
7806                                 </create>
7807                 <retrieve permission="ADMIN_INVOICE">
7808                                         <context link="invoice" field="receiver"/>
7809                                 </retrieve>
7810                 <update   permission="ADMIN_INVOICE">
7811                                         <context link="invoice" field="receiver"/>
7812                                 </update>
7813                                 <delete   permission="ADMIN_INVOICE">
7814                                         <context link="invoice" field="receiver"/>
7815                                 </delete>
7816             </actions>
7817         </permacrud>
7818         </class>
7819
7820         <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">
7821                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7822                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7823                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7824                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7825                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7826                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7827                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7828                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7829                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7830                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7831                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7832                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7833                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7834                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7835                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7836                 </fields>
7837                 <links>
7838                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7839                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7840                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7841                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7842                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7843                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7844                 </links>
7845         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7846             <actions>
7847                 <create   permission="ADMIN_INVOICE">
7848                                         <context link="invoice" field="receiver"/>
7849                                 </create>
7850                 <retrieve permission="ADMIN_INVOICE">
7851                                         <context link="invoice" field="receiver"/>
7852                                 </retrieve>
7853                 <update   permission="ADMIN_INVOICE">
7854                                         <context link="invoice" field="receiver"/>
7855                                 </update>
7856                                 <delete   permission="ADMIN_INVOICE">
7857                                         <context link="invoice" field="receiver"/>
7858                                 </delete>
7859             </actions>
7860         </permacrud>
7861         </class>
7862
7863         <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">
7864                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7865                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7866                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7867                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7868                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7869                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7870                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7871                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7872                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7873                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7874                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7875                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7876                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7877                 </fields>
7878                 <links>
7879                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7880                 </links>
7881         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7882             <actions>
7883                 <create permission="ADMIN_PROVIDER">
7884                     <context link="provider" field="owner"/>
7885                 </create>
7886                 <retrieve permission="ADMIN_PROVIDER">
7887                     <context link="provider" field="owner"/>
7888                 </retrieve>
7889                 <update permission="ADMIN_PROVIDER">
7890                     <context link="provider" field="owner"/>
7891                 </update>
7892                 <delete permission="ADMIN_PROVIDER">
7893                     <context link="provider" field="owner"/>
7894                 </delete>
7895             </actions>
7896         </permacrud>
7897         </class>
7898
7899         <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">
7900                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7901                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7902                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7903                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7904                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7905                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7906                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7907         </fields>
7908                 <links>
7909                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7910                 </links>
7911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7912             <actions>
7913                 <create permission="ADMIN_PROVIDER">
7914                     <context link="provider" field="owner"/>
7915                 </create>
7916                 <retrieve permission="ADMIN_PROVIDER">
7917                     <context link="provider" field="owner"/>
7918                 </retrieve>
7919                 <update permission="ADMIN_PROVIDER">
7920                     <context link="provider" field="owner"/>
7921                 </update>
7922                 <delete permission="ADMIN_PROVIDER">
7923                     <context link="provider" field="owner"/>
7924                 </delete>
7925             </actions>
7926         </permacrud>
7927     </class>
7928         <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">
7929                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7930                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7931                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7932                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7933                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7934                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7935                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7936                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7937                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7938                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7939                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7940                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7941                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7942                 </fields>
7943                 <links>
7944                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7945                 </links>
7946         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7947             <actions>
7948                 <create permission="ADMIN_PROVIDER">
7949                     <context link="contact" jump='provider' field="owner"/>
7950                 </create>
7951                 <retrieve permission="ADMIN_PROVIDER">
7952                     <context link="contact" jump='provider' field="owner"/>
7953                 </retrieve>
7954                 <update permission="ADMIN_PROVIDER">
7955                     <context link="contact" jump='provider' field="owner"/>
7956                 </update>
7957                 <delete permission="ADMIN_PROVIDER">
7958                     <context link="contact" jump='provider' field="owner"/>
7959                 </delete>
7960             </actions>
7961         </permacrud>
7962         </class>
7963
7964         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7965                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7966                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7967                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7968                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7969                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7970                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7971                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7972                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7973                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7974                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7975                 </fields>
7976                 <links>
7977                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7978                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7979                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7980                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7981                 </links>
7982         </class>
7983
7984         <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">
7985                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7986                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7987                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7988                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7989                 </fields>
7990                 <links>
7991             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7992                 </links>
7993                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7994                         <actions>
7995                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7996                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7997                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7998                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7999                         </actions>
8000                 </permacrud>
8001         </class>
8002
8003         <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">
8004                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
8005                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
8006                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
8007                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
8008                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
8009                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
8010                 </fields>
8011                 <links>
8012                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
8013                 </links>
8014                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8015                         <actions>
8016                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8017                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8018                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8019                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8020                         </actions>
8021                 </permacrud>
8022         </class>
8023
8024         <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">
8025                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
8026                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8027                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8028                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8029                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8030                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8031                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8032                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8033                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
8034                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
8035                 </fields>
8036                 <links>
8037                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8038                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8039             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
8040             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
8041                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
8042                 </links>
8043         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8044             <actions>
8045                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8046                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
8047                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8048                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8049             </actions>
8050         </permacrud>
8051         </class>
8052
8053         <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">
8054                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
8055                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
8056                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
8057                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8058                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8059                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
8060                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
8061                 </fields>
8062                 <links>
8063                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8064                 </links>
8065                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8066                         <actions>
8067                                 <create permission="ADMIN_FUNDING_SOURCE">
8068                     <context link="funding_source" field="owner"/>
8069                 </create>
8070                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
8071                     <context link="funding_source" field="owner"/>
8072                 </retrieve>
8073                                 <update permission="ADMIN_FUNDING_SOURCE">
8074                     <context link="funding_source" field="owner"/>
8075                 </update>
8076                                 <delete permission="ADMIN_FUNDING_SOURCE">
8077                     <context link="funding_source" field="owner"/>
8078                 </delete>
8079                         </actions>
8080                 </permacrud>
8081         </class>
8082
8083         <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">
8084                 <fields oils_persist:primary="id">
8085                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
8086                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
8087                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
8088                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
8089                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8090                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8091                 </fields>
8092                 <links>
8093                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8094                 </links>
8095         </class>
8096
8097         <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">
8098                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
8099                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
8100                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8101                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
8102                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
8103                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8104                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
8105                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
8106                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8107                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
8108                 </fields>
8109                 <links>
8110                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8111                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8112                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
8113                 </links>
8114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8115                         <actions>
8116                                 <create permission="ADMIN_ACQ_FUND">
8117                     <context link="fund" field="org"/>
8118                 </create>
8119                                 <retrieve permission="ADMIN_ACQ_FUND">
8120                     <context link="fund" field="org"/>
8121                 </retrieve>
8122                                 <update permission="ADMIN_ACQ_FUND">
8123                     <context link="fund" field="org"/>
8124                 </update>
8125                                 <delete permission="ADMIN_ACQ_FUND">
8126                     <context link="fund" field="org"/>
8127                 </delete>
8128                         </actions>
8129                 </permacrud>
8130         </class>
8131
8132         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
8133                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8134                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8135                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8136                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8137                         <field reporter:label="Year" name="year" reporter:datatype="int" />
8138                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8139                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8140                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8141                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8142                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8143                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8144                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8145                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8146                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8147                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
8148                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8149                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
8150                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
8151                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
8152                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
8153                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8154                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8155                 </fields>
8156                 <links>
8157                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8158                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8159             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
8160             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
8161             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
8162             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
8163             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
8164             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
8165             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
8166             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
8167             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
8168                 </links>
8169         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
8170             <actions>
8171                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
8172                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8173                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
8174                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
8175             </actions>
8176         </permacrud>
8177         </class>
8178
8179         <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">
8180                 <fields oils_persist:primary="fund">
8181                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8182                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8183                 </fields>
8184                 <links>
8185                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8186                 </links>
8187         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8188             <actions>
8189                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8190                                         <context link="fund" field="org" />
8191                 </retrieve>
8192             </actions>
8193         </permacrud>
8194         </class>
8195
8196         <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">
8197                 <fields oils_persist:primary="fund">
8198                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8199                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
8200                 </fields>
8201                 <links>
8202                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8203                 </links>
8204         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8205             <actions>
8206                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8207                                         <context link="fund" field="org" />
8208                 </retrieve>
8209             </actions>
8210         </permacrud>
8211         </class>
8212
8213         <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">
8214                 <fields oils_persist:primary="fund">
8215                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8216                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
8217                 </fields>
8218                 <links>
8219                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8220                 </links>
8221         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8222             <actions>
8223                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8224                                         <context link="fund" field="org" />
8225                 </retrieve>
8226             </actions>
8227         </permacrud>
8228         </class>
8229
8230         <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">
8231                 <fields oils_persist:primary="fund">
8232                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8233                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8234                 </fields>
8235                 <links>
8236                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8237                 </links>
8238         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8239             <actions>
8240                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8241                                         <context link="fund" field="org" />
8242                 </retrieve>
8243             </actions>
8244         </permacrud>
8245         </class>
8246
8247         <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">
8248                 <fields oils_persist:primary="fund">
8249                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8250                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
8251                 </fields>
8252                 <links>
8253                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8254                 </links>
8255         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8256             <actions>
8257                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8258                                         <context link="fund" field="org" />
8259                 </retrieve>
8260             </actions>
8261         </permacrud>
8262         </class>
8263
8264    <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">
8265         <fields oils_persist:primary="fund">
8266             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8267             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8268         </fields>
8269         <links>
8270             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8271         </links>
8272     </class>
8273
8274    <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">
8275         <fields oils_persist:primary="fund">
8276             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8277             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
8278         </fields>
8279         <links>
8280             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8281         </links>
8282     </class>
8283
8284    <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">
8285         <fields oils_persist:primary="fund">
8286             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8287             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8288         </fields>
8289         <links>
8290             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8291         </links>
8292     </class>
8293
8294    <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">
8295         <fields oils_persist:primary="fund">
8296             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8297             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
8298         </fields>
8299         <links>
8300             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8301         </links>
8302     </class>
8303
8304    <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">
8305         <fields oils_persist:primary="fund">
8306             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8307             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
8308         </fields>
8309         <links>
8310             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8311         </links>
8312     </class>
8313
8314         <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">
8315                 <fields oils_persist:primary="funding_source">
8316                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8317                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8318                 </fields>
8319                 <links>
8320                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8321                 </links>
8322         </class>
8323
8324         <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">
8325                 <fields oils_persist:primary="funding_source">
8326                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8327                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8328                 </fields>
8329                 <links>
8330                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8331                 </links>
8332         </class>
8333
8334         <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">
8335                 <fields oils_persist:primary="funding_source">
8336                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8337                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8338                 </fields>
8339                 <links>
8340                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8341                 </links>
8342         </class>
8343
8344         <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">
8345                 <fields oils_persist:primary="fund">
8346                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8347                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8348                 </fields>
8349                 <links>
8350                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8351                 </links>
8352         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8353             <actions>
8354                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8355                                         <context link="fund" field="org" />
8356                 </retrieve>
8357             </actions>
8358         </permacrud>
8359     </class>
8360     <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">
8361         <oils_persist:source_definition><![CDATA[
8362             SELECT
8363                 acqf.*,
8364                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8365                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8366                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8367                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8368             FROM
8369                 acq.fund acqf
8370                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8371                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8372                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8373                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8374         ]]></oils_persist:source_definition>
8375         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8376             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8377             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8378             <field reporter:label="Name" name="name" reporter:datatype="text" />
8379             <field reporter:label="Year" name="year" reporter:datatype="int" />
8380             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8381             <field reporter:label="Code" name="code" reporter:datatype="text" />
8382             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8383             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8384             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8385             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8386             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8387
8388             <!-- non fund-native fields -->
8389             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8390             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8391             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8392             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8393         </fields>
8394         <links>
8395             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8396             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8397             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8398         </links>
8399         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8400             <actions>
8401                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8402             </actions>
8403         </permacrud>
8404         </class>
8405         <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">
8406                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8407                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8408                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8409                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8410                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8411                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8412                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8413                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8414                 </fields>
8415                 <links>
8416                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8417                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8418                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8419                 </links>
8420                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8421                         <actions>
8422                                 <create permission="ADMIN_ACQ_FUND">
8423                     <context link="fund" field="org"/>
8424                 </create>
8425                                 <retrieve permission="ADMIN_ACQ_FUND">
8426                     <context link="fund" field="org"/>
8427                 </retrieve>
8428                                 <update permission="ADMIN_ACQ_FUND">
8429                     <context link="fund" field="org"/>
8430                 </update>
8431                                 <delete permission="ADMIN_ACQ_FUND">
8432                     <context link="fund" field="org"/>
8433                 </delete>
8434                         </actions>
8435                 </permacrud>
8436         </class>
8437
8438     <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">
8439         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8440             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8441             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8442             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8443             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8444             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8445             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8446             <field reporter:label="Note" name="note" reporter:datatype="text" />
8447             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8448         </fields>
8449         <links>
8450             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8451             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8452             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8453         </links>
8454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8455                         <actions>
8456                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8457                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8458                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8459                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8460                         </actions>
8461                 </permacrud>
8462     </class>
8463
8464         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8465                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8466                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8467                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8468                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8469                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8470                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8471                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8472                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8473                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8474                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8475                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8476                 </fields>
8477                 <links>
8478                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8479                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8480                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8481                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8482                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8483                 </links>
8484                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8485                         <actions>
8486                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8487                         </actions>
8488                 </permacrud>
8489         </class>
8490
8491         <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">
8492                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8493                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8494                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8495                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8496                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8497                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8498                 </fields>
8499                 <links>
8500                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8501                 </links>
8502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8503                         <actions>
8504                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8505                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8506                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8507                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8508                         </actions>
8509                 </permacrud>
8510         </class>
8511
8512         <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">
8513                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8514                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8515                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8516                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8517                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8518                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8519                         <field reporter:label="State" name="state" reporter:datatype="text" />
8520                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8521                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8522                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8523                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8524                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8525                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8526                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8527                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8528                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8529                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8530                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8531                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8532                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
8533                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8534                 </fields>
8535                 <links>
8536                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8537                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8538                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8539                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8540                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8541                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8542                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8543                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8544                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8545                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8546                 </links>
8547                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8548                         <actions>
8549                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8550                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8551                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8552                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8553                         </actions>
8554                 </permacrud>
8555         </class>
8556
8557         <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">
8558                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8559                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8560                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8561                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8562                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8563                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8564                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8565                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8566                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8567                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8568                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8569                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8570                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8571                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8572                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8573                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8574                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8575                 </fields>
8576                 <links>
8577                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8578                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8579                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8580                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8581                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8582                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8583                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8584                 </links>
8585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8586             <actions>
8587                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8588             </actions>
8589                 </permacrud>
8590         </class>
8591
8592         <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">
8593                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8594                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8595                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8596                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8597                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8598                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8599                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8600                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8601                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8602                 </fields>
8603                 <links>
8604                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8605                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8606                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8607                 </links>
8608                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8609             <actions>
8610                 <create permission="CREATE_PURCHASE_ORDER">
8611                     <context link="purchase_order" field="ordering_agency"/>
8612                 </create>
8613                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8614                     <context link="purchase_order" field="ordering_agency"/>
8615                 </retrieve>
8616                 <update permission="CREATE_PURCHASE_ORDER">
8617                     <context link="purchase_order" field="ordering_agency"/>
8618                 </update>
8619                 <delete permission="CREATE_PURCHASE_ORDER">
8620                     <context link="purchase_order" field="ordering_agency"/>
8621                 </delete>
8622             </actions>
8623                 </permacrud>
8624         </class>
8625
8626         <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">
8627                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8628                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8629                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8630                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8631                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8632                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8633                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8634                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8635                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8636                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8637                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8638                 </fields>
8639                 <links>
8640                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8641                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8642                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8643                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8644                 </links>
8645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8646             <actions>
8647                 <create permission="CREATE_PURCHASE_ORDER">
8648                     <context link="purchase_order" field="ordering_agency"/>
8649                 </create>
8650                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8651                     <context link="purchase_order" field="ordering_agency"/>
8652                 </retrieve>
8653                 <update permission="CREATE_PURCHASE_ORDER">
8654                     <context link="purchase_order" field="ordering_agency"/>
8655                 </update>
8656                 <delete permission="CREATE_PURCHASE_ORDER">
8657                     <context link="purchase_order" field="ordering_agency"/>
8658                 </delete>
8659             </actions>
8660                 </permacrud>
8661         </class>
8662
8663         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8664                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8665                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8666                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8667                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8668                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8669                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8670                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8671                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8672                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8673                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8674                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8675                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8676                         <field reporter:label="State" name="state" reporter:datatype="text" />
8677                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8678                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8679                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8680                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8681                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8682                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8683                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8684                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8685                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8686                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8687                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8688                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8689                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8690                 </fields>
8691                 <links>
8692                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8693                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8694                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8695                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8696                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8697                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8698                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8699                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8700                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8701                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8702                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8703                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8704                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8705                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8706                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8707                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8708                 </links>
8709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8710                         <actions>
8711                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8712                                         <context link="purchase_order" field="ordering_agency"/>
8713                                         <context link="picklist" field="org_unit"/>
8714                                 </retrieve>
8715                         </actions>
8716                 </permacrud>
8717         </class>
8718
8719         <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">
8720                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8721                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8722                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8723                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8724                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8725                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8726                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8727                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8728                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8729                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8730                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8731                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8732                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8733                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8734                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8735                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8736                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8737                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8738                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8739                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8740                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8741                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8742                 </fields>
8743                 <links>
8744                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8745                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8746                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8747                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8748                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8749                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8750                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8751                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8752                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8753                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8754                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8755                 </links>
8756                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8757                         <actions>
8758                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8759                                         <context link="purchase_order" field="ordering_agency"/>
8760                                         <context link="picklist" field="org_unit"/>
8761                                 </retrieve>
8762                         </actions>
8763                 </permacrud>
8764         </class>
8765
8766         <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">
8767                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8768                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8769                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8770                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8771                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8772                 </fields>
8773                 <links>
8774                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8775                 </links>
8776                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8777                         <actions>
8778                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8779                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8780                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8781                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8782                         </actions>
8783                 </permacrud>
8784         </class>
8785
8786         <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">
8787                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8788                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8789                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8790                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8791                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8792                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8793                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8794                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8795                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8796                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8797                 </fields>
8798                 <links>
8799                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8800                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8801                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8802                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8803                 </links>
8804         </class>
8805
8806         <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">
8807                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8808                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8809                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8810                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8811                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8812                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8813                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8814                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8815                 </fields>
8816                 <links>
8817                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8818                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8819                 </links>
8820         </class>
8821
8822         <class id="acqlid" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_detail" oils_persist:tablename="acq.lineitem_detail" reporter:label="Line Item Detail">
8823                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8824                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8825                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8826                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8827                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8828                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8829                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8830                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8831                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8832                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8833                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8834                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8835                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8836                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8837                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8838                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8839                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8840                 </fields>
8841                 <links>
8842                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8843                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8844                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8845                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8846                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8847                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8848                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8849                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8850                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8851                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8852                 </links>
8853         </class>
8854
8855         <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">
8856                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8857                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8858                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8859                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8860                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8861                 </fields>
8862                 <links/>
8863                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8864                         <actions>
8865                                 <retrieve />
8866                         </actions>
8867                 </permacrud>
8868         </class>
8869
8870         <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">
8871                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8872                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8873                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8874                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8875                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8876                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8877             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8878                 </fields>
8879                 <links/>
8880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8881             <actions>
8882                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8883                 <retrieve />
8884                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8885                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8886             </actions>
8887         </permacrud>
8888         </class>
8889
8890         <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">
8891                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8892                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8893                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8894                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8895                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8896                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8897                 </fields>
8898                 <links/>
8899         </class>
8900         <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">
8901                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8902                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8903                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8904                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8905                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8906                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8907                 </fields>
8908                 <links>
8909                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8910                 </links>
8911         </class>
8912
8913         <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">
8914             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8915                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8916                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8917                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8918                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8919                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8920                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8921         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8922
8923             </fields>
8924             <links>
8925                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8926             </links>
8927             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8928                 <actions>
8929                     <create permission="ADMIN_PROVIDER">
8930                         <context link="provider" field="owner"/>
8931                     </create>
8932                     <retrieve permission="ADMIN_PROVIDER">
8933                         <context link="provider" field="owner"/>
8934                     </retrieve>
8935                     <update permission="ADMIN_PROVIDER">
8936                         <context link="provider" field="owner"/>
8937                     </update>
8938                     <delete permission="ADMIN_PROVIDER">
8939                         <context link="provider" field="owner"/>
8940                     </delete>
8941                 </actions>
8942             </permacrud>
8943         </class>
8944         
8945         <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">
8946             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8947                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8948                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8949                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8950                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8951             </fields>
8952             <links>
8953                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8954             </links>
8955             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8956                 <actions>
8957                     <create permission="ADMIN_PROVIDER">
8958                         <context link="provider" field="owner"/>
8959                     </create>
8960                     <retrieve permission="ADMIN_PROVIDER">
8961                         <context link="provider" field="owner"/>
8962                     </retrieve>
8963                     <update permission="ADMIN_PROVIDER">
8964                         <context link="provider" field="owner"/>
8965                     </update>
8966                     <delete permission="ADMIN_PROVIDER">
8967                         <context link="provider" field="owner"/>
8968                     </delete>
8969                 </actions>
8970             </permacrud>
8971         </class>
8972         
8973         <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">
8974             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8975                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8976                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8977                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8978                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8979                 </fields>
8980                 <links/>
8981         </class>
8982
8983         <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">
8984                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8985                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8986                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8987                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8988                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8989                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8990                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8991                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8992                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8993                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8994                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8995                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8996                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8997                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8998                 </fields>
8999                 <links>
9000                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9001                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9002                 </links>
9003         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9004             <actions>
9005                 <create permission="ADMIN_PROVIDER">
9006                     <context link="provider" field="owner"/>
9007                 </create>
9008                 <retrieve permission="ADMIN_PROVIDER">
9009                     <context link="provider" field="owner"/>
9010                 </retrieve>
9011                 <update permission="ADMIN_PROVIDER">
9012                     <context link="provider" field="owner"/>
9013                 </update>
9014                 <delete permission="ADMIN_PROVIDER">
9015                     <context link="provider" field="owner"/>
9016                 </delete>
9017             </actions>
9018         </permacrud>
9019         </class>
9020
9021         <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">
9022                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
9023                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
9024                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
9025                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
9026                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
9027                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
9028                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
9029                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
9030                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
9031                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
9032                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
9033                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
9034                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
9035                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
9036                 </fields>
9037                 <links>
9038                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
9039                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9040                 </links>
9041         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9042             <actions>
9043                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9044                     <context link="account" jump="provider" field="owner"/>
9045                 </retrieve>
9046                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9047                     <context link="account" jump="provider" field="owner"/>
9048                 </update>
9049                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9050                     <context link="account" jump="provider" field="owner"/>
9051                 </delete>
9052             </actions>
9053         </permacrud>
9054         </class>
9055
9056
9057         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
9058                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
9059                         <field name="id" reporter:datatype="id" />
9060                         <field name="parent" reporter:datatype="link"/>
9061                         <field name="owner" reporter:datatype="link"/>
9062                         <field name="create_time" reporter:datatype="timestamp"/>
9063                         <field name="name" reporter:datatype="text"/>
9064                         <field name="shared" reporter:datatype="bool"/>
9065                         <field name="share_with" reporter:datatype="link"/>
9066                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9067                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
9068                 </fields>
9069                 <links>
9070                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9071                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
9072                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
9073                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9074                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
9075                 </links>
9076         </class>
9077         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
9078                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
9079                         <field name="id" reporter:datatype="id" />
9080                         <field name="parent" reporter:datatype="link"/>
9081                         <field name="owner" reporter:datatype="link"/>
9082                         <field name="create_time" reporter:datatype="timestamp"/>
9083                         <field name="name" reporter:datatype="text"/>
9084                         <field name="shared" reporter:datatype="bool"/>
9085                         <field name="share_with" reporter:datatype="link"/>
9086                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9087                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
9088                 </fields>
9089                 <links>
9090                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9091                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
9092                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
9093                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9094                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
9095                 </links>
9096         </class>
9097         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
9098                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
9099                         <field name="id" reporter:datatype="id" />
9100                         <field name="parent" reporter:datatype="link"/>
9101                         <field name="owner" reporter:datatype="link"/>
9102                         <field name="create_time" reporter:datatype="timestamp"/>
9103                         <field name="name" reporter:datatype="text"/>
9104                         <field name="shared" reporter:datatype="bool"/>
9105                         <field name="share_with" reporter:datatype="link"/>
9106                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9107                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9108                 </fields>
9109                 <links>
9110                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9111                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
9112                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
9113                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9114                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
9115                 </links>
9116         </class>
9117         <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">
9118                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
9119                         <field name="id" reporter:datatype="id" />
9120                         <field name="owner" reporter:datatype="link"/>
9121                         <field name="create_time" reporter:datatype="timestamp"/>
9122                         <field name="name" reporter:datatype="text"/>
9123                         <field name="data" reporter:datatype="text"/>
9124                         <field name="folder" reporter:datatype="link"/>
9125                         <field name="description" reporter:datatype="text"/>
9126                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9127                 </fields>
9128                 <links>
9129                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9130                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
9131                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
9132                 </links>
9133         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9134             <actions>
9135                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9136                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9137                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9138                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9139             </actions>
9140         </permacrud>
9141         </class>
9142         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
9143                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
9144                         <field name="id" reporter:datatype="id" />
9145                         <field name="owner" reporter:datatype="link"/>
9146                         <field name="create_time" reporter:datatype="timestamp"/>
9147                         <field name="template" reporter:datatype="link"/>
9148                         <field name="data" reporter:datatype="text"/>
9149                         <field name="folder" reporter:datatype="link"/>
9150                         <field name="recur" reporter:datatype="bool"/>
9151                         <field name="recurrence" reporter:datatype="interval"/>
9152                         <field name="name" reporter:datatype="text"/>
9153                         <field name="description" reporter:datatype="text"/>
9154                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
9155                 </fields>
9156                 <links>
9157                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9158                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
9159                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
9160                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
9161                 </links>
9162         </class>
9163         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
9164                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
9165                         <field name="id" reporter:datatype="id" />
9166                         <field name="runner" reporter:datatype="link"/>
9167                         <field name="start_time" reporter:datatype="timestamp"/>
9168                         <field name="complete_time" reporter:datatype="timestamp"/>
9169                         <field name="run_time" reporter:datatype="timestamp"/>
9170                         <field name="email" reporter:datatype="text"/>
9171                         <field name="excel_format" reporter:datatype="bool"/>
9172                         <field name="csv_format" reporter:datatype="bool"/>
9173                         <field name="html_format" reporter:datatype="bool"/>
9174                         <field name="error_code" reporter:datatype="int"/>
9175                         <field name="error_text" reporter:datatype="text"/>
9176                         <field name="report" reporter:datatype="link"/>
9177                         <field name="folder" reporter:datatype="link"/>
9178                         <field name="chart_pie" reporter:datatype="bool"/>
9179                         <field name="chart_bar" reporter:datatype="bool"/>
9180                         <field name="chart_line" reporter:datatype="bool"/>
9181                 </fields>
9182                 <links>
9183                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
9184                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
9185                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
9186                 </links>
9187         </class>
9188         <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">
9189                 <fields oils_persist:primary="id">
9190                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9191                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9192                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9193                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9194                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9195                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9196                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9197                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9198                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9199                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9200                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9201                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9202                 </fields>
9203                 <links>
9204                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9205                 </links>
9206                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9207                         <actions>
9208                                 <retrieve />
9209                         </actions>
9210                 </permacrud>
9211         </class>
9212         <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">
9213                 <fields oils_persist:primary="id">
9214                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9215                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9216                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9217                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9218                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9219                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9220                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9221                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9222                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9223                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9224                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9225                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9226                 </fields>
9227                 <links>
9228                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9229                 </links>
9230         </class>
9231         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
9232                 <fields oils_persist:primary="id">
9233                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9234                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
9235                         <field reporter:label="Fingerprint" name="fingerprint" />
9236                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9237                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9238                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9239                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9240                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
9241                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9242                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9243                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9244                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
9245                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
9246                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
9247                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9248                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9249                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
9250                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
9251                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
9252                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
9253                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
9254                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
9255                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9256                 </fields>
9257                 <links>
9258                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
9259                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9260                 </links>
9261         </class>
9262         <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">
9263                 <fields oils_persist:primary="id">
9264                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
9265                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
9266                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
9267                 </fields>
9268                 <links>
9269                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
9270                 </links>
9271         </class>
9272         <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">
9273                 <fields oils_persist:primary="id">
9274                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
9275                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
9276                 </fields>
9277                 <links>
9278                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
9279                 </links>
9280         </class>
9281         <class id="rhrr" controller="open-ils.reporter-store open-ils.cstore" oils_obj:fieldmapper="reporter::hold_request_record" oils_persist:tablename="reporter.hold_request_record" reporter:label="Hold Request Record">
9282                 <fields oils_persist:primary="id">
9283                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
9284                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
9285                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
9286                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
9287                 </fields>
9288                 <links>
9289                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
9290                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
9291                 </links>
9292         </class>
9293         <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">
9294                 <fields oils_persist:primary="xact">
9295                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9296                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
9297                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
9298                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
9299                 </fields>
9300                 <links>
9301                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9302                 </links>
9303         </class>
9304         <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">
9305                 <fields oils_persist:primary="xact">
9306                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9307                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
9308                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
9309                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
9310                 </fields>
9311                 <links>
9312                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9313                 </links>
9314         </class>
9315         <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)">
9316                 <fields oils_persist:primary="id">
9317                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
9318                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
9319                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
9320                 </fields>
9321                 <links>
9322                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9323                 </links>
9324         </class>
9325         <class id="erfcc" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::full_circ_count" oils_persist:tablename="extend_reporter.full_circ_count" reporter:label="Total Circulation Count, Including Legacy">
9326                 <fields oils_persist:primary="id">
9327                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9328                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9329                 </fields>
9330                 <links>
9331                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9332                 </links>
9333         </class>
9334         <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">
9335                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9336                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9337                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9338                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9339                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9340                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9341                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9342                 </fields>
9343                 <links>
9344                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9345                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9346                 </links>
9347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9348                         <actions>
9349                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9350                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9351                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9352                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9353                         </actions>
9354                 </permacrud>
9355         </class>
9356         <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">
9357                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9358                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9359                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9360                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9361                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9362                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9363                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9364                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9365                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9366                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9367                 </fields>
9368                 <links>
9369                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9370                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9371                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9372                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9373                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9374                 </links>
9375                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9376                         <actions>
9377                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9378                                         <context link="formula" field="owner"/>
9379                                 </create>
9380                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9381                                         <context link="formula" field="owner"/>
9382                                 </retrieve>
9383                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9384                                         <context link="formula" field="owner"/>
9385                                 </update>
9386                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9387                                         <context link="formula" field="owner"/>
9388                                 </delete>
9389                         </actions>
9390                 </permacrud>
9391         </class>
9392
9393         <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">
9394                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9395                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9396                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9397                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9398                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9399                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9400                 </fields>
9401                 <links>
9402                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9403                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9404                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9405                 </links>
9406                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9407                         <actions>
9408                                 <create permission="CREATE_PURCHASE_ORDER">
9409                                         <context link="formula" field="owner"/>
9410                 </create>
9411                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9412                                         <context link="formula" field="owner"/>
9413                 </retrieve>
9414                                 <update permission="CREATE_PURCHASE_ORDER">
9415                                         <context link="formula" field="owner"/>
9416                 </update>
9417                                 <delete permission="CREATE_PURCHASE_ORDER">
9418                                         <context link="formula" field="owner"/>
9419                 </delete>
9420                         </actions>
9421                 </permacrud>
9422         </class>
9423
9424         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9425                 <fields oils_persist:primary="id">
9426                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9427                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9428                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9429                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9430                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9431                 </fields>
9432                 <links>
9433                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9434                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9435                 </links>
9436         </class>
9437
9438         <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">
9439                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9440                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9441                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9442                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9443                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9444                 </fields>
9445                 <links>
9446                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9447                 </links>
9448                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9449                         <actions>
9450                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9451                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9452                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9453                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9454                         </actions>
9455                 </permacrud>
9456         </class>
9457
9458         <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">
9459                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9460                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9461                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9462                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9463                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9464                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9465                 </fields>
9466                 <links>
9467                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9468                 </links>
9469                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9470                         <actions>
9471                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9472                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9473                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9474                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9475                         </actions>
9476                 </permacrud>
9477         </class>
9478
9479         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9480                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9481                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9482                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9483                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9484                 </fields>
9485                 <links>
9486                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9487                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9488                 </links>
9489         </class>
9490
9491         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9492                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9493                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9494                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9495                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9496                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9497                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9498                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9499                 </fields>
9500                 <links>
9501                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9502                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9503                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9504                 </links>
9505         </class>
9506
9507         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9508                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9509                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9510                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9511                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9512                 </fields>
9513                 <links>
9514                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9515                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9516                 </links>
9517         </class>
9518
9519         <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">
9520                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9521                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9522                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9523                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9524                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9525                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9526                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9527                 </fields>
9528                 <links>
9529                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9530                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9531                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9532                 </links>
9533         </class>
9534
9535         <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">
9536                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9537                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9538                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9539                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9540                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9541                 </fields>
9542                 <links>
9543                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9544                 </links>
9545                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9546             <actions>
9547                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9548                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9549                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9550                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9551             </actions>
9552                 </permacrud>
9553         </class>
9554
9555         <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">
9556                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9557                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9558                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9559                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9560                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9561                 </fields>
9562                 <links>
9563                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9564                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9565                 </links>
9566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9567                         <actions>
9568                                 <create permission="ADMIN_CLAIM_POLICY">
9569                                         <context link="claim_policy" field="org_unit"/>
9570                 </create>
9571                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9572                                         <context link="claim_policy" field="org_unit"/>
9573                 </retrieve>
9574                                 <update permission="ADMIN_CLAIM_POLICY">
9575                                         <context link="claim_policy" field="org_unit"/>
9576                 </update>
9577                                 <delete permission="ADMIN_CLAIM_POLICY">
9578                                         <context link="claim_policy" field="org_unit"/>
9579                 </delete>
9580                         </actions>
9581                 </permacrud>
9582         </class>
9583
9584     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9585         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9586             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9587             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9588             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9589             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9590             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9591             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9592             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9593             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9594             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9595             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9596             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9597             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9598             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9599             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9600             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9601             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9602         </fields>
9603         <links>
9604             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9605         </links>
9606     </class>
9607
9608     <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">
9609         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9610             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9611             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9612             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9613             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9614             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9615         </fields>
9616     </class>
9617
9618     <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">
9619         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9620             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9621             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9622             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9623             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9624             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9625             <field reporter:label="City" name="city" reporter:datatype="text"/>
9626             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9627             <field reporter:label="State" name="state" reporter:datatype="text"/>
9628             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9629             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9630             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9631         </fields>
9632     </class>
9633
9634     <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">
9635         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9636             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9637             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9638             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9639             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9640             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9641             <field reporter:label="City" name="city" reporter:datatype="text"/>
9642             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9643             <field reporter:label="State" name="state" reporter:datatype="text"/>
9644             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9645             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9646             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9647         </fields>
9648     </class>
9649
9650     <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">
9651         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9652             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9653             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9654             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9655             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9656             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9657             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9658         </fields>
9659     </class>
9660
9661     <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">
9662         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
9663             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9664             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9665             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9666             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
9667             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
9668             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9669         </fields>
9670     </class>
9671
9672         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9673                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9674                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9675                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9676                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9677                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9678                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9679                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9680                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9681                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9682                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9683                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9684                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9685                 </fields>
9686                 <links>
9687                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9688                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9689                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9690                 </links>
9691         </class>
9692
9693         <class id="afscv" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
9694                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9695                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9696                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9697                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9698                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9699                 </fields>
9700                 <links>
9701                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9702                 </links>
9703         </class>
9704
9705     <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">
9706         <fields>
9707             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9708             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9709             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9710         </fields>
9711                 <links>
9712                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9713                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9714                 </links>
9715     </class>
9716
9717     <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">
9718         <fields>
9719             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9720             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9721         </fields>
9722                 <links>
9723                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9724                 </links>
9725     </class>
9726
9727     <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">
9728         <fields>
9729             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9730             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9731             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9732         </fields>
9733                 <links>
9734                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9735                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9736                 </links>
9737     </class>
9738
9739     <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">
9740         <fields>
9741             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9742             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9743         </fields>
9744                 <links>
9745                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9746                 </links>
9747     </class>
9748
9749     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9750                 <oils_persist:source_definition>
9751
9752             SELECT  DISTINCT l.*
9753               FROM  action.unfulfilled_hold_loops l
9754                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9755               WHERE l.count = m.max
9756
9757                 </oils_persist:source_definition>
9758         <fields>
9759             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9760             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9761             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9762         </fields>
9763                 <links>
9764                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9765                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9766                 </links>
9767     </class>
9768
9769         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9770                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9771                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9772                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9773                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9774                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9775                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9776                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9777                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9778                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9779                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9780                 </fields>
9781                 <links>
9782                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9783                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9784                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9785                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9786                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9787                 </links>
9788         </class>
9789
9790         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9791                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9792                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9793                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9794                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9795                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9796                 </fields>
9797                 <links>
9798                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9799                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9800                 </links>
9801         </class>
9802
9803         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9804                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9805                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9806                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9807                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9808                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9809                 </fields>
9810                 <links>
9811                 </links>
9812         </class>
9813
9814         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9815                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9816                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9817                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9818                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9819                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9820                 </fields>
9821                 <links>
9822                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9823                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9824                 </links>
9825         </class>
9826         
9827         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9828                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9829                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9830                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9831                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9832                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9833                 </fields>
9834                 <links>
9835                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9836                 </links>
9837         </class>
9838         
9839         <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">
9840                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9841                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9842                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9843                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9844                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9845                 </fields>
9846                 <links>
9847                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9848                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9849                 </links>
9850         </class>
9851
9852         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9853                 <fields oils_persist:primary="name">
9854                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9855                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9856                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9857                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9858                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9859                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9860                 </fields>
9861                 <links>
9862                 </links>
9863         </class>
9864
9865         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9866                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9867                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9868                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9869                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9870                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9871                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9872                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9873                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9874                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9875                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9876                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9877                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9878                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9879                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9880                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9881                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9882                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9883                 </fields>
9884                 <links>
9885                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9886                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9887                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9888                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9889                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9890                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9891                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9892                 </links>
9893         </class>
9894
9895         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9896                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9897                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9898                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9899                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9900                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9901                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9902                 </fields>
9903                 <links>
9904                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9905                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9906                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9907                 </links>
9908         </class>
9909
9910         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9911                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9912                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9913                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9914                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9915                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9916                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9917                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9918                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9919                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9920                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9921                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9922                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9923                 </fields>
9924                 <links>
9925                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9926                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9927                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9928                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9929                 </links>
9930         </class>
9931
9932         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9933                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9934                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9935                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9936                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9937                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9938                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9939                 </fields>
9940                 <links>
9941                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9942                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9943                 </links>
9944         </class>
9945
9946         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9947                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9948                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9949                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9950                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9951                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9952                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9953                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9954                 </fields>
9955                 <links>
9956                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9957                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9958                 </links>
9959         </class>
9960
9961         <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">
9962                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9963                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9964                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9965                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9966                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9967                 </fields>
9968                 <links>
9969                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9970                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9971                 </links>
9972         </class>
9973
9974         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9975                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9976                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9977                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9978                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9979                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9980                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9981                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9982                 </fields>
9983                 <links>
9984                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9985                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9986                 </links>
9987         </class>
9988
9989         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9990                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9991                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9992                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9993                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9994                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9995                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9996                 </fields>
9997                 <links>
9998                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9999                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
10000                 </links>
10001         </class>
10002
10003         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
10004                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10005                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10006                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10007                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10008                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10009                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10010                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10011                 </fields>
10012                 <links>
10013                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10014                 </links>
10015         </class>
10016
10017         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
10018                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10019                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10020                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10021                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10022                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10023                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10024                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10025                 </fields>
10026                 <links>
10027                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10028                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10029                 </links>
10030         </class>
10031
10032         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
10033                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10034                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10035                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10036                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10037                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10038                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10039                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10040                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10041                 </fields>
10042                 <links>
10043                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10044                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10045                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10046                 </links>
10047         </class>
10048
10049         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
10050                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10051                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10052                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10053                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10054                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10055                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10056                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10057                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10058                 </fields>
10059                 <links>
10060                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10061                 </links>
10062         </class>
10063
10064         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
10065                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10066                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10067                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10068                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10069                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10070                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10071                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10072                 </fields>
10073                 <links>
10074                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10075                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10076                 </links>
10077         </class>
10078
10079         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
10080                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10081                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10082                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10083                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10084                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10085                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10086                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10087                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10088                 </fields>
10089                 <links>
10090                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10091                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10092                 </links>
10093         </class>
10094
10095         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
10096                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10097                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10098                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10099                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10100                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10101                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10102                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10103                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10104                 </fields>
10105                 <links>
10106                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10107                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10108                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10109                 </links>
10110         </class>
10111
10112         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
10113                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10114                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10115                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10116                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10117                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10118                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10119                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10120                 </fields>
10121                 <links>
10122                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10123                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10124                 </links>
10125         </class>
10126
10127         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
10128                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10129                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10130                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10131                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10132                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10133                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10134                 </fields>
10135                 <links>
10136                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10137                 </links>
10138         </class>
10139
10140         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
10141                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10142                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10143                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10144                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10145                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10146                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10147                 </fields>
10148                 <links>
10149                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10150                 </links>
10151         </class>
10152
10153         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
10154                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10155                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10156                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10157                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10158                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10159                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10160                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10161                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10162                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10163                 </fields>
10164                 <links>
10165                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10166                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10167                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10168                 </links>
10169         </class>
10170
10171         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
10172                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10173                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10174                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10175                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10176                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10177                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10178                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10179                 </fields>
10180                 <links>
10181                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10182                 </links>
10183         </class>
10184
10185         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
10186                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10187                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10188                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10189                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10190                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10191                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10192                 </fields>
10193                 <links>
10194                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10195                 </links>
10196         </class>
10197
10198         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
10199                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10200                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10201                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10202                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10203                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10204                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10205                 </fields>
10206                 <links>
10207                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10208                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10209                 </links>
10210         </class>
10211
10212         <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">
10213                 <fields oils_persist:primary="id">
10214                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
10215                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
10216                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
10217                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
10218                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
10219                 </fields>
10220                 <links>
10221                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
10222                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10223                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
10224                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
10225                 </links>
10226         </class>
10227
10228         <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">
10229                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
10230                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10231                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
10232                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10233                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
10234                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10235                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10236                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
10237                 </fields>
10238                 <links/>
10239                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10240                         <actions>
10241                                 <retrieve/>
10242                         </actions>
10243                 </permacrud>
10244         </class>
10245
10246         <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">
10247                 <fields oils_persist:primary="ptype_key">
10248                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
10249                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10250                 </fields>
10251                 <links/>
10252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10253                         <actions>
10254                                 <retrieve/>
10255                         </actions>
10256                 </permacrud>
10257         </class>
10258
10259         <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">
10260                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
10261                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10262                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
10263                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10264                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10265                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10266                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10267                 </fields>
10268                 <links>
10269                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
10270                 </links>
10271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10272                         <actions>
10273                                 <retrieve/>
10274                         </actions>
10275                 </permacrud>
10276         </class>
10277
10278         <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">
10279                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
10280                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10281                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
10282                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
10283                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10284                 </fields>
10285                 <links>
10286                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10287                 </links>
10288                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10289                         <actions>
10290                                 <retrieve/>
10291                         </actions>
10292                 </permacrud>
10293         </class>
10294
10295     <class
10296         id="uvs"
10297         controller="open-ils.cstore open-ils.pcrud"
10298         oils_obj:fieldmapper="url_verify::session"
10299         oils_persist:tablename="url_verify.session"
10300         reporter:label="URL Verification Session"
10301     >
10302         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
10303             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
10304             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10305                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
10306             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10307             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
10308             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10309             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
10310             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
10311             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
10312         </fields>
10313
10314         <links>
10315             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10316             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10317             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
10318             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
10319             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
10320         </links>
10321
10322         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10323             <actions>
10324                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
10325             </actions>
10326         </permacrud>
10327
10328     </class>
10329
10330     <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">
10331         <oils_persist:source_definition>
10332             SELECT
10333                 cbrebi.id AS id,  -- so we can have a pkey in our view
10334                 uvs.id AS session,
10335                 uvs.owning_lib,
10336                 cbrebi.target_biblio_record_entry
10337             FROM url_verify.session uvs
10338             JOIN container.biblio_record_entry_bucket cbreb
10339                 ON (uvs.container = cbreb.id)
10340             JOIN container.biblio_record_entry_bucket_item cbrebi
10341                 ON (cbrebi.bucket = cbreb.id)
10342         </oils_persist:source_definition>
10343         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10344             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10345             <field reporter:label="Session" name="session" reporter:datatype="link" />
10346             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10347             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10348         </fields>
10349         <links>
10350             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10351             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10352             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10353         </links>
10354         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10355             <actions>
10356                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10357             </actions>
10358         </permacrud>
10359     </class>
10360
10361     <class
10362         id="uvus"
10363         controller="open-ils.cstore open-ils.pcrud"
10364         oils_obj:fieldmapper="url_verify::url_selector"
10365         oils_persist:tablename="url_verify.url_selector"
10366         reporter:label="URL Verification URL Selector"
10367     >
10368         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10369             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10370             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10371                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10372             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10373         </fields>
10374
10375         <links>
10376             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10377             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10378         </links>
10379
10380         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10381             <actions>
10382                 <create permission="URL_VERIFY">
10383                     <context link="session" field="owning_lib"/>
10384                 </create>
10385                 <retrieve permission="URL_VERIFY">
10386                     <context link="session" field="owning_lib"/>
10387                 </retrieve>
10388                 <update permission="URL_VERIFY">
10389                     <context link="session" field="owning_lib"/>
10390                 </update>
10391                 <delete permission="URL_VERIFY">
10392                     <context link="session" field="owning_lib"/>
10393                 </delete>
10394             </actions>
10395         </permacrud>
10396
10397     </class>
10398
10399     <class
10400         id="uvu"
10401         controller="open-ils.cstore open-ils.pcrud"
10402         oils_obj:fieldmapper="url_verify::url"
10403         oils_persist:tablename="url_verify.url"
10404         reporter:label="URL Verification URL"
10405     >
10406         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10407             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10408                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10409                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10410                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10411                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10412             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10413             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10414             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10415             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10416             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10417             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10418             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10419             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10420             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10421             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10422             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10423             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10424             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10425         </fields>
10426
10427         <links>
10428             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10429             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10430             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10431             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10432             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10433         </links>
10434
10435         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10436             <actions>
10437                 <create permission="URL_VERIFY">
10438                     <context link="session" field="owning_lib"/>
10439                 </create>
10440                 <retrieve permission="URL_VERIFY">
10441                     <context link="session" field="owning_lib"/>
10442                 </retrieve>
10443                 <update permission="URL_VERIFY">
10444                     <context link="session" field="owning_lib"/>
10445                 </update>
10446                 <delete permission="URL_VERIFY">
10447                     <context link="session" field="owning_lib"/>
10448                 </delete>
10449             </actions>
10450         </permacrud>
10451
10452     </class>
10453
10454     <class
10455         id="uvva"
10456         controller="open-ils.cstore open-ils.pcrud"
10457         oils_obj:fieldmapper="url_verify::verification_attempt"
10458         oils_persist:tablename="url_verify.verification_attempt"
10459         reporter:label="URL Verification Attempt"
10460     >
10461         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10462             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10463                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10464                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10465             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10466             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10467         </fields>
10468
10469         <links>
10470             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10471             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10472         </links>
10473
10474         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10475             <actions>
10476                 <create permission="URL_VERIFY">
10477                     <context link="session" field="owning_lib"/>
10478                 </create>
10479                 <retrieve permission="URL_VERIFY">
10480                     <context link="session" field="owning_lib"/>
10481                 </retrieve>
10482                 <update permission="URL_VERIFY">
10483                     <context link="session" field="owning_lib"/>
10484                 </update>
10485                 <delete permission="URL_VERIFY">
10486                     <context link="session" field="owning_lib"/>
10487                 </delete>
10488             </actions>
10489         </permacrud>
10490
10491     </class>
10492
10493     <class
10494         id="uvuv"
10495         controller="open-ils.cstore open-ils.pcrud"
10496         oils_obj:fieldmapper="url_verify::url_verification"
10497         oils_persist:tablename="url_verify.url_verification"
10498         reporter:label="URL Verification"
10499     >
10500         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10501             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10502                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10503                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10504             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10505             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10506             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10507             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10508                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10509         </fields>
10510
10511         <links>
10512             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10513             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10514             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10515         </links>
10516
10517         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10518             <actions>
10519                 <create permission="URL_VERIFY">
10520                     <context link="attempt" jump="session" field="owning_lib"/>
10521                 </create>
10522                 <retrieve permission="URL_VERIFY">
10523                     <context link="attempt" jump="session" field="owning_lib"/>
10524                 </retrieve>
10525                 <update permission="URL_VERIFY">
10526                     <context link="attempt" jump="session" field="owning_lib"/>
10527                 </update>
10528                 <delete permission="URL_VERIFY">
10529                     <context link="attempt" jump="session" field="owning_lib"/>
10530                 </delete>
10531             </actions>
10532         </permacrud>
10533
10534     </class>
10535
10536         <class
10537                 id="cfdi"
10538                 controller="open-ils.cstore open-ils.pcrud"
10539                 oils_obj:fieldmapper="config::filter_dialog_interface"
10540                 oils_persist:tablename="config.filter_dialog_interface"
10541                 reporter:label="FilterDialog Interface">
10542                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10543                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10544                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10545                 </fields>
10546                 <links>
10547                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10548                 </links>
10549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10550                         <actions>
10551                                 <retrieve />
10552                         </actions>
10553                 </permacrud>
10554         </class>
10555
10556         <class
10557                 id="cfdfs"
10558                 controller="open-ils.cstore open-ils.pcrud"
10559                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10560                 oils_persist:tablename="config.filter_dialog_filter_set"
10561                 reporter:label="FilterDialog Filter Set">
10562                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10563                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10564                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10565                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10566                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10567                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10568                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10569                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10570                 </fields>
10571                 <links>
10572                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10573                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10574                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10575                 </links>
10576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10577                         <actions>
10578                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10579                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10580                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10581                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10582                         </actions>
10583                 </permacrud>
10584
10585         </class>
10586
10587         <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">
10588                 <fields oils_persist:primary="code">
10589                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10590                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10591                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10592                 </fields>
10593                 <links/>
10594                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10595                         <actions>
10596                                 <retrieve/>
10597                         </actions>
10598                 </permacrud>
10599         </class>
10600
10601         <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">
10602                 <oils_persist:source_definition>
10603
10604             SELECT  b.id,
10605                     MAX(dcp.edit_date) AS last_delete_date
10606              FROM   biblio.record_entry b
10607                     JOIN asset.call_number cn ON (cn.record = b.id)
10608                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10609              WHERE  NOT b.deleted
10610              GROUP BY b.id
10611              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10612
10613                 </oils_persist:source_definition>
10614                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10615                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10616                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10617                 </fields>
10618                 <links>
10619                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10620                 </links>
10621                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10622                         <actions>
10623                                 <retrieve/>
10624                         </actions>
10625                 </permacrud>
10626         </class>
10627
10628         <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">
10629                 <oils_persist:source_definition>
10630
10631             -- -- If we uncomment the RIGHT JOIN against biblio.record_entry, then we'll get a row for every non-deleted bib, whether it has active holds or not.
10632             -- -- If we expect to use pcrud to query against specific bibs, we probably want to do this.  However, if we're using this to populate a report, we
10633             -- -- may not.
10634             -- SELECT
10635             --     bre.id AS bib_id,
10636             --     COALESCE( z.copy_count, 0 ) AS copy_count,
10637             --     COALESCE( z.hold_count, 0 ) AS hold_count,
10638             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
10639             -- FROM (
10640                 SELECT
10641                     y.bre AS id,
10642                     COALESCE( x.copy_count, 0 ) AS copy_count,
10643                     y.hold_count AS hold_count,
10644                     (y.hold_count::REAL / (CASE WHEN x.copy_count = 0 OR x.copy_count IS NULL THEN 0.1 ELSE x.copy_count::REAL END)) AS hold_copy_ratio
10645                 FROM (
10646                         SELECT
10647                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
10648                             COUNT(*) AS hold_count
10649                         FROM action.hold_request h
10650                         WHERE
10651                             cancel_time IS NULL
10652                             AND fulfillment_time IS NULL
10653                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10654                         GROUP BY 1
10655                     )y LEFT JOIN (
10656                         SELECT 
10657                             (SELECT id
10658                                 FROM biblio.record_entry 
10659                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10660                             ) AS bre, 
10661                             COUNT(*) AS copy_count
10662                         FROM asset.copy
10663                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10664                         WHERE copy.holdable 
10665                             AND NOT copy.deleted 
10666                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10667                         GROUP BY 1
10668                     )x ON x.bre = y.bre
10669                 -- )z RIGHT JOIN (
10670                 --     SELECT id
10671                 --     FROM biblio.record_entry
10672                 --     WHERE NOT deleted
10673                 -- )bre ON (z.bib_id = bre.id)
10674                 
10675
10676                 </oils_persist:source_definition>
10677                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10678                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10679                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10680                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10681                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10682                 </fields>
10683                 <links>
10684                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10685                 </links>
10686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10687                         <actions>
10688                                 <retrieve/>
10689                         </actions>
10690                 </permacrud>
10691         </class>
10692
10693         <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">
10694                 <oils_persist:source_definition>
10695             SELECT *,
10696                 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,
10697                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10698             FROM
10699                 (SELECT bib_record as id, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
10700                     FROM
10701                         action.hold_request ahr
10702                         JOIN reporter.hold_request_record rhrr USING (id)
10703                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10704                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10705                     WHERE
10706                         ahr.cancel_time IS NULL
10707                         AND ahr.fulfillment_time IS NULL
10708                     GROUP BY bib_record, pickup_lib
10709                 )x
10710                 JOIN
10711                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10712                     FROM
10713                         action.hold_request ahr
10714                         JOIN reporter.hold_request_record rhrr USING (id)
10715                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10716                     WHERE
10717                         ahr.cancel_time IS NULL
10718                         AND ahr.fulfillment_time IS NULL
10719                     GROUP BY bib_record
10720                 )y
10721                 USING (id)
10722                 </oils_persist:source_definition>
10723                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10724                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10725                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10726                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10727                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10728                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10729                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10730                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10731                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10732                 </fields>
10733                 <links>
10734                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10735                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10736                 </links>
10737                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10738                         <actions>
10739                                 <retrieve/>
10740                         </actions>
10741                 </permacrud>
10742         </class>
10743
10744         <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) ">
10745                 <oils_persist:source_definition>
10746             WITH counts_at_ou AS (
10747                 SELECT bib_record, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, 
10748                     COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
10749                 FROM action.hold_request ahr
10750                 JOIN reporter.hold_request_record rhrr USING (id)
10751                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10752                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10753                 WHERE ahr.cancel_time IS NULL
10754                 AND ahr.fulfillment_time IS NULL
10755                 GROUP BY bib_record, pickup_lib
10756             )
10757             SELECT *,
10758                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE holds_at_or_below::FLOAT/copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
10759                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10760             FROM
10761                 (SELECT bib_record AS id, aou.id AS pickup_lib_or_desc, SUM(holds_at_pickup_library) AS holds_at_or_below, SUM(copy_count_at_pickup_library) AS copy_count_at_or_below
10762                 FROM actor.org_unit aou
10763                 JOIN counts_at_ou cao ON (cao.pickup_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))) 
10764                 GROUP BY bib_record, pickup_lib_or_desc
10765                 )x
10766                 JOIN
10767                 (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10768                     FROM
10769                         action.hold_request ahr
10770                         JOIN reporter.hold_request_record rhrr USING (id)
10771                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10772                     WHERE
10773                         ahr.cancel_time IS NULL
10774                         AND ahr.fulfillment_time IS NULL
10775                     GROUP BY bib_record
10776                 )y
10777                 USING (id)
10778                 </oils_persist:source_definition>
10779                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10780                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10781                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
10782                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
10783                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
10784                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10785                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10786                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
10787                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10788                 </fields>
10789                 <links>
10790                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10791                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
10792                 </links>
10793                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10794                         <actions>
10795                                 <retrieve/>
10796                         </actions>
10797                 </permacrud>
10798         </class>
10799
10800         <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">
10801                 <oils_persist:source_definition>
10802             SELECT
10803                 ac.id,
10804                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10805                 MAX(actac.xact_start) AS last_circ
10806             FROM asset.copy ac
10807                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10808             GROUP BY ac.id
10809
10810             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10811             --SELECT
10812             --    ac.id,
10813             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10814             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10815             --FROM asset.copy ac
10816             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10817             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10818             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10819                 </oils_persist:source_definition>
10820                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10821                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10822                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10823                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10824                 </fields>
10825                 <links>
10826                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10827                 </links>
10828                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10829                         <actions>
10830                                 <retrieve/>
10831                         </actions>
10832                 </permacrud>
10833         </class>
10834
10835         <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">
10836                 <fields oils_persist:primary="id">
10837                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10838                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10839                 </fields>
10840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10841                         <actions>
10842                                 <retrieve/>
10843                         </actions>
10844                 </permacrud>
10845         </class>
10846
10847         <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">
10848                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10849                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10850                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10851                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10852                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10853                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10854                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10855                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10856                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10857                 </fields>
10858                 <links>
10859                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10860                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10861                 </links>
10862                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10863                         <actions>
10864                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10865                                 <retrieve/>
10866                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10867                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10868                         </actions>
10869                 </permacrud>
10870         </class>
10871
10872         <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">
10873                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10874                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10875                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10876                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10877                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10878                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10879                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10880                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10881                 </fields>
10882                 <links>
10883                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10884                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10885                 </links>
10886                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10887                         <actions>
10888                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10889                                 <retrieve/>
10890                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10891                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10892                         </actions>
10893                 </permacrud>
10894         </class>
10895
10896
10897         <!-- ********************************************************************************************************************* -->
10898         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10899         <!-- ********************************************************************************************************************* -->
10900         <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">
10901                 <fields oils_persist:primary="id">
10902                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10903                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10904                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10905                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10906                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10907                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10908                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10909                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10910                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10911                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10912                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10913                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10914                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10915                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10916                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10917                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10918                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10919                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10920                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10921                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10922                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10923                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10924                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10925                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10926                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10927                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10928                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10929                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10930                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10931                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10932                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10933                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10934                 </fields>
10935                 <links>
10936                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10937                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10938                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10939                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10940                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10941                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10942                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10943                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10944                 </links>
10945         </class>
10946
10947         <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">
10948                 <fields oils_persist:primary="id">
10949                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10950                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10951                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10952                 </fields>
10953                 <links>
10954                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10955                 </links>
10956         </class>
10957
10958         <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">
10959                 <fields oils_persist:primary="id">
10960                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10961                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10962                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10963                 </fields>
10964                 <links>
10965                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10966                 </links>
10967         </class>
10968
10969         <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">
10970                 <fields oils_persist:primary="id">
10971                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10972
10973                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10974                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10975                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10976
10977                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10978                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10979                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10980
10981                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10982                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10983
10984                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10985                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10986                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10987
10988                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10989                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10990
10991                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10992                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10993                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10994
10995                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10996                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10997                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10998
10999                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
11000                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
11001                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
11002                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
11003
11004                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
11005                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
11006
11007                 </fields>
11008                 <links>
11009                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
11010                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11011                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
11012                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
11013                 </links>
11014         </class>
11015
11016         <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">
11017                 <oils_persist:source_definition>
11018
11019             SELECT
11020                 po.ordering_agency AS ordering_agency,
11021                 po.id AS purchase_order,
11022                 li.id AS lineitem,
11023                 lid.id AS lineitem_detail,
11024                 cpa.id AS claim_policy_action
11025             FROM
11026                 acq.lineitem_detail lid
11027                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
11028                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
11029                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
11030                 JOIN acq.claim_policy_action cpa ON (
11031                     cpa.claim_policy = cp.id
11032
11033                     -- we only care about claim policy actions whose claim
11034                     -- interval we'd reached or exceeded
11035                     AND (NOW() - cpa.action_interval) &gt; po.order_date
11036
11037                     -- filter out all claim policy actions where claim events
11038                     -- have occurred on or after the action's action_interval
11039                     AND NOT EXISTS (
11040                         SELECT 1
11041                         FROM
11042                             acq.claim_event evt
11043                             JOIN acq.claim claim ON (
11044                                 claim.id = evt.claim
11045                                 AND claim.lineitem_detail = lid.id
11046                             )
11047                         WHERE
11048                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
11049                     )
11050                 )
11051             WHERE
11052                 lid.cancel_reason IS NULL
11053                 AND li.cancel_reason IS NULL -- belt/suspenders
11054                 AND po.cancel_reason IS NULL -- belt/suspenders
11055                 AND lid.recv_time IS NULL
11056                 AND po.state = 'on-order'
11057             ORDER BY 1, 2, 3, 4, 5
11058
11059                 </oils_persist:source_definition>
11060                 <fields>
11061                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
11062                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
11063                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11064                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11065                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
11066                 </fields>
11067                 <links>
11068                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
11069                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
11070                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11071                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11072                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
11073                 </links>
11074         </class>
11075         <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">
11076                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11077                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11078                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11079                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11080                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11081                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11082                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11083                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11084                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11085                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11086                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11087                 </fields>
11088                 <links>
11089                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11090                 </links>
11091     </class>
11092         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
11093                 <oils_persist:source_definition>
11094             SELECT * FROM acq.lineitem_summary 
11095                                 WHERE item_count > (invoice_count + cancel_count)
11096         </oils_persist:source_definition>
11097                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11098                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11099                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11100                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11101                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11102                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11103                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11104                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11105                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11106                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11107                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11108                 </fields>
11109                 <links>
11110                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11111                 </links>
11112     </class>
11113         <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">
11114                 <oils_persist:source_definition>
11115
11116                         SELECT  t.*
11117                           FROM  action.transit_copy t
11118                                 JOIN actor.org_unit AS s ON (t.source = s.id)
11119                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
11120                           WHERE s.parent_ou &lt;&gt; d.parent_ou
11121
11122                 </oils_persist:source_definition>
11123                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
11124                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
11125                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
11126                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
11127                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
11128                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
11129                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
11130                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
11131                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
11132                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
11133                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
11134                 </fields>
11135                 <links>
11136                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
11137                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
11138                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
11139                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
11140                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11141                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
11142                 </links>
11143         </class>
11144
11145     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
11146                 <oils_persist:source_definition>
11147
11148         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
11149                 SELECT
11150                         cp.id as copy,
11151                         COUNT(circ.id),
11152                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11153                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11154                 FROM
11155                         asset.copy cp
11156                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
11157                 GROUP BY 1, 3, 4
11158                 UNION ALL
11159                 SELECT
11160                         cp.id as copy,
11161                         COUNT(circ.id),
11162                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11163                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11164                 FROM
11165                         asset.copy cp
11166                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
11167                 GROUP BY 1, 3, 4
11168                 UNION ALL
11169                 SELECT
11170                         id as copy,
11171                         circ_count,
11172                         -1 AS year,
11173                         false as is_renewal
11174                 FROM
11175                         extend_reporter.legacy_circ_count
11176         )x GROUP BY 1, 3, 4
11177
11178                 </oils_persist:source_definition>
11179         <fields>
11180             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
11181             <field reporter:label="Count" name="count" reporter:datatype="int"/>
11182             <field reporter:label="Year" name="year" reporter:datatype="int"/>
11183             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
11184         </fields>
11185                 <links>
11186                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
11187                 </links>
11188                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11189                         <actions>
11190                                 <retrieve/>
11191                         </actions>
11192                 </permacrud>
11193     </class>
11194
11195         <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">
11196                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
11197                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
11198                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
11199                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
11200                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
11201                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
11202                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
11203                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
11204                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
11205                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
11206                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
11207                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
11208                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
11209                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
11210                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
11211                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
11212                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
11213                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
11214                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
11215                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
11216                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
11217                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
11218                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
11219                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
11220                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
11221                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
11222                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
11223                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
11224                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
11225                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
11226                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
11227                 </fields>
11228                 <links>
11229                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
11230                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
11231                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
11232                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11233                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
11234                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11235                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11236                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
11237                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
11238                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
11239                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
11240                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
11241                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
11242                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
11243                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
11244                 </links>
11245         </class>
11246
11247     <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">
11248         <fields oils_persist:primary="id">
11249             <field reporter:label="Title" name="title" reporter:datatype="text"/>
11250             <field reporter:label="Author" name="author" reporter:datatype="text"/>
11251             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
11252             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11253             <field reporter:label="Price" name="price" reporter:datatype="money"/>
11254             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11255             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
11256             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
11257             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11258             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
11259             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11260             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
11261             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
11262             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
11263             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11264             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11265             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
11266             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
11267             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
11268             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
11269             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
11270             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
11271             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11272             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
11273             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
11274             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
11275             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
11276             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
11277             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
11278             <field reporter:label="Status" name="status" reporter:datatype="link"/>
11279             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
11280             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
11281             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
11282             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
11283         </fields>
11284         <links>
11285             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11286             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11287             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11288             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11289             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
11290             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
11291             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
11292             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
11293         </links>
11294     </class>
11295
11296     <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">
11297         <fields oils_persist:primary="id">
11298             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11299             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11300             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11301             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11302         </fields>
11303         <links>
11304             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11305             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11306         </links>
11307     </class>
11308
11309     <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">
11310         <fields oils_persist:primary="owning_lib">
11311             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11312             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11313             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11314         </fields>
11315         <links>
11316             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11317         </links>
11318     </class>
11319
11320     <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">
11321         <fields oils_persist:primary="id">
11322             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11323             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11324             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11325             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11326             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11327         </fields>
11328         <links>
11329             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11330             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11331             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11332         </links>
11333     </class>
11334
11335     <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">
11336         <fields oils_persist:primary="circ_lib">
11337             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11338             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11339             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11340             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11341         </fields>
11342         <links>
11343             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11344             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11345         </links>
11346     </class>
11347
11348     <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">
11349         <fields oils_persist:primary="id">
11350             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11351             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11352             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11353             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11354             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11355         </fields>
11356         <links>
11357             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11358             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11359             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11360         </links>
11361     </class>
11362
11363     <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">
11364         <fields oils_persist:primary="home_ou">
11365             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11366             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11367             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11368             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11369         </fields>
11370         <links>
11371             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11372             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11373         </links>
11374     </class>
11375         <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">
11376                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
11377                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
11378                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
11379                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
11380                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
11381                 </fields>
11382                 <links>
11383                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11384                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
11385                 </links>
11386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11387                         <actions>
11388                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11389                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
11390                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11391                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11392                         </actions>
11393                 </permacrud>
11394         </class>
11395         <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">
11396                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11397                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11398                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11399                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11400                 </fields>
11401                 <links>
11402                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11403                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11404                         </links>
11405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11406                 <actions>
11407                                 <create permission="ADMIN_ACQ_FUND_TAG">
11408                                         <context link="tag" field="owner"/>
11409                                 </create>
11410                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11411                                         <context link="tag" field="owner"/>
11412                                 </retrieve>
11413                                 <update permission="ADMIN_ACQ_FUND_TAG">
11414                                         <context link="tag" field="owner"/>
11415                                 </update>
11416                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11417                                         <context link="tag" field="owner"/>
11418                                 </delete>
11419                         </actions>
11420                 </permacrud>
11421         </class>
11422         <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">
11423                 <oils_persist:source_definition><![CDATA[
11424                 SELECT
11425                         poi.purchase_order AS purchase_order,
11426                         ii.invoice AS invoice,
11427                         NULL AS lineitem,
11428                         poi.id AS po_item,
11429                         NULL AS picklist
11430                 FROM
11431                         acq.po_item poi
11432                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11433                 UNION SELECT
11434                         jub.purchase_order AS purchase_order,
11435                         ie.invoice AS invoice,
11436                         jub.id AS lineitem,
11437                         NULL AS po_item,
11438                         jub.picklist AS picklist
11439                 FROM
11440                         acq.lineitem jub
11441                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11442                 UNION SELECT
11443                         ii.purchase_order AS purchase_order,
11444                         ii.invoice AS invoice,
11445                         NULL AS lineitem,
11446                         NULL AS po_item,
11447                         NULL AS picklist
11448                 FROM
11449                         acq.invoice_item ii
11450                 WHERE ii.po_item IS NULL
11451                 UNION SELECT
11452                         ie.purchase_order AS purchase_order,
11453                         ie.invoice AS invoice,
11454                         NULL AS lineitem,
11455                         NULL AS po_item,
11456                         NULL AS picklist
11457                 FROM
11458                         acq.invoice_entry ie
11459                 WHERE ie.lineitem IS NULL
11460                 UNION SELECT
11461                         NULL AS purchase_order,
11462                         NULL AS invoice,
11463                         jub.id AS lineitem,
11464                         NULL AS po_item,
11465                         jub.picklist AS picklist
11466                 FROM
11467                         acq.lineitem jub
11468                 WHERE jub.purchase_order IS NULL
11469                 ]]></oils_persist:source_definition>
11470                 <fields>
11471                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11472                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11473                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11474                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11475                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11476                 </fields>
11477                 <links>
11478                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11479                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11480                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11481                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11482                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11483                 </links>
11484         </class>
11485         <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">
11486                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11487                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11488                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11489                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11490                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11491                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11492                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11493                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11494                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11495                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11496                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11497                 </fields>
11498                 <links>
11499                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11500                 </links>
11501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11502                         <actions>
11503                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11504                                 <retrieve/>
11505                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11506                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11507                         </actions>
11508                 </permacrud>
11509         </class>
11510
11511         <class id="coustl" controller="open-ils.cstore open-ils.pcrud" 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">
11512                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11513                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11514                         <field name="date_applied" reporter:datatype="timestamp"/>
11515                         <field name="org" reporter:datatype="org_unit"/>
11516                         <field name="original_value" reporter:datatype="text"/>
11517                         <field name="new_value" reporter:datatype="text"/>
11518                         <field name="field_name" reporter:datatype="link"/>
11519                 </fields>
11520                 <links>
11521                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11522                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11523                 </links>
11524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11525                         <actions>
11526                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11527                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
11528                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11529                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11530                         </actions>
11531                 </permacrud>
11532         </class>
11533         <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">
11534                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11535                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11536                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11537                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11538                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11539                 </fields>
11540                 <links>
11541                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11542                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11543                 </links>
11544         </class>
11545         <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">
11546                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11547                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11548                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11549                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11550                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11551                 </fields>
11552                 <links>
11553                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11554                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11555                 </links>
11556         </class>
11557         <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">
11558                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11559                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11560                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11561                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11562                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11563                 </fields>
11564                 <links>
11565                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11566                 </links>
11567                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11568                         <actions>
11569                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11570                                 <retrieve/>
11571                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11572                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11573                         </actions>
11574                 </permacrud>
11575         </class>
11576         <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">
11577                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11578                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11579                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11580                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11581                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11582                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11583                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11584                 </fields>
11585                 <links>
11586                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11587                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11588                 </links>
11589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11590                         <actions>
11591                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11592                                 <retrieve/>
11593                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11594                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11595                         </actions>
11596                 </permacrud>
11597         </class>
11598         <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">
11599         <oils_persist:source_definition>
11600         SELECT ahcm.target_copy AS id,count(*) AS count
11601          FROM
11602          action.hold_request ahr,
11603          action.hold_copy_map ahcm
11604          WHERE
11605          ahr.cancel_time IS NULL AND
11606          ahr.fulfillment_time IS NULL AND
11607          ahr.capture_time IS NULL AND
11608          ahr.id = ahcm.hold
11609          GROUP BY ahcm.target_copy
11610         </oils_persist:source_definition>
11611         <fields oils_persist:primary="id">
11612             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11613             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
11614         </fields>
11615         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11616             <actions>
11617                <retrieve/>
11618             </actions>
11619         </permacrud>
11620         </class>
11621
11622         <!-- ********************************************************************************************************************* -->
11623
11624 </IDL>
11625
11626 <!--
11627     vim:noet:ts=4:sw=4:
11628 -->