]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1545115: add description field for policy matrix tables
[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="Keep" name="keep" reporter:datatype="bool"/>
424                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="text"/>
425                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
426                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
427                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
428                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
429                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
430                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
431                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
432                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
433                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
434                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
435                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
436                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
437                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
438                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
439                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
440                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
441                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
442                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
443                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
444                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
445                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
446                 </fields>
447                 <links>
448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
449                 </links>
450                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
451                         <actions>
452                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
453                                 <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"/>
454                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
456                         </actions>
457                 </permacrud>
458         </class>
459
460         <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">
461                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
462                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
463                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
464                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
465                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
466                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
467                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
468                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
469                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
470                 </fields>
471                 <links>
472                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
473                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
474                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
475                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
476                 </links>
477                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
478                         <actions>
479                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
482                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
483                         </actions>
484                 </permacrud>
485         </class>
486
487         <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">
488                 <fields oils_persist:primary="code">
489                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
490                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
491                 </fields>
492                 <links>
493                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
494                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
495                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
496                 </links>
497                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
498                         <actions>
499                                 <retrieve/>
500                         </actions>
501                 </permacrud>
502         </class>
503
504         <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">
505                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
506                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
507                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
509                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
510                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
511                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
512                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
513                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
514                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
515                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
516                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
519                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
520                 </fields>
521                 <links>
522                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
523                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
524                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
525                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
526             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
527             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
528             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
529                 </links>
530                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
531                         <actions>
532                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
535                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
536                         </actions>
537                 </permacrud>
538         </class>
539
540         <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">
541                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
542                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
543                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
544                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
545                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
546                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
547                 </fields>
548                 <links/>
549                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
550                         <actions>
551                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
552                 <retrieve/>
553                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
555                         </actions>
556                 </permacrud>
557         </class>
558
559         <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">
560                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
561                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
562                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
563                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
564                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
565                 </fields>
566                 <links>
567                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
568                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
569                 </links>
570                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
571                         <actions>
572                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
575                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
576                         </actions>
577                 </permacrud>
578         </class>
579
580         <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">
581                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
582                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
583                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
584                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
585                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
586                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
587                 </fields>
588                 <links>
589                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
590                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
591                 </links>
592                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
593                         <actions>
594                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
597                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
598                         </actions>
599                 </permacrud>
600         </class>
601
602         <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">
603                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
604                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
605                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
606                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
607                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
608                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
609                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
610                 </fields>
611                 <links>
612                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
613                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
614                 </links>
615                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
616                         <actions>
617                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
621                         </actions>
622                 </permacrud>
623         </class>
624
625         <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">
626                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
627                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
628                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
630                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
631                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
632                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
633                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
634                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
635                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
636                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
638                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
639                 </fields>
640                 <links>
641                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
642                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
643                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
644             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
645             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
646                 </links>
647                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
648                         <actions>
649                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
653                         </actions>
654                 </permacrud>
655         </class>
656
657         <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">
658                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
659                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
660                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
661                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
662                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
663                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
664                 </fields>
665                 <links/>
666                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
667                         <actions>
668                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
669                 <retrieve/>
670                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
672                         </actions>
673                 </permacrud>
674         </class>
675
676         <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">
677                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
678                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
679                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
680                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
681                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
682                 </fields>
683                 <links>
684                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
685                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
686                 </links>
687                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
688                         <actions>
689                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
693                         </actions>
694                 </permacrud>
695         </class>
696
697         <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">
698                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
699                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
700                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
701                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
702                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
703                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
704                 </fields>
705                 <links>
706                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
707                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
708                 </links>
709                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
710                         <actions>
711                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
715                         </actions>
716                 </permacrud>
717         </class>
718
719         <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">
720                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
721                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
722                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
723                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
724                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
725                 </fields>
726                 <links>
727                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
728                 </links>
729                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
730                         <actions>
731                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
735                         </actions>
736                 </permacrud>
737         </class>
738
739         <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">
740                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
741                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
742                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
743                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
744                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
745                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
746                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
747                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
748             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
749                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
750                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
751                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
752                 </fields>
753                 <links>
754                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
755                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
756                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
757                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
758                 </links>
759                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
760                         <actions>
761                                 <create permission="ADMIN_IMPORT_MATCH_SET">
762                     <context link="match_set" field="owner"/>
763                                 </create>
764                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
765                     <context link="match_set" field="owner"/>
766                                 </retrieve>
767                                 <update permission="ADMIN_IMPORT_MATCH_SET">
768                     <context link="match_set" field="owner"/>
769                                 </update>
770                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
771                     <context link="match_set" field="owner"/>
772                                 </delete>
773                         </actions>
774                 </permacrud>
775         </class>
776
777         <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">
778                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
779                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
780                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
781                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
782                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
783                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
784                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
785                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
786                 </fields>
787                 <links>
788                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
789                 </links>
790                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
791                         <actions>
792                                 <create permission="ADMIN_IMPORT_MATCH_SET">
793                     <context link="match_set" field="owner"/>
794                                 </create>
795                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
796                     <context link="match_set" field="owner"/>
797                                 </retrieve>
798                                 <update permission="ADMIN_IMPORT_MATCH_SET">
799                     <context link="match_set" field="owner"/>
800                                 </update>
801                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
802                     <context link="match_set" field="owner"/>
803                                 </delete>
804                         </actions>
805                 </permacrud>
806         </class>
807
808         <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">
809                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
810                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
811                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
812                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
813                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
814                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
815                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
816                 </fields>
817                 <links>
818                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
819                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
820                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
821                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
822                 </links>
823         </class>
824
825     <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">
826         <fields oils_persist:primary="name">
827             <field reporter:label="Name" name="name" reporter:datatype="text"/>
828             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
829             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
830             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
831         </fields>
832         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
833             <actions>
834                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
835                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
836                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
837                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
838             </actions>
839         </permacrud>
840     </class>
841
842     <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">
843         <fields oils_persist:primary="id">
844             <field reporter:label="ID" name="id" reporter:datatype="id"/>
845             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
846             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
847             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
848             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
849         </fields>
850         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
851             <actions>
852                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
853                 <retrieve/>
854                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
855                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
856             </actions>
857         </permacrud>
858     </class>
859
860         <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">
861                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
862                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
863                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
864                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
865                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
866                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
867                 </fields>
868                 <links>
869                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
870                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
871                 </links>
872         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
873             <actions>
874                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
875                 <retrieve/>
876                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
877                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
878             </actions>
879         </permacrud>
880         </class>
881
882         <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">
883                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
884                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
885                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
886                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
887         </fields>
888         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
889             <actions>
890                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
891                 <retrieve/>
892                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
893                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
894             </actions>
895         </permacrud>
896         </class>
897
898         <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">
899                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
900                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
901                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
902                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
903                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
904                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
905                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
906                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
907                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
908                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
909                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
910                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
911         </fields>
912                 <links>
913                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
914                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
915         </links>
916         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
917             <actions>
918                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
919                 <retrieve/>
920                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
921                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
922             </actions>
923         </permacrud>
924         </class>
925
926         <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">
927                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
928                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
929                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
930                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
931                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
932                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
933                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
934                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
935                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
936                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
937                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
938         </fields>
939                 <links>
940                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
941                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
942         </links>
943         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
944             <actions>
945                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
946                 <retrieve/>
947                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
948                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
949             </actions>
950         </permacrud>
951         </class>
952
953         <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">
954                 <fields oils_persist:primary="name">
955                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
956                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
957                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
958                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
959                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
960                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
961                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
962                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
963                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
964                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
965                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
966                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
967                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
968                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
969                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
970                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
971                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
972                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
973                 </fields>
974                 <links>
975                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
976                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
977                 </links>
978         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
979             <actions>
980                 <create permission="ADMIN_SVF" global_required="true"/>
981                 <retrieve/>
982                 <update permission="ADMIN_SVF" global_required="true"/>
983                 <delete permission="ADMIN_SVF" global_required="true"/>
984             </actions>
985         </permacrud>
986         </class>
987
988         <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">
989                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
990                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
991                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
992                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
993             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
994                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
995                 </fields>
996                 <links/>
997         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
998             <actions>
999                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
1000                 <retrieve/>
1001                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1002                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1003             </actions>
1004         </permacrud>
1005         </class>
1006
1007         <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">
1008                 <fields oils_persist:primary="coded_value">
1009                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1010                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1011                 </fields>
1012                 <links>
1013                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1014                 </links>
1015         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1016             <actions>
1017                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1018                 <retrieve/>
1019                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1020                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1021             </actions>
1022         </permacrud>
1023         </class>
1024
1025         <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">
1026                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1027                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1028                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1029                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1030                 </fields>
1031                 <links>
1032                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1033                 </links>
1034         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1035             <actions>
1036                 <retrieve/>
1037             </actions>
1038         </permacrud>
1039         </class>
1040
1041
1042         <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">
1043                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1044                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1045                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1046                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1047                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1048                 </fields>
1049                 <links>
1050                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1051                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1052                 </links>
1053         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1054             <actions>
1055                 <retrieve/>
1056             </actions>
1057         </permacrud>
1058         </class>
1059
1060
1061         <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">
1062                 <fields oils_persist:primary="source">
1063                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1064                         <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 -->
1065                 </fields>
1066                 <links>
1067                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1068                 </links>
1069         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1070             <actions>
1071                 <retrieve/>
1072             </actions>
1073         </permacrud>
1074         </class>
1075
1076         <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">
1077                 <fields>
1078                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1079                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1080                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1081                 </fields>
1082                 <links>
1083                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1084                 </links>
1085         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1086             <actions>
1087                 <retrieve/>
1088             </actions>
1089         </permacrud>
1090         </class>
1091
1092         <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">
1093                 <fields oils_persist:primary="id">
1094                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1095                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1096                 </fields>
1097                 <links>
1098                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1099                 </links>
1100         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1101             <actions>
1102                 <retrieve/>
1103             </actions>
1104         </permacrud>
1105         </class>
1106
1107         <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">
1108                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1109                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1110                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1111                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1112                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1113                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1114                 </fields>
1115                 <links>
1116                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1117                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1118                 </links>
1119         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1120             <actions>
1121                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1122                 <retrieve/>
1123                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1124                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1125             </actions>
1126         </permacrud>
1127         </class>
1128
1129         <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">
1130                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1131                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1132                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1133                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1134                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1135                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1136                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1137                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1138             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1139             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1140             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1141                 </fields>
1142                 <links>
1143                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1144                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1145                 </links>
1146         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1147             <actions>
1148                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1149                 <retrieve/>
1150                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1151                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1152             </actions>
1153         </permacrud>
1154         </class>
1155
1156         <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">
1157                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1158                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1159                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1160                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1161                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1162                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1163                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1164                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1165                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1166                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1167                 </fields>
1168                 <links>
1169                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1170                 </links>
1171         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1172             <actions>
1173                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1174                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1175                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1176                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1177             </actions>
1178         </permacrud>
1179         </class>
1180
1181     <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">
1182         <fields oils_persist:primary="name">
1183             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1184             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1185             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1186             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1187             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1188             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1189             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1190             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1191             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1192             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1193         </fields>
1194         <links>
1195             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1196             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1197         </links>
1198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1199             <actions>
1200                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1201                 <retrieve/>
1202                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1203                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1204             </actions>
1205         </permacrud>
1206     </class>
1207
1208     <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">
1209         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1210             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1211             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1212             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1213             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1214             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1215             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1216             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1217         </fields>
1218         <links>
1219             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1220         </links>
1221         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1222             <actions>
1223                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1224                 <retrieve/>
1225                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1226                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1227             </actions>
1228         </permacrud>
1229     </class>
1230
1231     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1232                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1233                         oils_persist:tablename="config.z3950_index_field_map" 
1234                         reporter:label="Z39.50 Index Field Map">
1235         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1236             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1237             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1238             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1239             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1240             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1241             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1242         </fields>
1243         <links>
1244             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1245             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1246             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1247         </links>
1248         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1249             <actions>
1250                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1251                 <retrieve/>
1252                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1253                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1254             </actions>
1255         </permacrud>
1256     </class>
1257
1258
1259         <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">
1260                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1261                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1262                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1263                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1264                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1265                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1266                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1267                 </fields>
1268                 <links>
1269             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1270             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1271                 </links>
1272                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1273                         <actions>
1274                                 <retrieve/>
1275                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1276                         </actions>
1277                 </permacrud>
1278         </class>
1279
1280         <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">
1281                 <fields oils_persist:primary="key">
1282                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1283                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1284                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1285                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1286                 </fields>
1287                 <links/>
1288                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1289                         <actions>
1290                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1291                                 <retrieve/>
1292                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1293                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1294                         </actions>
1295                 </permacrud>
1296         </class>
1297
1298         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1299                 <fields oils_persist:primary="module">
1300                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1301                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1302                 </fields>
1303                 <links/>
1304         </class>
1305
1306         <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">
1307                 <fields oils_persist:primary="module">
1308                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1309                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1310                 </fields>
1311                 <links/>
1312                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1313                         <actions>
1314                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1315                                 <retrieve/>
1316                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1317                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1318                         </actions>
1319                 </permacrud>
1320         </class>
1321
1322         <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">
1323                 <fields oils_persist:primary="module">
1324                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1325                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1326                 </fields>
1327                 <links/>
1328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1329                         <actions>
1330                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1331                                 <retrieve/>
1332                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1333                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1334                         </actions>
1335                 </permacrud>
1336         </class>
1337
1338         <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">
1339                 <fields oils_persist:primary="module">
1340                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1341                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1342                 </fields>
1343                 <links/>
1344                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1345                         <actions>
1346                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1347                                 <retrieve/>
1348                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1349                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1350                         </actions>
1351                 </permacrud>
1352         </class>
1353
1354         <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">
1355                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1356                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1357                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1358                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1359                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1360                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1361                 </fields>
1362                 <links>
1363                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1364                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1365                 </links>
1366                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1367                         <actions>
1368                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1369                     <context link="event_def" field="owner"/>
1370                 </create>
1371                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1372                     <context link="event_def" field="owner"/>
1373                 </retrieve>
1374                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1375                     <context link="event_def" field="owner"/>
1376                 </update>
1377                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1378                     <context link="event_def" field="owner"/>
1379                 </delete>
1380                         </actions>
1381                 </permacrud>
1382         </class>
1383
1384         <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">
1385                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1386                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1387                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1388                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1389                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1390                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1391                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1392                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1393                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1394                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1395                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1396                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1397                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1398                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1399                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1400                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1401                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1402                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1403                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1404                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1405                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1406                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1407                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1408                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1409                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1410                 </fields>
1411                 <links>
1412                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1413                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1414                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1415                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1416                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1417                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1418                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1419                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1420                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1421                 </links>
1422                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1423                         <actions>
1424                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1425                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1426                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1427                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1428                         </actions>
1429                 </permacrud>
1430         </class>
1431
1432         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1433                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1434                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1435                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1436                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1437                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1438                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1439                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1440                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1441                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1442                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1443                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1444                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1445                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1446                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1447                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1448                 </fields>
1449                 <links>
1450                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1451                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1452                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1453                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1454                 </links>
1455         </class>
1456
1457         <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">
1458                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1459                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1460                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1461                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1462                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1463                 </fields>
1464                 <links>
1465                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1466                 </links>
1467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1468                         <actions>
1469                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1470                     <context link="event_def" field="owner"/>
1471                 </create>
1472                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1473                     <context link="event_def" field="owner"/>
1474                 </retrieve>
1475                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1476                     <context link="event_def" field="owner"/>
1477                 </update>
1478                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1479                     <context link="event_def" field="owner"/>
1480                 </delete>
1481                         </actions>
1482                 </permacrud>
1483         </class>
1484
1485         <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">
1486                 <oils_persist:source_definition><![CDATA[
1487                 SELECT  atevdef.hook,
1488                         atevdef.name,
1489                         atevdef.reactor,
1490                         atev.id,
1491                         atev.event_def,
1492                         atev.add_time,
1493                         atev.run_time,
1494                         atev.start_time,
1495                         atev.update_time,
1496                         atev.complete_time,
1497                         atev.update_process,
1498                         atev.state,
1499                         atev.user_data,
1500                         atev.template_output,
1501                         atev.error_output,
1502                         atev.async_output,
1503                         targ_circ.id AS target_circ,
1504                         targ_ahr.id AS target_hold,
1505                         COALESCE(
1506                                 targ_circ.circ_lib,
1507                                 targ_ahr.pickup_lib
1508                         ) AS perm_lib
1509                 FROM action_trigger.event atev
1510                 JOIN action_trigger.event_definition atevdef ON
1511                         (atevdef.id = atev.event_def)
1512                 JOIN action_trigger.hook ath ON
1513                         (ath.key = atevdef.hook)
1514                 LEFT JOIN action.circulation targ_circ ON
1515                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1516                 LEFT JOIN action.hold_request targ_ahr ON
1517                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1518                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1519                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1520                                 'circ.staff.max_visible_event_age',
1521                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1522                         ) UNION
1523                         SELECT '1000 YEARS'::INTERVAL AS value
1524                 ) ous)
1525                 ]]></oils_persist:source_definition>
1526                 <fields oils_persist:primary="id">
1527                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1528                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1529                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1530                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1531                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1532                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1533                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1534                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1535                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1536                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1537                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1538                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1539                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1540                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1541                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1542                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1543                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1544                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1545                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1546                 </fields>
1547                 <links>
1548                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1549                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1550                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1551                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1552                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1553                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1554                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1555                 </links>
1556                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1557                         <actions>
1558                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1559                         </actions>
1560                 </permacrud>
1561         </class>
1562
1563         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1564                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1565                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1566                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1567                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1568                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1569                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1570                 </fields>
1571                 <links>
1572                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1573                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1574                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1575                 </links>
1576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1577                         <actions>
1578                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1579                         </actions>
1580                 </permacrud>
1581         </class>
1582
1583         <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">
1584                 <fields oils_persist:primary="code">
1585                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1586                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1587                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1588                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1589                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1590                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1591                 </fields>
1592                 <links/>
1593         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1594             <actions>
1595                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1596                 <retrieve/>
1597                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1598                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1599             </actions>
1600         </permacrud>
1601         </class>
1602
1603         <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">
1604                 <fields oils_persist:primary="code">
1605                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1606                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1607                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1608                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1609                 </fields>
1610                 <links/>
1611         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1612             <actions>
1613                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1614                 <retrieve/>
1615                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1616                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1617             </actions>
1618         </permacrud>
1619         </class>
1620
1621         <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">
1622                 <fields oils_persist:primary="code">
1623                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1624                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1625                 </fields>
1626                 <links/>
1627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1628             <actions>
1629                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1630                 <retrieve/>
1631                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1632                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1633             </actions>
1634         </permacrud>
1635         </class>
1636
1637         <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">
1638                 <fields oils_persist:primary="code">
1639                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1640                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1641                 </fields>
1642                 <links/>
1643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1644             <actions>
1645                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1646                 <retrieve/>
1647                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1648                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1649             </actions>
1650         </permacrud>
1651         </class>
1652
1653         <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">
1654                 <fields oils_persist:primary="code">
1655                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1656                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1657                 </fields>
1658                 <links/>
1659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1660             <actions>
1661                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1662                 <retrieve/>
1663                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1664                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1665             </actions>
1666         </permacrud>
1667         </class>
1668
1669         <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">
1670                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1671                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1672                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1673                 </fields>
1674                 <links/>
1675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1676             <actions>
1677                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1678                 <retrieve/>
1679                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1680                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1681             </actions>
1682         </permacrud>
1683         </class>
1684
1685         <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">
1686                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1687                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1688                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1689                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1690                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1691                 </fields>
1692         <links>
1693             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1694             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1695             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1696         </links>
1697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1698             <actions>
1699                 <create permission="UPDATE_COPY">
1700                     <context link="target_copy" field="circ_lib"/>
1701                 </create>
1702                 <retrieve/>
1703                 <update permission="UPDATE_COPY">
1704                     <context link="target_copy" field="circ_lib"/>
1705                 </update>
1706                 <delete permission="UPDATE_COPY">
1707                     <context link="target_copy" field="circ_lib"/>
1708                 </delete>
1709             </actions>
1710         </permacrud>
1711         </class>
1712
1713         <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">
1714                 <fields oils_persist:primary="code">
1715                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1716                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1717                 </fields>
1718                 <links/>
1719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1720             <actions>
1721                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1722                 <retrieve/>
1723                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1724                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1725             </actions>
1726         </permacrud>
1727         </class>
1728
1729         <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">
1730                 <fields oils_persist:primary="code">
1731                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1732                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1733                 </fields>
1734                 <links/>
1735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1736             <actions>
1737                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1738                 <retrieve/>
1739                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1740                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1741             </actions>
1742         </permacrud>
1743         </class>
1744
1745         <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">
1746                 <fields oils_persist:primary="code">
1747                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1748                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1749                 </fields>
1750                 <links/>
1751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1752             <actions>
1753                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1754                 <retrieve/>
1755                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1756                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1757             </actions>
1758         </permacrud>
1759         </class>
1760
1761     <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">
1762         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1763             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1764             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1765             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1766             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1767             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1768             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1769             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1770             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1771             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1772             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1773             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1774             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1775             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1776             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1777             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1778             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1779             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1780         </fields>
1781         <links/>
1782         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1783             <actions>
1784                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1785                 <retrieve/>
1786                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1787                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1788             </actions>
1789         </permacrud>
1790     </class>
1791
1792     <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">
1793         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1794             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1795             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1796             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1797             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1798             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1799             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1800             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1801             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1802             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1803             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1804             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1805             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1806             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1807             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1808             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1809             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1810             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1811             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1812             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1813         </fields>
1814         <links/>
1815         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1816             <actions>
1817                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1818                 <retrieve/>
1819                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1820                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1821             </actions>
1822         </permacrud>
1823     </class>
1824
1825     <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">
1826         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1827             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1828             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1829             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1830             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1831             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1832         </fields>
1833         <links>
1834             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1835             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1836             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1837         </links>
1838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1839             <actions>
1840                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1841                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1842                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1843                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1844             </actions>
1845         </permacrud>
1846     </class>
1847
1848         <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">
1849                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1850                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1851                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1852                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1853                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1854                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1855                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1856                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1857                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1858                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1859                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1860                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1861                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1862                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1863                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1864                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1865                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1866             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1867                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1868                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1869                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1870                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1871                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1872                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1873                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1874                 </fields>
1875                 <links>
1876                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1878                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1879                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1880                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1881                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1882                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1883                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1884                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1885                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1886                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1887                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1888                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1889             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1890                 </links>
1891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1892             <actions>
1893                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1894                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1895                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1896                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1897             </actions>
1898         </permacrud>
1899         </class>
1900
1901         <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">
1902                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1903                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1904                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1905                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1906                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1907                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1908                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1909                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1910                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1911                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1912                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1913                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1914                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1915                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1916                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1917                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1918             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1919                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1920                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1921             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1922                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1923                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1924                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1925                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1926             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1927             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1928             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1929                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1930                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1931                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1932                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1933                 </fields>
1934                 <links>
1935                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1936                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1937                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1938                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1939                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1940                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1941                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1942                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1943                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1944                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1945                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1946                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1947                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1948                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1949             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1950                 </links>
1951         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1952             <actions>
1953                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1954                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1955                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1956                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1957             </actions>
1958         </permacrud>
1959         </class>
1960
1961     <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">
1962         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1963             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1964             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1965             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1966         </fields>
1967         <links/>
1968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1969             <actions>
1970                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1971                 <retrieve/>
1972                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1973                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1974             </actions>
1975         </permacrud>
1976     </class>
1977
1978     <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">
1979         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1980             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1981             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1982             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1983             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1984             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1985             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1986             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1987         </fields>
1988         <links>
1989             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1990         </links>
1991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992             <actions>
1993                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1994                 <retrieve/>
1995                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1996                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1997             </actions>
1998         </permacrud>
1999     </class>
2000
2001     <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">
2002         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2003             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2004             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2005             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2006             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2007             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2008         </fields>
2009         <links>
2010             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2011             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2012         </links>
2013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014             <actions>
2015                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2016                     <context link="matchpoint" field="org_unit"/>
2017                 </create>
2018                 <retrieve/>
2019                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2020                     <context link="matchpoint" field="org_unit"/>
2021                 </update>
2022                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2023                     <context link="matchpoint" field="org_unit"/>
2024                 </delete>
2025             </actions>
2026         </permacrud>
2027     </class>
2028
2029     <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">
2030         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2031             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2032             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2033             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2034         </fields>
2035         <links>
2036             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2037             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2038         </links>
2039         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2040             <actions>
2041                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2042                     <context link="limit_set" field="owning_lib"/>
2043                 </create>
2044                 <retrieve/>
2045                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2046                     <context link="limit_set" field="owning_lib"/>
2047                 </update>
2048                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2049                     <context link="limit_set" field="owning_lib"/>
2050                 </delete>
2051             </actions>
2052         </permacrud>
2053     </class>
2054     <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">
2055         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2056             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2057             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2058             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2059         </fields>
2060         <links>
2061             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2062             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2063         </links>
2064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2065             <actions>
2066                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2067                     <context link="limit_set" field="owning_lib"/>
2068                 </create>
2069                 <retrieve/>
2070                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2071                     <context link="limit_set" field="owning_lib"/>
2072                 </update>
2073                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2074                     <context link="limit_set" field="owning_lib"/>
2075                 </delete>
2076             </actions>
2077         </permacrud>
2078     </class>
2079
2080     <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">
2081         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2082             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2083             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2084             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2085             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2086         </fields>
2087         <links>
2088             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2089             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2090         </links>
2091         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2092             <actions>
2093                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2094                     <context link="limit_set" field="owning_lib"/>
2095                 </create>
2096                 <retrieve/>
2097                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2098                     <context link="limit_set" field="owning_lib"/>
2099                 </update>
2100                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2101                     <context link="limit_set" field="owning_lib"/>
2102                 </delete>
2103             </actions>
2104         </permacrud>
2105     </class>
2106
2107         <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">
2108                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2109                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2110                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2111                 </fields>
2112                 <links/>
2113         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2114             <actions>
2115                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2116                 <retrieve/>
2117                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2118                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2119             </actions>
2120         </permacrud>
2121         </class>
2122
2123         <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">
2124                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2125                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2126                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2127                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2128                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2129                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2130                 </fields>
2131                 <links>
2132                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2133                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2134                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2135                 </links>
2136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2137             <actions>
2138                 <create permission="ADMIN_SURVEY">
2139                     <context link="survey" field="owner"/>
2140                 </create>
2141                 <retrieve/>
2142                 <update permission="ADMIN_SURVEY">
2143                     <context link="survey" field="owner"/>
2144                 </update>
2145                 <delete permission="ADMIN_SURVEY">
2146                     <context link="survey" field="owner"/>
2147                 </delete>
2148             </actions>
2149         </permacrud>
2150         </class>
2151         <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">
2152                 <fields oils_persist:primary="id" oils_persist:sequence="">
2153                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2154                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2155                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2156                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2157                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2158                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2159                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2160                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2161                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2162                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2163                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2164                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2165                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2166                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2167                 </fields>
2168                 <links>
2169                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2170                 </links>
2171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2172                         <actions>
2173                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2174                                         <context link="usr" field="home_ou" />
2175                                 </retrieve>
2176                         </actions>
2177                 </permacrud>
2178         </class>
2179         <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">
2180                 <fields oils_persist:primary="id" oils_persist:sequence="">
2181                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2182                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2183                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2184                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2185                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2186                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2187                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2188                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2189                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2190                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2191                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2192                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2193                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2194                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2195                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2196                 </fields>
2197                 <links>
2198                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2199                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2200                 </links>
2201         </class>
2202         <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">
2203                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2204                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2205                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2206                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2207                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2208                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2209                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2210                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2211                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2212                 </fields>
2213                 <links>
2214                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2215                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2216                 </links>
2217                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2218                         <actions> <!-- created magically, so no create action -->
2219                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2220                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2221                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2222                         </actions>
2223                 </permacrud>
2224         </class>
2225         <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)">
2226                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2227                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2228                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2229                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2230                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2231                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2232                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2233                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2234                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2235                 </fields>
2236                 <links>
2237                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2238                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2239                 </links>
2240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2241                         <actions> <!-- created magically, so no create action -->
2242                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2243                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2244                         </actions>
2245                 </permacrud>
2246         </class>
2247         <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">
2248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2249                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2250                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2251                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2252                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2253                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2254                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2255                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2256                 </fields>
2257                 <links>
2258                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2259                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2260                 </links>
2261         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2262             <actions>
2263                 <create permission="UPDATE_USER" context_field="owner">
2264                     <context link="usr" field="home_ou"/>
2265                 </create>
2266                                 <!-- note: public notes are still accessible via API -->
2267                 <retrieve permission="UPDATE_USER">
2268                     <context link="usr" field="home_ou"/>
2269                                 </retrieve>
2270                 <update permission="UPDATE_USER">
2271                     <context link="usr" field="home_ou"/>
2272                                 </update>
2273                 <delete permission="UPDATE_USER">
2274                     <context link="usr" field="home_ou"/>
2275                                 </delete>
2276             </actions>
2277         </permacrud>
2278         </class>
2279         <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">
2280                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2281                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2282                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2283                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2284                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2285                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2286                 </fields>
2287                 <links>
2288                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2289                 </links>
2290         </class>
2291         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2292                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2293                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2294                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2295                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2296                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2297                 </fields>
2298                 <links>
2299                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2300                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2301                 </links>
2302         </class>
2303         <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">
2304                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2305                         <field name="field" reporter:datatype="link"/>
2306                         <field name="id" reporter:datatype="id" />
2307                         <field name="source" reporter:datatype="link"/>
2308                         <field name="value" reporter:datatype="text"/>
2309                 </fields>
2310                 <links>
2311                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2312                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2313                 </links>
2314         </class>
2315         <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">
2316                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2317                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2318                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2319                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2320                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2321                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2322                 </fields>
2323                 <links>
2324                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2325                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2326                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2327                 </links>
2328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2329                         <actions>
2330                                 <retrieve/>
2331                         </actions>
2332                 </permacrud>
2333         </class>
2334         <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">
2335                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2336                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2337                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2338                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2339                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2340                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2341                 </fields>
2342                 <links>
2343                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2344                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2345                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2346                 </links>
2347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2348                         <actions>
2349                                 <retrieve/>
2350                         </actions>
2351                 </permacrud>
2352         </class>
2353         <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">
2354                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2355                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2356                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2357                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2358                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2359                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2360                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2361                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2362                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2363                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2364                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2365                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2366                 </fields>
2367                 <links>
2368                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2369                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2370                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2371                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2372                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2373                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2374                 </links>
2375         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2376             <actions>
2377                 <create permission="TRANSIT_COPY" context_field="owner">
2378                     <context link="target_copy" field="circ_lib"/>
2379                 </create>
2380                 <retrieve/>
2381                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2382                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2383             </actions>
2384         </permacrud>
2385         </class>
2386         <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">
2387                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2388                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2389                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2390                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2392                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2393                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2394                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2395                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2396                 </fields>
2397                 <links>
2398                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2399                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2400                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2401                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2402                 </links>
2403         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2404             <actions>
2405                 <create permission="ADMIN_SURVEY">
2406                     <context link="survey" field="owner"/>
2407                 </create>
2408                 <retrieve permission="VIEW_USER">
2409                     <context link="usr" field="home_ou"/>
2410                 </retrieve>
2411                 <update permission="ADMIN_SURVEY">
2412                     <context link="survey" field="owner"/>
2413                 </update>
2414                 <delete permission="ADMIN_SURVEY">
2415                     <context link="survey" field="owner"/>
2416                 </delete>
2417             </actions>
2418         </permacrud>
2419         </class>
2420         <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">
2421                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2422                         <field name="bucket" />
2423                         <field name="id" reporter:datatype="id" />
2424                         <field name="target_copy" reporter:datatype="link"/>
2425                         <field name="create_time" reporter:datatype="timestamp" />
2426                         <field name="pos" reporter:datatype="int" />
2427                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2428                 </fields>
2429                 <links>
2430                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2431                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2432             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2433                 </links>
2434         </class>
2435         <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">
2436                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2437                         <field name="id" reporter:datatype="id" />
2438                         <field name="item" reporter:datatype="link"/>
2439                         <field name="note" reporter:datatype="text" />
2440                 </fields>
2441                 <links>
2442                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2443                 </links>
2444         </class>
2445
2446         <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">
2447                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2448                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2449                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2450                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2451                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2452                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2453                 </fields>
2454                 <links>
2455                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2456                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2457                 </links>
2458                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2459                         <actions>
2460                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2461                                 <retrieve/>
2462                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2463                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2464                         </actions>
2465                 </permacrud>
2466         </class>
2467
2468         <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">
2469                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2470                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2471                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2472                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2473                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2474                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2475                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2476                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2477                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2478                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2479                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2480                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2481                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2482                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2483                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2484                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2485                 </fields>
2486                 <links>
2487                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2488                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2489                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2490                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2491                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2492                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2493                 </links>
2494                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2495                         <actions>
2496                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2497                                 <retrieve/>
2498                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2499                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2500                         </actions>
2501                 </permacrud>
2502         </class>
2503
2504         <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">
2505                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2506                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2507                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2508                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2509                 </fields>
2510                 <links>
2511                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2512                 </links>
2513                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2514                         <actions>
2515                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2516                                 <retrieve/>
2517                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2518                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2519                         </actions>
2520                 </permacrud>
2521         </class>
2522
2523         <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">
2524                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2525                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2526                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2527                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2528                 </fields>
2529                 <links>
2530                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2531                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2532                 </links>
2533                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2534                         <actions>
2535                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2536                                 <retrieve/>
2537                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2538                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2539                         </actions>
2540                 </permacrud>
2541         </class>
2542
2543         <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">
2544                 <fields oils_persist:primary="code">
2545                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2546                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2547                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2548                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2549                 </fields>
2550                 <links>
2551                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2552                 </links>
2553                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2554                         <actions>
2555                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2556                                 <retrieve/>
2557                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2558                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2559                         </actions>
2560                 </permacrud>
2561         </class>
2562
2563         <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">
2564                 <fields oils_persist:primary="code">
2565                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2566                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2567                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2568                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2569                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2570                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2571                 </fields>
2572                 <links>
2573                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2574                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2575                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2576                 </links>
2577                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2578                         <actions>
2579                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2580                                 <retrieve/>
2581                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2582                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2583                         </actions>
2584                 </permacrud>
2585         </class>
2586
2587     <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">
2588         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2589             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2590             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2591             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2592         </fields>
2593         <links>
2594             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2595             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2596         </links>
2597         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2598             <actions>
2599                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2600                 <retrieve/>
2601                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2602                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2603             </actions>
2604         </permacrud>
2605     </class>
2606
2607         <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">
2608                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2609                         <field name="active" reporter:datatype="bool"/>
2610                         <field name="create_date" reporter:datatype="timestamp"/>
2611                         <field name="creator" />
2612                         <field name="deleted" reporter:datatype="bool"/>
2613                         <field name="edit_date" reporter:datatype="timestamp"/>
2614                         <field name="editor" />
2615                         <field name="id" reporter:datatype="id" />
2616                         <field name="last_xact_id" />
2617                         <field name="marc" />
2618                         <field name="source" />
2619                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2620                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2621                         <field name="heading" />
2622                         <field name="simple_heading" />
2623                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2624                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2625                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2626                 </fields>
2627                 <links>
2628                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2629                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2630                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2631                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2632                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2633                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2634                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2635                 </links>
2636                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2637                         <actions>
2638                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2639                                 <retrieve/>
2640                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2641                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2642                         </actions>
2643                 </permacrud>
2644         </class>
2645         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2646                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2647                         <field name="char_encoding" />
2648                         <field name="id" />
2649                         <field name="record" />
2650                         <field name="record_status" />
2651                         <field name="thesaurus" />
2652                 </fields>
2653                 <links>
2654                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2655                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2656                 </links>
2657         </class>
2658         <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">
2659                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2660                         <field name="id" reporter:datatype="id" />
2661                         <field name="bib" reporter:datatype="link" />
2662                         <field name="authority" reporter:datatype="link" />
2663                 </fields>
2664                 <links>
2665                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2666                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2667                 </links>
2668         </class>
2669         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2670                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2671                         <field name="id" reporter:datatype="id" />
2672                         <field name="record" reporter:datatype="link" />
2673                         <field name="atag" reporter:datatype="link" />
2674                         <field name="value" reporter:datatype="text" />
2675                 </fields>
2676                 <links>
2677                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2678                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2679                 </links>
2680         </class>
2681         <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">
2682                 <fields oils_persist:primary="code" oils_persist:sequence="">
2683                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2684                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2685                 </fields>
2686                 <links/>
2687         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2688             <actions>
2689                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2690                 <retrieve/>
2691                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2692                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2693             </actions>
2694         </permacrud>
2695         </class>
2696         <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">
2697                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2698                         <field name="accepting_usr" />
2699                         <field name="amount" reporter:datatype="money" />
2700                         <field name="amount_collected" reporter:datatype="money" />
2701                         <field name="approval_code" reporter:datatype="text"/>
2702                         <field name="cash_drawer" reporter:datatype="link"/>
2703                         <field name="cc_number" reporter:datatype="text"/>
2704                         <field name="cc_order_number" reporter:datatype="text"/>
2705                         <field name="cc_processor" reporter:datatype="text"/>
2706                         <field name="id" reporter:datatype="id" />
2707                         <field name="note" reporter:datatype="text"/>
2708                         <field name="payment_ts" reporter:datatype="timestamp"/>
2709                         <field name="xact" reporter:datatype="link"/>
2710                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2711                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2712                 </fields>
2713                 <links>
2714                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2715                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2716                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2717                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2718                 </links>
2719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2720             <actions>
2721                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2722                     <context link="xact" jump="usr" field="home_ou"/>
2723                 </retrieve>
2724                         </actions>
2725                 </permacrud>
2726         </class>
2727         <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">
2728                 <fields oils_persist:primary="name">
2729                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2730                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2731                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2732                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2733                 </fields>
2734                 <links/>
2735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2736             <actions>
2737                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2738                 <retrieve/>
2739                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2740                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2741             </actions>
2742         </permacrud>
2743         </class>
2744
2745         <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">
2746                 <fields oils_persist:primary="alias">
2747                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2748                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2749                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2750                 </fields>
2751                 <links>
2752                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2753                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2754                 </links>
2755         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2756             <actions>
2757                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2758                 <retrieve/>
2759                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2760                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2761             </actions>
2762         </permacrud>
2763         </class>
2764
2765         <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">
2766                 <fields oils_persist:primary="name">
2767                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2768                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2769                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2770                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2771                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2772                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2773                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2774                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2775                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2776                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2777                 </fields>
2778                 <links>
2779                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2780                 </links>
2781         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2782             <actions>
2783                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2784                 <retrieve/>
2785                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2786                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2787             </actions>
2788         </permacrud>
2789         </class>
2790
2791         <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">
2792                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2793                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2794                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2795                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2796                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2797                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2798                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2799                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2800                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2801                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2802                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2803                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2804                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2805                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2806                 </fields>
2807                 <links>
2808                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2809                 </links>
2810         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2811             <actions>
2812                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2813                 <retrieve/>
2814                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2815                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2816             </actions>
2817         </permacrud>
2818         </class>
2819         <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">
2820                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2821                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2822                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2823                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2824                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2825                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2826                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2827                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2828                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2829                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2830                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2831                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2832                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2833                 </fields>
2834                 <links>
2835                 </links>
2836                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2837                         <actions>
2838                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2839                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2840                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2841                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2842                         </actions>
2843                 </permacrud>
2844         </class>
2845         <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">
2846                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2847                         <field name="id" reporter:datatype="id" />
2848                         <field name="name" reporter:datatype="text"/>
2849                         <field name="xpath" reporter:datatype="text"/>
2850                         <field name="format" reporter:datatype="link"/>
2851                         <field name="first_word" reporter:datatype="bool" />
2852                 </fields>
2853                 <links/>
2854         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2855             <actions>
2856                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2857                 <retrieve/>
2858                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2859                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2860             </actions>
2861         </permacrud>
2862         </class>
2863         <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">
2864                 <fields oils_persist:primary="code" oils_persist:sequence="">
2865                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2866                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2867                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2868                 </fields>
2869                 <links/>
2870         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2871             <actions>
2872                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2873                 <retrieve/>
2874                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2875                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2876             </actions>
2877         </permacrud>
2878         </class>
2879         <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">
2880                 <fields oils_persist:primary="code" oils_persist:sequence="">
2881                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2882                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2883                 </fields>
2884                 <links/>
2885         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2886             <actions>
2887                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2888                 <retrieve/>
2889                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2890                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2891             </actions>
2892         </permacrud>
2893         </class>
2894     <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">
2895         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2896             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2897             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2898             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2899             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2900         </fields>
2901         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2902             <actions>
2903                 <retrieve/>
2904             </actions>
2905         </permacrud>
2906     </class>
2907         <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">
2908                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2909                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2910                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2911                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2912                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2913                 </fields>
2914                 <links>
2915                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2916                 </links>
2917         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2918             <actions>
2919                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2920                 <retrieve/>
2921                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2922                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2923             </actions>
2924         </permacrud>
2925         </class>
2926         <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">
2927                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2928                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2929                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2930                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2931                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2932                 </fields>
2933                 <links>
2934                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2935                 </links>
2936         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2937             <actions>
2938                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2939                 <retrieve/>
2940                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2941                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2942             </actions>
2943         </permacrud>
2944         </class>
2945         <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">
2946                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2947                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2948                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2949                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2950                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2951                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2952                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2953                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2954                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2955                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2956                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2957                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2958                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2959                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2960                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2961                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2962                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2963                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2964                 </fields>
2965                 <links>
2966                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2967                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2968                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2969                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2970                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2971                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2972                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2973                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2974                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2975                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2976                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2977                 </links>
2978         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2979             <actions>
2980                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2981                 <retrieve/>
2982                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2983                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2984             </actions>
2985         </permacrud>
2986         </class>
2987         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2988                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2989                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2990                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2991                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2992                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2993                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2994                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2995                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2996                 </fields>
2997                 <links>
2998                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2999                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3000         </links>
3001         </class>
3002         <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">
3003                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3004                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3005                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3006                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3007                 </fields>
3008                 <links>
3009                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3010                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3011                 </links>
3012         </class>
3013         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3014                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3015                         <field name="id" reporter:datatype="id" />
3016                         <field name="value" oils_persist:i18n="true" />
3017                 </fields>
3018                 <links/>
3019         </class>
3020         <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">
3021                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3022                         <field name="balance_owed" reporter:datatype="money" />
3023                         <field name="total_owed" reporter:datatype="money" />
3024                         <field name="total_paid" reporter:datatype="money" />
3025                         <field name="usr" reporter:datatype="link"/>
3026                 </fields>
3027                 <links>
3028                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3029         </links>
3030         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3031             <actions>
3032                 <retrieve permission="VIEW_USER">
3033                     <context link="usr" field="home_ou"/>
3034                 </retrieve>
3035             </actions>
3036         </permacrud>
3037         </class>
3038         <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">
3039                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3040                         <field name="collector" />
3041                         <field name="enter_time" reporter:datatype="timestamp"/>
3042                         <field name="id" reporter:datatype="id" />
3043                         <field name="location" reporter:datatype="link"/>
3044                         <field name="usr" reporter:datatype="link"/>
3045                 </fields>
3046                 <links>
3047                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3048                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3049                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3050                 </links>
3051         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3052             <actions>
3053                 <create permission="money.collections_tracker.create" context_field="location"/>
3054                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3055                 <delete permission="money.collections_tracker.create" context_field="location"/>
3056             </actions>
3057         </permacrud>
3058         </class>
3059         <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">
3060                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3061                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3062                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3063                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3064                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3065                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3066                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3067                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3068                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3069                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3070                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3071                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3072                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3073                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3074                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3075                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3076                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3077                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3078                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3079                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3080                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3081                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3082                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3083                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3084                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3085                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3086                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3087                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3088                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3089                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3090                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3092                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3093                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3094                 </fields>
3095                 <links>
3096                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3097                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3098                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3099                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3100                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3101                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3102                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3103                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3104                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3105                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3106                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3107                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3108                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3109                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3110                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3111                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3112                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3113                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3114                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3115                         <link field="mattrs" reltype="might_have" key="id" map="" class="mraf"/>
3116                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3117                 </links>
3118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3119             <actions>
3120                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3121                 <retrieve/>
3122                 <update permission="UPDATE_MARC" global_required="true"/>
3123                 <!-- 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. -->
3124                 <delete permission="DELETE_RECORD" global_required="true"/>
3125             </actions>
3126         </permacrud>
3127         </class>
3128         <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">
3129                 <fields oils_persist:primary="id">
3130                         <field name="dow_0_close" />
3131                         <field name="dow_0_open" />
3132                         <field name="dow_1_close" />
3133                         <field name="dow_1_open" />
3134                         <field name="dow_2_close" />
3135                         <field name="dow_2_open" />
3136                         <field name="dow_3_close" />
3137                         <field name="dow_3_open" />
3138                         <field name="dow_4_close" />
3139                         <field name="dow_4_open" />
3140                         <field name="dow_5_close" />
3141                         <field name="dow_5_open" />
3142                         <field name="dow_6_close" />
3143                         <field name="dow_6_open" />
3144                         <field name="id" reporter:datatype="id" />
3145                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3146                 </fields>
3147                 <links>
3148                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3149                 </links>
3150         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3151             <actions>
3152                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3153                 <retrieve/>
3154                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3155                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3156             </actions>
3157         </permacrud>
3158         </class>
3159         <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">
3160                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3161                         <field name="id" reporter:datatype="id" />
3162                         <field name="record" reporter:datatype="link"/>
3163                         <field name="label" reporter:datatype="text"/>
3164                         <field name="label_sortkey" reporter:datatype="text"/>
3165                         <field name="deleted" reporter:datatype="bool"/>
3166                 </fields>
3167                 <links>
3168                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3169                 </links>
3170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3171             <actions>
3172                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3173                 <retrieve/>
3174                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3175                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3176             </actions>
3177         </permacrud>
3178         </class>
3179         <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">
3180                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3181                         <field name="id" reporter:datatype="id" />
3182                         <field name="target_copy" reporter:datatype="link" />
3183                         <field name="part" reporter:datatype="link"/>
3184                 </fields>
3185                 <links>
3186                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3187                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3188                 </links>
3189         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3190             <actions>
3191                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3192                 <retrieve/>
3193                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3194                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3195             </actions>
3196         </permacrud>
3197         </class>
3198         <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">
3199                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3200                         <field name="close_end" reporter:datatype="timestamp" />
3201                         <field name="close_start" reporter:datatype="timestamp" />
3202                         <field name="id" reporter:datatype="id" />
3203                         <field name="org_unit" reporter:datatype="org_unit"/>
3204                         <field name="reason" reporter:datatype="text"/>
3205                 </fields>
3206                 <links>
3207                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3208                 </links>
3209         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3210             <actions>
3211                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3212                 <retrieve/>
3213                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3214                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3215             </actions>
3216         </permacrud>
3217         </class>
3218         <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">
3219                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3220                         <field name="extended" reporter:datatype="interval"/>
3221                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3222                         <field name="max_renewals" reporter:datatype="int" />
3223                         <field name="name" reporter:datatype="text"/>
3224                         <field name="normal" reporter:datatype="interval"/>
3225                         <field name="shrt" reporter:datatype="interval"/>
3226                 </fields>
3227                 <links>
3228                 </links>
3229         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3230             <actions>
3231                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3232                 <retrieve/>
3233                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3234                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3235             </actions>
3236         </permacrud>
3237         </class>
3238
3239         <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">
3240                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3241                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3242                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3243             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3244                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3245             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3246                 </fields>
3247                 <links>
3248             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3249                 </links>
3250                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3251             <actions>
3252                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3253                 <retrieve/>
3254                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3255                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3256             </actions>
3257                 </permacrud>
3258         </class>
3259
3260         <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">
3261                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3262                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3263                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3264                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3265             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3266                 </fields>
3267                 <links>
3268                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3269                 </links>
3270                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3271             <actions>
3272                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3273                 <retrieve/>
3274                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3275                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3276             </actions>
3277                 </permacrud>
3278         </class>
3279
3280         <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">
3281                 <fields oils_persist:primary="id" oils_persist:sequence="">
3282                         <field name="balance_owed" reporter:datatype="money"/>
3283                         <field name="id" reporter:datatype="id" />
3284                         <field name="last_billing_note" reporter:datatype="text"/>
3285                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3286                         <field name="last_billing_type" reporter:datatype="text"/>
3287                         <field name="last_payment_note" reporter:datatype="text"/>
3288                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3289                         <field name="last_payment_type" reporter:datatype="text"/>
3290                         <field name="total_owed" reporter:datatype="money"/>
3291                         <field name="total_paid" reporter:datatype="money"/>
3292                         <field name="usr" reporter:datatype="link"/>
3293                         <field name="xact_finish" reporter:datatype="timestamp" />
3294                         <field name="xact_start" reporter:datatype="timestamp" />
3295                         <field name="xact_type" reporter:datatype="text"/>
3296                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3297                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3298                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3299                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3300                         <field name="billing_location" reporter:datatype="link"/>
3301                 </fields>
3302                 <links>
3303                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3304                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3305                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3306                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3307                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3308                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3309                 </links>
3310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3311                         <actions>
3312                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3313                                         <context link="usr" field="home_ou" />
3314                                 </retrieve>
3315                         </actions>
3316                 </permacrud>
3317         </class>
3318         <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">
3319                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3320                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3321                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3322                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3323                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3324                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3325                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3326                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3327                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3328                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3329                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3330                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3331                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3332                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3333                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3334                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3335                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3336                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3337                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3338                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3339                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3340                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3341                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3342                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3343                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3344                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3345                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3346                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3347                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3348                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3349                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3350                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3351                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3352                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3353                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3354                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3355                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3356                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3357                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3358                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3359                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3360                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3361                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3362                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3363                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3364                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3365                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3366                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3367                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3368                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3369                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3370                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3371                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3372                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3373                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3374                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3375                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3376                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3377                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3378                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3379                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3380                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3381                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3382                         <field reporter:label="User Activity Entries" name="usr_activity" 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                 </links>
3416                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3417                         <actions>
3418                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3419                         </actions>
3420                 </permacrud>
3421         </class>
3422         <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">
3423                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3424                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3425                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3426                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3427                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3428                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3429                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3430                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3431                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3432         </fields>
3433                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3434                         <actions>
3435                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3436                                 <retrieve/>
3437                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3438                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3439                         </actions>
3440                 </permacrud>
3441         </class>
3442         <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">
3443                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3444                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3445                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3446                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3447                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3448         </fields>
3449         <links>
3450                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3451                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3452                 </links>
3453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3454                         <actions>
3455                                 <retrieve permission="RUN_REPORTS">
3456                                         <context link="usr" field="home_ou" />
3457                                 </retrieve>
3458                         </actions>
3459                 </permacrud>
3460         </class>
3461         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3462                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3463                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3464                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3465                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3466                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3467                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3468                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3469         </fields>
3470         <links>
3471                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3472                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3473                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3474                 </links>
3475                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3476                         <actions>
3477                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3478                                         <context link="usr" field="home_ou" />
3479                                         <context link="ws" field="owning_lib" />
3480                                 </retrieve>
3481                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3482                                         <context link="usr" field="home_ou" />
3483                                         <context link="ws" field="owning_lib" />
3484                                 </create>
3485                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3486                                         <context link="usr" field="home_ou" />
3487                                         <context link="ws" field="owning_lib" />
3488                                 </update>
3489                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3490                                         <context link="usr" field="home_ou" />
3491                                         <context link="ws" field="owning_lib" />
3492                                 </delete>
3493                         </actions>
3494                 </permacrud>
3495         </class>
3496         <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">
3497                 <fields oils_persist:primary="name">
3498                         <field name="name" reporter:datatype="text"/>
3499                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3500                 </fields>
3501                 <links/>
3502                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3503                         <actions>
3504                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3505                                 <retrieve/>
3506                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3507                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3508                         </actions>
3509                 </permacrud>
3510         </class>
3511         <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">
3512                 <fields oils_persist:primary="name">
3513                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3514                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3515                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3516                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3517                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3518                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3519                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3520                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3521                 </fields>
3522                 <links>
3523                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3524                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3525                 </links>
3526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3527                         <actions>
3528                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3529                                 <retrieve/>
3530                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3531                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3532                         </actions>
3533                 </permacrud>
3534         </class>
3535         <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">
3536                 <fields oils_persist:primary="name">
3537                         <field name="name" reporter:datatype="text"/>
3538                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3539                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3540                         <field name="datatype" reporter:datatype="text"/>
3541                         <field name="view_perm" reporter:datatype="link"/>
3542                         <field name="update_perm" reporter:datatype="link"/>
3543                         <field name="fm_class" reporter:datatype="text"/>
3544                         <field name="grp" reporter:datatype="link"/>
3545                 </fields>
3546                 <links>
3547                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3548                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3549                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3550                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3551                 </links>
3552                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3553                         <actions>
3554                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3555                                 <retrieve/>
3556                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3557                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3558                         </actions>
3559                 </permacrud>
3560         </class>
3561         <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">
3562                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3563                         <field name="id" />
3564                         <field name="name"  reporter:datatype="text"/>
3565                         <field name="org_unit" reporter:datatype="org_unit"/>
3566                         <field name="value"  reporter:datatype="text"/>
3567                 </fields>
3568                 <links>
3569                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3570                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3571                 </links>
3572         </class>
3573         <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">
3574                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3575                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3576                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3577                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3578                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3579                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3580                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3581                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3582                 </fields>
3583                 <links>
3584                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3585                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3586                 </links>
3587         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3588             <actions>
3589                 <create permission="CREATE_COPY_NOTE">
3590                     <context link="owning_copy" field="circ_lib"/>
3591                 </create>
3592                 <retrieve permission="VIEW_COPY_NOTES">
3593                     <context link="owning_copy" field="circ_lib"/>
3594                 </retrieve>
3595                 <update permission="UPDATE_COPY_NOTE">
3596                     <context link="owning_copy" field="circ_lib"/>
3597                 </update>
3598                 <delete permission="DELETE_COPY_NOTE">
3599                     <context link="owning_copy" field="circ_lib"/>
3600                 </delete>
3601             </actions>
3602         </permacrud>
3603         </class>
3604         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3605                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3606                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3607                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3608                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3609                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3610                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3611                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3612                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3613                 </fields>
3614                 <links>
3615                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3616                 </links>
3617         </class>
3618         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3619                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3620                         <field name="fingerprint"  reporter:datatype="text"/>
3621                         <field name="id" reporter:datatype="id" />
3622                         <field name="master_record" reporter:datatype="link"/>
3623                         <field name="mods"  reporter:datatype="text"/>
3624                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3625                 </fields>
3626                 <links>
3627                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3628                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3629                 </links>
3630         </class>
3631         <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">
3632                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3633                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3634                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3635                 </fields>
3636                 <links/>
3637         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3638             <actions>
3639                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3640                 <retrieve/>
3641                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3642                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3643             </actions>
3644         </permacrud>
3645         </class>
3646         <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">
3647                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3648                         <field name="code"  reporter:datatype="text"/>
3649                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3650                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3651                 </fields>
3652                 <links/>
3653         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3654             <actions>
3655                 <create permission="CREATE_PERM" global_required="true"/>
3656                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3657                 <update permission="UPDATE_PERM" global_required="true"/>
3658                 <delete permission="DELETE_PERM" global_required="true"/>
3659             </actions>
3660         </permacrud>
3661         </class>
3662         <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">
3663                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3664                         <field name="id" reporter:datatype="id" />
3665                         <field name="metarecord" reporter:datatype="link"/>
3666                         <field name="source" reporter:datatype="link"/>
3667                 </fields>
3668                 <links>
3669                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3670                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3671                 </links>
3672         </class>
3673         <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">
3674                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3675                         <field name="id" reporter:datatype="id" />
3676                         <field name="field" reporter:datatype="link"/>
3677                         <field name="source" reporter:datatype="link"/>
3678                         <field name="value"  reporter:datatype="text"/>
3679                 </fields>
3680                 <links>
3681                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3682                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3683                 </links>
3684         </class>
3685         <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">
3686                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3687                         <field name="id" reporter:datatype="id" />
3688                         <field name="value" reporter:datatype="text"/>
3689                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3690                 </fields>
3691                 <links>
3692                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3693                 </links>
3694         </class>
3695         <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">
3696                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3697                         <field name="id" reporter:datatype="id" />
3698                         <field name="entry" reporter:datatype="link"/>
3699                         <field name="def" reporter:datatype="link"/>
3700                         <field name="source" reporter:datatype="link"/>
3701                 </fields>
3702                 <links>
3703                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3704                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3705                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3706                 </links>
3707         </class>
3708         <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">
3709                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3710                         <field name="id" reporter:datatype="id" />
3711                         <field name="entry" reporter:datatype="link"/>
3712                         <field name="simple_heading" reporter:datatype="link"/>
3713                 </fields>
3714                 <links>
3715                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3716                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3717                 </links>
3718         </class>
3719         <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">
3720                 <oils_persist:source_definition>
3721                         SELECT * FROM metabib.author_field_entry
3722                                                 UNION ALL
3723                         SELECT * FROM metabib.keyword_field_entry
3724                                                 UNION ALL
3725                         SELECT * FROM metabib.identifier_field_entry
3726                                                 UNION ALL
3727                         SELECT * FROM metabib.title_field_entry
3728                                                 UNION ALL
3729                         SELECT * FROM metabib.subject_field_entry
3730                                                 UNION ALL
3731                         SELECT * FROM metabib.series_field_entry
3732                 </oils_persist:source_definition>
3733                 <fields>
3734                         <field name="field" reporter:datatype="link"/>
3735                         <field name="id" reporter:datatype="id" />
3736                         <field name="source" reporter:datatype="link"/>
3737                         <field name="value"  reporter:datatype="text"/>
3738                 </fields>
3739                 <links>
3740                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3741                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3742                 </links>
3743         </class>
3744         <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">
3745                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3746                         <field name="field" reporter:datatype="link"/>
3747                         <field name="id" reporter:datatype="id" />
3748                         <field name="source" reporter:datatype="link"/>
3749                         <field name="value"  reporter:datatype="text"/>
3750                 </fields>
3751                 <links>
3752                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3753                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3754                 </links>
3755         </class>
3756         <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">
3757                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3758                         <field name="accepting_usr" reporter:datatype="link"/>
3759                         <field name="amount" reporter:datatype="money" />
3760                         <field name="amount_collected" reporter:datatype="money" />
3761                         <field name="cash_drawer" reporter:datatype="link"/>
3762                         <field name="id" reporter:datatype="id" />
3763                         <field name="note"  reporter:datatype="text"/>
3764                         <field name="payment_ts" reporter:datatype="timestamp"/>
3765                         <field name="xact" reporter:datatype="link"/>
3766                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3767                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3768                 </fields>
3769                 <links>
3770                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3771                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3772                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3773                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3774                 </links>
3775         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3776             <actions>
3777                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3778                     <context link="xact" jump="usr" field="home_ou"/>
3779                 </retrieve>
3780                         </actions>
3781                 </permacrud>
3782         </class>
3783         <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">
3784                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3785                         <field name="accepting_usr" reporter:datatype="link"/>
3786                         <field name="amount" reporter:datatype="money" />
3787                         <field name="amount_collected" reporter:datatype="money" />
3788                         <field name="id" reporter:datatype="id" />
3789                         <field name="note"  reporter:datatype="text"/>
3790                         <field name="payment_ts" reporter:datatype="timestamp"/>
3791                         <field name="xact" reporter:datatype="link"/>
3792                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3793                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3794                 </fields>
3795                 <links>
3796                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3797                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3798                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3799                 </links>
3800         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3801             <actions>
3802                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3803                     <context link="xact" jump="usr" field="home_ou"/>
3804                 </retrieve>
3805                         </actions>
3806                 </permacrud>
3807         </class>
3808         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
3809                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3810                         <field name="accepting_usr" reporter:datatype="link"/>
3811                         <field name="amount" reporter:datatype="money" />
3812                         <field name="amount_collected" reporter:datatype="money" />
3813                         <field name="id" reporter:datatype="id" />
3814                         <field name="note"  reporter:datatype="text"/>
3815                         <field name="payment_ts" reporter:datatype="timestamp"/>
3816                         <field name="xact" reporter:datatype="link"/>
3817                         <field name="billing" reporter:datatype="link"/>
3818                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3819                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3820                 </fields>
3821                 <links>
3822                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3823                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3824                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3825                         <link field="billing" reltype="might_have" key="id" class="mb"/>
3826                 </links>
3827         </class>
3828         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3829                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3830                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3831                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3832                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3833                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3834                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3835                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3836                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3837                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3838                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3839                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3840                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3841                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3842                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3843                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3844                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3845                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3846                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3847                 </fields>
3848                 <links>
3849                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3850                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3851                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3852                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3853                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3854                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3855                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3856                 </links>
3857         </class>
3858
3859         <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">
3860                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3861                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3862                         <field name="name"  reporter:datatype="text"/>
3863                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3864                         <field name="block_list" reporter:datatype="text"/>
3865                         <field name="staff_alert" reporter:datatype="bool"/>
3866                         <field name="org_depth" reporter:datatype="int"/>
3867                         <field name="ignore_proximity" reporter:datatype="int"/>
3868                 </fields>
3869                 <links/>
3870         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3871             <actions>
3872                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3873                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3874                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3875                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3876             </actions>
3877         </permacrud>
3878         </class>
3879         <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">
3880                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3881                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3882                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3883                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3884                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3885                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3886                 </fields>
3887                 <links>
3888                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3889                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3890                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3891         </links>
3892         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3893             <actions>
3894                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3895                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3896                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3897                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3898             </actions>
3899         </permacrud>
3900         </class>
3901         <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">
3902                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3903                         <field name="holdable" reporter:datatype="bool"/>
3904                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3905                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3906                         <field name="opac_visible" reporter:datatype="bool"/>
3907             <field name="copy_active" reporter:datatype="bool"/>
3908             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3909             <field name="is_available" reporter:datatype="bool"/>
3910                 </fields>
3911                 <links/>
3912         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3913             <actions>
3914                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3915                 <retrieve/>
3916                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3917                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3918             </actions>
3919         </permacrud>
3920         </class>
3921         <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">
3922                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3923                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3924                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3925                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3926                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3927                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3928                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3929                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3930                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3931                 </fields>
3932                 <links>
3933                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3934                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3935                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3936                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3937                 </links>
3938                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3939                         <actions>
3940                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3941                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3942                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3943                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3944                         </actions>
3945                 </permacrud>
3946         </class>
3947         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3948                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3949                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3950                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3951                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3952                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3953                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3954                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3955                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3956                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3957                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3958                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3959                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3960                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3961                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3962                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3963                 </fields>
3964                 <links>
3965                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3966                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3967                 </links>
3968         </class>
3969         <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">
3970                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3971                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3972                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3973                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3974                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3975                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3976                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3977                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3978                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3979                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3980                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3981                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3982                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3983                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3984                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3985                 </fields>
3986                 <links>
3987                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3988                 </links>
3989                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3990                         <actions>
3991                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3992                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3993                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3994                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3995                         </actions>
3996                 </permacrud>
3997         </class>
3998
3999
4000         <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">
4001                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4002                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4003                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4004                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4005                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4006                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4007                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4008                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4009                 </fields>
4010                 <links>
4011                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4012                 </links>
4013         </class>
4014
4015         <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">
4016                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4017                         <field name="call_number" />
4018                         <field name="create_date" reporter:datatype="timestamp"/>
4019                         <field name="creator" reporter:datatype="link"/>
4020                         <field name="id" reporter:datatype="id" />
4021                         <field name="pub" reporter:datatype="bool"/>
4022                         <field name="title"  reporter:datatype="text"/>
4023                         <field name="value"  reporter:datatype="text"/>
4024                 </fields>
4025                 <links>
4026                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4027                 </links>
4028         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4029             <actions>
4030                 <create permission="CREATE_VOLUME_NOTE">
4031                     <context link="call_number" field="owning_lib"/>
4032                 </create>
4033                 <retrieve permission="VIEW_VOLUME_NOTES">
4034                     <context link="call_number" field="owning_lib"/>
4035                 </retrieve>
4036                 <update permission="UPDATE_VOLUME_NOTE">
4037                     <context link="call_number" field="owning_lib"/>
4038                 </update>
4039                 <delete permission="DELETE_VOLUME_NOTE">
4040                     <context link="call_number" field="owning_lib"/>
4041                 </delete>
4042             </actions>
4043         </permacrud>
4044         </class>
4045         <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">
4046                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4047                         <field name="create_date" reporter:datatype="timestamp"/>
4048                         <field name="creator" reporter:datatype="link"/>
4049                         <field name="edit_date" reporter:datatype="timestamp"/>
4050                         <field name="editor" reporter:datatype="link"/>
4051                         <field name="id" reporter:datatype="id" />
4052                         <field name="record" reporter:datatype="link"/>
4053                         <field name="value" reporter:datatype="text"/>
4054                 </fields>
4055                 <links>
4056                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4057                 </links>
4058         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4059             <actions>
4060                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4061                 <retrieve/>
4062                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4063                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4064             </actions>
4065         </permacrud>
4066         </class>
4067         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4068         <oils_persist:source_definition>
4069 SELECT  usr,
4070         SUM(
4071             CASE
4072                 WHEN (
4073                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4074                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4075                 ) THEN 1
4076                 ELSE 0
4077             END
4078         ) AS out,
4079
4080         SUM(
4081             CASE
4082                 WHEN (
4083                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4084                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4085                 ) THEN 1
4086                 ELSE 0
4087             END
4088         ) AS overdue,
4089
4090         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4091         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4092         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4093   FROM  action.circulation
4094   WHERE checkin_time IS NULL
4095   GROUP BY 1
4096         </oils_persist:source_definition>
4097         <fields oils_persist:primary="usr">
4098             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4099             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4100             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4101             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4102             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4103             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4104         </fields>
4105         <links>
4106             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4107         </links>
4108         </class>
4109         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4110         <oils_persist:source_definition>
4111 SELECT  usr,
4112         STRING_AGG(
4113             CASE
4114                 WHEN (
4115                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4116                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4117                 ) THEN id::TEXT
4118                 ELSE '0'
4119             END
4120         ,',') AS out,
4121
4122         STRING_AGG(
4123             CASE
4124                 WHEN (
4125                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4126                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4127                 ) THEN id::TEXT
4128                 ELSE '0'
4129             END
4130         ,',') AS overdue,
4131
4132         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4133         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4134         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4135   FROM  action.circulation
4136   WHERE checkin_time IS NULL
4137   GROUP BY 1
4138         </oils_persist:source_definition>
4139         <fields oils_persist:primary="usr">
4140             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4141             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4142             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4143             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4144             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4145             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4146         </fields>
4147         <links>
4148             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4149         </links>
4150         </class>
4151         <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">
4152                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4153                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4154                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4155                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4156                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4157                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4158                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4159                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4160                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4161                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4162                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4163                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4164                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4165                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4166                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4167                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4168                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4169                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4170                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4171                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4172                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4173                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4174                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4175                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4176                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4177                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4178                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4179                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4180                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4181                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4182                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4183                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4184                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4185                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4186                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4187                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4188                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4189                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4190                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4191                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4192                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4193                 </fields>
4194                 <links>
4195                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4196                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4197                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4198                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4199                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4200                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4201                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4202                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4203                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4204                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4205                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4206                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4207                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4208                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4209                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4210                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4211                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4212                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4213                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4214                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4215                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4216                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4217                 </links>
4218                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4219                         <actions>
4220                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4221                         </actions>
4222                 </permacrud>
4223         </class>
4224         <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">
4225                 <fields>
4226                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
4227                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4228                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
4229                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4230                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
4231                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
4232                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
4233                 </fields>
4234                 <links>
4235                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4236                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4237                 </links>
4238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4239                         <actions>
4240                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4241                         </actions>
4242                 </permacrud>
4243         </class>
4244         <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">
4245                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4246                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4247                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4248                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4249                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4250                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4251                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4252                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4253                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4254                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4255                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4256                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4257                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4258                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4259                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4260                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4261                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4262                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4263                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4264                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4265                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4266                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4267                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4268                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4269                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4270                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4271                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4272                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4273                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4274                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4275                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4276                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4277                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4278                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4279                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4280                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4281                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4282                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4283                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4284                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4285                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4286                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4287                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4288                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4289                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4290                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4291                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4292                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4293                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4294                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4295                 </fields>
4296                 <links>
4297                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4298                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4299                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4300                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4301                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4302                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4303                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4304                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4305                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4306                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4307                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4308                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4309                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4310                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4311                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4312                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4313                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4314                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4315                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4316                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4317                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4318                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4319                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4320                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4321                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4322                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4323                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4324                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4325                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4326                 </links>
4327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4328                         <actions>
4329                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4330                         </actions>
4331                 </permacrud>
4332         </class>
4333         <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">
4334                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4335                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4336                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4337                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4338                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4339                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4340                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4341                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4342                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4343                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4344                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4345                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4346                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4347                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4348                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4349                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4350                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4351                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4352                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4353                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4354                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4355                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4356                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4357                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4358                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4359                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4360                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4361                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4362                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4363                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4364                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4365                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4366                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4367                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4368                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4369                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4370                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4371                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4372                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4373                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4374                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4375                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4376                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4377                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4378                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4379                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4380                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4381                 </fields>
4382                 <links>
4383                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4384                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4385                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4386                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4387                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4388                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4389                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4390                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4391                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4392                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4393                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4394                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4395                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4396                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4397                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4398                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4399                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4400                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4401                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4402                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4403                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4404                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4405                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4406                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4407                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4408                 </links>
4409         </class>
4410         <class id="auch" 
4411                 controller="open-ils.cstore" 
4412                 oils_obj:fieldmapper="action::user_circ_history" 
4413                 oils_persist:tablename="action.usr_circ_history" 
4414                 reporter:label="User Checkout History">
4415                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4416                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4417                         <!-- prevent reporting on the user that owns the checkout history -->
4418                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4419                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4420                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4421                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4422                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4423                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4424                 </fields>
4425                 <links>
4426                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4427                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4428                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4429                 </links>
4430         </class>
4431         <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">
4432                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4433                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4434                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4435                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4436                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4437                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4438                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4439                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4440                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4441                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4442                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4443                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4444                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4445                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4446                 </fields>
4447                 <links>
4448                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4449                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4450                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4451                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4452                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4453                 </links>
4454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4455                         <actions>
4456                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4457                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4458                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4459                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4460                         </actions>
4461                 </permacrud>
4462         </class>
4463
4464         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4465                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4466                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4467                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4468                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4469                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4470                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4471                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4472                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4473                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4474                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4475                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4476                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4477                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4478                 </fields>
4479                 <links>
4480                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4481                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4482                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4483                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4484                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4485                 </links>
4486                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4487                         <actions>
4488                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4489                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4490                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4491                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4492                         </actions>
4493                 </permacrud>
4494         </class>
4495         
4496         <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">
4497                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4498                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4499                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4500                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4501                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4502                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4503                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4504                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4505                 </fields>
4506                 <links>
4507                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4508                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4509                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4510                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4511                 </links>
4512                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4513                         <actions>
4514                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4515                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4516                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4517                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4518                         </actions>
4519                 </permacrud>
4520         </class>
4521         
4522         <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">
4523                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4524                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4525                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4526                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4527                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4528                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4529                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4530                 </fields>
4531                 <links>
4532                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4533                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4534                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4535                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4536                 </links>
4537                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4538                         <actions>
4539                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4540                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4541                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4542                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4543                         </actions>
4544                 </permacrud>
4545         </class>
4546         
4547         <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">
4548                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4549                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4550                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4551                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4552                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4553                 </fields>
4554                 <links>
4555                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4556                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4557                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4558                 </links>
4559                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4560                         <actions>
4561                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4562                     <context link="resource" field="owner" />
4563                 </create>
4564                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4565                     <context link="resource" field="owner" />
4566                 </retrieve>
4567                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4568                     <context link="resource" field="owner" />
4569                 </update>
4570                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4571                     <context link="resource" field="owner" />
4572                 </delete>
4573                         </actions>
4574                 </permacrud>
4575         </class>
4576         
4577         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4578                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4579                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4580                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4581                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4582                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4583                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4584                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4585                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4586                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4587                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4588                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4589                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4590                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4591                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4592                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4593                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4594                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4595                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4596                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4597                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4598                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4599                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4600                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4601                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4602                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4603                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4604                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4605                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4606                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4607                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4608                 </fields>
4609                 <links>
4610                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4611                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4612                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4613                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4614                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4615                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4616                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4617                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4618                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4619                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4620                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4621                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4622                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4623                 </links>
4624                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4625                         <actions>
4626                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4627                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4628                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4629                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4630                         </actions>
4631                 </permacrud>
4632         </class>
4633         
4634         <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">
4635                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4636                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4637                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4638                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4639                 </fields>
4640                 <links>
4641                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4642                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4643                 </links>
4644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4645                         <actions>
4646                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4647                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4648                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4649                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4650                         </actions>
4651                 </permacrud>
4652         </class>
4653
4654         <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">
4655                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4656                         <field name="bucket" reporter:datatype="link"/>
4657                         <field name="id" reporter:datatype="id" />
4658                         <field name="target_call_number" reporter:datatype="link" />
4659                         <field name="create_time" reporter:datatype="timestamp" />
4660                         <field name="pos" reporter:datatype="int" />
4661                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4662                 </fields>
4663                 <links>
4664                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4665                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4666             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4667                 </links>
4668         </class>
4669         <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">
4670                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4671                         <field name="id" reporter:datatype="id" />
4672                         <field name="item" reporter:datatype="link"/>
4673                         <field name="note" reporter:datatype="text" />
4674                 </fields>
4675                 <links>
4676                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4677                 </links>
4678         </class>
4679         <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">
4680                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4681                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4682                         <field name="btype" reporter:datatype="text"/>
4683                         <field name="id" reporter:datatype="id" />
4684                         <field name="name" reporter:datatype="text"/>
4685                         <field name="description" reporter:datatype="text"/>
4686                         <field name="owner" reporter:datatype="link"/>
4687                         <field name="pub" reporter:datatype="bool"/>
4688                         <field name="create_time" reporter:datatype="timestamp" />
4689                 </fields>
4690                 <links>
4691                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4692                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4693                 </links>
4694         </class>
4695         <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">
4696                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4697                         <field name="id" reporter:datatype="id" />
4698                         <field name="bucket" reporter:datatype="link"/>
4699                         <field name="note" reporter:datatype="text" />
4700                 </fields>
4701                 <links>
4702                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4703                 </links>
4704         </class>
4705         <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">
4706                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4707                         <field name="hold" reporter:datatype="link"/>
4708                         <field name="id" reporter:datatype="id" />
4709                         <field name="target_copy" reporter:datatype="link"/>
4710                         <field name="proximity" reporter:datatype="number"/>
4711                 </fields>
4712                 <links>
4713                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4714                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4715                 </links>
4716         </class>
4717         <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">
4718                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4719                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4720                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4721                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4722                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4723                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4724                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4725                 </fields>
4726                 <links>
4727                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4728                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4729                 </links>
4730         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4731             <actions>
4732                 <create permission="CREATE_HOLD_NOTIFICATION">
4733                                         <context link="hold" jump="usr" field="home_ou" />
4734                                 </create>
4735                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4736                                         <context link="hold" jump="usr" field="home_ou" />
4737                                 </retrieve>
4738                 <update permission="CREATE_HOLD_NOTIFICATION">
4739                                         <context link="hold" jump="usr" field="home_ou" />
4740                                 </update>
4741                 <delete permission="CREATE_HOLD_NOTIFICATION">
4742                                         <context link="hold" jump="usr" field="home_ou" />
4743                                 </delete>
4744             </actions>
4745         </permacrud>
4746         </class>
4747         <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">
4748                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4749                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4750                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4751                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4752                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4753                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4754                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4755                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4756                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4757                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4758                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4759                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4760                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4761                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
4762                 </fields>
4763                 <links>
4764                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4765                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4766                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4767                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4768                 </links>
4769         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4770             <actions>
4771                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4772                 <retrieve/>
4773                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4774                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4775             </actions>
4776         </permacrud>
4777         </class>
4778         <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">
4779                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4780                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4781                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4782                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4783                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4784             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4785             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4786             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4787                 </fields>
4788                 <links>
4789                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4790                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4791                 </links>
4792         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4793             <actions>
4794                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4795                 <retrieve/>
4796                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4797                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4798             </actions>
4799         </permacrud>
4800         </class>
4801         <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">
4802                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4803                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4804             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4805             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4806                 </fields>
4807                 <links>
4808                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4809                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4810                 </links>
4811         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4812             <actions>
4813                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4814                                         <context link="lgroup" field="owner" />
4815                 </create>
4816                 <retrieve/>
4817                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4818                                         <context link="lgroup" field="owner" />
4819                 </update>
4820                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4821                                         <context link="lgroup" field="owner" />
4822                 </delete>
4823             </actions>
4824         </permacrud>
4825         </class>
4826
4827     <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">
4828         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4829             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4830             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4831             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4832             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4833         </fields>
4834         <links>
4835             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4836             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4837         </links>
4838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4839             <actions>
4840                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4841                 <retrieve/>
4842                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4843                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4844             </actions>
4845         </permacrud>
4846     </class>
4847
4848         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4849                 <fields>
4850                         <field name="sre_id" oils_persist:virtual="true" />
4851                         <field name="location" oils_persist:virtual="true" />
4852                         <field name="owning_lib" oils_persist:virtual="true" />
4853                         <field name="basic_holdings" oils_persist:virtual="true" />
4854                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4855                         <field name="supplement_holdings" oils_persist:virtual="true" />
4856                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4857                         <field name="index_holdings" oils_persist:virtual="true" />
4858                         <field name="index_holdings_add" oils_persist:virtual="true" />
4859                         <field name="online" oils_persist:virtual="true" />
4860                         <field name="missing" oils_persist:virtual="true" />
4861                         <field name="incomplete" oils_persist:virtual="true" />
4862                 </fields>
4863         </class>
4864
4865         <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">
4866                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4867                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4868                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4869                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4870                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4871                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4872                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4873                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4874                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4875                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4876                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4877                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4878                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4879                 </fields>
4880                 <links>
4881                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4882                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4883                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4884                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4885                 </links>
4886                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4887                         <actions>
4888                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4889                                 <retrieve/>
4890                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4891                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4892                         </actions>
4893                 </permacrud>
4894         </class>
4895
4896         <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">
4897                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4898                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4899                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4900                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4901                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4902                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4903                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4904                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4905                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4906                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4907                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4908                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4909                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4910                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4911                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4912                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4913                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4914                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4915                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4916                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4917                 </fields>
4918                 <links>
4919                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4920                 </links>
4921                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4922                         <actions>
4923                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4924                                         <context link="subscription" field="owning_lib" />
4925                                 </create>
4926                                 <retrieve />
4927                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4928                                         <context link="subscription" field="owning_lib" />
4929                                 </update>
4930                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4931                                         <context link="subscription" field="owning_lib" />
4932                                 </delete>
4933                         </actions>
4934                 </permacrud>
4935         </class>
4936
4937         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4938                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4939                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4940                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4941                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4942                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4943                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4944                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4945                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4946                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4947                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4948                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4949                 </fields>
4950                 <links>
4951                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4952                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4953                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4954                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4955                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4956                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4957                 </links>
4958                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4959                         <actions>
4960                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4961                                 <retrieve />
4962                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4963                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4964                         </actions>
4965                 </permacrud>
4966         </class>
4967
4968         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4969                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4970                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4971                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4972                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4973                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4974                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4975                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4976                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4977                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4978                 </fields>
4979                 <links>
4980                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4981                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4982                 </links>
4983         </class>
4984
4985         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4986                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4987                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4988                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4989                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4990                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4991                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4992                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4993                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4994                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4995                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4996                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4997                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4998                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4999                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
5000                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
5001                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5002                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5003                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5004                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5005                 </fields>
5006                 <links>
5007                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
5008                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5009                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
5010                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
5011                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
5012                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
5013                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
5014                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
5015                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
5016                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
5017                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
5018                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
5019                 </links>
5020                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5021                         <actions>
5022                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5023                                 <retrieve />
5024                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5025                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5026                         </actions>
5027                 </permacrud>
5028         </class>
5029
5030         <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">
5031                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5032                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5033                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5034                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5035                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5036                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5037                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5038                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5039                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5040                 </fields>
5041                 <links>
5042                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5043                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5044                 </links>
5045                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5046                         <actions>
5047                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5048                                         <context link="distribution" field="holding_lib" />
5049                                 </create>
5050                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5051                                         <context link="distribution" field="holding_lib" />
5052                                 </retrieve>
5053                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5054                                         <context link="distribution" field="holding_lib" />
5055                                 </update>
5056                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5057                                         <context link="distribution" field="holding_lib" />
5058                                 </delete>
5059                         </actions>
5060                 </permacrud>
5061         </class>
5062
5063         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5064                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
5065                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5066                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5067                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
5068                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5069                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5070                 </fields>
5071                 <links>
5072                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5073                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
5074                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5075                 </links>
5076                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5077                         <actions>
5078                                 <create permission="ADMIN_SERIAL_STREAM">
5079                                         <context link="distribution" field="holding_lib" />
5080                                 </create>
5081                                 <retrieve />
5082                                 <update permission="ADMIN_SERIAL_STREAM">
5083                                         <context link="distribution" field="holding_lib" />
5084                                 </update>
5085                                 <delete permission="ADMIN_SERIAL_STREAM">
5086                                         <context link="distribution" field="holding_lib" />
5087                                 </delete>
5088                         </actions>
5089                 </permacrud>
5090         </class>
5091
5092         <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">
5093                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5094                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5095                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5096                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5097                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5098                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5099                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5100                 </fields>
5101                 <links>
5102                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5103                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5104                 </links>
5105                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5106                         <actions>
5107                                 <create permission="ADMIN_SERIAL_STREAM">
5108                                         <context link="stream" jump="distribution" field="holding_lib" />
5109                                 </create>
5110                                 <retrieve permission="RECEIVE_SERIAL">
5111                                         <context link="stream" jump="distribution" field="holding_lib" />
5112                                 </retrieve>
5113                                 <update permission="ADMIN_SERIAL_STREAM">
5114                                         <context link="stream" jump="distribution" field="holding_lib" />
5115                                 </update>
5116                                 <delete permission="ADMIN_SERIAL_STREAM">
5117                                         <context link="stream" jump="distribution" field="holding_lib" />
5118                                 </delete>
5119                         </actions>
5120                 </permacrud>
5121         </class>
5122
5123         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5124                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5125                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5126                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5127                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5128                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5129                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5130                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5131                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5132                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5133                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5134                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5135                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5136                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5137                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5138                 </fields>
5139                 <links>
5140                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5141                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5142                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5143                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5144                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5145                 </links>
5146                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5147                         <actions>
5148                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5149                                         <context link="subscription" field="owning_lib" />
5150                                 </create>
5151                                 <retrieve/>
5152                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5153                                         <context link="subscription" field="owning_lib" />
5154                                 </update>
5155                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5156                                         <context link="subscription" field="owning_lib" />
5157                                 </delete>
5158                         </actions>
5159                 </permacrud>
5160         </class>
5161
5162         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5163                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5164                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5165                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5166                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5167                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5168                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5169                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5170                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5171                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5172                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5173                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5174                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5175                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5176                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5177                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5178                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5179                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5180                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5181                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5182                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5183                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5184                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5185                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5186                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5187                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5188                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5189                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5190                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5191                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5192                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5193                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5194                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5195                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5196                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5197                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5198                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5199                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5200                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5201                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5202                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5203                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5204                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5205                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5206                 </fields>
5207                 <links>
5208                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5209                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5210                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5211                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5212                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5213                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5214                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5215                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5216                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5217                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5218                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5219                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5220                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5221                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5222                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5223                 </links>
5224                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5225                         <actions>
5226                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5227                                 <retrieve/>
5228                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5229                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5230                         </actions>
5231                 </permacrud>
5232         </class>
5233
5234         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5235                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5236                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5237                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5238                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5239                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5240                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5241                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5242                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5243                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5244                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5245                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5246                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5247                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5248                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5249                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5250                 </fields>
5251                 <links>
5252                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5253                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5254                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5255                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5256                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5257                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5258                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5259                 </links>
5260                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5261                         <actions>
5262                                 <create permission="ADMIN_SERIAL_ITEM">
5263                                         <context link="stream" jump="distribution" field="holding_lib" />
5264                                 </create>
5265                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5266                                         <context link="stream" jump="distribution" field="holding_lib" />
5267                                 </retrieve>
5268                                 <update permission="ADMIN_SERIAL_ITEM">
5269                                         <context link="stream" jump="distribution" field="holding_lib" />
5270                                 </update>
5271                                 <delete permission="ADMIN_SERIAL_ITEM">
5272                                         <context link="stream" jump="distribution" field="holding_lib" />
5273                                 </delete>
5274                         </actions>
5275                 </permacrud>
5276         </class>
5277
5278         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
5279                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5280                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5281                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5282                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5283                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5284                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5285                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5286                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5287                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5288                 </fields>
5289                 <links>
5290                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5291                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5292                 </links>
5293                 <!-- Not available via PCRUD at this time -->
5294         </class>
5295         <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">
5296                 <fields>
5297                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5298                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5299                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5300                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5301                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5302                 </fields>
5303                 <links>
5304                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5305                 </links>
5306         </class>
5307         <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">
5308                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5309                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5310                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5311                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5312                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5313                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5314                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5315                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5316                 </fields>
5317                 <links>
5318                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5319                 </links>
5320         </class>
5321         <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">
5322                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5323                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5324                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5325                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5326                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5327                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5328                 </fields>
5329                 <links>
5330                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5331                 </links>
5332                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5333                         <actions>
5334                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5335                                         <context link="distribution" field="holding_lib" />
5336                                 </create>
5337                                 <retrieve/>
5338                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5339                                         <context link="distribution" field="holding_lib" />
5340                                 </update>
5341                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5342                                         <context link="distribution" field="holding_lib" />
5343                                 </delete>
5344                         </actions>
5345                 </permacrud>
5346         </class>
5347
5348         <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">
5349                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5350                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5351                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5352                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5353                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5354                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5355                 </fields>
5356                 <links>
5357                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5358                 </links>
5359                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5360                         <actions>
5361                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5362                                         <context link="distribution" field="holding_lib" />
5363                                 </create>
5364                                 <retrieve/>
5365                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5366                                         <context link="distribution" field="holding_lib" />
5367                                 </update>
5368                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5369                                         <context link="distribution" field="holding_lib" />
5370                                 </delete>
5371                         </actions>
5372                 </permacrud>
5373         </class>
5374
5375         <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">
5376                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5377                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5378                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5379                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5380                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5381                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5382                 </fields>
5383                 <links>
5384                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5385                 </links>
5386                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5387                         <actions>
5388                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5389                                         <context link="distribution" field="holding_lib" />
5390                                 </create>
5391                                 <retrieve/>
5392                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5393                                         <context link="distribution" field="holding_lib" />
5394                                 </update>
5395                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5396                                         <context link="distribution" field="holding_lib" />
5397                                 </delete>
5398                         </actions>
5399                 </permacrud>
5400         </class>
5401
5402         <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">
5403                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5404                         <field name="id" reporter:datatype="id" />
5405                         <field name="owning_copy" reporter:datatype="link"/>
5406                         <field name="stat_cat" reporter:datatype="link"/>
5407                         <field name="stat_cat_entry" reporter:datatype="link"/>
5408                 </fields>
5409                 <links>
5410                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5411                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5412                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5413                 </links>
5414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5415                         <actions>
5416                                 <retrieve/>
5417                         </actions>
5418                 </permacrud>
5419         </class>
5420         <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">
5421                 <fields oils_persist:primary="code">
5422                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5423                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5424                 </fields>
5425                 <links/>
5426         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5427             <actions>
5428                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5429                 <retrieve/>
5430                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5431                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5432             </actions>
5433         </permacrud>
5434         </class>
5435         <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">
5436                 <fields oils_persist:primary="code">
5437                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5438                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5439                 </fields>
5440                 <links/>
5441         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5442             <actions>
5443                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5444                 <retrieve/>
5445                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5446                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5447             </actions>
5448         </permacrud>
5449         </class>
5450         <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">
5451                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5452                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5453                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5454                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5455                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5456                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5457                 </fields>
5458                 <links>
5459             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5460         </links>
5461         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5462             <actions>
5463                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5464                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5465                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5466                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5467             </actions>
5468         </permacrud>
5469         </class>
5470         <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">
5471                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5472                         <field name="id" reporter:datatype="id" />
5473                         <field name="name" reporter:datatype="text"/>
5474                 </fields>
5475                 <links/>
5476         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5477             <actions>
5478                 <create permission="CREATE_LASSO" global_required="true"/>
5479                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5480                 <update permission="UPDATE_LASSO" global_required="true"/>
5481                 <delete permission="DELETE_LASSO" global_required="true"/>
5482             </actions>
5483         </permacrud>
5484         </class>
5485         <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">
5486                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5487                         <field name="id" reporter:datatype="id" />
5488                         <field name="lasso" reporter:datatype="link"/>
5489                         <field name="org_unit" reporter:datatype="org_unit"/>
5490                 </fields>
5491                 <links>
5492                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5493                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5494                 </links>
5495         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5496             <actions>
5497                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5498                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5499                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5500                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5501             </actions>
5502         </permacrud>
5503         </class>
5504         <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">
5505                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5506                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5507                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5508                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5509                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5510                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5511                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5512                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5513                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5514                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5515                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5516                 </fields>
5517                 <links>
5518                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5519                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5520                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5521                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5522                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5523                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5524                 </links>
5525         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5526             <actions>
5527                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5528                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5529                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5530                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5531             </actions>
5532         </permacrud>
5533         </class>
5534         <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">
5535                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5536                         <field name="id" reporter:datatype="id" />
5537                         <field name="from_org" reporter:datatype="org_unit"/>
5538                         <field name="to_org" reporter:datatype="org_unit"/>
5539                         <field name="prox" reporter:datatype="int" />
5540                 </fields>
5541                 <links>
5542                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5543                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5544                 </links>
5545         </class>
5546         <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">
5547                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5548                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5549                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5550                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5551                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5552                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5553                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5554                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5555                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5556                 </fields>
5557                 <links/>
5558         </class>
5559         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5560                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5561                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5562                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5563                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5564                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5565                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5566                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5567                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5568                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5569                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5570                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5571                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5572                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5573                 </fields>
5574                 <links>
5575                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5576                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5577                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5578                 </links>
5579         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5580             <actions>
5581                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5582                 <retrieve/>
5583                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5584                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5585             </actions>
5586         </permacrud>
5587         </class>
5588         <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">
5589                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5590                         <field name="address_type"  reporter:datatype="text"/>
5591                         <field name="city"  reporter:datatype="text"/>
5592                         <field name="country"  reporter:datatype="text"/>
5593                         <field name="county"  reporter:datatype="text"/>
5594                         <field name="id" reporter:datatype="id" />
5595                         <field name="org_unit" reporter:datatype="org_unit"/>
5596                         <field name="post_code"  reporter:datatype="text"/>
5597                         <field name="state"  reporter:datatype="text"/>
5598                         <field name="street1"  reporter:datatype="text"/>
5599                         <field name="street2"  reporter:datatype="text"/>
5600                         <field name="valid" reporter:datatype="bool"/>
5601                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5602                 </fields>
5603                 <links>
5604                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5605                 </links>
5606         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5607             <actions>
5608                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5609                 <retrieve/>
5610                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5611                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5612             </actions>
5613         </permacrud>
5614         </class>
5615         <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">
5616                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5617                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5618                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5619                         <field name="query_text" reporter:datatype="text"/>
5620                 </fields>
5621         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5622             <actions>
5623                 <retrieve/>
5624             </actions>
5625         </permacrud>
5626         </class>
5627
5628         <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">
5629                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5630                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5631                         <field name="owner" reporter:datatype="org_unit"/>
5632                         <field name="code" reporter:datatype="text"/>
5633                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5634                         <field name="create_date" reporter:datatype="timestamp"/>
5635                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5636                 </fields>
5637                 <links>
5638                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5639                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5640                 </links>
5641         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5642             <actions>
5643                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5644                 <retrieve/>
5645                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5646                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5647             </actions>
5648         </permacrud>
5649         </class>
5650         <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">
5651                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5652                         <field name="id" reporter:datatype="id"/>
5653                         <field name="grp" reporter:datatype="link"/>
5654                         <field name="pos" reporter:datatype="int"/>
5655                         <field name="query" reporter:datatype="link"/>
5656                 </fields>
5657                 <links>
5658                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5659                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5660                 </links>
5661         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5662             <actions>
5663                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5664                     <context link="grp" field="owner"/>
5665                 </create>
5666                 <retrieve/>
5667                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5668                     <context link="grp" field="owner"/>
5669                 </update>
5670                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5671                     <context link="grp" field="owner"/>
5672                 </delete>
5673             </actions>
5674         </permacrud>
5675         </class>
5676
5677         <!-- A note: Please update alhr and ahopl when updating ahr -->
5678         <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">
5679                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5680                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5681                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5682                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5683                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5684                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5685                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5686                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5687                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5688                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5689                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5690                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5691                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5692                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5693                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5694                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5695                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5696                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5697                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5698                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5699                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5700                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5701                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5702                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5703                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5704                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5705                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5706                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5707                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5708                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5709                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5710                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5711                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5712                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5713                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5714                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5715                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5716                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5717                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5718                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5719                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5720                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5721                 </fields>
5722                 <links>
5723                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5724                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5725                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5726                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5727                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5728                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5729                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5730                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5731                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5732                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5733                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5734                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5735                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5736                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5737                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5738                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5739                 </links>
5740                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5741                         <actions>
5742                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5743                         </actions>
5744                 </permacrud>
5745         </class>
5746         <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">
5747                 <oils_persist:source_definition><![CDATA[
5748                 SELECT
5749                         ahr.*,
5750                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5751                                 copy_location_order_position,
5752                         CASE WHEN au.alias IS NOT NULL THEN
5753                                 au.alias
5754                         ELSE
5755                                 au.first_given_name
5756                         END AS usr_alias_or_first_given_name,
5757                         au.first_given_name AS usr_first_given_name,
5758                         au.second_given_name AS usr_second_given_name,
5759                         au.family_name AS usr_family_name,
5760                         au.prefix AS usr_prefix,
5761                         au.suffix AS usr_suffix,
5762                         au.alias AS usr_alias,
5763                         CASE WHEN au.alias IS NOT NULL THEN
5764                                 au.alias
5765                         ELSE
5766                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5767                                         COALESCE(au.family_name, ''),
5768                                         COALESCE(au.suffix, ''),
5769                                         ', ',
5770                                         COALESCE(au.prefix, ''),
5771                                         COALESCE(au.first_given_name, ''),
5772                                         COALESCE(au.second_given_name, '')
5773                                 ], ' '), E'\\s+,', ',')
5774                         END AS usr_alias_or_display_name,
5775                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5776                                 COALESCE(au.family_name, ''),
5777                                 COALESCE(au.suffix, ''),
5778                                 ', ',
5779                                 COALESCE(au.prefix, ''),
5780                                 COALESCE(au.first_given_name, ''),
5781                                 COALESCE(au.second_given_name, '')
5782                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5783                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5784                                 AS call_number_label,
5785                         siss.label AS issuance_label,
5786                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5787                         ahcm_1.copy_count AS potential_copies
5788                 FROM action.hold_request ahr
5789                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5790                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5791                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5792                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5793                 JOIN actor.usr au ON (au.id = ahr.usr)
5794                 JOIN (
5795                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5796                         FROM asset.copy_location
5797                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5798                 LEFT JOIN actor.usr_standing_penalty ausp 
5799                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5800                 LEFT JOIN config.standing_penalty csp
5801                         ON (
5802                                 csp.id = ausp.standing_penalty AND 
5803                                 csp.block_list LIKE '%CAPTURE%' AND (
5804                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5805                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5806                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5807                                         )
5808                                 )
5809                         )
5810                 JOIN (
5811                         SELECT COUNT(target_copy) AS copy_count, hold
5812                         FROM action.hold_copy_map
5813                         GROUP BY 2
5814                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5815                 LEFT JOIN serial.issuance siss
5816                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5817                 LEFT JOIN asset.copy_location_order acplo
5818                         ON (acp.location = acplo.location AND
5819                                 acp.circ_lib = acplo.org)
5820                 WHERE
5821                         ahr.capture_time IS NULL AND
5822                         ahr.cancel_time IS NULL AND
5823                         csp.id IS NULL AND
5824                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5825                         acp.status IN (0,7)
5826                 ]]></oils_persist:source_definition>
5827                 <fields oils_persist:primary="id">
5828                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5829                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5830                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5831                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5832                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5833                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5834                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5835                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5836                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5837                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5838                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5839                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5840                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5841                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5842                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5843                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5844                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5845                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5846                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5847                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5848                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5849                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5850                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5851                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5852                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5853                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5854                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5855                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5856                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5857                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5858                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5859                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5860                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5861                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5862                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5863                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5864                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5865                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5866                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5867                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5868                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5869                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5870                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5871                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5872                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5873                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5874                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5875                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5876                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5877                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5878                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5879                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5880                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5881                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5882                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5883                 </fields>
5884                 <links>
5885                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5886                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5887                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5888                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5889                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5890                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5891                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5892                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5893                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5894                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5895                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5896                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5897                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5898                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5899                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5900                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5901                 </links>
5902                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5903                         <actions>
5904                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5905                         </actions>
5906                 </permacrud>
5907         </class>
5908         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5909                 <oils_persist:source_definition>
5910                         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)
5911                 </oils_persist:source_definition>
5912                 <fields oils_persist:primary="id">
5913                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5914                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5915                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5916                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5917                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5918                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5919                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5920                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5921                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5922                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5923                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5924                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5925                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5926                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5927                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5928                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5929                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5930                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5931                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5932                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5933                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5934                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5935                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5936                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5937                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5938                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5939                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5940                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5941                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5942                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5943                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5944                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5945                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5946                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5947                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5948                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5949                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5950                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5951                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5952                 </fields>
5953                 <links>
5954                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5955                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5956                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5957                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5958                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5959                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5960                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5961                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5962                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5963                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5964                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5965                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5966                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5967                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5968                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5969                 </links>
5970         </class>
5971
5972         <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">
5973                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5974                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5975                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5976                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5977                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5978                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5979                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5980                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5981                 </fields>
5982                 <links>
5983                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5984                 </links>
5985                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5986                         <actions>
5987                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5988                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5989                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5990                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5991                         </actions>
5992                 </permacrud>
5993         </class>
5994         <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">
5995                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5996                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5997                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5998                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5999                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6000                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6001                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6002                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6003                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6004                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6005                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6006                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6007                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6008                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6009                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6010                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6011                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6012                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6013                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6014                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6015                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6016                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6017                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6018                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6019                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6020                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6021                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6022                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6023                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6024                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6025                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6026                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6027                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6028                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6029                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6030                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6031                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6032                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6033                 </fields>
6034                 <links>
6035                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6036                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6037                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6038                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6039                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6040                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6041                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6042                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6043                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6044                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6045                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6046                 </links>
6047                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6048                         <actions>
6049                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6050                         </actions>
6051                 </permacrud>
6052         </class>
6053         <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">
6054                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6055                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6056                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6057                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6058                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6059                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6060                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6061                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6062                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6063                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6064                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6065                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6066                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6067                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6068                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6069                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6070                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6071                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6072                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6073                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6074                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6075                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6076                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6077                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6078                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6079                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6080                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6081                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6082                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6083                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6084                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6085                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6086                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6087                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6088                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6089                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6090                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6091                 </fields>
6092                 <links>
6093                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6094                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6095                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6096                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6097                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6098                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6099                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6100                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6101                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6102                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6103                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6104                 </links>
6105                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6106                         <actions>
6107                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6108                         </actions>
6109                 </permacrud>
6110         </class>
6111
6112         <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">
6113                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6114                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6115                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6116                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6117                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6118                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6119                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6120                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6121                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
6122                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6123                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6124                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6125                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6126                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6127                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
6128                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6129                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6130                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6131                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6132                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6133                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6134                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6135                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6136                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6137                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6138                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6139                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6140                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6141                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6142                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6143                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6144                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6145                 </fields>
6146                 <links>
6147                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6148                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6149                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6150                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6151                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6152                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6153                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6154                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6155                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6156                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6157                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6158                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6159                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6160                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6161                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6162                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6163                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6164                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6165                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6166                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6167                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6168                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6169                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6170                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6171                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6172                 </links>
6173         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6174             <actions>
6175                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6176                 <retrieve />
6177                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6178                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6179             </actions>
6180         </permacrud>
6181         </class>
6182         <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">
6183                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6184                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6185                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6186                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6187                 </fields>
6188                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6189                         <actions>
6190                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6191                                 <retrieve/>
6192                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6193                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6194                         </actions>
6195                 </permacrud>
6196         </class>
6197         <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">
6198                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6199                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6200                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6201                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6202                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6203                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6204                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6205                 </fields>
6206                 <links>
6207                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6208                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6209                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6210                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6211                 </links>
6212                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6213                         <actions>
6214                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6215                                 <retrieve/>
6216                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6217                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6218                         </actions>
6219                 </permacrud>
6220         </class>
6221         <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">
6222                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6223                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6224                         <field name="btype" reporter:datatype="text"/>
6225                         <field name="id" reporter:datatype="id" />
6226                         <field name="name"  reporter:datatype="text"/>
6227                         <field name="description" reporter:datatype="text"/>
6228                         <field name="owner" reporter:datatype="link"/>
6229                         <field name="pub" reporter:datatype="bool"/>
6230                         <field name="create_time" reporter:datatype="timestamp" />
6231                 </fields>
6232                 <links>
6233                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6234                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6235                 </links>
6236         </class>
6237         <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">
6238                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6239                         <field name="id" reporter:datatype="id" />
6240                         <field name="bucket" reporter:datatype="link"/>
6241                         <field name="note" reporter:datatype="text" />
6242                 </fields>
6243                 <links>
6244                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6245                 </links>
6246         </class>
6247         <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">
6248                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6249                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6250                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6251                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6252                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6253                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6254                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6255                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6256                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6257                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6258                 </fields>
6259                 <links>
6260                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6261                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6262                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6263                 </links>
6264                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6265                         <actions>
6266                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6267                         </actions>
6268                 </permacrud>
6269         </class>
6270         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6271                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6272                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6273                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6274                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6275                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6276                 </fields>
6277                 <links>
6278                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6279                 </links>
6280                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6281                         <actions>
6282                                 <retrieve permission="VIEW_USER">
6283                                         <context link="usr" field="home_ou" />
6284                                 </retrieve>
6285                         </actions>
6286                 </permacrud>
6287         </class>
6288     <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">
6289         <fields oils_persist:primary="field">
6290             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6291             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6292             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6293         </fields>
6294         <links/>
6295         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6296             <actions>
6297                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6298                 <retrieve />
6299                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6300                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6301             </actions>
6302         </permacrud>
6303     </class>
6304         <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">
6305                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6306                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6307                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6308                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6309                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6310                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6311                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6312                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6313                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6314                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6315                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6316                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6317                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6318                 </fields>
6319                 <links>
6320                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6321                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6322                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6323                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6324                 </links>
6325         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6326             <actions>
6327                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6328                 <retrieve />
6329                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6330                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6331             </actions>
6332         </permacrud>
6333         </class>
6334         <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">
6335                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6336                         <field name="field" reporter:datatype="link"/>
6337                         <field name="id" reporter:datatype="id" />
6338                         <field name="source" reporter:datatype="link"/>
6339                         <field name="value"  reporter:datatype="text"/>
6340                 </fields>
6341                 <links>
6342                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6343                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6344                 </links>
6345         </class>
6346         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6347                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6348                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6349                         <field name="btype" reporter:datatype="text"/>
6350                         <field name="id" reporter:datatype="id" />
6351                         <field name="name"  reporter:datatype="text"/>
6352                         <field name="description" reporter:datatype="text"/>
6353                         <field name="owner" reporter:datatype="link"/>
6354                         <field name="pub" reporter:datatype="bool"/>
6355                         <field name="create_time" reporter:datatype="timestamp" />
6356                 </fields>
6357                 <links>
6358                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6359                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6360                 </links>
6361         </class>
6362         <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">
6363                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6364                         <field name="id" reporter:datatype="id" />
6365                         <field name="bucket" reporter:datatype="link"/>
6366                         <field name="note" reporter:datatype="text" />
6367                 </fields>
6368                 <links>
6369                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6370                 </links>
6371         </class>
6372         <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">
6373                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6374                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6375                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6376                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6377                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6378                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6379                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6380                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6381                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6382                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6383                 </fields>
6384                 <links>
6385                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6386                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6387                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6388                 </links>
6389         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6390             <actions>
6391                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6392                     <context link="xact" jump="usr" field="home_ou"/>
6393                 </retrieve>
6394                         </actions>
6395                 </permacrud>
6396         </class>
6397         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6398                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6399                         <field name="id" reporter:datatype="id" />
6400                         <field name="ind1" />
6401                         <field name="ind2" />
6402                         <field name="record" />
6403                         <field name="subfield" />
6404                         <field name="tag" />
6405                         <field name="value" />
6406                 </fields>
6407                 <links>
6408                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6409                 </links>
6410         </class>
6411         <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">
6412                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6413                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6414                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6415                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6416                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6417                 </fields>
6418                 <links>
6419                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6420                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6421                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6422                 </links>
6423         </class>
6424         <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">
6425                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6426                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6427                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6428                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6429                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6430                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6431                 </fields>
6432                 <links>
6433                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6434                 </links>
6435         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6436             <actions>
6437                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6438                 <retrieve/>
6439                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6440                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6441             </actions>
6442         </permacrud>
6443
6444         </class>
6445         <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">
6446                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6447                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6448                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6449                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6450                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6451                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6452                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6453                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6454                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6455                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6456                 </fields>
6457                 <links>
6458                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6459                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6460                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6461                 </links>
6462         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6463             <actions>
6464                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6465                 <retrieve/>
6466                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6467                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6468             </actions>
6469         </permacrud>
6470         </class>
6471         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6472                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6473                         <field name="create_date" reporter:datatype="timestamp"/>
6474                         <field name="creator" reporter:datatype="link"/>
6475                         <field name="edit_date" reporter:datatype="timestamp"/>
6476                         <field name="editor" reporter:datatype="link"/>
6477                         <field name="id" reporter:datatype="id" />
6478                         <field name="pub" reporter:datatype="bool"/>
6479                         <field name="record" reporter:datatype="link"/>
6480                         <field name="value"  reporter:datatype="text"/>
6481                 </fields>
6482                 <links>
6483                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6484                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6485                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6486                 </links>
6487         </class>
6488         <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">
6489                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6490                         <field name="balance_owed" reporter:datatype="money" />
6491                         <field name="total_owed" reporter:datatype="money" />
6492                         <field name="total_paid" reporter:datatype="money" />
6493                         <field name="usr" reporter:datatype="link"/>
6494                 </fields>
6495                 <links>
6496                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6497                 </links>
6498         </class>
6499         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6500                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6501                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6502                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6503                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6504                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6505                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6506                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6507                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6508                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6509                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6510                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6511                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6512                 </fields>
6513                 <links>
6514                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6515                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6516                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6517                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6518                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6519                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6520                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6521                 </links>
6522         </class>
6523         <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">
6524                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6525                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6526                         <field name="quality" reporter:datatype="int" />
6527                         <field name="source" reporter:datatype="text"/>
6528                         <field name="transcendant" reporter:datatype="bool"/>
6529                         <field name="can_have_copies" reporter:datatype="bool"/>
6530                 </fields>
6531                 <links/>
6532         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6533             <actions>
6534                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6535                 <retrieve/>
6536                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6537                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6538             </actions>
6539         </permacrud>
6540         </class>
6541         <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">
6542                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6543                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6544                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6545                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6546                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6547                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6548                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6549                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6550                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6551                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6552                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6553                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6554                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6555                 </fields>
6556                 <links>
6557                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6558                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6559                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6560                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6561                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6562                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6563                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6564                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6565                 </links>
6566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6567                         <actions>
6568                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6569                                         <context link="usr" field="home_ou" />
6570                                 </retrieve>
6571                         </actions>
6572                 </permacrud>
6573         </class>
6574         <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">
6575                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6576                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6577                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6578                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6579                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6580                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6581                 </fields>
6582                 <links>
6583                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6584                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6585                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6586                 </links>
6587         </class>
6588         <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">
6589                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6590                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6591                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6592                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6593                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6594                 </fields>
6595                 <links>
6596                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6597                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6598                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6599                 </links>
6600         </class>
6601         <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">
6602                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6603                         <field name="bucket" reporter:datatype="link"/>
6604                         <field name="id" reporter:datatype="id" />
6605                         <field name="target_user" reporter:datatype="link"/>
6606                         <field name="create_time" reporter:datatype="timestamp" />
6607                         <field name="pos" reporter:datatype="int" />
6608                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6609                 </fields>
6610                 <links>
6611                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6612                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6613             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6614                 </links>
6615         </class>
6616         <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">
6617                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6618                         <field name="id" reporter:datatype="id" />
6619                         <field name="item" reporter:datatype="link"/>
6620                         <field name="note" reporter:datatype="text" />
6621                 </fields>
6622                 <links>
6623                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6624                 </links>
6625         </class>
6626         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6627                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6628                         <field name="balance_owed" reporter:datatype="money" />
6629                         <field name="total_owed" reporter:datatype="money" />
6630                         <field name="total_paid" reporter:datatype="money" />
6631                         <field name="usr" reporter:datatype="link"/>
6632                 </fields>
6633                 <links>
6634                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6635                 </links>
6636         </class>
6637         <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">
6638                 <fields oils_persist:primary="code" oils_persist:sequence="">
6639                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6640                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6641                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6642                 </fields>
6643                 <links/>
6644         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6645             <actions>
6646                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6647                 <retrieve/>
6648                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6649                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6650             </actions>
6651         </permacrud>
6652         </class>
6653         <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">
6654                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6655                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6656                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6657                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6658                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6659                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6660                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6661                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6662                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6663                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6664                 </fields>
6665                 <links>
6666                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6667                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6668                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6669                 </links>
6670         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6671             <actions>
6672                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6673                     <context link="xact" jump="usr" field="home_ou"/>
6674                 </retrieve>
6675                         </actions>
6676                 </permacrud>
6677         </class>
6678         <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">
6679                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6680                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6681                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6682                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6683                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6684                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6685                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6686                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6687                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6688                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6689                 </fields>
6690                 <links>
6691                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6692                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6693                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6694                 </links>
6695         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6696             <actions>
6697                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6698                     <context link="xact" jump="usr" field="home_ou"/>
6699                 </retrieve>
6700                         </actions>
6701                 </permacrud>
6702         </class>
6703         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6704                 <fields oils_persist:primary="id" oils_persist:sequence="">
6705                         <field name="checkin_lib" reporter:datatype="link"/>
6706                         <field name="checkin_staff" reporter:datatype="link"/>
6707                         <field name="checkin_time" reporter:datatype="timestamp"/>
6708                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6709                         <field name="circ_staff" reporter:datatype="link"/>
6710                         <field name="desk_renewal" reporter:datatype="bool"/>
6711                         <field name="due_date" reporter:datatype="timestamp"/>
6712                         <field name="duration" reporter:datatype="interval"/>
6713                         <field name="duration_rule" reporter:datatype="link"/>
6714                         <field name="fine_interval" reporter:datatype="interval"/>
6715                         <field name="id" reporter:datatype="id" />
6716                         <field name="max_fine" reporter:datatype="money" />
6717                         <field name="max_fine_rule" reporter:datatype="link"/>
6718                         <field name="opac_renewal" reporter:datatype="bool"/>
6719                         <field name="phone_renewal" reporter:datatype="bool"/>
6720                         <field name="recurring_fine" reporter:datatype="money" />
6721                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6722                         <field name="renewal_remaining" reporter:datatype="int" />
6723             <field name="grace_period" reporter:datatype="interval" />
6724                         <field name="stop_fines" reporter:datatype="text"/>
6725                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6726                         <field name="target_copy" reporter:datatype="link"/>
6727                         <field name="usr" reporter:datatype="link"/>
6728                         <field name="xact_finish" reporter:datatype="timestamp" />
6729                         <field name="xact_start" reporter:datatype="timestamp" />
6730                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6731                 </fields>
6732                 <links>
6733                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6734                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6735                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6736                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6737                 </links>
6738         </class>
6739         <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">
6740                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6741                         <field name="field" reporter:datatype="link"/>
6742                         <field name="id" reporter:datatype="id" />
6743                         <field name="source" reporter:datatype="link"/>
6744                         <field name="value" reporter:datatype="text"/>
6745                 </fields>
6746                 <links>
6747                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6748                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6749                 </links>
6750         </class>
6751         <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">
6752                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6753                         <field name="high" reporter:datatype="money" />
6754                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6755                         <field name="low" reporter:datatype="money" />
6756                         <field name="name" reporter:datatype="text"/>
6757                         <field name="normal" reporter:datatype="money" />
6758                         <field name="recurrence_interval" reporter:datatype="interval"/>
6759             <field name="grace_period" reporter:datatype="interval" />
6760                 </fields>
6761                 <links/>
6762         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6763             <actions>
6764                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6765                 <retrieve/>
6766                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6767                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6768             </actions>
6769         </permacrud>
6770         </class>
6771         <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">
6772                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6773                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6774                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6775                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6776                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6777                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6778                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6779                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6780                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6781                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6782                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6783                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6784                 </fields>
6785                 <links>
6786                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6787                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6788                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6789                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6790                 </links>
6791         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6792             <actions>
6793                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6794                     <context link="xact" jump="usr" field="home_ou"/>
6795                 </retrieve>
6796                         </actions>
6797                 </permacrud>
6798         </class>
6799         <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">
6800                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6801                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6802                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6803                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6804                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6805                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6806                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6807                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6808                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6809                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6810                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6811                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6812                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6813                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6814                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6815                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6816                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6817                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6818                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6819                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6820                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6821                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6822                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6823                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6824                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6825                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6826                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6827                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6828                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6829                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6830                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6831                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6832                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6833                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6834                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6835                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6836                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6837                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6838                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6839                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6840                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6841                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6842                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6843                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6844                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6845                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6846                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6847                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
6848                 </fields>
6849                 <links>
6850                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6851                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6852                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6853                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6854                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6855                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6856                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6857                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6858                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6859                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6860                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6861                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6862                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
6863                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6864                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6865                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6866                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6867                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6868                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6869                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6870                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6871                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6872                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
6873                 </links>
6874         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6875             <actions>
6876                 <create permission="CREATE_COPY">
6877                     <context link="call_number" field="owning_lib"/>
6878                 </create>
6879                 <retrieve/>
6880                 <update permission="UPDATE_COPY">
6881                     <context link="call_number" field="owning_lib"/>
6882                 </update>
6883                 <delete permission="DELETE_COPY">
6884                     <context link="call_number" field="owning_lib"/>
6885                 </delete>
6886             </actions>
6887         </permacrud>
6888         </class>
6889
6890         <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">
6891                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6892                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6893                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6894                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6895                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6896                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6897                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6898                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6899                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6900                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6901                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6902                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6903                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6904                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6905                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6906                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6907                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6908                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6909                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6910                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6911                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6912                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6913                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6914                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6915                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6916                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6917                 </fields>
6918                 <links>
6919                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6920                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6921                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6922                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6923                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6924                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6925                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6926                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6927                 </links>
6928                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6929                         <actions>
6930                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6931                                 <retrieve />
6932                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6933                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6934                         </actions>
6935                 </permacrud>
6936         </class>
6937
6938         <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">
6939                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6940                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6941                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6942                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6943                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6944                 </fields>
6945                 <links/>
6946         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6947             <actions>
6948                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6949                 <retrieve/>
6950                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6951                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6952             </actions>
6953         </permacrud>
6954         </class>
6955         <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">
6956                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6957                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6958                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6959                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6960                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6961                 </fields>
6962                 <links/>
6963         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6964             <actions>
6965                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6966                 <retrieve/>
6967                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6968                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6969             </actions>
6970         </permacrud>
6971         </class>
6972         <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">
6973                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6974                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6975                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6976                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6977                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6978                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6979                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6980                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6981                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6982                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6983                 </fields>
6984                 <links>
6985                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6986                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6987                 </links>
6988         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6989             <actions>
6990                 <create permission="CREATE_PERM" global_required="true"/>
6991                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6992                 <update permission="UPDATE_PERM" global_required="true"/>
6993                 <delete permission="DELETE_PERM" global_required="true"/>
6994             </actions>
6995         </permacrud>
6996         </class>
6997         <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">
6998                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6999                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
7000                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
7001                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
7002                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
7003                 </fields>
7004                 <links>
7005                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
7006                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
7007                 </links>
7008         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7009             <actions>
7010                 <create permission="ADMIN_SURVEY">
7011                     <context link="question" jump="survey" field="owner"/>
7012                 </create>
7013                 <retrieve/>
7014                 <update permission="ADMIN_SURVEY">
7015                     <context link="question" jump="survey" field="owner"/>
7016                 </update>
7017                 <delete permission="ADMIN_SURVEY">
7018                     <context link="question" jump="survey" field="owner"/>
7019                 </delete>
7020             </actions>
7021         </permacrud>
7022         </class>
7023         <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">
7024                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7025                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7026                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7027                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7028                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7029                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7030                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7031                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7032                 </fields>
7033                 <links>
7034                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7035                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7036                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7037                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7038                 </links>
7039                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7040                         <actions>
7041                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7042                         </actions>
7043                 </permacrud>
7044         </class>
7045         <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">
7046                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7047                         <field name="balance_owed" reporter:datatype="money" />
7048                         <field name="total_owed" reporter:datatype="money" />
7049                         <field name="total_paid" reporter:datatype="money" />
7050                         <field name="usr" reporter:datatype="link"/>
7051                 </fields>
7052                 <links>
7053                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7054                 </links>
7055         </class>
7056         <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">
7057                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7058                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7059                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7060                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7061                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7062                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7063                 </fields>
7064                 <links>
7065                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7066                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7067                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7068                 </links>
7069         </class>
7070         <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">
7071                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7072                         <field name="field" reporter:datatype="link"/>
7073                         <field name="id" reporter:datatype="id" />
7074                         <field name="source" reporter:datatype="link"/>
7075                         <field name="value" reporter:datatype="text"/>
7076                 </fields>
7077                 <links>
7078                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7079                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7080                 </links>
7081         </class>
7082         <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">
7083                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7084                         <field name="field" reporter:datatype="link"/>
7085                         <field name="id" reporter:datatype="id" />
7086                         <field name="source" reporter:datatype="link"/>
7087                         <field name="value" reporter:datatype="text"/>
7088                 </fields>
7089                 <links>
7090                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7091                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7092                 </links>
7093         </class>
7094         <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">
7095                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7096                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7097                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7098                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7099                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7100                 </fields>
7101                 <links>
7102                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7103                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7104                 </links>
7105         </class>
7106         <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">
7107                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7108                         <field name="depth" reporter:datatype="int" />
7109                         <field name="grantable" reporter:datatype="bool"/>
7110                         <field name="grp" reporter:datatype="link"/>
7111                         <field name="id" reporter:datatype="id" />
7112                         <field name="perm" reporter:datatype="link"/>
7113                 </fields>
7114                 <links>
7115                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7116                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7117                 </links>
7118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7119             <actions>
7120                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7121                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7122                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7123                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7124             </actions>
7125         </permacrud>
7126         </class>
7127         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
7128                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7129                         <field name="items" oils_persist:virtual="true" />
7130                         <field name="btype" reporter:datatype="text"/>
7131                         <field name="id" reporter:datatype="id" />
7132                         <field name="name" reporter:datatype="text"/>
7133                         <field name="description" reporter:datatype="text"/>
7134                         <field name="owner" reporter:datatype="link"/>
7135                         <field name="pub" reporter:datatype="bool"/>
7136                         <field name="create_time" reporter:datatype="timestamp" />
7137                 </fields>
7138                 <links>
7139                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7140                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
7141                 </links>
7142         </class>
7143         <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">
7144                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
7145                         <field name="id" reporter:datatype="id" />
7146                         <field name="bucket" reporter:datatype="link"/>
7147                         <field name="note" reporter:datatype="text" />
7148                 </fields>
7149                 <links>
7150                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
7151                 </links>
7152         </class>
7153         <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">
7154                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
7155                         <field name="id" reporter:datatype="int" />
7156                         <field name="usr" reporter:datatype="link"/>
7157                         <field name="work_ou" reporter:datatype="link"/>
7158                 </fields>
7159                 <links>
7160                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7161                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
7162                 </links>
7163         </class>
7164         <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">
7165                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
7166                         <field name="depth" reporter:datatype="int"/>
7167                         <field name="grantable" reporter:datatype="bool"/>
7168                         <field name="id" reporter:datatype="id" />
7169                         <field name="perm" reporter:datatype="link"/>
7170                         <field name="usr" reporter:datatype="link"/>
7171                 </fields>
7172                 <links>
7173                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7174                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7175                 </links>
7176         </class>
7177         <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">
7178                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
7179                         <field name="object_id" reporter:datatype="text"/>
7180                         <field name="grantable" reporter:datatype="bool"/>
7181                         <field name="id" reporter:datatype="id" />
7182                         <field name="perm" reporter:datatype="link"/>
7183                         <field name="usr" reporter:datatype="link"/>
7184                         <field name="object_type" reporter:datatype="text"/>
7185                 </fields>
7186                 <links>
7187                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7188                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7189                 </links>
7190         </class>
7191         <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">
7192                 <fields oils_persist:primary="id" oils_persist:sequence="">
7193                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7194                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7195                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7196                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7197                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7198                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7199                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7200                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7207                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7208                 </fields>
7209                 <links>
7210                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7211                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7212                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7213                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7214                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7215                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7216                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7217                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7218                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7219                 </links>
7220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7221             <actions>
7222                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7223                     <context link="xact" jump="usr" field="home_ou"/>
7224                 </retrieve>
7225                         </actions>
7226                 </permacrud>
7227         </class>
7228         <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">
7229                 <fields oils_persist:primary="id" oils_persist:sequence="">
7230                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7231                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7232                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7233                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7234                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7235                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7236                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7237                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7238                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7239                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7240                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7241                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7242                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7243                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7244                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7245                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7246                 </fields>
7247                 <links>
7248                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7249                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7250                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7251                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7252                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7253                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7254                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7255                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7256                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7257                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7258                 </links>
7259         </class>
7260         <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">
7261                 <fields oils_persist:primary="id" oils_persist:sequence="">
7262                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7263                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7264                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7265                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7266                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7267                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7268                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7269                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7270                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7271                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7272                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7273                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7274                 </fields>
7275                 <links>
7276                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7277                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7278                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7279                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7280                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7281                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7282                 </links>
7283         </class>
7284         <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">
7285                 <fields oils_persist:primary="id" oils_persist:sequence="">
7286                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7287                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7288                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7289                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7290                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7291                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7292                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7293                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
7294                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7295                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7296                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7297                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7298                 </fields>
7299                 <links>
7300                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7301                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7302                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7303                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7304                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7305                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7306                 </links>
7307         </class>
7308         <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">
7309                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7310                         <field name="bucket" reporter:datatype="link"/>
7311                         <field name="id" reporter:datatype="id" />
7312                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7313                         <field name="create_time" reporter:datatype="timestamp" />
7314                         <field name="pos" reporter:datatype="int" />
7315                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7316                 </fields>
7317                 <links>
7318                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7319                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7320             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7321                 </links>
7322         </class>
7323         <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">
7324                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7325                         <field name="id" reporter:datatype="id" />
7326                         <field name="item" reporter:datatype="link"/>
7327                         <field name="note" reporter:datatype="text" />
7328                 </fields>
7329                 <links>
7330                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7331                 </links>
7332         </class>
7333         <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">
7334                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7335                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7336                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7337                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7338                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7339                 </fields>
7340                 <links>
7341                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7342                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7343                 </links>
7344                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7345                         <actions>
7346                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7347                         </actions>
7348                 </permacrud>
7349         </class>
7350     <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">
7351         <fields oils_persist:primary="field">
7352             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7353             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7354             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7355         </fields>
7356         <links/>
7357         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7358             <actions>
7359                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7360                 <retrieve />
7361                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7362                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7363             </actions>
7364         </permacrud>
7365     </class>
7366         <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">
7367                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7368                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7369                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7370                 </fields>
7371                 <links/>
7372         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7373             <actions>
7374                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7375                 <retrieve/>
7376                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7377                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7378             </actions>
7379         </permacrud>
7380         </class>
7381
7382
7383         <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">
7384                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7385                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7386                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7387                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7388                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7389                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7390                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7391                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7392                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7393                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7394                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7395                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7396                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7397                 </fields>
7398                 <links>
7399                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7400                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7401                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7402                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7403                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7404                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7405                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7406                 </links>
7407         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7408             <actions>
7409                 <create permission="TRANSIT_COPY">
7410                     <context link="target_copy" field="owner"/>
7411                 </create>
7412                 <retrieve/>
7413                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7414                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7415             </actions>
7416         </permacrud>
7417         </class>
7418         <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">
7419                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7420                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7421                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7422                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7423                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7424                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7425                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7426                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7427                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7428                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7429                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7430                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7431                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7432                 </fields>
7433                 <links>
7434                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7435                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7436                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7437                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7438                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7439                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7440                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7441                 </links>
7442         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7443             <actions>
7444                 <create permission="TRANSIT_COPY" context_field="owner">
7445                     <context link="target_copy" field="circ_lib"/>
7446                 </create>
7447                 <retrieve/>
7448                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7449                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7450             </actions>
7451         </permacrud>
7452         </class>
7453         <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">
7454                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7455                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7456                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7457                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7458                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7459                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7460                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7461                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7462                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7463                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7464                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7465                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
7466                 </fields>
7467                 <links>
7468                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7469                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7470                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7471                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
7472                 </links>
7473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7474             <actions>
7475                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7476                     <context link="xact" jump="usr" field="home_ou"/>
7477                 </retrieve>
7478                         </actions>
7479                 </permacrud>
7480         </class>
7481         <class id="pugm" controller="open-ils.cstore" oils_obj:fieldmapper="permission::usr_grp_map" oils_persist:tablename="permission.usr_grp_map" reporter:label="User Group Map">
7482                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7483                         <field name="grp" />
7484                         <field name="id" reporter:datatype="id" />
7485                         <field name="usr" />
7486                 </fields>
7487                 <links>
7488                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7489                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7490                 </links>
7491         </class>
7492         <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">
7493                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7494                         <field name="id" reporter:datatype="id" />
7495                         <field name="fq_field" reporter:datatype="text"/>
7496                         <field name="identity_value" reporter:datatype="text"/>
7497                         <field name="translation" reporter:datatype="text"/>
7498                         <field name="string" reporter:datatype="text"/>
7499                 </fields>
7500                 <links>
7501                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7502                 </links>
7503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7504             <actions>
7505                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7506                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7507                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7508                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7509             </actions>
7510         </permacrud>
7511         </class>
7512         <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">
7513                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7514                         <field name="id" reporter:datatype="id" />
7515                         <field name="fm_class" reporter:datatype="text"/>
7516                         <field name="field" reporter:datatype="text"/>
7517                         <field name="owner" reporter:datatype="org_unit"/>
7518                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7519                 </fields>
7520                 <links>
7521                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7522                 </links>
7523         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7524             <actions>
7525                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7526                 <retrieve/>
7527                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7528                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7529             </actions>
7530         </permacrud>
7531         </class>
7532         <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">
7533                 <fields oils_persist:primary="code">
7534                         <field name="code" reporter:datatype="id" />
7535                         <field name="marc_code" reporter:datatype="text"/>
7536                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7537                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7538                         <field name="rtl" reporter:datatype="bool"/>
7539                 </fields>
7540                 <links/>
7541         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7542             <actions>
7543                 <create permission="CREATE_LOCALE" global_required="true"/>
7544                 <retrieve/>
7545                 <update permission="UPDATE_LOCALE" global_required="true"/>
7546                 <delete permission="DELETE_LOCALE" global_required="true"/>
7547             </actions>
7548         </permacrud>
7549         </class>
7550         <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">
7551                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7552                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7553                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7554                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7555             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7556                 </fields>
7557                 <links>
7558                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7559                 </links>
7560         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7561             <actions>
7562                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7563                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7564                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7565                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7566             </actions>
7567         </permacrud>
7568         </class>
7569
7570         <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">
7571                 <fields oils_persist:primary="id">
7572                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7573                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7574                 </fields>
7575                 <links/>
7576         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7577             <actions>
7578                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7579                 <retrieve/>
7580                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7581                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7582             </actions>
7583         </permacrud>
7584         </class>
7585
7586         <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">
7587                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7588                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7589                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7590                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7591                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7592                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7593                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7594                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7595                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7596                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7597                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7598                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7599                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7600                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7601                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7602                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7603                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7604                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7605                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7606                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7607                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7608                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7609                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7610                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7611                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7612                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7613                 </fields>
7614                 <links>
7615                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7616                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7617                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7618                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7619                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7620                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7621                 </links>
7622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7623             <actions>
7624                 <create permission="user_request.create">
7625                     <context link="usr" field="home_ou"/>
7626                                 </create>
7627                 <retrieve permission="user_request.view">
7628                     <context link="usr" field="home_ou"/>
7629                                 </retrieve>
7630                 <update permission="user_request.update">
7631                     <context link="usr" field="home_ou"/>
7632                                 </update>
7633                 <delete permission="user_request.delete">
7634                     <context link="usr" field="home_ou"/>
7635                                 </delete>
7636             </actions>
7637         </permacrud>
7638         </class>
7639
7640         <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">
7641                 <fields oils_persist:primary="code">
7642                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7643                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7644                 </fields>
7645                 <links/>
7646         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7647             <actions>
7648                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7649                 <retrieve/>
7650                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7651                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7652             </actions>
7653         </permacrud>
7654         </class>
7655
7656         <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">
7657                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7658                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7659                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7660                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7661                         <field reporter:label="Ratio" name="ratio" />
7662                 </fields>
7663                 <links>
7664                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7665                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7666                 </links>
7667                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7668                         <actions>
7669                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7670                                 <retrieve/>
7671                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7672                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7673                         </actions>
7674                 </permacrud>
7675         </class>
7676
7677         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7678                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7679                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7680                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7681                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7682                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7683                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7684                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7685                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7686                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7687                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7688                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7689                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7690                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7691                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7692                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7693                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7694                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7695                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7696                 </fields>
7697                 <links>
7698                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7699                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7700             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7701             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7702             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7703                 </links>
7704         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7705             <actions>
7706                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7707                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7708                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7709                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7710             </actions>
7711         </permacrud>
7712         </class>
7713
7714         <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">
7715                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7716                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7717                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7718                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7719                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7720                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7721                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7722                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7723                 </fields>
7724                 <links>
7725                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7726                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7727                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7728                 </links>
7729         </class>
7730
7731         <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">
7732                 <fields oils_persist:primary="code">
7733                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7734                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7735                 </fields>
7736                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7737             <actions>
7738                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7739                 <retrieve/>
7740                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7741                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7742             </actions>
7743                 </permacrud>
7744         </class>
7745
7746         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7747                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7748                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7749                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7750                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7751                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7752                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7753                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7754                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7755                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7756                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7757                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7758                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7759                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7760                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7761                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7762                 </fields>
7763                 <links>
7764                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7765                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7766                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7767                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7768                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7769                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7770                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7771                 </links>
7772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7773             <actions>
7774                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7775                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7776                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7777                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7778             </actions>
7779         </permacrud>
7780         </class>
7781
7782         <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">
7783                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7784                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7785                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7786                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7787                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7788                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7789                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7790                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7791                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7792                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7793                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7794                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7795                 </fields>
7796                 <links>
7797                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7798                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7799                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7800                 </links>
7801         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7802             <actions>
7803                 <create   permission="ADMIN_INVOICE">
7804                                         <context link="invoice" field="receiver"/>
7805                                 </create>
7806                 <retrieve permission="ADMIN_INVOICE">
7807                                         <context link="invoice" field="receiver"/>
7808                                 </retrieve>
7809                 <update   permission="ADMIN_INVOICE">
7810                                         <context link="invoice" field="receiver"/>
7811                                 </update>
7812                                 <delete   permission="ADMIN_INVOICE">
7813                                         <context link="invoice" field="receiver"/>
7814                                 </delete>
7815             </actions>
7816         </permacrud>
7817         </class>
7818
7819         <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">
7820                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7821                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7822                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7823                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7824                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7825                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7826                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7827                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7828                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7829                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7830                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7831                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7832                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7833                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7834                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7835                 </fields>
7836                 <links>
7837                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7838                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7839                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7840                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7841                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7842                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7843                 </links>
7844         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7845             <actions>
7846                 <create   permission="ADMIN_INVOICE">
7847                                         <context link="invoice" field="receiver"/>
7848                                 </create>
7849                 <retrieve permission="ADMIN_INVOICE">
7850                                         <context link="invoice" field="receiver"/>
7851                                 </retrieve>
7852                 <update   permission="ADMIN_INVOICE">
7853                                         <context link="invoice" field="receiver"/>
7854                                 </update>
7855                                 <delete   permission="ADMIN_INVOICE">
7856                                         <context link="invoice" field="receiver"/>
7857                                 </delete>
7858             </actions>
7859         </permacrud>
7860         </class>
7861
7862         <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">
7863                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7864                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7865                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7866                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7867                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7868                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7869                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7870                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7871                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7872                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7873                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7874                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7875                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7876                 </fields>
7877                 <links>
7878                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7879                 </links>
7880         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7881             <actions>
7882                 <create permission="ADMIN_PROVIDER">
7883                     <context link="provider" field="owner"/>
7884                 </create>
7885                 <retrieve permission="ADMIN_PROVIDER">
7886                     <context link="provider" field="owner"/>
7887                 </retrieve>
7888                 <update permission="ADMIN_PROVIDER">
7889                     <context link="provider" field="owner"/>
7890                 </update>
7891                 <delete permission="ADMIN_PROVIDER">
7892                     <context link="provider" field="owner"/>
7893                 </delete>
7894             </actions>
7895         </permacrud>
7896         </class>
7897
7898         <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">
7899                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7900                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7901                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7902                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7903                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7904                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7905                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7906         </fields>
7907                 <links>
7908                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7909                 </links>
7910         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7911             <actions>
7912                 <create permission="ADMIN_PROVIDER">
7913                     <context link="provider" field="owner"/>
7914                 </create>
7915                 <retrieve permission="ADMIN_PROVIDER">
7916                     <context link="provider" field="owner"/>
7917                 </retrieve>
7918                 <update permission="ADMIN_PROVIDER">
7919                     <context link="provider" field="owner"/>
7920                 </update>
7921                 <delete permission="ADMIN_PROVIDER">
7922                     <context link="provider" field="owner"/>
7923                 </delete>
7924             </actions>
7925         </permacrud>
7926     </class>
7927         <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">
7928                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7929                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7930                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7931                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7932                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7933                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7934                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7935                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7936                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7937                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7938                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7939                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7940                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7941                 </fields>
7942                 <links>
7943                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7944                 </links>
7945         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7946             <actions>
7947                 <create permission="ADMIN_PROVIDER">
7948                     <context link="contact" jump='provider' field="owner"/>
7949                 </create>
7950                 <retrieve permission="ADMIN_PROVIDER">
7951                     <context link="contact" jump='provider' field="owner"/>
7952                 </retrieve>
7953                 <update permission="ADMIN_PROVIDER">
7954                     <context link="contact" jump='provider' field="owner"/>
7955                 </update>
7956                 <delete permission="ADMIN_PROVIDER">
7957                     <context link="contact" jump='provider' field="owner"/>
7958                 </delete>
7959             </actions>
7960         </permacrud>
7961         </class>
7962
7963         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7964                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7965                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7966                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7967                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7968                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7969                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7970                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7971                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7972                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7973                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7974                 </fields>
7975                 <links>
7976                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7977                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7978                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7979                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7980                 </links>
7981         </class>
7982
7983         <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">
7984                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7985                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7986                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7987                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7988                 </fields>
7989                 <links>
7990             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7991                 </links>
7992                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7993                         <actions>
7994                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7995                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7996                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7997                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7998                         </actions>
7999                 </permacrud>
8000         </class>
8001
8002         <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">
8003                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
8004                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
8005                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
8006                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
8007                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
8008                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
8009                 </fields>
8010                 <links>
8011                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
8012                 </links>
8013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8014                         <actions>
8015                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8016                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8017                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8018                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8019                         </actions>
8020                 </permacrud>
8021         </class>
8022
8023         <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">
8024                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
8025                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8026                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8027                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8028                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8029                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8030                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8031                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8032                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
8033                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
8034                 </fields>
8035                 <links>
8036                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8037                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8038             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
8039             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
8040                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
8041                 </links>
8042         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8043             <actions>
8044                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8045                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
8046                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8047                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8048             </actions>
8049         </permacrud>
8050         </class>
8051
8052         <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">
8053                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
8054                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
8055                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
8056                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8057                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8058                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
8059                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
8060                 </fields>
8061                 <links>
8062                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8063                 </links>
8064                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8065                         <actions>
8066                                 <create permission="ADMIN_FUNDING_SOURCE">
8067                     <context link="funding_source" field="owner"/>
8068                 </create>
8069                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
8070                     <context link="funding_source" field="owner"/>
8071                 </retrieve>
8072                                 <update permission="ADMIN_FUNDING_SOURCE">
8073                     <context link="funding_source" field="owner"/>
8074                 </update>
8075                                 <delete permission="ADMIN_FUNDING_SOURCE">
8076                     <context link="funding_source" field="owner"/>
8077                 </delete>
8078                         </actions>
8079                 </permacrud>
8080         </class>
8081
8082         <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">
8083                 <fields oils_persist:primary="id">
8084                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
8085                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
8086                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
8087                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
8088                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8089                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8090                 </fields>
8091                 <links>
8092                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8093                 </links>
8094         </class>
8095
8096         <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">
8097                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
8098                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
8099                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8100                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
8101                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
8102                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8103                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
8104                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
8105                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8106                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
8107                 </fields>
8108                 <links>
8109                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8110                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8111                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
8112                 </links>
8113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8114                         <actions>
8115                                 <create permission="ADMIN_ACQ_FUND">
8116                     <context link="fund" field="org"/>
8117                 </create>
8118                                 <retrieve permission="ADMIN_ACQ_FUND">
8119                     <context link="fund" field="org"/>
8120                 </retrieve>
8121                                 <update permission="ADMIN_ACQ_FUND">
8122                     <context link="fund" field="org"/>
8123                 </update>
8124                                 <delete permission="ADMIN_ACQ_FUND">
8125                     <context link="fund" field="org"/>
8126                 </delete>
8127                         </actions>
8128                 </permacrud>
8129         </class>
8130
8131         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
8132                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8133                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8134                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8135                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8136                         <field reporter:label="Year" name="year" reporter:datatype="int" />
8137                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8138                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8139                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8140                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8141                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8142                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8143                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8144                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8145                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8146                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
8147                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8148                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
8149                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
8150                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
8151                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
8152                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8153                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8154                 </fields>
8155                 <links>
8156                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8157                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8158             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
8159             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
8160             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
8161             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
8162             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
8163             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
8164             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
8165             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
8166             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
8167                 </links>
8168         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
8169             <actions>
8170                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
8171                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8172                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
8173                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
8174             </actions>
8175         </permacrud>
8176         </class>
8177
8178         <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">
8179                 <fields oils_persist:primary="fund">
8180                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8181                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8182                 </fields>
8183                 <links>
8184                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8185                 </links>
8186         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8187             <actions>
8188                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8189                                         <context link="fund" field="org" />
8190                 </retrieve>
8191             </actions>
8192         </permacrud>
8193         </class>
8194
8195         <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">
8196                 <fields oils_persist:primary="fund">
8197                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8198                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
8199                 </fields>
8200                 <links>
8201                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8202                 </links>
8203         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8204             <actions>
8205                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8206                                         <context link="fund" field="org" />
8207                 </retrieve>
8208             </actions>
8209         </permacrud>
8210         </class>
8211
8212         <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">
8213                 <fields oils_persist:primary="fund">
8214                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8215                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
8216                 </fields>
8217                 <links>
8218                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8219                 </links>
8220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8221             <actions>
8222                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8223                                         <context link="fund" field="org" />
8224                 </retrieve>
8225             </actions>
8226         </permacrud>
8227         </class>
8228
8229         <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">
8230                 <fields oils_persist:primary="fund">
8231                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8232                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8233                 </fields>
8234                 <links>
8235                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8236                 </links>
8237         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8238             <actions>
8239                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8240                                         <context link="fund" field="org" />
8241                 </retrieve>
8242             </actions>
8243         </permacrud>
8244         </class>
8245
8246         <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">
8247                 <fields oils_persist:primary="fund">
8248                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8249                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
8250                 </fields>
8251                 <links>
8252                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8253                 </links>
8254         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8255             <actions>
8256                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8257                                         <context link="fund" field="org" />
8258                 </retrieve>
8259             </actions>
8260         </permacrud>
8261         </class>
8262
8263    <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">
8264         <fields oils_persist:primary="fund">
8265             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8266             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8267         </fields>
8268         <links>
8269             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8270         </links>
8271     </class>
8272
8273    <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">
8274         <fields oils_persist:primary="fund">
8275             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8276             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
8277         </fields>
8278         <links>
8279             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8280         </links>
8281     </class>
8282
8283    <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">
8284         <fields oils_persist:primary="fund">
8285             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8286             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8287         </fields>
8288         <links>
8289             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8290         </links>
8291     </class>
8292
8293    <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">
8294         <fields oils_persist:primary="fund">
8295             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8296             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
8297         </fields>
8298         <links>
8299             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8300         </links>
8301     </class>
8302
8303    <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">
8304         <fields oils_persist:primary="fund">
8305             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8306             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
8307         </fields>
8308         <links>
8309             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8310         </links>
8311     </class>
8312
8313         <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">
8314                 <fields oils_persist:primary="funding_source">
8315                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8316                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8317                 </fields>
8318                 <links>
8319                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8320                 </links>
8321         </class>
8322
8323         <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">
8324                 <fields oils_persist:primary="funding_source">
8325                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8326                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8327                 </fields>
8328                 <links>
8329                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8330                 </links>
8331         </class>
8332
8333         <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">
8334                 <fields oils_persist:primary="funding_source">
8335                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8336                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8337                 </fields>
8338                 <links>
8339                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8340                 </links>
8341         </class>
8342
8343         <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">
8344                 <fields oils_persist:primary="fund">
8345                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8346                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8347                 </fields>
8348                 <links>
8349                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8350                 </links>
8351         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8352             <actions>
8353                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8354                                         <context link="fund" field="org" />
8355                 </retrieve>
8356             </actions>
8357         </permacrud>
8358     </class>
8359     <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">
8360         <oils_persist:source_definition><![CDATA[
8361             SELECT
8362                 acqf.*,
8363                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8364                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8365                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8366                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8367             FROM
8368                 acq.fund acqf
8369                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8370                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8371                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8372                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8373         ]]></oils_persist:source_definition>
8374         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8375             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8376             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8377             <field reporter:label="Name" name="name" reporter:datatype="text" />
8378             <field reporter:label="Year" name="year" reporter:datatype="int" />
8379             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8380             <field reporter:label="Code" name="code" reporter:datatype="text" />
8381             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8382             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8383             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8384             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8385             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8386
8387             <!-- non fund-native fields -->
8388             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8389             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8390             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8391             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8392         </fields>
8393         <links>
8394             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8395             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8396             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8397         </links>
8398         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8399             <actions>
8400                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8401             </actions>
8402         </permacrud>
8403         </class>
8404         <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">
8405                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8406                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8407                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8408                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8409                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8410                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8411                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8412                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8413                 </fields>
8414                 <links>
8415                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8416                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8417                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8418                 </links>
8419                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8420                         <actions>
8421                                 <create permission="ADMIN_ACQ_FUND">
8422                     <context link="fund" field="org"/>
8423                 </create>
8424                                 <retrieve permission="ADMIN_ACQ_FUND">
8425                     <context link="fund" field="org"/>
8426                 </retrieve>
8427                                 <update permission="ADMIN_ACQ_FUND">
8428                     <context link="fund" field="org"/>
8429                 </update>
8430                                 <delete permission="ADMIN_ACQ_FUND">
8431                     <context link="fund" field="org"/>
8432                 </delete>
8433                         </actions>
8434                 </permacrud>
8435         </class>
8436
8437     <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">
8438         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8439             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8440             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8441             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8442             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8443             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8444             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8445             <field reporter:label="Note" name="note" reporter:datatype="text" />
8446             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8447         </fields>
8448         <links>
8449             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8450             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8451             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8452         </links>
8453                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8454                         <actions>
8455                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8456                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8457                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8458                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8459                         </actions>
8460                 </permacrud>
8461     </class>
8462
8463         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8464                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8465                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8466                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8467                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8468                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8469                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8470                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8471                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8472                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8473                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8474                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8475                 </fields>
8476                 <links>
8477                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8478                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8479                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8480                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8481                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8482                 </links>
8483                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8484                         <actions>
8485                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8486                         </actions>
8487                 </permacrud>
8488         </class>
8489
8490         <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">
8491                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8492                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8493                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8494                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8495                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8496                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8497                 </fields>
8498                 <links>
8499                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8500                 </links>
8501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8502                         <actions>
8503                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8504                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8505                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8506                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8507                         </actions>
8508                 </permacrud>
8509         </class>
8510
8511         <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">
8512                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8513                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8514                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8515                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8516                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8517                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8518                         <field reporter:label="State" name="state" reporter:datatype="text" />
8519                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8520                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8521                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8522                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8523                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8524                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8525                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8526                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8527                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8528                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8529                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8530                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8531                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
8532                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8533                 </fields>
8534                 <links>
8535                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8536                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8537                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8538                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8539                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8540                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8541                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8542                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8543                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8544                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8545                 </links>
8546                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8547                         <actions>
8548                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8549                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8550                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8551                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8552                         </actions>
8553                 </permacrud>
8554         </class>
8555
8556         <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">
8557                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8558                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8559                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8560                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8561                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8562                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8563                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8564                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8565                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8566                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8567                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8568                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8569                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8570                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8571                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8572                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8573                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8574                 </fields>
8575                 <links>
8576                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8577                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8578                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8579                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8580                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8581                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8582                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8583                 </links>
8584                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8585             <actions>
8586                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8587             </actions>
8588                 </permacrud>
8589         </class>
8590
8591         <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">
8592                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8593                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8594                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8595                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8596                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8597                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8598                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8599                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8600                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8601                 </fields>
8602                 <links>
8603                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8604                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8605                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8606                 </links>
8607                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8608             <actions>
8609                 <create permission="CREATE_PURCHASE_ORDER">
8610                     <context link="purchase_order" field="ordering_agency"/>
8611                 </create>
8612                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8613                     <context link="purchase_order" field="ordering_agency"/>
8614                 </retrieve>
8615                 <update permission="CREATE_PURCHASE_ORDER">
8616                     <context link="purchase_order" field="ordering_agency"/>
8617                 </update>
8618                 <delete permission="CREATE_PURCHASE_ORDER">
8619                     <context link="purchase_order" field="ordering_agency"/>
8620                 </delete>
8621             </actions>
8622                 </permacrud>
8623         </class>
8624
8625         <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">
8626                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8627                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8628                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8629                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8630                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8631                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8632                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8633                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8634                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8635                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8636                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8637                 </fields>
8638                 <links>
8639                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8640                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8641                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8642                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8643                 </links>
8644                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8645             <actions>
8646                 <create permission="CREATE_PURCHASE_ORDER">
8647                     <context link="purchase_order" field="ordering_agency"/>
8648                 </create>
8649                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8650                     <context link="purchase_order" field="ordering_agency"/>
8651                 </retrieve>
8652                 <update permission="CREATE_PURCHASE_ORDER">
8653                     <context link="purchase_order" field="ordering_agency"/>
8654                 </update>
8655                 <delete permission="CREATE_PURCHASE_ORDER">
8656                     <context link="purchase_order" field="ordering_agency"/>
8657                 </delete>
8658             </actions>
8659                 </permacrud>
8660         </class>
8661
8662         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8663                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8664                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8665                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8666                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8667                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8668                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8669                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8670                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8671                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8672                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8673                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8674                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8675                         <field reporter:label="State" name="state" reporter:datatype="text" />
8676                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8677                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8678                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8679                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8680                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8681                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8682                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8683                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8684                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8685                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8686                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8687                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8688                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8689                 </fields>
8690                 <links>
8691                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8692                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8693                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8694                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8695                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8696                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8697                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8698                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8699                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8700                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8701                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8702                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8703                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8704                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8705                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8706                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8707                 </links>
8708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8709                         <actions>
8710                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8711                                         <context link="purchase_order" field="ordering_agency"/>
8712                                         <context link="picklist" field="org_unit"/>
8713                                 </retrieve>
8714                         </actions>
8715                 </permacrud>
8716         </class>
8717
8718         <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">
8719                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8720                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8721                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8722                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8723                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8724                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8725                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8726                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8727                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8728                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8729                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8730                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8731                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8732                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8733                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8734                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8735                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8736                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8737                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8738                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8739                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8740                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8741                 </fields>
8742                 <links>
8743                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8744                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8745                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8746                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8747                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8748                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8749                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8750                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8751                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8752                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8753                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8754                 </links>
8755                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8756                         <actions>
8757                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8758                                         <context link="purchase_order" field="ordering_agency"/>
8759                                         <context link="picklist" field="org_unit"/>
8760                                 </retrieve>
8761                         </actions>
8762                 </permacrud>
8763         </class>
8764
8765         <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">
8766                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8767                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8768                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8769                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8770                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8771                 </fields>
8772                 <links>
8773                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8774                 </links>
8775                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8776                         <actions>
8777                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8778                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8779                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8780                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8781                         </actions>
8782                 </permacrud>
8783         </class>
8784
8785         <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">
8786                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8787                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8788                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8789                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8790                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8791                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8792                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8793                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8794                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8795                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8796                 </fields>
8797                 <links>
8798                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8799                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8800                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8801                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8802                 </links>
8803         </class>
8804
8805         <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">
8806                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8807                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8808                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8809                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8810                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8811                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8812                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8813                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8814                 </fields>
8815                 <links>
8816                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8817                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8818                 </links>
8819         </class>
8820
8821         <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">
8822                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8823                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8824                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8825                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8826                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8827                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8828                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8829                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8830                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8831                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8832                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8833                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8834                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8835                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8836                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8837                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8838                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8839                 </fields>
8840                 <links>
8841                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8842                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8843                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8844                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8845                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8846                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8847                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8848                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8849                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8850                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8851                 </links>
8852         </class>
8853
8854         <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">
8855                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8856                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8857                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8858                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8859                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8860                 </fields>
8861                 <links/>
8862                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8863                         <actions>
8864                                 <retrieve />
8865                         </actions>
8866                 </permacrud>
8867         </class>
8868
8869         <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">
8870                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8871                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8872                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8873                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8874                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8875                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8876             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8877                 </fields>
8878                 <links/>
8879         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8880             <actions>
8881                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8882                 <retrieve />
8883                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8884                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8885             </actions>
8886         </permacrud>
8887         </class>
8888
8889         <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">
8890                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8891                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8892                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8893                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8894                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8895                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8896                 </fields>
8897                 <links/>
8898         </class>
8899         <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">
8900                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8901                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8902                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8903                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8904                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8905                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8906                 </fields>
8907                 <links>
8908                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8909                 </links>
8910         </class>
8911
8912         <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">
8913             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8914                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8915                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8916                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8917                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8918                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8919                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8920         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8921
8922             </fields>
8923             <links>
8924                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8925             </links>
8926             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8927                 <actions>
8928                     <create permission="ADMIN_PROVIDER">
8929                         <context link="provider" field="owner"/>
8930                     </create>
8931                     <retrieve permission="ADMIN_PROVIDER">
8932                         <context link="provider" field="owner"/>
8933                     </retrieve>
8934                     <update permission="ADMIN_PROVIDER">
8935                         <context link="provider" field="owner"/>
8936                     </update>
8937                     <delete permission="ADMIN_PROVIDER">
8938                         <context link="provider" field="owner"/>
8939                     </delete>
8940                 </actions>
8941             </permacrud>
8942         </class>
8943         
8944         <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">
8945             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8946                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8947                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8948                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8949                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8950             </fields>
8951             <links>
8952                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8953             </links>
8954             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8955                 <actions>
8956                     <create permission="ADMIN_PROVIDER">
8957                         <context link="provider" field="owner"/>
8958                     </create>
8959                     <retrieve permission="ADMIN_PROVIDER">
8960                         <context link="provider" field="owner"/>
8961                     </retrieve>
8962                     <update permission="ADMIN_PROVIDER">
8963                         <context link="provider" field="owner"/>
8964                     </update>
8965                     <delete permission="ADMIN_PROVIDER">
8966                         <context link="provider" field="owner"/>
8967                     </delete>
8968                 </actions>
8969             </permacrud>
8970         </class>
8971         
8972         <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">
8973             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8974                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8975                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8976                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8977                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8978                 </fields>
8979                 <links/>
8980         </class>
8981
8982         <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">
8983                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8984                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8985                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8986                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8987                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8988                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8989                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8990                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8991                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8992                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8993                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8994                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8995                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8996                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8997                 </fields>
8998                 <links>
8999                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9000                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9001                 </links>
9002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9003             <actions>
9004                 <create permission="ADMIN_PROVIDER">
9005                     <context link="provider" field="owner"/>
9006                 </create>
9007                 <retrieve permission="ADMIN_PROVIDER">
9008                     <context link="provider" field="owner"/>
9009                 </retrieve>
9010                 <update permission="ADMIN_PROVIDER">
9011                     <context link="provider" field="owner"/>
9012                 </update>
9013                 <delete permission="ADMIN_PROVIDER">
9014                     <context link="provider" field="owner"/>
9015                 </delete>
9016             </actions>
9017         </permacrud>
9018         </class>
9019
9020         <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">
9021                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
9022                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
9023                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
9024                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
9025                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
9026                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
9027                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
9028                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
9029                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
9030                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
9031                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
9032                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
9033                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
9034                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
9035                 </fields>
9036                 <links>
9037                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
9038                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9039                 </links>
9040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9041             <actions>
9042                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9043                     <context link="account" jump="provider" field="owner"/>
9044                 </retrieve>
9045                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9046                     <context link="account" jump="provider" field="owner"/>
9047                 </update>
9048                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9049                     <context link="account" jump="provider" field="owner"/>
9050                 </delete>
9051             </actions>
9052         </permacrud>
9053         </class>
9054
9055
9056         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
9057                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
9058                         <field name="id" reporter:datatype="id" />
9059                         <field name="parent" reporter:datatype="link"/>
9060                         <field name="owner" reporter:datatype="link"/>
9061                         <field name="create_time" reporter:datatype="timestamp"/>
9062                         <field name="name" reporter:datatype="text"/>
9063                         <field name="shared" reporter:datatype="bool"/>
9064                         <field name="share_with" reporter:datatype="link"/>
9065                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9066                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
9067                 </fields>
9068                 <links>
9069                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9070                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
9071                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
9072                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9073                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
9074                 </links>
9075         </class>
9076         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
9077                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
9078                         <field name="id" reporter:datatype="id" />
9079                         <field name="parent" reporter:datatype="link"/>
9080                         <field name="owner" reporter:datatype="link"/>
9081                         <field name="create_time" reporter:datatype="timestamp"/>
9082                         <field name="name" reporter:datatype="text"/>
9083                         <field name="shared" reporter:datatype="bool"/>
9084                         <field name="share_with" reporter:datatype="link"/>
9085                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9086                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
9087                 </fields>
9088                 <links>
9089                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9090                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
9091                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
9092                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9093                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
9094                 </links>
9095         </class>
9096         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
9097                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
9098                         <field name="id" reporter:datatype="id" />
9099                         <field name="parent" reporter:datatype="link"/>
9100                         <field name="owner" reporter:datatype="link"/>
9101                         <field name="create_time" reporter:datatype="timestamp"/>
9102                         <field name="name" reporter:datatype="text"/>
9103                         <field name="shared" reporter:datatype="bool"/>
9104                         <field name="share_with" reporter:datatype="link"/>
9105                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9106                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9107                 </fields>
9108                 <links>
9109                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9110                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
9111                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
9112                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9113                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
9114                 </links>
9115         </class>
9116         <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">
9117                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
9118                         <field name="id" reporter:datatype="id" />
9119                         <field name="owner" reporter:datatype="link"/>
9120                         <field name="create_time" reporter:datatype="timestamp"/>
9121                         <field name="name" reporter:datatype="text"/>
9122                         <field name="data" reporter:datatype="text"/>
9123                         <field name="folder" reporter:datatype="link"/>
9124                         <field name="description" reporter:datatype="text"/>
9125                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9126                 </fields>
9127                 <links>
9128                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9129                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
9130                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
9131                 </links>
9132         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9133             <actions>
9134                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9135                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9136                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9137                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9138             </actions>
9139         </permacrud>
9140         </class>
9141         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
9142                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
9143                         <field name="id" reporter:datatype="id" />
9144                         <field name="owner" reporter:datatype="link"/>
9145                         <field name="create_time" reporter:datatype="timestamp"/>
9146                         <field name="template" reporter:datatype="link"/>
9147                         <field name="data" reporter:datatype="text"/>
9148                         <field name="folder" reporter:datatype="link"/>
9149                         <field name="recur" reporter:datatype="bool"/>
9150                         <field name="recurrence" reporter:datatype="interval"/>
9151                         <field name="name" reporter:datatype="text"/>
9152                         <field name="description" reporter:datatype="text"/>
9153                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
9154                 </fields>
9155                 <links>
9156                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9157                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
9158                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
9159                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
9160                 </links>
9161         </class>
9162         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
9163                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
9164                         <field name="id" reporter:datatype="id" />
9165                         <field name="runner" reporter:datatype="link"/>
9166                         <field name="start_time" reporter:datatype="timestamp"/>
9167                         <field name="complete_time" reporter:datatype="timestamp"/>
9168                         <field name="run_time" reporter:datatype="timestamp"/>
9169                         <field name="email" reporter:datatype="text"/>
9170                         <field name="excel_format" reporter:datatype="bool"/>
9171                         <field name="csv_format" reporter:datatype="bool"/>
9172                         <field name="html_format" reporter:datatype="bool"/>
9173                         <field name="error_code" reporter:datatype="int"/>
9174                         <field name="error_text" reporter:datatype="text"/>
9175                         <field name="report" reporter:datatype="link"/>
9176                         <field name="folder" reporter:datatype="link"/>
9177                         <field name="chart_pie" reporter:datatype="bool"/>
9178                         <field name="chart_bar" reporter:datatype="bool"/>
9179                         <field name="chart_line" reporter:datatype="bool"/>
9180                 </fields>
9181                 <links>
9182                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
9183                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
9184                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
9185                 </links>
9186         </class>
9187         <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">
9188                 <fields oils_persist:primary="id">
9189                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9190                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9191                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9192                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9193                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9194                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9195                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9196                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9197                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9198                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9199                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9200                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9201                 </fields>
9202                 <links>
9203                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9204                 </links>
9205                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9206                         <actions>
9207                                 <retrieve />
9208                         </actions>
9209                 </permacrud>
9210         </class>
9211         <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">
9212                 <fields oils_persist:primary="id">
9213                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9214                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9215                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9216                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9217                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9218                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9219                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9220                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9221                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9222                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9223                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9224                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9225                 </fields>
9226                 <links>
9227                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9228                 </links>
9229         </class>
9230         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
9231                 <fields oils_persist:primary="id">
9232                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9233                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
9234                         <field reporter:label="Fingerprint" name="fingerprint" />
9235                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9236                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9237                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9238                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9239                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
9240                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9241                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9242                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9243                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
9244                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
9245                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
9246                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9247                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9248                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
9249                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
9250                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
9251                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
9252                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
9253                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
9254                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9255                 </fields>
9256                 <links>
9257                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
9258                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9259                 </links>
9260         </class>
9261         <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">
9262                 <fields oils_persist:primary="id">
9263                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
9264                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
9265                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
9266                 </fields>
9267                 <links>
9268                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
9269                 </links>
9270         </class>
9271         <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">
9272                 <fields oils_persist:primary="id">
9273                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
9274                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
9275                 </fields>
9276                 <links>
9277                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
9278                 </links>
9279         </class>
9280         <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">
9281                 <fields oils_persist:primary="id">
9282                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
9283                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
9284                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
9285                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
9286                 </fields>
9287                 <links>
9288                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
9289                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
9290                 </links>
9291         </class>
9292         <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">
9293                 <fields oils_persist:primary="xact">
9294                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9295                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
9296                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
9297                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
9298                 </fields>
9299                 <links>
9300                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9301                 </links>
9302         </class>
9303         <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">
9304                 <fields oils_persist:primary="xact">
9305                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9306                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
9307                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
9308                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
9309                 </fields>
9310                 <links>
9311                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9312                 </links>
9313         </class>
9314         <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)">
9315                 <fields oils_persist:primary="id">
9316                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
9317                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
9318                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
9319                 </fields>
9320                 <links>
9321                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9322                 </links>
9323         </class>
9324         <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">
9325                 <fields oils_persist:primary="id">
9326                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9327                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9328                 </fields>
9329                 <links>
9330                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9331                 </links>
9332         </class>
9333         <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">
9334                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9335                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9336                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9337                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9338                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9339                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9340                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9341                 </fields>
9342                 <links>
9343                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9344                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9345                 </links>
9346                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9347                         <actions>
9348                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9349                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9350                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9351                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9352                         </actions>
9353                 </permacrud>
9354         </class>
9355         <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">
9356                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9357                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9358                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9359                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9360                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9361                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9362                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9363                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9364                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9365                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9366                 </fields>
9367                 <links>
9368                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9369                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9370                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9371                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9372                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9373                 </links>
9374                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9375                         <actions>
9376                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9377                                         <context link="formula" field="owner"/>
9378                                 </create>
9379                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9380                                         <context link="formula" field="owner"/>
9381                                 </retrieve>
9382                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9383                                         <context link="formula" field="owner"/>
9384                                 </update>
9385                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9386                                         <context link="formula" field="owner"/>
9387                                 </delete>
9388                         </actions>
9389                 </permacrud>
9390         </class>
9391
9392         <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">
9393                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9394                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9395                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9396                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9397                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9398                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9399                 </fields>
9400                 <links>
9401                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9402                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9403                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9404                 </links>
9405                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9406                         <actions>
9407                                 <create permission="CREATE_PURCHASE_ORDER">
9408                                         <context link="formula" field="owner"/>
9409                 </create>
9410                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9411                                         <context link="formula" field="owner"/>
9412                 </retrieve>
9413                                 <update permission="CREATE_PURCHASE_ORDER">
9414                                         <context link="formula" field="owner"/>
9415                 </update>
9416                                 <delete permission="CREATE_PURCHASE_ORDER">
9417                                         <context link="formula" field="owner"/>
9418                 </delete>
9419                         </actions>
9420                 </permacrud>
9421         </class>
9422
9423         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9424                 <fields oils_persist:primary="id">
9425                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9426                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9427                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9428                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9429                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9430                 </fields>
9431                 <links>
9432                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9433                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9434                 </links>
9435         </class>
9436
9437         <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">
9438                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9439                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9440                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9441                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9442                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9443                 </fields>
9444                 <links>
9445                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9446                 </links>
9447                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9448                         <actions>
9449                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9450                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9451                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9452                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9453                         </actions>
9454                 </permacrud>
9455         </class>
9456
9457         <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">
9458                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9459                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9460                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9461                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9462                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9463                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9464                 </fields>
9465                 <links>
9466                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9467                 </links>
9468                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9469                         <actions>
9470                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9471                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9472                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9473                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9474                         </actions>
9475                 </permacrud>
9476         </class>
9477
9478         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9479                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9480                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9481                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9482                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9483                 </fields>
9484                 <links>
9485                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9486                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9487                 </links>
9488         </class>
9489
9490         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9491                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9492                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9493                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9494                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9495                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9496                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9497                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9498                 </fields>
9499                 <links>
9500                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9501                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9502                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9503                 </links>
9504         </class>
9505
9506         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9507                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9508                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9509                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9510                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9511                 </fields>
9512                 <links>
9513                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9514                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9515                 </links>
9516         </class>
9517
9518         <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">
9519                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9520                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9521                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9522                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9523                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9524                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9525                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9526                 </fields>
9527                 <links>
9528                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9529                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9530                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9531                 </links>
9532         </class>
9533
9534         <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">
9535                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9536                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9537                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9538                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9539                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9540                 </fields>
9541                 <links>
9542                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9543                 </links>
9544                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9545             <actions>
9546                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9547                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9548                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9549                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9550             </actions>
9551                 </permacrud>
9552         </class>
9553
9554         <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">
9555                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9556                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9557                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9558                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9559                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9560                 </fields>
9561                 <links>
9562                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9563                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9564                 </links>
9565                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9566                         <actions>
9567                                 <create permission="ADMIN_CLAIM_POLICY">
9568                                         <context link="claim_policy" field="org_unit"/>
9569                 </create>
9570                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9571                                         <context link="claim_policy" field="org_unit"/>
9572                 </retrieve>
9573                                 <update permission="ADMIN_CLAIM_POLICY">
9574                                         <context link="claim_policy" field="org_unit"/>
9575                 </update>
9576                                 <delete permission="ADMIN_CLAIM_POLICY">
9577                                         <context link="claim_policy" field="org_unit"/>
9578                 </delete>
9579                         </actions>
9580                 </permacrud>
9581         </class>
9582
9583     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9584         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9585             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9586             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9587             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9588             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9589             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9590             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9591             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9592             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9593             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9594             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9595             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9596             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9597             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9598             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9599             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9600             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9601         </fields>
9602         <links>
9603             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9604         </links>
9605     </class>
9606
9607     <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">
9608         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9609             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9610             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9611             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9612             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9613             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9614         </fields>
9615     </class>
9616
9617     <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">
9618         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9619             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9620             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9621             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9622             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9623             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9624             <field reporter:label="City" name="city" reporter:datatype="text"/>
9625             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9626             <field reporter:label="State" name="state" reporter:datatype="text"/>
9627             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9628             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9629             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9630         </fields>
9631     </class>
9632
9633     <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">
9634         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9635             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9636             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9637             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9638             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9639             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9640             <field reporter:label="City" name="city" reporter:datatype="text"/>
9641             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9642             <field reporter:label="State" name="state" reporter:datatype="text"/>
9643             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9644             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9645             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9646         </fields>
9647     </class>
9648
9649     <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">
9650         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9651             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9652             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9653             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9654             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9655             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9656             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9657         </fields>
9658     </class>
9659
9660     <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">
9661         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
9662             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9663             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9664             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9665             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
9666             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
9667             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9668         </fields>
9669     </class>
9670
9671         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9672                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9673                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9674                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9675                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9676                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9677                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9678                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9679                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9680                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9681                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9682                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9683                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9684                 </fields>
9685                 <links>
9686                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9687                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9688                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9689                 </links>
9690         </class>
9691
9692         <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">
9693                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9694                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9695                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9696                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9697                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9698                 </fields>
9699                 <links>
9700                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9701                 </links>
9702         </class>
9703
9704     <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">
9705         <fields>
9706             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9707             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9708             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9709         </fields>
9710                 <links>
9711                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9712                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9713                 </links>
9714     </class>
9715
9716     <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">
9717         <fields>
9718             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9719             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9720         </fields>
9721                 <links>
9722                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9723                 </links>
9724     </class>
9725
9726     <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">
9727         <fields>
9728             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9729             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9730             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9731         </fields>
9732                 <links>
9733                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9734                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9735                 </links>
9736     </class>
9737
9738     <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">
9739         <fields>
9740             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9741             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
9742         </fields>
9743                 <links>
9744                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9745                 </links>
9746     </class>
9747
9748     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9749                 <oils_persist:source_definition>
9750
9751             SELECT  DISTINCT l.*
9752               FROM  action.unfulfilled_hold_loops l
9753                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9754               WHERE l.count = m.max
9755
9756                 </oils_persist:source_definition>
9757         <fields>
9758             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9759             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9760             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9761         </fields>
9762                 <links>
9763                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9764                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9765                 </links>
9766     </class>
9767
9768         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9769                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9770                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9771                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9772                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9773                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9774                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9775                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9776                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9777                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9778                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9779                 </fields>
9780                 <links>
9781                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9782                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9783                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9784                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9785                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9786                 </links>
9787         </class>
9788
9789         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9790                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9791                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9792                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9793                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9794                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9795                 </fields>
9796                 <links>
9797                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9798                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9799                 </links>
9800         </class>
9801
9802         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9803                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9804                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9805                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9806                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9807                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9808                 </fields>
9809                 <links>
9810                 </links>
9811         </class>
9812
9813         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9814                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9815                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9816                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9817                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9818                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9819                 </fields>
9820                 <links>
9821                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9822                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9823                 </links>
9824         </class>
9825         
9826         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9827                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9828                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9829                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9830                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9831                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9832                 </fields>
9833                 <links>
9834                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9835                 </links>
9836         </class>
9837         
9838         <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">
9839                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9840                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9841                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9842                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9843                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9844                 </fields>
9845                 <links>
9846                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9847                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9848                 </links>
9849         </class>
9850
9851         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9852                 <fields oils_persist:primary="name">
9853                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9854                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9855                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9856                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9857                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9858                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9859                 </fields>
9860                 <links>
9861                 </links>
9862         </class>
9863
9864         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9865                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9866                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9867                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9868                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9869                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9870                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9871                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9872                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9873                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9874                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9875                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9876                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9877                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9878                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9879                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9880                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9881                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9882                 </fields>
9883                 <links>
9884                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9885                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9886                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9887                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9888                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9889                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9890                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9891                 </links>
9892         </class>
9893
9894         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9895                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9896                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9897                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9898                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9899                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9900                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9901                 </fields>
9902                 <links>
9903                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9904                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9905                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9906                 </links>
9907         </class>
9908
9909         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9910                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9911                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9912                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9913                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9914                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9915                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9916                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9917                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9918                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9919                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9920                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9921                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9922                 </fields>
9923                 <links>
9924                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9925                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9926                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9927                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9928                 </links>
9929         </class>
9930
9931         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9932                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9933                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9934                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9935                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9936                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9937                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9938                 </fields>
9939                 <links>
9940                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9941                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9942                 </links>
9943         </class>
9944
9945         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9946                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9947                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9948                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9949                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9950                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9951                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9952                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9953                 </fields>
9954                 <links>
9955                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9956                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9957                 </links>
9958         </class>
9959
9960         <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">
9961                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9962                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9963                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9964                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9965                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9966                 </fields>
9967                 <links>
9968                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9969                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9970                 </links>
9971         </class>
9972
9973         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9974                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9975                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9976                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9977                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9978                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9979                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9980                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9981                 </fields>
9982                 <links>
9983                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9984                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9985                 </links>
9986         </class>
9987
9988         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9989                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9990                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9991                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9992                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9993                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9994                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9995                 </fields>
9996                 <links>
9997                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9998                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9999                 </links>
10000         </class>
10001
10002         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
10003                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10004                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10005                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10006                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10007                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10008                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10009                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10010                 </fields>
10011                 <links>
10012                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10013                 </links>
10014         </class>
10015
10016         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
10017                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10018                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10019                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10020                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10021                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10022                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10023                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10024                 </fields>
10025                 <links>
10026                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10027                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10028                 </links>
10029         </class>
10030
10031         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
10032                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10033                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10034                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10035                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10036                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10037                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10038                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10039                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10040                 </fields>
10041                 <links>
10042                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10043                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10044                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10045                 </links>
10046         </class>
10047
10048         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
10049                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10050                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10051                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10052                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10053                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10054                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10055                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10056                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10057                 </fields>
10058                 <links>
10059                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10060                 </links>
10061         </class>
10062
10063         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
10064                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10065                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10066                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10067                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10068                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10069                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10070                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10071                 </fields>
10072                 <links>
10073                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10074                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10075                 </links>
10076         </class>
10077
10078         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
10079                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10080                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10081                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10082                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10083                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10084                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10085                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10086                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10087                 </fields>
10088                 <links>
10089                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10090                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10091                 </links>
10092         </class>
10093
10094         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
10095                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10096                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10097                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10098                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10099                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10100                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10101                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10102                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10103                 </fields>
10104                 <links>
10105                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10106                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10107                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10108                 </links>
10109         </class>
10110
10111         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
10112                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10113                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10114                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10115                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10116                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10117                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10118                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10119                 </fields>
10120                 <links>
10121                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10122                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10123                 </links>
10124         </class>
10125
10126         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
10127                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10128                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10129                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10130                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10131                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10132                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10133                 </fields>
10134                 <links>
10135                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10136                 </links>
10137         </class>
10138
10139         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
10140                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10141                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10142                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10143                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10144                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10145                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10146                 </fields>
10147                 <links>
10148                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10149                 </links>
10150         </class>
10151
10152         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
10153                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10154                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10155                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10156                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10157                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10158                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10159                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10160                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10161                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10162                 </fields>
10163                 <links>
10164                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10165                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10166                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10167                 </links>
10168         </class>
10169
10170         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
10171                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10172                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10173                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10174                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10175                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10176                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10177                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10178                 </fields>
10179                 <links>
10180                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10181                 </links>
10182         </class>
10183
10184         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
10185                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10186                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10187                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10188                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10189                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10190                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10191                 </fields>
10192                 <links>
10193                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10194                 </links>
10195         </class>
10196
10197         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
10198                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10199                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10200                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10201                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10202                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10203                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10204                 </fields>
10205                 <links>
10206                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10207                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10208                 </links>
10209         </class>
10210
10211         <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">
10212                 <fields oils_persist:primary="id">
10213                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
10214                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
10215                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
10216                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
10217                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
10218                 </fields>
10219                 <links>
10220                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
10221                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10222                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
10223                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
10224                 </links>
10225         </class>
10226
10227         <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">
10228                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
10229                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10230                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
10231                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10232                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
10233                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10234                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10235                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
10236                 </fields>
10237                 <links/>
10238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10239                         <actions>
10240                                 <retrieve/>
10241                         </actions>
10242                 </permacrud>
10243         </class>
10244
10245         <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">
10246                 <fields oils_persist:primary="ptype_key">
10247                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
10248                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10249                 </fields>
10250                 <links/>
10251                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10252                         <actions>
10253                                 <retrieve/>
10254                         </actions>
10255                 </permacrud>
10256         </class>
10257
10258         <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">
10259                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
10260                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10261                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
10262                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10263                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10264                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10265                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10266                 </fields>
10267                 <links>
10268                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
10269                 </links>
10270                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10271                         <actions>
10272                                 <retrieve/>
10273                         </actions>
10274                 </permacrud>
10275         </class>
10276
10277         <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">
10278                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
10279                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10280                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
10281                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
10282                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10283                 </fields>
10284                 <links>
10285                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10286                 </links>
10287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10288                         <actions>
10289                                 <retrieve/>
10290                         </actions>
10291                 </permacrud>
10292         </class>
10293
10294     <class
10295         id="uvs"
10296         controller="open-ils.cstore open-ils.pcrud"
10297         oils_obj:fieldmapper="url_verify::session"
10298         oils_persist:tablename="url_verify.session"
10299         reporter:label="URL Verification Session"
10300     >
10301         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
10302             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
10303             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10304                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
10305             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10306             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
10307             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10308             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
10309             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
10310             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
10311         </fields>
10312
10313         <links>
10314             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10315             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10316             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
10317             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
10318             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
10319         </links>
10320
10321         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10322             <actions>
10323                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
10324             </actions>
10325         </permacrud>
10326
10327     </class>
10328
10329     <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">
10330         <oils_persist:source_definition>
10331             SELECT
10332                 cbrebi.id AS id,  -- so we can have a pkey in our view
10333                 uvs.id AS session,
10334                 uvs.owning_lib,
10335                 cbrebi.target_biblio_record_entry
10336             FROM url_verify.session uvs
10337             JOIN container.biblio_record_entry_bucket cbreb
10338                 ON (uvs.container = cbreb.id)
10339             JOIN container.biblio_record_entry_bucket_item cbrebi
10340                 ON (cbrebi.bucket = cbreb.id)
10341         </oils_persist:source_definition>
10342         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10343             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10344             <field reporter:label="Session" name="session" reporter:datatype="link" />
10345             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10346             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10347         </fields>
10348         <links>
10349             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10350             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10351             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10352         </links>
10353         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10354             <actions>
10355                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10356             </actions>
10357         </permacrud>
10358     </class>
10359
10360     <class
10361         id="uvus"
10362         controller="open-ils.cstore open-ils.pcrud"
10363         oils_obj:fieldmapper="url_verify::url_selector"
10364         oils_persist:tablename="url_verify.url_selector"
10365         reporter:label="URL Verification URL Selector"
10366     >
10367         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10368             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10369             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10370                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10371             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10372         </fields>
10373
10374         <links>
10375             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10376             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10377         </links>
10378
10379         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10380             <actions>
10381                 <create permission="URL_VERIFY">
10382                     <context link="session" field="owning_lib"/>
10383                 </create>
10384                 <retrieve permission="URL_VERIFY">
10385                     <context link="session" field="owning_lib"/>
10386                 </retrieve>
10387                 <update permission="URL_VERIFY">
10388                     <context link="session" field="owning_lib"/>
10389                 </update>
10390                 <delete permission="URL_VERIFY">
10391                     <context link="session" field="owning_lib"/>
10392                 </delete>
10393             </actions>
10394         </permacrud>
10395
10396     </class>
10397
10398     <class
10399         id="uvu"
10400         controller="open-ils.cstore open-ils.pcrud"
10401         oils_obj:fieldmapper="url_verify::url"
10402         oils_persist:tablename="url_verify.url"
10403         reporter:label="URL Verification URL"
10404     >
10405         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10406             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10407                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10408                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10409                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10410                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10411             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10412             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10413             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10414             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10415             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10416             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10417             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10418             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10419             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10420             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10421             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10422             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10423             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10424         </fields>
10425
10426         <links>
10427             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10428             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10429             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10430             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10431             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10432         </links>
10433
10434         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10435             <actions>
10436                 <create permission="URL_VERIFY">
10437                     <context link="session" field="owning_lib"/>
10438                 </create>
10439                 <retrieve permission="URL_VERIFY">
10440                     <context link="session" field="owning_lib"/>
10441                 </retrieve>
10442                 <update permission="URL_VERIFY">
10443                     <context link="session" field="owning_lib"/>
10444                 </update>
10445                 <delete permission="URL_VERIFY">
10446                     <context link="session" field="owning_lib"/>
10447                 </delete>
10448             </actions>
10449         </permacrud>
10450
10451     </class>
10452
10453     <class
10454         id="uvva"
10455         controller="open-ils.cstore open-ils.pcrud"
10456         oils_obj:fieldmapper="url_verify::verification_attempt"
10457         oils_persist:tablename="url_verify.verification_attempt"
10458         reporter:label="URL Verification Attempt"
10459     >
10460         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10461             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10462                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10463                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10464             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10465             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10466         </fields>
10467
10468         <links>
10469             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10470             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10471         </links>
10472
10473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10474             <actions>
10475                 <create permission="URL_VERIFY">
10476                     <context link="session" field="owning_lib"/>
10477                 </create>
10478                 <retrieve permission="URL_VERIFY">
10479                     <context link="session" field="owning_lib"/>
10480                 </retrieve>
10481                 <update permission="URL_VERIFY">
10482                     <context link="session" field="owning_lib"/>
10483                 </update>
10484                 <delete permission="URL_VERIFY">
10485                     <context link="session" field="owning_lib"/>
10486                 </delete>
10487             </actions>
10488         </permacrud>
10489
10490     </class>
10491
10492     <class
10493         id="uvuv"
10494         controller="open-ils.cstore open-ils.pcrud"
10495         oils_obj:fieldmapper="url_verify::url_verification"
10496         oils_persist:tablename="url_verify.url_verification"
10497         reporter:label="URL Verification"
10498     >
10499         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10500             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10501                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10502                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10503             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10504             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10505             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10506             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10507                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10508         </fields>
10509
10510         <links>
10511             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10512             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10513             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10514         </links>
10515
10516         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10517             <actions>
10518                 <create permission="URL_VERIFY">
10519                     <context link="attempt" jump="session" field="owning_lib"/>
10520                 </create>
10521                 <retrieve permission="URL_VERIFY">
10522                     <context link="attempt" jump="session" field="owning_lib"/>
10523                 </retrieve>
10524                 <update permission="URL_VERIFY">
10525                     <context link="attempt" jump="session" field="owning_lib"/>
10526                 </update>
10527                 <delete permission="URL_VERIFY">
10528                     <context link="attempt" jump="session" field="owning_lib"/>
10529                 </delete>
10530             </actions>
10531         </permacrud>
10532
10533     </class>
10534
10535         <class
10536                 id="cfdi"
10537                 controller="open-ils.cstore open-ils.pcrud"
10538                 oils_obj:fieldmapper="config::filter_dialog_interface"
10539                 oils_persist:tablename="config.filter_dialog_interface"
10540                 reporter:label="FilterDialog Interface">
10541                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10542                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10543                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10544                 </fields>
10545                 <links>
10546                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10547                 </links>
10548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10549                         <actions>
10550                                 <retrieve />
10551                         </actions>
10552                 </permacrud>
10553         </class>
10554
10555         <class
10556                 id="cfdfs"
10557                 controller="open-ils.cstore open-ils.pcrud"
10558                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10559                 oils_persist:tablename="config.filter_dialog_filter_set"
10560                 reporter:label="FilterDialog Filter Set">
10561                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10562                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10563                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10564                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10565                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10566                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10567                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10568                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10569                 </fields>
10570                 <links>
10571                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10572                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10573                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10574                 </links>
10575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10576                         <actions>
10577                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10578                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10579                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10580                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10581                         </actions>
10582                 </permacrud>
10583
10584         </class>
10585
10586         <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">
10587                 <fields oils_persist:primary="code">
10588                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10589                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10590                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10591                 </fields>
10592                 <links/>
10593                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10594                         <actions>
10595                                 <retrieve/>
10596                         </actions>
10597                 </permacrud>
10598         </class>
10599
10600         <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">
10601                 <oils_persist:source_definition>
10602
10603             SELECT  b.id,
10604                     MAX(dcp.edit_date) AS last_delete_date
10605              FROM   biblio.record_entry b
10606                     JOIN asset.call_number cn ON (cn.record = b.id)
10607                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10608              WHERE  NOT b.deleted
10609              GROUP BY b.id
10610              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10611
10612                 </oils_persist:source_definition>
10613                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10614                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10615                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10616                 </fields>
10617                 <links>
10618                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10619                 </links>
10620                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10621                         <actions>
10622                                 <retrieve/>
10623                         </actions>
10624                 </permacrud>
10625         </class>
10626
10627         <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">
10628                 <oils_persist:source_definition>
10629
10630             -- -- 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.
10631             -- -- 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
10632             -- -- may not.
10633             -- SELECT
10634             --     bre.id AS bib_id,
10635             --     COALESCE( z.copy_count, 0 ) AS copy_count,
10636             --     COALESCE( z.hold_count, 0 ) AS hold_count,
10637             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
10638             -- FROM (
10639                 SELECT
10640                     y.bre AS id,
10641                     COALESCE( x.copy_count, 0 ) AS copy_count,
10642                     y.hold_count AS hold_count,
10643                     (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
10644                 FROM (
10645                         SELECT
10646                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
10647                             COUNT(*) AS hold_count
10648                         FROM action.hold_request h
10649                         WHERE
10650                             cancel_time IS NULL
10651                             AND fulfillment_time IS NULL
10652                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10653                         GROUP BY 1
10654                     )y LEFT JOIN (
10655                         SELECT 
10656                             (SELECT id
10657                                 FROM biblio.record_entry 
10658                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10659                             ) AS bre, 
10660                             COUNT(*) AS copy_count
10661                         FROM asset.copy
10662                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10663                         WHERE copy.holdable 
10664                             AND NOT copy.deleted 
10665                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10666                         GROUP BY 1
10667                     )x ON x.bre = y.bre
10668                 -- )z RIGHT JOIN (
10669                 --     SELECT id
10670                 --     FROM biblio.record_entry
10671                 --     WHERE NOT deleted
10672                 -- )bre ON (z.bib_id = bre.id)
10673                 
10674
10675                 </oils_persist:source_definition>
10676                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10677                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10678                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10679                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10680                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10681                 </fields>
10682                 <links>
10683                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10684                 </links>
10685                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10686                         <actions>
10687                                 <retrieve/>
10688                         </actions>
10689                 </permacrud>
10690         </class>
10691
10692         <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">
10693                 <oils_persist:source_definition>
10694             SELECT *,
10695                 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,
10696                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10697             FROM
10698                 (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
10699                     FROM
10700                         action.hold_request ahr
10701                         JOIN reporter.hold_request_record rhrr USING (id)
10702                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10703                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10704                     WHERE
10705                         ahr.cancel_time IS NULL
10706                         AND ahr.fulfillment_time IS NULL
10707                     GROUP BY bib_record, pickup_lib
10708                 )x
10709                 JOIN
10710                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10711                     FROM
10712                         action.hold_request ahr
10713                         JOIN reporter.hold_request_record rhrr USING (id)
10714                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10715                     WHERE
10716                         ahr.cancel_time IS NULL
10717                         AND ahr.fulfillment_time IS NULL
10718                     GROUP BY bib_record
10719                 )y
10720                 USING (id)
10721                 </oils_persist:source_definition>
10722                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10723                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10724                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10725                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10726                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10727                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10728                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10729                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10730                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10731                 </fields>
10732                 <links>
10733                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10734                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10735                 </links>
10736                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10737                         <actions>
10738                                 <retrieve/>
10739                         </actions>
10740                 </permacrud>
10741         </class>
10742
10743         <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) ">
10744                 <oils_persist:source_definition>
10745             WITH counts_at_ou AS (
10746                 SELECT bib_record, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, 
10747                     COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
10748                 FROM action.hold_request ahr
10749                 JOIN reporter.hold_request_record rhrr USING (id)
10750                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10751                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10752                 WHERE ahr.cancel_time IS NULL
10753                 AND ahr.fulfillment_time IS NULL
10754                 GROUP BY bib_record, pickup_lib
10755             )
10756             SELECT *,
10757                 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,
10758                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10759             FROM
10760                 (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
10761                 FROM actor.org_unit aou
10762                 JOIN counts_at_ou cao ON (cao.pickup_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))) 
10763                 GROUP BY bib_record, pickup_lib_or_desc
10764                 )x
10765                 JOIN
10766                 (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10767                     FROM
10768                         action.hold_request ahr
10769                         JOIN reporter.hold_request_record rhrr USING (id)
10770                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10771                     WHERE
10772                         ahr.cancel_time IS NULL
10773                         AND ahr.fulfillment_time IS NULL
10774                     GROUP BY bib_record
10775                 )y
10776                 USING (id)
10777                 </oils_persist:source_definition>
10778                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10779                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10780                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
10781                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
10782                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
10783                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10784                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10785                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
10786                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10787                 </fields>
10788                 <links>
10789                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10790                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
10791                 </links>
10792                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10793                         <actions>
10794                                 <retrieve/>
10795                         </actions>
10796                 </permacrud>
10797         </class>
10798
10799         <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">
10800                 <oils_persist:source_definition>
10801             SELECT
10802                 ac.id,
10803                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10804                 MAX(actac.xact_start) AS last_circ
10805             FROM asset.copy ac
10806                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10807             GROUP BY ac.id
10808
10809             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10810             --SELECT
10811             --    ac.id,
10812             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10813             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10814             --FROM asset.copy ac
10815             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10816             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10817             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10818                 </oils_persist:source_definition>
10819                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10820                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10821                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10822                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10823                 </fields>
10824                 <links>
10825                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10826                 </links>
10827                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10828                         <actions>
10829                                 <retrieve/>
10830                         </actions>
10831                 </permacrud>
10832         </class>
10833
10834         <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">
10835                 <fields oils_persist:primary="id">
10836                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10837                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10838                 </fields>
10839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10840                         <actions>
10841                                 <retrieve/>
10842                         </actions>
10843                 </permacrud>
10844         </class>
10845
10846         <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">
10847                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10848                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10849                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10850                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10851                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10852                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10853                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10854                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10855                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10856                 </fields>
10857                 <links>
10858                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10859                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10860                 </links>
10861                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10862                         <actions>
10863                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10864                                 <retrieve/>
10865                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10866                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10867                         </actions>
10868                 </permacrud>
10869         </class>
10870
10871         <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">
10872                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10873                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10874                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10875                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10876                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10877                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10878                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10879                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10880                 </fields>
10881                 <links>
10882                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10883                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10884                 </links>
10885                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10886                         <actions>
10887                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10888                                 <retrieve/>
10889                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10890                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10891                         </actions>
10892                 </permacrud>
10893         </class>
10894
10895
10896         <!-- ********************************************************************************************************************* -->
10897         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10898         <!-- ********************************************************************************************************************* -->
10899         <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">
10900                 <fields oils_persist:primary="id">
10901                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10902                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10903                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10904                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10905                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10906                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10907                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10908                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10909                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10910                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10911                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10912                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10913                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10914                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10915                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10916                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10917                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10918                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10919                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10920                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10921                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10922                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10923                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10924                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10925                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10926                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10927                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10928                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10929                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10930                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10931                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10932                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10933                 </fields>
10934                 <links>
10935                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10936                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10937                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10938                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10939                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10940                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10941                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10942                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10943                 </links>
10944         </class>
10945
10946         <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">
10947                 <fields oils_persist:primary="id">
10948                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10949                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10950                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10951                 </fields>
10952                 <links>
10953                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10954                 </links>
10955         </class>
10956
10957         <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">
10958                 <fields oils_persist:primary="id">
10959                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10960                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10961                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10962                 </fields>
10963                 <links>
10964                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10965                 </links>
10966         </class>
10967
10968         <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">
10969                 <fields oils_persist:primary="id">
10970                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10971
10972                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10973                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10974                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10975
10976                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10977                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10978                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10979
10980                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10981                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10982
10983                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10984                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10985                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10986
10987                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10988                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10989
10990                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10991                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10992                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10993
10994                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10995                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10996                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10997
10998                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10999                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
11000                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
11001                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
11002
11003                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
11004                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
11005
11006                 </fields>
11007                 <links>
11008                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
11009                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11010                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
11011                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
11012                 </links>
11013         </class>
11014
11015         <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">
11016                 <oils_persist:source_definition>
11017
11018             SELECT
11019                 po.ordering_agency AS ordering_agency,
11020                 po.id AS purchase_order,
11021                 li.id AS lineitem,
11022                 lid.id AS lineitem_detail,
11023                 cpa.id AS claim_policy_action
11024             FROM
11025                 acq.lineitem_detail lid
11026                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
11027                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
11028                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
11029                 JOIN acq.claim_policy_action cpa ON (
11030                     cpa.claim_policy = cp.id
11031
11032                     -- we only care about claim policy actions whose claim
11033                     -- interval we'd reached or exceeded
11034                     AND (NOW() - cpa.action_interval) &gt; po.order_date
11035
11036                     -- filter out all claim policy actions where claim events
11037                     -- have occurred on or after the action's action_interval
11038                     AND NOT EXISTS (
11039                         SELECT 1
11040                         FROM
11041                             acq.claim_event evt
11042                             JOIN acq.claim claim ON (
11043                                 claim.id = evt.claim
11044                                 AND claim.lineitem_detail = lid.id
11045                             )
11046                         WHERE
11047                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
11048                     )
11049                 )
11050             WHERE
11051                 lid.cancel_reason IS NULL
11052                 AND li.cancel_reason IS NULL -- belt/suspenders
11053                 AND po.cancel_reason IS NULL -- belt/suspenders
11054                 AND lid.recv_time IS NULL
11055                 AND po.state = 'on-order'
11056             ORDER BY 1, 2, 3, 4, 5
11057
11058                 </oils_persist:source_definition>
11059                 <fields>
11060                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
11061                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
11062                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11063                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11064                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
11065                 </fields>
11066                 <links>
11067                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
11068                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
11069                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11070                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11071                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
11072                 </links>
11073         </class>
11074         <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">
11075                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11076                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11077                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11078                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11079                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11080                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11081                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11082                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11083                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11084                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11085                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11086                 </fields>
11087                 <links>
11088                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11089                 </links>
11090     </class>
11091         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
11092                 <oils_persist:source_definition>
11093             SELECT * FROM acq.lineitem_summary 
11094                                 WHERE item_count > (invoice_count + cancel_count)
11095         </oils_persist:source_definition>
11096                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11097                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11098                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11099                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11100                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11101                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11102                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11103                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11104                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11105                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11106                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11107                 </fields>
11108                 <links>
11109                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11110                 </links>
11111     </class>
11112         <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">
11113                 <oils_persist:source_definition>
11114
11115                         SELECT  t.*
11116                           FROM  action.transit_copy t
11117                                 JOIN actor.org_unit AS s ON (t.source = s.id)
11118                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
11119                           WHERE s.parent_ou &lt;&gt; d.parent_ou
11120
11121                 </oils_persist:source_definition>
11122                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
11123                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
11124                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
11125                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
11126                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
11127                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
11128                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
11129                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
11130                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
11131                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
11132                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
11133                 </fields>
11134                 <links>
11135                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
11136                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
11137                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
11138                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
11139                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11140                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
11141                 </links>
11142         </class>
11143
11144     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
11145                 <oils_persist:source_definition>
11146
11147         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
11148                 SELECT
11149                         cp.id as copy,
11150                         COUNT(circ.id),
11151                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11152                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11153                 FROM
11154                         asset.copy cp
11155                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
11156                 GROUP BY 1, 3, 4
11157                 UNION ALL
11158                 SELECT
11159                         cp.id as copy,
11160                         COUNT(circ.id),
11161                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11162                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11163                 FROM
11164                         asset.copy cp
11165                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
11166                 GROUP BY 1, 3, 4
11167                 UNION ALL
11168                 SELECT
11169                         id as copy,
11170                         circ_count,
11171                         -1 AS year,
11172                         false as is_renewal
11173                 FROM
11174                         extend_reporter.legacy_circ_count
11175         )x GROUP BY 1, 3, 4
11176
11177                 </oils_persist:source_definition>
11178         <fields>
11179             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
11180             <field reporter:label="Count" name="count" reporter:datatype="int"/>
11181             <field reporter:label="Year" name="year" reporter:datatype="int"/>
11182             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
11183         </fields>
11184                 <links>
11185                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
11186                 </links>
11187                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11188                         <actions>
11189                                 <retrieve/>
11190                         </actions>
11191                 </permacrud>
11192     </class>
11193
11194         <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">
11195                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
11196                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
11197                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
11198                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
11199                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
11200                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
11201                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
11202                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
11203                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
11204                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
11205                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
11206                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
11207                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
11208                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
11209                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
11210                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
11211                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
11212                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
11213                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
11214                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
11215                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
11216                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
11217                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
11218                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
11219                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
11220                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
11221                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
11222                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
11223                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
11224                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
11225                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
11226                 </fields>
11227                 <links>
11228                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
11229                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
11230                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
11231                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11232                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
11233                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11234                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11235                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
11236                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
11237                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
11238                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
11239                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
11240                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
11241                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
11242                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
11243                 </links>
11244         </class>
11245
11246     <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">
11247         <fields oils_persist:primary="id">
11248             <field reporter:label="Title" name="title" reporter:datatype="text"/>
11249             <field reporter:label="Author" name="author" reporter:datatype="text"/>
11250             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
11251             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11252             <field reporter:label="Price" name="price" reporter:datatype="money"/>
11253             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11254             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
11255             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
11256             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11257             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
11258             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11259             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
11260             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
11261             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
11262             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11263             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11264             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
11265             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
11266             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
11267             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
11268             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
11269             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
11270             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11271             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
11272             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
11273             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
11274             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
11275             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
11276             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
11277             <field reporter:label="Status" name="status" reporter:datatype="link"/>
11278             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
11279             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
11280             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
11281             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
11282         </fields>
11283         <links>
11284             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11285             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11286             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11287             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11288             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
11289             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
11290             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
11291             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
11292         </links>
11293     </class>
11294
11295     <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">
11296         <fields oils_persist:primary="id">
11297             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11298             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11299             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11300             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11301         </fields>
11302         <links>
11303             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11304             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11305         </links>
11306     </class>
11307
11308     <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">
11309         <fields oils_persist:primary="owning_lib">
11310             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11311             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11312             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11313         </fields>
11314         <links>
11315             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11316         </links>
11317     </class>
11318
11319     <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">
11320         <fields oils_persist:primary="id">
11321             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11322             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11323             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11324             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11325             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11326         </fields>
11327         <links>
11328             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11329             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11330             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11331         </links>
11332     </class>
11333
11334     <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">
11335         <fields oils_persist:primary="circ_lib">
11336             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11337             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11338             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11339             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11340         </fields>
11341         <links>
11342             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11343             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11344         </links>
11345     </class>
11346
11347     <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">
11348         <fields oils_persist:primary="id">
11349             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11350             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11351             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11352             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11353             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11354         </fields>
11355         <links>
11356             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11357             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11358             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11359         </links>
11360     </class>
11361
11362     <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">
11363         <fields oils_persist:primary="home_ou">
11364             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11365             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11366             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11367             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11368         </fields>
11369         <links>
11370             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11371             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11372         </links>
11373     </class>
11374         <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">
11375                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
11376                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
11377                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
11378                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
11379                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
11380                 </fields>
11381                 <links>
11382                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11383                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
11384                 </links>
11385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11386                         <actions>
11387                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11388                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
11389                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11390                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11391                         </actions>
11392                 </permacrud>
11393         </class>
11394         <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">
11395                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11396                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11397                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11398                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11399                 </fields>
11400                 <links>
11401                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11402                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11403                         </links>
11404                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11405                 <actions>
11406                                 <create permission="ADMIN_ACQ_FUND_TAG">
11407                                         <context link="tag" field="owner"/>
11408                                 </create>
11409                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11410                                         <context link="tag" field="owner"/>
11411                                 </retrieve>
11412                                 <update permission="ADMIN_ACQ_FUND_TAG">
11413                                         <context link="tag" field="owner"/>
11414                                 </update>
11415                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11416                                         <context link="tag" field="owner"/>
11417                                 </delete>
11418                         </actions>
11419                 </permacrud>
11420         </class>
11421         <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">
11422                 <oils_persist:source_definition><![CDATA[
11423                 SELECT
11424                         poi.purchase_order AS purchase_order,
11425                         ii.invoice AS invoice,
11426                         NULL AS lineitem,
11427                         poi.id AS po_item,
11428                         NULL AS picklist
11429                 FROM
11430                         acq.po_item poi
11431                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11432                 UNION SELECT
11433                         jub.purchase_order AS purchase_order,
11434                         ie.invoice AS invoice,
11435                         jub.id AS lineitem,
11436                         NULL AS po_item,
11437                         jub.picklist AS picklist
11438                 FROM
11439                         acq.lineitem jub
11440                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11441                 UNION SELECT
11442                         ii.purchase_order AS purchase_order,
11443                         ii.invoice AS invoice,
11444                         NULL AS lineitem,
11445                         NULL AS po_item,
11446                         NULL AS picklist
11447                 FROM
11448                         acq.invoice_item ii
11449                 WHERE ii.po_item IS NULL
11450                 UNION SELECT
11451                         ie.purchase_order AS purchase_order,
11452                         ie.invoice AS invoice,
11453                         NULL AS lineitem,
11454                         NULL AS po_item,
11455                         NULL AS picklist
11456                 FROM
11457                         acq.invoice_entry ie
11458                 WHERE ie.lineitem IS NULL
11459                 UNION SELECT
11460                         NULL AS purchase_order,
11461                         NULL AS invoice,
11462                         jub.id AS lineitem,
11463                         NULL AS po_item,
11464                         jub.picklist AS picklist
11465                 FROM
11466                         acq.lineitem jub
11467                 WHERE jub.purchase_order IS NULL
11468                 ]]></oils_persist:source_definition>
11469                 <fields>
11470                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11471                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11472                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11473                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11474                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11475                 </fields>
11476                 <links>
11477                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11478                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11479                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11480                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11481                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11482                 </links>
11483         </class>
11484         <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">
11485                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11486                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11487                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11488                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11489                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11490                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11491                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11492                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11493                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11494                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11495                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11496                 </fields>
11497                 <links>
11498                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11499                 </links>
11500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11501                         <actions>
11502                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11503                                 <retrieve/>
11504                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11505                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11506                         </actions>
11507                 </permacrud>
11508         </class>
11509
11510         <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">
11511                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11512                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11513                         <field name="date_applied" reporter:datatype="timestamp"/>
11514                         <field name="org" reporter:datatype="org_unit"/>
11515                         <field name="original_value" reporter:datatype="text"/>
11516                         <field name="new_value" reporter:datatype="text"/>
11517                         <field name="field_name" reporter:datatype="link"/>
11518                 </fields>
11519                 <links>
11520                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11521                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11522                 </links>
11523                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11524                         <actions>
11525                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11526                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
11527                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11528                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11529                         </actions>
11530                 </permacrud>
11531         </class>
11532         <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">
11533                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11534                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11535                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11536                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11537                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11538                 </fields>
11539                 <links>
11540                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11541                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11542                 </links>
11543         </class>
11544         <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">
11545                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11546                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11547                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11548                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11549                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11550                 </fields>
11551                 <links>
11552                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11553                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11554                 </links>
11555         </class>
11556         <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">
11557                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11558                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11559                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11560                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11561                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11562                 </fields>
11563                 <links>
11564                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11565                 </links>
11566                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11567                         <actions>
11568                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11569                                 <retrieve/>
11570                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11571                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11572                         </actions>
11573                 </permacrud>
11574         </class>
11575         <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">
11576                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11577                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11578                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11579                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11580                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11581                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11582                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11583                 </fields>
11584                 <links>
11585                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11586                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
11587                 </links>
11588                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11589                         <actions>
11590                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11591                                 <retrieve/>
11592                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11593                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11594                         </actions>
11595                 </permacrud>
11596         </class>
11597         <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">
11598         <oils_persist:source_definition>
11599         SELECT ahcm.target_copy AS id,count(*) AS count
11600          FROM
11601          action.hold_request ahr,
11602          action.hold_copy_map ahcm
11603          WHERE
11604          ahr.cancel_time IS NULL AND
11605          ahr.fulfillment_time IS NULL AND
11606          ahr.capture_time IS NULL AND
11607          ahr.id = ahcm.hold
11608          GROUP BY ahcm.target_copy
11609         </oils_persist:source_definition>
11610         <fields oils_persist:primary="id">
11611             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11612             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
11613         </fields>
11614         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11615             <actions>
11616                <retrieve/>
11617             </actions>
11618         </permacrud>
11619         </class>
11620
11621         <!-- ********************************************************************************************************************* -->
11622
11623 </IDL>
11624
11625 <!--
11626     vim:noet:ts=4:sw=4:
11627 -->