]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1653001 webstaff: Holds pull list sortable columns
[working/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"/>
957                         <field reporter:label="Description" name="description" reporter:datatype="text" />
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                 </fields>
1874                 <links>
1875                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1876                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1878                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1879                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1880                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1881                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1882                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1883                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1884                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1885                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1886                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1887                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1888             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1889                 </links>
1890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1891             <actions>
1892                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1893                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1894                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1895                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1896             </actions>
1897         </permacrud>
1898         </class>
1899
1900         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
1901                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1902                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1903                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1904                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1905                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1906                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1907                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1908                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1909                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1910                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1911                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1912                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1913                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1914                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1915                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1916                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1917             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1918                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1919                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1920             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1921                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1922                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1923                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1924                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1925             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1926             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1927             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1928                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1929                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1930                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1931                 </fields>
1932                 <links>
1933                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1934                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1935                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1936                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1937                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1938                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1939                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1940                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1941                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1942                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1943                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1944                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1945                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1946                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1947             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1948                 </links>
1949         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1950             <actions>
1951                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1952                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1953                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1954                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1955             </actions>
1956         </permacrud>
1957         </class>
1958
1959     <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">
1960         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1961             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1962             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1963             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1964         </fields>
1965         <links/>
1966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1967             <actions>
1968                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1969                 <retrieve/>
1970                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1971                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1972             </actions>
1973         </permacrud>
1974     </class>
1975
1976     <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">
1977         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1978             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1979             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1980             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1981             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1982             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1983             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1984             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1985         </fields>
1986         <links>
1987             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1988         </links>
1989         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1990             <actions>
1991                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1992                 <retrieve/>
1993                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1994                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1995             </actions>
1996         </permacrud>
1997     </class>
1998
1999     <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">
2000         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2001             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2002             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2003             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2004             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2005             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2006         </fields>
2007         <links>
2008             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2009             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2010         </links>
2011         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2012             <actions>
2013                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2014                     <context link="matchpoint" field="org_unit"/>
2015                 </create>
2016                 <retrieve/>
2017                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2018                     <context link="matchpoint" field="org_unit"/>
2019                 </update>
2020                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2021                     <context link="matchpoint" field="org_unit"/>
2022                 </delete>
2023             </actions>
2024         </permacrud>
2025     </class>
2026
2027     <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">
2028         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2029             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2030             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2031             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2032         </fields>
2033         <links>
2034             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2035             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2036         </links>
2037         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2038             <actions>
2039                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2040                     <context link="limit_set" field="owning_lib"/>
2041                 </create>
2042                 <retrieve/>
2043                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2044                     <context link="limit_set" field="owning_lib"/>
2045                 </update>
2046                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2047                     <context link="limit_set" field="owning_lib"/>
2048                 </delete>
2049             </actions>
2050         </permacrud>
2051     </class>
2052     <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">
2053         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2054             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2055             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2056             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2057         </fields>
2058         <links>
2059             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2060             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2061         </links>
2062         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2063             <actions>
2064                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2065                     <context link="limit_set" field="owning_lib"/>
2066                 </create>
2067                 <retrieve/>
2068                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2069                     <context link="limit_set" field="owning_lib"/>
2070                 </update>
2071                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2072                     <context link="limit_set" field="owning_lib"/>
2073                 </delete>
2074             </actions>
2075         </permacrud>
2076     </class>
2077
2078     <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">
2079         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2080             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2081             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2082             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2083             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2084         </fields>
2085         <links>
2086             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2087             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2088         </links>
2089         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2090             <actions>
2091                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2092                     <context link="limit_set" field="owning_lib"/>
2093                 </create>
2094                 <retrieve/>
2095                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2096                     <context link="limit_set" field="owning_lib"/>
2097                 </update>
2098                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2099                     <context link="limit_set" field="owning_lib"/>
2100                 </delete>
2101             </actions>
2102         </permacrud>
2103     </class>
2104
2105         <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">
2106                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2107                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2108                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2109                 </fields>
2110                 <links/>
2111         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2112             <actions>
2113                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2114                 <retrieve/>
2115                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2116                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2117             </actions>
2118         </permacrud>
2119         </class>
2120
2121         <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">
2122                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2123                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2124                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2125                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2126                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2127                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2128                 </fields>
2129                 <links>
2130                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2131                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2132                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2133                 </links>
2134         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2135             <actions>
2136                 <create permission="ADMIN_SURVEY">
2137                     <context link="survey" field="owner"/>
2138                 </create>
2139                 <retrieve/>
2140                 <update permission="ADMIN_SURVEY">
2141                     <context link="survey" field="owner"/>
2142                 </update>
2143                 <delete permission="ADMIN_SURVEY">
2144                     <context link="survey" field="owner"/>
2145                 </delete>
2146             </actions>
2147         </permacrud>
2148         </class>
2149         <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">
2150                 <fields oils_persist:primary="id" oils_persist:sequence="">
2151                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2152                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2153                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2154                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2155                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2156                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2157                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2158                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2159                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2160                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2161                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2162                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2163                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2164                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2165                 </fields>
2166                 <links>
2167                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2168                 </links>
2169                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2170                         <actions>
2171                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2172                                         <context link="usr" field="home_ou" />
2173                                 </retrieve>
2174                         </actions>
2175                 </permacrud>
2176         </class>
2177         <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">
2178                 <fields oils_persist:primary="id" oils_persist:sequence="">
2179                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2180                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2181                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2182                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2183                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2184                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2185                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2186                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2187                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2188                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2189                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2190                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2191                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2192                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2193                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2194                 </fields>
2195                 <links>
2196                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2197                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2198                 </links>
2199         </class>
2200         <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">
2201                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2202                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2203                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2204                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2205                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2206                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2207                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2208                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2209                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2210                 </fields>
2211                 <links>
2212                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2213                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2214                 </links>
2215                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2216                         <actions> <!-- created magically, so no create action -->
2217                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2218                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2219                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2220                         </actions>
2221                 </permacrud>
2222         </class>
2223         <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)">
2224                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2225                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2226                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2227                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2228                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2229                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2230                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2231                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2232                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2233                 </fields>
2234                 <links>
2235                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2236                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2237                 </links>
2238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2239                         <actions> <!-- created magically, so no create action -->
2240                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2241                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2242                         </actions>
2243                 </permacrud>
2244         </class>
2245         <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">
2246                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2247                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2248                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2249                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2250                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2251                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2252                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2253                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2254                 </fields>
2255                 <links>
2256                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2257                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2258                 </links>
2259         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2260             <actions>
2261                 <create permission="UPDATE_USER" context_field="owner">
2262                     <context link="usr" field="home_ou"/>
2263                 </create>
2264                                 <!-- note: public notes are still accessible via API -->
2265                 <retrieve permission="UPDATE_USER">
2266                     <context link="usr" field="home_ou"/>
2267                                 </retrieve>
2268                 <update permission="UPDATE_USER">
2269                     <context link="usr" field="home_ou"/>
2270                                 </update>
2271                 <delete permission="UPDATE_USER">
2272                     <context link="usr" field="home_ou"/>
2273                                 </delete>
2274             </actions>
2275         </permacrud>
2276         </class>
2277         <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">
2278                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2279                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2280                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2281                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2282                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2283                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2284                 </fields>
2285                 <links>
2286                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2287                 </links>
2288         </class>
2289         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2290                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2291                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2292                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2293                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2294                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2295                 </fields>
2296                 <links>
2297                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2298                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2299                 </links>
2300         </class>
2301         <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">
2302                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2303                         <field name="field" reporter:datatype="link"/>
2304                         <field name="id" reporter:datatype="id" />
2305                         <field name="source" reporter:datatype="link"/>
2306                         <field name="value" reporter:datatype="text"/>
2307                 </fields>
2308                 <links>
2309                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2310                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2311                 </links>
2312         </class>
2313         <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">
2314                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2315                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2316                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2317                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2318                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2319                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2320                 </fields>
2321                 <links>
2322                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2323                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2324                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2325                 </links>
2326                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2327                         <actions>
2328                                 <retrieve/>
2329                         </actions>
2330                 </permacrud>
2331         </class>
2332         <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">
2333                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2334                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2335                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2336                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2337                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2338                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2339                 </fields>
2340                 <links>
2341                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2342                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2343                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2344                 </links>
2345                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2346                         <actions>
2347                                 <retrieve/>
2348                         </actions>
2349                 </permacrud>
2350         </class>
2351         <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">
2352                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2353                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2354                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2355                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2356                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2357                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2358                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2359                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2360                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2361                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2362                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2363                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2364                 </fields>
2365                 <links>
2366                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2367                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2368                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2369                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2370                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2371                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2372                 </links>
2373         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2374             <actions>
2375                 <create permission="TRANSIT_COPY" context_field="owner">
2376                     <context link="target_copy" field="circ_lib"/>
2377                 </create>
2378                 <retrieve/>
2379                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2380                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2381             </actions>
2382         </permacrud>
2383         </class>
2384         <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">
2385                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2386                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2387                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2388                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2389                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2390                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2391                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2392                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2393                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2394                 </fields>
2395                 <links>
2396                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2397                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2398                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2399                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2400                 </links>
2401         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2402             <actions>
2403                 <create permission="ADMIN_SURVEY">
2404                     <context link="survey" field="owner"/>
2405                 </create>
2406                 <retrieve permission="VIEW_USER">
2407                     <context link="usr" field="home_ou"/>
2408                 </retrieve>
2409                 <update permission="ADMIN_SURVEY">
2410                     <context link="survey" field="owner"/>
2411                 </update>
2412                 <delete permission="ADMIN_SURVEY">
2413                     <context link="survey" field="owner"/>
2414                 </delete>
2415             </actions>
2416         </permacrud>
2417         </class>
2418         <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">
2419                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2420                         <field name="bucket" />
2421                         <field name="id" reporter:datatype="id" />
2422                         <field name="target_copy" reporter:datatype="link"/>
2423                         <field name="create_time" reporter:datatype="timestamp" />
2424                         <field name="pos" reporter:datatype="int" />
2425                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2426                 </fields>
2427                 <links>
2428                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2429                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2430             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2431                 </links>
2432         </class>
2433         <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">
2434                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2435                         <field name="id" reporter:datatype="id" />
2436                         <field name="item" reporter:datatype="link"/>
2437                         <field name="note" reporter:datatype="text" />
2438                 </fields>
2439                 <links>
2440                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2441                 </links>
2442         </class>
2443
2444         <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">
2445                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2446                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2447                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2448                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2449                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2450                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2451                 </fields>
2452                 <links>
2453                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2454                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2455                 </links>
2456                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2457                         <actions>
2458                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2459                                 <retrieve/>
2460                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2461                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2462                         </actions>
2463                 </permacrud>
2464         </class>
2465
2466         <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">
2467                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2468                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2469                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2470                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2471                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2472                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2473                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2474                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2475                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2476                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2477                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2478                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2479                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2480                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2481                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2482                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2483                 </fields>
2484                 <links>
2485                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2486                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2487                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2488                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2489                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2490                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2491                 </links>
2492                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2493                         <actions>
2494                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2495                                 <retrieve/>
2496                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2497                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2498                         </actions>
2499                 </permacrud>
2500         </class>
2501
2502         <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">
2503                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2504                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2505                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2506                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2507                 </fields>
2508                 <links>
2509                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2510                 </links>
2511                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2512                         <actions>
2513                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2514                                 <retrieve/>
2515                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2516                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2517                         </actions>
2518                 </permacrud>
2519         </class>
2520
2521         <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">
2522                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2523                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2524                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2525                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2526                 </fields>
2527                 <links>
2528                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2529                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2530                 </links>
2531                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2532                         <actions>
2533                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2534                                 <retrieve/>
2535                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2536                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2537                         </actions>
2538                 </permacrud>
2539         </class>
2540
2541         <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">
2542                 <fields oils_persist:primary="code">
2543                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2544                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2545                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2546                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2547                 </fields>
2548                 <links>
2549                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2550                 </links>
2551                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2552                         <actions>
2553                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2554                                 <retrieve/>
2555                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2556                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2557                         </actions>
2558                 </permacrud>
2559         </class>
2560
2561         <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">
2562                 <fields oils_persist:primary="code">
2563                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2564                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2565                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2566                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2567                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2568                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2569                 </fields>
2570                 <links>
2571                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2572                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2573                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2574                 </links>
2575                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2576                         <actions>
2577                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2578                                 <retrieve/>
2579                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2580                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2581                         </actions>
2582                 </permacrud>
2583         </class>
2584
2585     <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">
2586         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2587             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2588             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2589             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2590         </fields>
2591         <links>
2592             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2593             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2594         </links>
2595         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2596             <actions>
2597                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2598                 <retrieve/>
2599                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2600                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2601             </actions>
2602         </permacrud>
2603     </class>
2604
2605         <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">
2606                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2607                         <field name="active" reporter:datatype="bool"/>
2608                         <field name="create_date" reporter:datatype="timestamp"/>
2609                         <field name="creator" />
2610                         <field name="deleted" reporter:datatype="bool"/>
2611                         <field name="edit_date" reporter:datatype="timestamp"/>
2612                         <field name="editor" />
2613                         <field name="id" reporter:datatype="id" />
2614                         <field name="last_xact_id" />
2615                         <field name="marc" />
2616                         <field name="source" />
2617                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2618                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2619                         <field name="heading" />
2620                         <field name="simple_heading" />
2621                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2622                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2623                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2624                 </fields>
2625                 <links>
2626                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2627                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2628                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2629                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2630                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2631                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2632                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2633                 </links>
2634                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2635                         <actions>
2636                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2637                                 <retrieve/>
2638                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2639                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2640                         </actions>
2641                 </permacrud>
2642         </class>
2643         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2644                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2645                         <field name="char_encoding" />
2646                         <field name="id" />
2647                         <field name="record" />
2648                         <field name="record_status" />
2649                         <field name="thesaurus" />
2650                 </fields>
2651                 <links>
2652                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2653                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2654                 </links>
2655         </class>
2656         <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">
2657                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2658                         <field name="id" reporter:datatype="id" />
2659                         <field name="bib" reporter:datatype="link" />
2660                         <field name="authority" reporter:datatype="link" />
2661                 </fields>
2662                 <links>
2663                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2664                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2665                 </links>
2666         </class>
2667         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2668                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2669                         <field name="id" reporter:datatype="id" />
2670                         <field name="record" reporter:datatype="link" />
2671                         <field name="atag" reporter:datatype="link" />
2672                         <field name="value" reporter:datatype="text" />
2673                 </fields>
2674                 <links>
2675                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2676                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2677                 </links>
2678         </class>
2679         <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">
2680                 <fields oils_persist:primary="code" oils_persist:sequence="">
2681                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2682                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2683                 </fields>
2684                 <links/>
2685         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2686             <actions>
2687                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2688                 <retrieve/>
2689                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2690                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2691             </actions>
2692         </permacrud>
2693         </class>
2694         <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">
2695                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2696                         <field name="accepting_usr" />
2697                         <field name="amount" reporter:datatype="money" />
2698                         <field name="amount_collected" reporter:datatype="money" />
2699                         <field name="approval_code" reporter:datatype="text"/>
2700                         <field name="cash_drawer" reporter:datatype="link"/>
2701                         <field name="cc_number" reporter:datatype="text"/>
2702                         <field name="cc_order_number" reporter:datatype="text"/>
2703                         <field name="cc_processor" reporter:datatype="text"/>
2704                         <field name="id" reporter:datatype="id" />
2705                         <field name="note" reporter:datatype="text"/>
2706                         <field name="payment_ts" reporter:datatype="timestamp"/>
2707                         <field name="xact" reporter:datatype="link"/>
2708                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2709                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2710                 </fields>
2711                 <links>
2712                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2713                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2714                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2715                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2716                 </links>
2717         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2718             <actions>
2719                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2720                     <context link="xact" jump="usr" field="home_ou"/>
2721                 </retrieve>
2722                         </actions>
2723                 </permacrud>
2724         </class>
2725         <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">
2726                 <fields oils_persist:primary="name">
2727                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2728                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2729                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2730                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2731                 </fields>
2732                 <links/>
2733         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2734             <actions>
2735                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2736                 <retrieve/>
2737                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2738                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2739             </actions>
2740         </permacrud>
2741         </class>
2742
2743         <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">
2744                 <fields oils_persist:primary="alias">
2745                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2746                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2747                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2748                 </fields>
2749                 <links>
2750                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2751                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2752                 </links>
2753         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2754             <actions>
2755                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2756                 <retrieve/>
2757                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2758                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2759             </actions>
2760         </permacrud>
2761         </class>
2762
2763         <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">
2764                 <fields oils_persist:primary="name">
2765                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2766                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2767                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2768                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2769                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2770                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2771                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2772                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2773                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2774                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2775                 </fields>
2776                 <links>
2777                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2778                 </links>
2779         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2780             <actions>
2781                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2782                 <retrieve/>
2783                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2784                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2785             </actions>
2786         </permacrud>
2787         </class>
2788
2789         <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">
2790                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2791                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2792                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2793                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2794                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2795                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2796                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2797                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2798                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2799                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2800                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2801                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2802                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2803                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2804                 </fields>
2805                 <links>
2806                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2807                 </links>
2808         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2809             <actions>
2810                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2811                 <retrieve/>
2812                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2813                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2814             </actions>
2815         </permacrud>
2816         </class>
2817         <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">
2818                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2819                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2820                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2821                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2822                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2823                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2824                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2825                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2826                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2827                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2828                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2829                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2830                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2831                 </fields>
2832                 <links>
2833                 </links>
2834                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2835                         <actions>
2836                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2837                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2838                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2839                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2840                         </actions>
2841                 </permacrud>
2842         </class>
2843         <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">
2844                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2845                         <field name="id" reporter:datatype="id" />
2846                         <field name="name" reporter:datatype="text"/>
2847                         <field name="xpath" reporter:datatype="text"/>
2848                         <field name="format" reporter:datatype="link"/>
2849                         <field name="first_word" reporter:datatype="bool" />
2850                 </fields>
2851                 <links/>
2852         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2853             <actions>
2854                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2855                 <retrieve/>
2856                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2857                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2858             </actions>
2859         </permacrud>
2860         </class>
2861         <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">
2862                 <fields oils_persist:primary="code" oils_persist:sequence="">
2863                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2864                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2865                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2866                 </fields>
2867                 <links/>
2868         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2869             <actions>
2870                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2871                 <retrieve/>
2872                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2873                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2874             </actions>
2875         </permacrud>
2876         </class>
2877         <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">
2878                 <fields oils_persist:primary="code" oils_persist:sequence="">
2879                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2880                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2881                 </fields>
2882                 <links/>
2883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2884             <actions>
2885                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2886                 <retrieve/>
2887                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2888                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2889             </actions>
2890         </permacrud>
2891         </class>
2892     <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">
2893         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2894             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2895             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2896             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2897             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2898         </fields>
2899         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2900             <actions>
2901                 <retrieve/>
2902             </actions>
2903         </permacrud>
2904     </class>
2905         <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">
2906                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2907                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2908                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2909                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2910                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2911                 </fields>
2912                 <links>
2913                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2914                 </links>
2915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2916             <actions>
2917                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2918                 <retrieve/>
2919                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2920                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2921             </actions>
2922         </permacrud>
2923         </class>
2924         <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">
2925                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2926                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2927                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2928                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2929                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2930                 </fields>
2931                 <links>
2932                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2933                 </links>
2934         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2935             <actions>
2936                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2937                 <retrieve/>
2938                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2939                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2940             </actions>
2941         </permacrud>
2942         </class>
2943         <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">
2944                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2945                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2946                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2947                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2948                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2949                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2950                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2951                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2952                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2953                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2954                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2955                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2956                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2957                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
2958                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
2959                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
2960                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
2961                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
2962                 </fields>
2963                 <links>
2964                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2965                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2966                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
2967                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2968                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
2969                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
2970                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
2971                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
2972                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
2973                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
2974                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
2975                 </links>
2976         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2977             <actions>
2978                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
2979                 <retrieve/>
2980                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
2981                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
2982             </actions>
2983         </permacrud>
2984         </class>
2985         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
2986                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
2987                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
2988                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
2989                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2990                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
2991                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2992                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
2993                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
2994                 </fields>
2995                 <links>
2996                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
2997                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
2998         </links>
2999         </class>
3000         <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">
3001                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3002                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3003                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3004                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3005                 </fields>
3006                 <links>
3007                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3008                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3009                 </links>
3010         </class>
3011         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3012                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3013                         <field name="id" reporter:datatype="id" />
3014                         <field name="value" oils_persist:i18n="true" />
3015                 </fields>
3016                 <links/>
3017         </class>
3018         <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">
3019                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3020                         <field name="balance_owed" reporter:datatype="money" />
3021                         <field name="total_owed" reporter:datatype="money" />
3022                         <field name="total_paid" reporter:datatype="money" />
3023                         <field name="usr" reporter:datatype="link"/>
3024                 </fields>
3025                 <links>
3026                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3027         </links>
3028         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3029             <actions>
3030                 <retrieve permission="VIEW_USER">
3031                     <context link="usr" field="home_ou"/>
3032                 </retrieve>
3033             </actions>
3034         </permacrud>
3035         </class>
3036         <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">
3037                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3038                         <field name="collector" />
3039                         <field name="enter_time" reporter:datatype="timestamp"/>
3040                         <field name="id" reporter:datatype="id" />
3041                         <field name="location" reporter:datatype="link"/>
3042                         <field name="usr" reporter:datatype="link"/>
3043                 </fields>
3044                 <links>
3045                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3046                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3047                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3048                 </links>
3049         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3050             <actions>
3051                 <create permission="money.collections_tracker.create" context_field="location"/>
3052                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3053                 <delete permission="money.collections_tracker.create" context_field="location"/>
3054             </actions>
3055         </permacrud>
3056         </class>
3057         <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">
3058                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3059                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3060                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3061                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3062                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3063                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3064                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3065                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3066                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3067                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3068                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3069                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3070                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3071                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3072                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3073                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3074                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3075                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3076                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3077                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3078                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3079                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3080                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3081                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3082                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3083                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3084                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3085                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3086                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3087                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3088                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3089                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3090                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3091                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3092                 </fields>
3093                 <links>
3094                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3095                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3096                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3097                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3098                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3099                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3100                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3101                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3102                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3103                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3104                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3105                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3106                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3107                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3108                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3109                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3110                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3111                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3112                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3113                         <link field="mattrs" reltype="might_have" key="id" map="" class="mraf"/>
3114                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3115                 </links>
3116         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3117             <actions>
3118                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3119                 <retrieve/>
3120                 <update permission="UPDATE_MARC" global_required="true"/>
3121                 <!-- 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. -->
3122                 <delete permission="DELETE_RECORD" global_required="true"/>
3123             </actions>
3124         </permacrud>
3125         </class>
3126         <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">
3127                 <fields oils_persist:primary="id">
3128                         <field name="dow_0_close" />
3129                         <field name="dow_0_open" />
3130                         <field name="dow_1_close" />
3131                         <field name="dow_1_open" />
3132                         <field name="dow_2_close" />
3133                         <field name="dow_2_open" />
3134                         <field name="dow_3_close" />
3135                         <field name="dow_3_open" />
3136                         <field name="dow_4_close" />
3137                         <field name="dow_4_open" />
3138                         <field name="dow_5_close" />
3139                         <field name="dow_5_open" />
3140                         <field name="dow_6_close" />
3141                         <field name="dow_6_open" />
3142                         <field name="id" reporter:datatype="id" />
3143                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3144                 </fields>
3145                 <links>
3146                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3147                 </links>
3148         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3149             <actions>
3150                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3151                 <retrieve/>
3152                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3153                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3154             </actions>
3155         </permacrud>
3156         </class>
3157         <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">
3158                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3159                         <field name="id" reporter:datatype="id" />
3160                         <field name="record" reporter:datatype="link"/>
3161                         <field name="label" reporter:datatype="text"/>
3162                         <field name="label_sortkey" reporter:datatype="text"/>
3163                         <field name="deleted" reporter:datatype="bool"/>
3164                 </fields>
3165                 <links>
3166                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3167                 </links>
3168         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3169             <actions>
3170                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3171                 <retrieve/>
3172                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3173                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3174             </actions>
3175         </permacrud>
3176         </class>
3177         <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">
3178                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3179                         <field name="id" reporter:datatype="id" />
3180                         <field name="target_copy" reporter:datatype="link" />
3181                         <field name="part" reporter:datatype="link"/>
3182                 </fields>
3183                 <links>
3184                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3185                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3186                 </links>
3187         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3188             <actions>
3189                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3190                 <retrieve/>
3191                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3192                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3193             </actions>
3194         </permacrud>
3195         </class>
3196         <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">
3197                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3198                         <field name="close_end" reporter:datatype="timestamp" />
3199                         <field name="close_start" reporter:datatype="timestamp" />
3200                         <field name="id" reporter:datatype="id" />
3201                         <field name="org_unit" reporter:datatype="org_unit"/>
3202                         <field name="reason" reporter:datatype="text"/>
3203                 </fields>
3204                 <links>
3205                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3206                 </links>
3207         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3208             <actions>
3209                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3210                 <retrieve/>
3211                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3212                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3213             </actions>
3214         </permacrud>
3215         </class>
3216         <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">
3217                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3218                         <field name="extended" reporter:datatype="interval"/>
3219                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3220                         <field name="max_renewals" reporter:datatype="int" />
3221                         <field name="name" reporter:datatype="text"/>
3222                         <field name="normal" reporter:datatype="interval"/>
3223                         <field name="shrt" reporter:datatype="interval"/>
3224                 </fields>
3225                 <links>
3226                 </links>
3227         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3228             <actions>
3229                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3230                 <retrieve/>
3231                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3232                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3233             </actions>
3234         </permacrud>
3235         </class>
3236
3237         <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">
3238                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3239                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3240                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3241             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3242                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3243             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3244                 </fields>
3245                 <links>
3246             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3247                 </links>
3248                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3249             <actions>
3250                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3251                 <retrieve/>
3252                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3253                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3254             </actions>
3255                 </permacrud>
3256         </class>
3257
3258         <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">
3259                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3260                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3261                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3262                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3263             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3264                 </fields>
3265                 <links>
3266                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3267                 </links>
3268                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3269             <actions>
3270                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3271                 <retrieve/>
3272                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3273                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3274             </actions>
3275                 </permacrud>
3276         </class>
3277
3278         <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">
3279                 <fields oils_persist:primary="id" oils_persist:sequence="">
3280                         <field name="balance_owed" reporter:datatype="money"/>
3281                         <field name="id" reporter:datatype="id" />
3282                         <field name="last_billing_note" reporter:datatype="text"/>
3283                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3284                         <field name="last_billing_type" reporter:datatype="text"/>
3285                         <field name="last_payment_note" reporter:datatype="text"/>
3286                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3287                         <field name="last_payment_type" reporter:datatype="text"/>
3288                         <field name="total_owed" reporter:datatype="money"/>
3289                         <field name="total_paid" reporter:datatype="money"/>
3290                         <field name="usr" reporter:datatype="link"/>
3291                         <field name="xact_finish" reporter:datatype="timestamp" />
3292                         <field name="xact_start" reporter:datatype="timestamp" />
3293                         <field name="xact_type" reporter:datatype="text"/>
3294                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3295                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3296                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3297                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3298                         <field name="billing_location" reporter:datatype="link"/>
3299                 </fields>
3300                 <links>
3301                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3302                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3303                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3304                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3305                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3306                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3307                 </links>
3308                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3309                         <actions>
3310                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3311                                         <context link="usr" field="home_ou" />
3312                                 </retrieve>
3313                         </actions>
3314                 </permacrud>
3315         </class>
3316         <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">
3317                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3318                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3319                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3320                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3321                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3322                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3323                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3324                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3325                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3326                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3327                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3328                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3329                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3330                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3331                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3332                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3333                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3334                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3335                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3336                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3337                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3338                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3339                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3340                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3341                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3342                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3343                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3344                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3345                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3346                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3347                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3348                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3349                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3350                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3351                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3352                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3353                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3354                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3355                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3356                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3357                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3358                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3359                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3360                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3361                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3362                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3363                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3364                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3365                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3366                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3367                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3368                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3369                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3370                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3371                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3372                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3373                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3374                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3375                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3376                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3377                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3378                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3379                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3380                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3381                 </fields>
3382                 <links>
3383                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3384                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3385                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3386                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3387                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3388                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3389                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3390                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3391                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3392                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3393                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3394                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3395                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3396                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3397                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3398                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3399                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3400                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3401                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3402                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3403                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3404                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3405                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3406                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3407                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3408                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3409                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3410                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3411                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3412                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3413                 </links>
3414                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3415                         <actions>
3416                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3417                         </actions>
3418                 </permacrud>
3419         </class>
3420         <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">
3421                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3422                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3423                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3424                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3425                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3426                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3427                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3428                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3429                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3430         </fields>
3431                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3432                         <actions>
3433                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3434                                 <retrieve/>
3435                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3436                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3437                         </actions>
3438                 </permacrud>
3439         </class>
3440         <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">
3441                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3442                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3443                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3444                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3445                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3446         </fields>
3447         <links>
3448                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3449                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3450                 </links>
3451                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3452                         <actions>
3453                                 <retrieve permission="RUN_REPORTS">
3454                                         <context link="usr" field="home_ou" />
3455                                 </retrieve>
3456                         </actions>
3457                 </permacrud>
3458         </class>
3459         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3460                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3461                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3462                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3463                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3464                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3465                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3466                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3467         </fields>
3468         <links>
3469                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3470                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3471                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3472                 </links>
3473                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3474                         <actions>
3475                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3476                                         <context link="usr" field="home_ou" />
3477                                         <context link="ws" field="owning_lib" />
3478                                 </retrieve>
3479                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3480                                         <context link="usr" field="home_ou" />
3481                                         <context link="ws" field="owning_lib" />
3482                                 </create>
3483                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3484                                         <context link="usr" field="home_ou" />
3485                                         <context link="ws" field="owning_lib" />
3486                                 </update>
3487                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3488                                         <context link="usr" field="home_ou" />
3489                                         <context link="ws" field="owning_lib" />
3490                                 </delete>
3491                         </actions>
3492                 </permacrud>
3493         </class>
3494         <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">
3495                 <fields oils_persist:primary="name">
3496                         <field name="name" reporter:datatype="text"/>
3497                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3498                 </fields>
3499                 <links/>
3500                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3501                         <actions>
3502                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3503                                 <retrieve/>
3504                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3505                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3506                         </actions>
3507                 </permacrud>
3508         </class>
3509         <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">
3510                 <fields oils_persist:primary="name">
3511                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3512                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3513                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3514                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3515                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3516                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3517                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3518                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3519                 </fields>
3520                 <links>
3521                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3522                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3523                 </links>
3524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3525                         <actions>
3526                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3527                                 <retrieve/>
3528                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3529                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3530                         </actions>
3531                 </permacrud>
3532         </class>
3533         <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">
3534                 <fields oils_persist:primary="name">
3535                         <field name="name" reporter:datatype="text"/>
3536                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3537                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3538                         <field name="datatype" reporter:datatype="text"/>
3539                         <field name="view_perm" reporter:datatype="link"/>
3540                         <field name="update_perm" reporter:datatype="link"/>
3541                         <field name="fm_class" reporter:datatype="text"/>
3542                         <field name="grp" reporter:datatype="link"/>
3543                 </fields>
3544                 <links>
3545                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3546                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3547                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3548                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3549                 </links>
3550                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3551                         <actions>
3552                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3553                                 <retrieve/>
3554                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3555                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3556                         </actions>
3557                 </permacrud>
3558         </class>
3559         <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">
3560                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3561                         <field name="id" />
3562                         <field name="name"  reporter:datatype="text"/>
3563                         <field name="org_unit" reporter:datatype="org_unit"/>
3564                         <field name="value"  reporter:datatype="text"/>
3565                 </fields>
3566                 <links>
3567                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3568                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3569                 </links>
3570         </class>
3571         <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">
3572                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3573                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3574                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3575                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3576                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3577                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3578                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3579                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3580                 </fields>
3581                 <links>
3582                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3583                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3584                 </links>
3585         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3586             <actions>
3587                 <create permission="CREATE_COPY_NOTE">
3588                     <context link="owning_copy" field="circ_lib"/>
3589                 </create>
3590                 <retrieve permission="VIEW_COPY_NOTES">
3591                     <context link="owning_copy" field="circ_lib"/>
3592                 </retrieve>
3593                 <update permission="UPDATE_COPY_NOTE">
3594                     <context link="owning_copy" field="circ_lib"/>
3595                 </update>
3596                 <delete permission="DELETE_COPY_NOTE">
3597                     <context link="owning_copy" field="circ_lib"/>
3598                 </delete>
3599             </actions>
3600         </permacrud>
3601         </class>
3602         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3603                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3604                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3605                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3606                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3607                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3608                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3609                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3610                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3611                 </fields>
3612                 <links>
3613                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3614                 </links>
3615         </class>
3616         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3617                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3618                         <field name="fingerprint"  reporter:datatype="text"/>
3619                         <field name="id" reporter:datatype="id" />
3620                         <field name="master_record" reporter:datatype="link"/>
3621                         <field name="mods"  reporter:datatype="text"/>
3622                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3623                 </fields>
3624                 <links>
3625                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3626                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3627                 </links>
3628         </class>
3629         <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">
3630                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3631                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3632                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3633                 </fields>
3634                 <links/>
3635         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3636             <actions>
3637                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3638                 <retrieve/>
3639                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3640                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3641             </actions>
3642         </permacrud>
3643         </class>
3644         <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">
3645                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3646                         <field name="code"  reporter:datatype="text"/>
3647                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3648                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3649                 </fields>
3650                 <links/>
3651         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3652             <actions>
3653                 <create permission="CREATE_PERM" global_required="true"/>
3654                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3655                 <update permission="UPDATE_PERM" global_required="true"/>
3656                 <delete permission="DELETE_PERM" global_required="true"/>
3657             </actions>
3658         </permacrud>
3659         </class>
3660         <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">
3661                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3662                         <field name="id" reporter:datatype="id" />
3663                         <field name="metarecord" reporter:datatype="link"/>
3664                         <field name="source" reporter:datatype="link"/>
3665                 </fields>
3666                 <links>
3667                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3668                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3669                 </links>
3670         </class>
3671         <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">
3672                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3673                         <field name="id" reporter:datatype="id" />
3674                         <field name="field" reporter:datatype="link"/>
3675                         <field name="source" reporter:datatype="link"/>
3676                         <field name="value"  reporter:datatype="text"/>
3677                 </fields>
3678                 <links>
3679                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3680                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3681                 </links>
3682         </class>
3683         <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">
3684                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3685                         <field name="id" reporter:datatype="id" />
3686                         <field name="value" reporter:datatype="text"/>
3687                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3688                 </fields>
3689                 <links>
3690                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3691                 </links>
3692         </class>
3693         <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">
3694                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3695                         <field name="id" reporter:datatype="id" />
3696                         <field name="entry" reporter:datatype="link"/>
3697                         <field name="def" reporter:datatype="link"/>
3698                         <field name="source" reporter:datatype="link"/>
3699                 </fields>
3700                 <links>
3701                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3702                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3703                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3704                 </links>
3705         </class>
3706         <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">
3707                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3708                         <field name="id" reporter:datatype="id" />
3709                         <field name="entry" reporter:datatype="link"/>
3710                         <field name="simple_heading" reporter:datatype="link"/>
3711                 </fields>
3712                 <links>
3713                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3714                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3715                 </links>
3716         </class>
3717         <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">
3718                 <oils_persist:source_definition>
3719                         SELECT * FROM metabib.author_field_entry
3720                                                 UNION ALL
3721                         SELECT * FROM metabib.keyword_field_entry
3722                                                 UNION ALL
3723                         SELECT * FROM metabib.identifier_field_entry
3724                                                 UNION ALL
3725                         SELECT * FROM metabib.title_field_entry
3726                                                 UNION ALL
3727                         SELECT * FROM metabib.subject_field_entry
3728                                                 UNION ALL
3729                         SELECT * FROM metabib.series_field_entry
3730                 </oils_persist:source_definition>
3731                 <fields>
3732                         <field name="field" reporter:datatype="link"/>
3733                         <field name="id" reporter:datatype="id" />
3734                         <field name="source" reporter:datatype="link"/>
3735                         <field name="value"  reporter:datatype="text"/>
3736                 </fields>
3737                 <links>
3738                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3739                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3740                 </links>
3741         </class>
3742         <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">
3743                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3744                         <field name="field" reporter:datatype="link"/>
3745                         <field name="id" reporter:datatype="id" />
3746                         <field name="source" reporter:datatype="link"/>
3747                         <field name="value"  reporter:datatype="text"/>
3748                 </fields>
3749                 <links>
3750                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3751                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3752                 </links>
3753         </class>
3754         <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">
3755                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3756                         <field name="accepting_usr" reporter:datatype="link"/>
3757                         <field name="amount" reporter:datatype="money" />
3758                         <field name="amount_collected" reporter:datatype="money" />
3759                         <field name="cash_drawer" reporter:datatype="link"/>
3760                         <field name="id" reporter:datatype="id" />
3761                         <field name="note"  reporter:datatype="text"/>
3762                         <field name="payment_ts" reporter:datatype="timestamp"/>
3763                         <field name="xact" reporter:datatype="link"/>
3764                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3765                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3766                 </fields>
3767                 <links>
3768                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3769                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3770                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3771                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3772                 </links>
3773         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3774             <actions>
3775                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3776                     <context link="xact" jump="usr" field="home_ou"/>
3777                 </retrieve>
3778                         </actions>
3779                 </permacrud>
3780         </class>
3781         <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">
3782                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3783                         <field name="accepting_usr" reporter:datatype="link"/>
3784                         <field name="amount" reporter:datatype="money" />
3785                         <field name="amount_collected" reporter:datatype="money" />
3786                         <field name="id" reporter:datatype="id" />
3787                         <field name="note"  reporter:datatype="text"/>
3788                         <field name="payment_ts" reporter:datatype="timestamp"/>
3789                         <field name="xact" reporter:datatype="link"/>
3790                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3791                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3792                 </fields>
3793                 <links>
3794                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3795                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3796                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3797                 </links>
3798         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3799             <actions>
3800                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3801                     <context link="xact" jump="usr" field="home_ou"/>
3802                 </retrieve>
3803                         </actions>
3804                 </permacrud>
3805         </class>
3806         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
3807                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3808                         <field name="accepting_usr" reporter:datatype="link"/>
3809                         <field name="amount" reporter:datatype="money" />
3810                         <field name="amount_collected" reporter:datatype="money" />
3811                         <field name="id" reporter:datatype="id" />
3812                         <field name="note"  reporter:datatype="text"/>
3813                         <field name="payment_ts" reporter:datatype="timestamp"/>
3814                         <field name="xact" reporter:datatype="link"/>
3815                         <field name="billing" reporter:datatype="link"/>
3816                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3817                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3818                 </fields>
3819                 <links>
3820                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3821                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3822                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3823                         <link field="billing" reltype="might_have" key="id" class="mb"/>
3824                 </links>
3825         </class>
3826         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
3827                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
3828                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
3829                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3830                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3831                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
3832                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3833                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
3834                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
3835                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3836                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
3837                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
3838                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
3839                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
3840                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3841                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
3842                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
3843                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
3844                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
3845                 </fields>
3846                 <links>
3847                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3848                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
3849                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
3850                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
3851                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
3852                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
3853                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
3854                 </links>
3855         </class>
3856
3857         <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">
3858                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
3859                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3860                         <field name="name"  reporter:datatype="text"/>
3861                         <field name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
3862                         <field name="block_list" reporter:datatype="text"/>
3863                         <field name="staff_alert" reporter:datatype="bool"/>
3864                         <field name="org_depth" reporter:datatype="int"/>
3865                         <field name="ignore_proximity" reporter:datatype="int"/>
3866                 </fields>
3867                 <links/>
3868         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3869             <actions>
3870                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3871                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
3872                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3873                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
3874             </actions>
3875         </permacrud>
3876         </class>
3877         <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">
3878                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
3879                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
3880                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
3881                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
3882                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
3883                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
3884                 </fields>
3885                 <links>
3886                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
3887                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
3888                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3889         </links>
3890         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3891             <actions>
3892                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3893                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3894                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3895                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
3896             </actions>
3897         </permacrud>
3898         </class>
3899         <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">
3900                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
3901                         <field name="holdable" reporter:datatype="bool"/>
3902                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3903                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3904                         <field name="opac_visible" reporter:datatype="bool"/>
3905             <field name="copy_active" reporter:datatype="bool"/>
3906             <field name="restrict_copy_delete" reporter:datatype="bool"/>
3907             <field name="is_available" reporter:datatype="bool"/>
3908                 </fields>
3909                 <links/>
3910         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3911             <actions>
3912                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
3913                 <retrieve/>
3914                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
3915                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
3916             </actions>
3917         </permacrud>
3918         </class>
3919         <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">
3920                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
3921                         <field name="id" reporter:datatype="id" reporter:label="ID" />
3922                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
3923                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
3924                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
3925                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
3926                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
3927                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
3928                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
3929                 </fields>
3930                 <links>
3931                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3932                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3933                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
3934                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
3935                 </links>
3936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3937                         <actions>
3938                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
3939                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
3940                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
3941                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
3942                         </actions>
3943                 </permacrud>
3944         </class>
3945         <class id="aua" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
3946                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
3947                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
3948                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3949                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3950                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3951                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
3952                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3953                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3954                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3955                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3956                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
3957                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
3958                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
3959                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
3960                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
3961                 </fields>
3962                 <links>
3963                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3964                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
3965                 </links>
3966         </class>
3967         <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">
3968                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
3969                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
3970                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
3971                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3972                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
3973                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
3974                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
3975                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
3976                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
3977                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
3978                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
3979                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
3980                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
3981                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
3982                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
3983                 </fields>
3984                 <links>
3985                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3986                 </links>
3987                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3988                         <actions>
3989                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3990                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
3991                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3992                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
3993                         </actions>
3994                 </permacrud>
3995         </class>
3996
3997
3998         <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">
3999                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4000                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4001                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4002                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4003                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4004                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4005                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4006                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4007                 </fields>
4008                 <links>
4009                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4010                 </links>
4011         </class>
4012
4013         <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">
4014                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4015                         <field name="call_number" />
4016                         <field name="create_date" reporter:datatype="timestamp"/>
4017                         <field name="creator" reporter:datatype="link"/>
4018                         <field name="id" reporter:datatype="id" />
4019                         <field name="pub" reporter:datatype="bool"/>
4020                         <field name="title"  reporter:datatype="text"/>
4021                         <field name="value"  reporter:datatype="text"/>
4022                 </fields>
4023                 <links>
4024                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4025                 </links>
4026         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4027             <actions>
4028                 <create permission="CREATE_VOLUME_NOTE">
4029                     <context link="call_number" field="owning_lib"/>
4030                 </create>
4031                 <retrieve permission="VIEW_VOLUME_NOTES">
4032                     <context link="call_number" field="owning_lib"/>
4033                 </retrieve>
4034                 <update permission="UPDATE_VOLUME_NOTE">
4035                     <context link="call_number" field="owning_lib"/>
4036                 </update>
4037                 <delete permission="DELETE_VOLUME_NOTE">
4038                     <context link="call_number" field="owning_lib"/>
4039                 </delete>
4040             </actions>
4041         </permacrud>
4042         </class>
4043         <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">
4044                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4045                         <field name="create_date" reporter:datatype="timestamp"/>
4046                         <field name="creator" reporter:datatype="link"/>
4047                         <field name="edit_date" reporter:datatype="timestamp"/>
4048                         <field name="editor" reporter:datatype="link"/>
4049                         <field name="id" reporter:datatype="id" />
4050                         <field name="record" reporter:datatype="link"/>
4051                         <field name="value" reporter:datatype="text"/>
4052                 </fields>
4053                 <links>
4054                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4055                 </links>
4056         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4057             <actions>
4058                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4059                 <retrieve/>
4060                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4061                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4062             </actions>
4063         </permacrud>
4064         </class>
4065         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4066         <oils_persist:source_definition>
4067 SELECT  usr,
4068         SUM(
4069             CASE
4070                 WHEN (
4071                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4072                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4073                 ) THEN 1
4074                 ELSE 0
4075             END
4076         ) AS out,
4077
4078         SUM(
4079             CASE
4080                 WHEN (
4081                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4082                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4083                 ) THEN 1
4084                 ELSE 0
4085             END
4086         ) AS overdue,
4087
4088         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4089         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4090         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4091   FROM  action.circulation
4092   WHERE checkin_time IS NULL
4093   GROUP BY 1
4094         </oils_persist:source_definition>
4095         <fields oils_persist:primary="usr">
4096             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4097             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4098             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4099             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4100             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4101             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4102         </fields>
4103         <links>
4104             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4105         </links>
4106         </class>
4107         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4108         <oils_persist:source_definition>
4109 SELECT  usr,
4110         STRING_AGG(
4111             CASE
4112                 WHEN (
4113                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4114                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4115                 ) THEN id::TEXT
4116                 ELSE '0'
4117             END
4118         ,',') AS out,
4119
4120         STRING_AGG(
4121             CASE
4122                 WHEN (
4123                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4124                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4125                 ) THEN id::TEXT
4126                 ELSE '0'
4127             END
4128         ,',') AS overdue,
4129
4130         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4131         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4132         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4133   FROM  action.circulation
4134   WHERE checkin_time IS NULL
4135   GROUP BY 1
4136         </oils_persist:source_definition>
4137         <fields oils_persist:primary="usr">
4138             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4139             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4140             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4141             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4142             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4143             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4144         </fields>
4145         <links>
4146             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4147         </links>
4148         </class>
4149         <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">
4150                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4151                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4152                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4153                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4154                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4155                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4156                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4157                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4158                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4159                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4160                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4161                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4162                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4163                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4164                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4165                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4166                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4167                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4168                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4169                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4170                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4171                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4172                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4173                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4174                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4175                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4176                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4177                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4178                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4179                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4180                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4181                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4182                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4183                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4184                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4185                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4186                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4187                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4188                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4189                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4190                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4191                 </fields>
4192                 <links>
4193                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4194                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4195                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4196                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4197                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4198                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4199                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4200                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4201                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4202                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4203                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4204                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4205                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4206                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4207                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4208                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4209                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4210                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4211                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4212                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4213                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4214                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4215                 </links>
4216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4217                         <actions>
4218                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4219                         </actions>
4220                 </permacrud>
4221         </class>
4222         <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">
4223                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4224                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4225                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4226                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4227                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4228                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4229                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4230                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4231                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4232                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4233                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4234                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4235                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4236                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4237                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4238                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4239                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4240                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4241                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4242                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4243                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4244                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4245                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4246                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4247                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4248                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4249                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4250                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4251                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4252                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4253                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4254                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4255                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4256                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4257                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4258                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4259                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4260                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4261                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4262                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4263                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4264                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4265                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4266                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4267                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4268                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4269                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4270                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4271                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4272                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4273                 </fields>
4274                 <links>
4275                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4276                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4277                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4278                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4279                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4280                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4281                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4282                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4283                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4284                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4285                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4286                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4287                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4288                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4289                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4290                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4291                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4292                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4293                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4294                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4295                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4296                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4297                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4298                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4299                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4300                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4301                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4302                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4303                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4304                 </links>
4305                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4306                         <actions>
4307                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4308                         </actions>
4309                 </permacrud>
4310         </class>
4311         <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">
4312                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4313                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4314                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4315                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4316                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4317                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4318                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4319                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4320                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4321                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4322                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4323                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4324                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4325                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4326                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4327                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4328                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4329                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4330                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4331                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4332                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4333                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4334                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4335                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4336                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4337                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4338                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4339                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4340                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4341                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4342                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4343                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4344                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4345                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4346                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4347                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4348                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4349                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4350                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4351                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4352                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4353                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4354                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4355                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4356                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4357                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4358                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4359                 </fields>
4360                 <links>
4361                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4362                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4363                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4364                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4365                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4366                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4367                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4368                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4369                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4370                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4371                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4372                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4373                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4374                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4375                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4376                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4377                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4378                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4379                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4380                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4381                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4382                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4383                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4384                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4385                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4386                 </links>
4387         </class>
4388         <class id="auch" 
4389                 controller="open-ils.cstore" 
4390                 oils_obj:fieldmapper="action::user_circ_history" 
4391                 oils_persist:tablename="action.usr_circ_history" 
4392                 reporter:label="User Checkout History">
4393                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4394                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4395                         <!-- prevent reporting on the user that owns the checkout history -->
4396                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4397                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4398                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4399                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4400                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4401                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4402                 </fields>
4403                 <links>
4404                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4405                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4406                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4407                 </links>
4408         </class>
4409         <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">
4410                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4411                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4412                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4413                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4414                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4415                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4416                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4417                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4418                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4419                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4420                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4421                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4422                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4423                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4424                 </fields>
4425                 <links>
4426                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4427                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4428                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4429                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4430                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4431                 </links>
4432                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4433                         <actions>
4434                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4435                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4436                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4437                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4438                         </actions>
4439                 </permacrud>
4440         </class>
4441
4442         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4443                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4444                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4445                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4446                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4447                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4448                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4449                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4450                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4451                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4452                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4453                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4454                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4455                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4456                 </fields>
4457                 <links>
4458                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4459                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4460                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4461                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4462                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4463                 </links>
4464                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4465                         <actions>
4466                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4467                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4468                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4469                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4470                         </actions>
4471                 </permacrud>
4472         </class>
4473         
4474         <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">
4475                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4476                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4477                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4478                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4479                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4480                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4481                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4482                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4483                 </fields>
4484                 <links>
4485                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4486                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4487                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4488                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4489                 </links>
4490                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4491                         <actions>
4492                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4493                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4494                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4495                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4496                         </actions>
4497                 </permacrud>
4498         </class>
4499         
4500         <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">
4501                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4502                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4503                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4504                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4505                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4506                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4507                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4508                 </fields>
4509                 <links>
4510                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4511                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4512                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4513                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4514                 </links>
4515                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4516                         <actions>
4517                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4518                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4519                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4520                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4521                         </actions>
4522                 </permacrud>
4523         </class>
4524         
4525         <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">
4526                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4527                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4528                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4529                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4530                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4531                 </fields>
4532                 <links>
4533                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4534                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4535                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4536                 </links>
4537                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4538                         <actions>
4539                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4540                     <context link="resource" field="owner" />
4541                 </create>
4542                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4543                     <context link="resource" field="owner" />
4544                 </retrieve>
4545                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4546                     <context link="resource" field="owner" />
4547                 </update>
4548                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4549                     <context link="resource" field="owner" />
4550                 </delete>
4551                         </actions>
4552                 </permacrud>
4553         </class>
4554         
4555         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4556                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4557                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4558                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4559                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4560                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4561                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4562                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4563                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4564                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4565                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4566                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4567                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4568                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4569                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4570                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4571                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4572                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4573                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4574                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4575                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4576                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4577                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4578                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4579                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4580                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4581                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4582                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4583                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4584                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4585                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4586                 </fields>
4587                 <links>
4588                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4589                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4590                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4591                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4592                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4593                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4594                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4595                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4596                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4597                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4598                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4599                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4600                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4601                 </links>
4602                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4603                         <actions>
4604                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4605                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4606                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4607                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4608                         </actions>
4609                 </permacrud>
4610         </class>
4611         
4612         <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">
4613                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4614                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4615                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4616                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4617                 </fields>
4618                 <links>
4619                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4620                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4621                 </links>
4622                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4623                         <actions>
4624                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4625                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4626                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4627                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4628                         </actions>
4629                 </permacrud>
4630         </class>
4631
4632         <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">
4633                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4634                         <field name="bucket" reporter:datatype="link"/>
4635                         <field name="id" reporter:datatype="id" />
4636                         <field name="target_call_number" reporter:datatype="link" />
4637                         <field name="create_time" reporter:datatype="timestamp" />
4638                         <field name="pos" reporter:datatype="int" />
4639                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4640                 </fields>
4641                 <links>
4642                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4643                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4644             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4645                 </links>
4646         </class>
4647         <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">
4648                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4649                         <field name="id" reporter:datatype="id" />
4650                         <field name="item" reporter:datatype="link"/>
4651                         <field name="note" reporter:datatype="text" />
4652                 </fields>
4653                 <links>
4654                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4655                 </links>
4656         </class>
4657         <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">
4658                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4659                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4660                         <field name="btype" reporter:datatype="text"/>
4661                         <field name="id" reporter:datatype="id" />
4662                         <field name="name" reporter:datatype="text"/>
4663                         <field name="description" reporter:datatype="text"/>
4664                         <field name="owner" reporter:datatype="link"/>
4665                         <field name="pub" reporter:datatype="bool"/>
4666                         <field name="create_time" reporter:datatype="timestamp" />
4667                 </fields>
4668                 <links>
4669                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4670                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4671                 </links>
4672         </class>
4673         <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">
4674                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4675                         <field name="id" reporter:datatype="id" />
4676                         <field name="bucket" reporter:datatype="link"/>
4677                         <field name="note" reporter:datatype="text" />
4678                 </fields>
4679                 <links>
4680                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4681                 </links>
4682         </class>
4683         <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">
4684                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4685                         <field name="hold" reporter:datatype="link"/>
4686                         <field name="id" reporter:datatype="id" />
4687                         <field name="target_copy" reporter:datatype="link"/>
4688                         <field name="proximity" reporter:datatype="number"/>
4689                 </fields>
4690                 <links>
4691                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4692                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4693                 </links>
4694         </class>
4695         <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">
4696                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4697                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4698                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4699                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4700                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4701                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4702                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
4703                 </fields>
4704                 <links>
4705                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4706                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
4707                 </links>
4708         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4709             <actions>
4710                 <create permission="CREATE_HOLD_NOTIFICATION">
4711                                         <context link="hold" jump="usr" field="home_ou" />
4712                                 </create>
4713                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
4714                                         <context link="hold" jump="usr" field="home_ou" />
4715                                 </retrieve>
4716                 <update permission="CREATE_HOLD_NOTIFICATION">
4717                                         <context link="hold" jump="usr" field="home_ou" />
4718                                 </update>
4719                 <delete permission="CREATE_HOLD_NOTIFICATION">
4720                                         <context link="hold" jump="usr" field="home_ou" />
4721                                 </delete>
4722             </actions>
4723         </permacrud>
4724         </class>
4725         <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">
4726                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
4727                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
4728                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
4729                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
4730                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4731                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4732                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4733                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
4734                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
4735                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
4736                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
4737                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
4738                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
4739                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
4740                 </fields>
4741                 <links>
4742                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4743                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
4744                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
4745                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
4746                 </links>
4747         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4748             <actions>
4749                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
4750                 <retrieve/>
4751                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
4752                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
4753             </actions>
4754         </permacrud>
4755         </class>
4756         <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">
4757                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
4758                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4759                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4760                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
4761                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
4762             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
4763             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
4764             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4765                 </fields>
4766                 <links>
4767                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4768                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
4769                 </links>
4770         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4771             <actions>
4772                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4773                 <retrieve/>
4774                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4775                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
4776             </actions>
4777         </permacrud>
4778         </class>
4779         <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">
4780                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
4781                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4782             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
4783             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
4784                 </fields>
4785                 <links>
4786                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
4787                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4788                 </links>
4789         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4790             <actions>
4791                 <create permission="ADMIN_COPY_LOCATION_GROUP">
4792                                         <context link="lgroup" field="owner" />
4793                 </create>
4794                 <retrieve/>
4795                 <update permission="ADMIN_COPY_LOCATION_GROUP">
4796                                         <context link="lgroup" field="owner" />
4797                 </update>
4798                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
4799                                         <context link="lgroup" field="owner" />
4800                 </delete>
4801             </actions>
4802         </permacrud>
4803         </class>
4804
4805     <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">
4806         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
4807             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
4808             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
4809             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
4810             <field reporter:label="Position" name="position" reporter:datatype="int"/>
4811         </fields>
4812         <links>
4813             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
4814             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
4815         </links>
4816         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4817             <actions>
4818                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4819                 <retrieve/>
4820                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4821                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
4822             </actions>
4823         </permacrud>
4824     </class>
4825
4826         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
4827                 <fields>
4828                         <field name="sre_id" oils_persist:virtual="true" />
4829                         <field name="location" oils_persist:virtual="true" />
4830                         <field name="owning_lib" oils_persist:virtual="true" />
4831                         <field name="basic_holdings" oils_persist:virtual="true" />
4832                         <field name="basic_holdings_add" oils_persist:virtual="true" />
4833                         <field name="supplement_holdings" oils_persist:virtual="true" />
4834                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
4835                         <field name="index_holdings" oils_persist:virtual="true" />
4836                         <field name="index_holdings_add" oils_persist:virtual="true" />
4837                         <field name="online" oils_persist:virtual="true" />
4838                         <field name="missing" oils_persist:virtual="true" />
4839                         <field name="incomplete" oils_persist:virtual="true" />
4840                 </fields>
4841         </class>
4842
4843         <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">
4844                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
4845                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
4846                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
4847                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4848                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4849                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
4850                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
4851                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
4852                         <field reporter:label="ID" name="id" reporter:datatype="id" />
4853                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
4854                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
4855                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
4856                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
4857                 </fields>
4858                 <links>
4859                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4860                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
4861                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4862                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4863                 </links>
4864                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4865                         <actions>
4866                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
4867                                 <retrieve/>
4868                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
4869                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
4870                         </actions>
4871                 </permacrud>
4872         </class>
4873
4874         <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">
4875                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
4876                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4877                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4878                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
4879                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4880                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4881                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4882                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
4883                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
4884                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
4885                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
4886                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
4887                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
4888                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
4889                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
4890                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
4891                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
4892                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
4893                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
4894                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
4895                 </fields>
4896                 <links>
4897                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4898                 </links>
4899                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4900                         <actions>
4901                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
4902                                         <context link="subscription" field="owning_lib" />
4903                                 </create>
4904                                 <retrieve />
4905                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
4906                                         <context link="subscription" field="owning_lib" />
4907                                 </update>
4908                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
4909                                         <context link="subscription" field="owning_lib" />
4910                                 </delete>
4911                         </actions>
4912                 </permacrud>
4913         </class>
4914
4915         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
4916                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
4917                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4918                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
4919                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
4920                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
4921                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
4922                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
4923                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
4924                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
4925                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
4926                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4927                 </fields>
4928                 <links>
4929                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4930                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
4931                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
4932                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
4933                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
4934                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
4935                 </links>
4936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4937                         <actions>
4938                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4939                                 <retrieve />
4940                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4941                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
4942                         </actions>
4943                 </permacrud>
4944         </class>
4945
4946         <class id="ssubn" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
4947                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
4948                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4949                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4950                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
4951                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4952                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
4953                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
4954                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
4955                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
4956                 </fields>
4957                 <links>
4958                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4959                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
4960                 </links>
4961         </class>
4962
4963         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
4964                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
4965                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4966                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
4967                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
4968                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
4969                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
4970                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
4971                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
4972                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
4973                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
4974                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
4975                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
4976                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
4977                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
4978                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
4979                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
4980                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4981                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4982                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
4983                 </fields>
4984                 <links>
4985                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
4986                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
4987                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
4988                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
4989                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
4990                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
4991                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
4992                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
4993                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
4994                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
4995                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
4996                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
4997                 </links>
4998                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4999                         <actions>
5000                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5001                                 <retrieve />
5002                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5003                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5004                         </actions>
5005                 </permacrud>
5006         </class>
5007
5008         <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">
5009                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5010                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5011                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5012                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5013                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5014                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5015                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5016                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5017                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5018                 </fields>
5019                 <links>
5020                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5021                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5022                 </links>
5023                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5024                         <actions>
5025                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5026                                         <context link="distribution" field="holding_lib" />
5027                                 </create>
5028                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5029                                         <context link="distribution" field="holding_lib" />
5030                                 </retrieve>
5031                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5032                                         <context link="distribution" field="holding_lib" />
5033                                 </update>
5034                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5035                                         <context link="distribution" field="holding_lib" />
5036                                 </delete>
5037                         </actions>
5038                 </permacrud>
5039         </class>
5040
5041         <class id="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5042                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_id_seq">
5043                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5044                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5045                         <field reporter:label="Routing Label" name="routing_label" reporter:datatype="text"/>
5046                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5047                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5048                 </fields>
5049                 <links>
5050                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5051                         <link field="items" reltype="has_many" key="id" map="" class="sitem"/>
5052                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5053                 </links>
5054                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5055                         <actions>
5056                                 <create permission="ADMIN_SERIAL_STREAM">
5057                                         <context link="distribution" field="holding_lib" />
5058                                 </create>
5059                                 <retrieve />
5060                                 <update permission="ADMIN_SERIAL_STREAM">
5061                                         <context link="distribution" field="holding_lib" />
5062                                 </update>
5063                                 <delete permission="ADMIN_SERIAL_STREAM">
5064                                         <context link="distribution" field="holding_lib" />
5065                                 </delete>
5066                         </actions>
5067                 </permacrud>
5068         </class>
5069
5070         <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">
5071                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5072                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5073                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5074                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5075                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5076                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5077                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5078                 </fields>
5079                 <links>
5080                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5081                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5082                 </links>
5083                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5084                         <actions>
5085                                 <create permission="ADMIN_SERIAL_STREAM">
5086                                         <context link="stream" jump="distribution" field="holding_lib" />
5087                                 </create>
5088                                 <retrieve permission="RECEIVE_SERIAL">
5089                                         <context link="stream" jump="distribution" field="holding_lib" />
5090                                 </retrieve>
5091                                 <update permission="ADMIN_SERIAL_STREAM">
5092                                         <context link="stream" jump="distribution" field="holding_lib" />
5093                                 </update>
5094                                 <delete permission="ADMIN_SERIAL_STREAM">
5095                                         <context link="stream" jump="distribution" field="holding_lib" />
5096                                 </delete>
5097                         </actions>
5098                 </permacrud>
5099         </class>
5100
5101         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5102                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5103                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5104                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5105                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5106                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5107                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5108                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5109                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5110                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5111                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5112                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5113                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5114                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5115                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5116                 </fields>
5117                 <links>
5118                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5119                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5120                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5121                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5122                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5123                 </links>
5124                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5125                         <actions>
5126                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5127                                         <context link="subscription" field="owning_lib" />
5128                                 </create>
5129                                 <retrieve/>
5130                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5131                                         <context link="subscription" field="owning_lib" />
5132                                 </update>
5133                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5134                                         <context link="subscription" field="owning_lib" />
5135                                 </delete>
5136                         </actions>
5137                 </permacrud>
5138         </class>
5139
5140         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5141                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5142                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5143                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5144                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5145                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5146                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5147                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5148                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5149                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5150                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5151                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5152                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5153                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5154                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5155                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5156                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5157                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5158                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5159                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5160                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5161                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5162                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5163                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5164                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5165                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5166                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5167                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5168                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5169                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5170                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5171                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5172                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5173                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5174                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5175                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5176                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5177                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5178                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5179                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5180                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5181                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5182                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5183                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5184                 </fields>
5185                 <links>
5186                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5187                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5188                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5189                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5190                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5191                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5192                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5193                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5194                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5195                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5196                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5197                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5198                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5199                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5200                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5201                 </links>
5202                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5203                         <actions>
5204                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5205                                 <retrieve/>
5206                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5207                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5208                         </actions>
5209                 </permacrud>
5210         </class>
5211
5212         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5213                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5214                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5215                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5216                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5217                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5218                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5219                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5220                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5221                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5222                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5223                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5224                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5225                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5226                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5227                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5228                 </fields>
5229                 <links>
5230                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5231                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5232                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5233                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5234                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5235                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5236                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5237                 </links>
5238                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5239                         <actions>
5240                                 <create permission="ADMIN_SERIAL_ITEM">
5241                                         <context link="stream" jump="distribution" field="holding_lib" />
5242                                 </create>
5243                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5244                                         <context link="stream" jump="distribution" field="holding_lib" />
5245                                 </retrieve>
5246                                 <update permission="ADMIN_SERIAL_ITEM">
5247                                         <context link="stream" jump="distribution" field="holding_lib" />
5248                                 </update>
5249                                 <delete permission="ADMIN_SERIAL_ITEM">
5250                                         <context link="stream" jump="distribution" field="holding_lib" />
5251                                 </delete>
5252                         </actions>
5253                 </permacrud>
5254         </class>
5255
5256         <class id="sin" controller="open-ils.cstore" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
5257                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5258                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5259                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5260                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5261                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5262                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5263                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5264                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5265                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5266                 </fields>
5267                 <links>
5268                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5269                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5270                 </links>
5271                 <!-- Not available via PCRUD at this time -->
5272         </class>
5273         <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">
5274                 <fields>
5275                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5276                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5277                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5278                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5279                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5280                 </fields>
5281                 <links>
5282                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5283                 </links>
5284         </class>
5285         <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">
5286                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5287                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5288                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5289                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5290                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5291                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5292                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5293                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5294                 </fields>
5295                 <links>
5296                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5297                 </links>
5298         </class>
5299         <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">
5300                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5301                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5302                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5303                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5304                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5305                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5306                 </fields>
5307                 <links>
5308                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5309                 </links>
5310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5311                         <actions>
5312                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5313                                         <context link="distribution" field="holding_lib" />
5314                                 </create>
5315                                 <retrieve/>
5316                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5317                                         <context link="distribution" field="holding_lib" />
5318                                 </update>
5319                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5320                                         <context link="distribution" field="holding_lib" />
5321                                 </delete>
5322                         </actions>
5323                 </permacrud>
5324         </class>
5325
5326         <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">
5327                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5328                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5329                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5330                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5331                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5332                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5333                 </fields>
5334                 <links>
5335                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5336                 </links>
5337                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5338                         <actions>
5339                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5340                                         <context link="distribution" field="holding_lib" />
5341                                 </create>
5342                                 <retrieve/>
5343                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5344                                         <context link="distribution" field="holding_lib" />
5345                                 </update>
5346                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5347                                         <context link="distribution" field="holding_lib" />
5348                                 </delete>
5349                         </actions>
5350                 </permacrud>
5351         </class>
5352
5353         <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">
5354                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5355                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5356                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5357                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5358                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5359                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5360                 </fields>
5361                 <links>
5362                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5363                 </links>
5364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5365                         <actions>
5366                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5367                                         <context link="distribution" field="holding_lib" />
5368                                 </create>
5369                                 <retrieve/>
5370                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5371                                         <context link="distribution" field="holding_lib" />
5372                                 </update>
5373                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5374                                         <context link="distribution" field="holding_lib" />
5375                                 </delete>
5376                         </actions>
5377                 </permacrud>
5378         </class>
5379
5380         <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">
5381                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5382                         <field name="id" reporter:datatype="id" />
5383                         <field name="owning_copy" reporter:datatype="link"/>
5384                         <field name="stat_cat" reporter:datatype="link"/>
5385                         <field name="stat_cat_entry" reporter:datatype="link"/>
5386                 </fields>
5387                 <links>
5388                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5389                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5390                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5391                 </links>
5392                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5393                         <actions>
5394                                 <retrieve/>
5395                         </actions>
5396                 </permacrud>
5397         </class>
5398         <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">
5399                 <fields oils_persist:primary="code">
5400                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5401                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5402                 </fields>
5403                 <links/>
5404         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5405             <actions>
5406                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5407                 <retrieve/>
5408                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5409                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5410             </actions>
5411         </permacrud>
5412         </class>
5413         <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">
5414                 <fields oils_persist:primary="code">
5415                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5416                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5417                 </fields>
5418                 <links/>
5419         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5420             <actions>
5421                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5422                 <retrieve/>
5423                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5424                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5425             </actions>
5426         </permacrud>
5427         </class>
5428         <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">
5429                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5430                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5431                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5432                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5433                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5434                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5435                 </fields>
5436                 <links>
5437             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5438         </links>
5439         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5440             <actions>
5441                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5442                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5443                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5444                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5445             </actions>
5446         </permacrud>
5447         </class>
5448         <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">
5449                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5450                         <field name="id" reporter:datatype="id" />
5451                         <field name="name" reporter:datatype="text"/>
5452                 </fields>
5453                 <links/>
5454         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5455             <actions>
5456                 <create permission="CREATE_LASSO" global_required="true"/>
5457                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5458                 <update permission="UPDATE_LASSO" global_required="true"/>
5459                 <delete permission="DELETE_LASSO" global_required="true"/>
5460             </actions>
5461         </permacrud>
5462         </class>
5463         <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">
5464                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5465                         <field name="id" reporter:datatype="id" />
5466                         <field name="lasso" reporter:datatype="link"/>
5467                         <field name="org_unit" reporter:datatype="org_unit"/>
5468                 </fields>
5469                 <links>
5470                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5471                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5472                 </links>
5473         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5474             <actions>
5475                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5476                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5477                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5478                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5479             </actions>
5480         </permacrud>
5481         </class>
5482         <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">
5483                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5484                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5485                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5486                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5487                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5488                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5489                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5490                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5491                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5492                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5493                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5494                 </fields>
5495                 <links>
5496                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5497                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5498                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5499                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5500                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5501                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5502                 </links>
5503         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5504             <actions>
5505                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5506                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5507                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5508                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5509             </actions>
5510         </permacrud>
5511         </class>
5512         <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">
5513                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5514                         <field name="id" reporter:datatype="id" />
5515                         <field name="from_org" reporter:datatype="org_unit"/>
5516                         <field name="to_org" reporter:datatype="org_unit"/>
5517                         <field name="prox" reporter:datatype="int" />
5518                 </fields>
5519                 <links>
5520                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5521                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5522                 </links>
5523         </class>
5524         <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">
5525                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5526                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5527                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5528                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5529                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5530                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5531                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5532                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5533                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5534                 </fields>
5535                 <links/>
5536         </class>
5537         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5538                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5539                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5540                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5541                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5542                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5543                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5544                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5545                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5546                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5547                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5548                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5549                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5550                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5551                 </fields>
5552                 <links>
5553                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5554                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5555                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5556                 </links>
5557         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5558             <actions>
5559                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5560                 <retrieve/>
5561                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5562                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5563             </actions>
5564         </permacrud>
5565         </class>
5566         <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">
5567                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5568                         <field name="address_type"  reporter:datatype="text"/>
5569                         <field name="city"  reporter:datatype="text"/>
5570                         <field name="country"  reporter:datatype="text"/>
5571                         <field name="county"  reporter:datatype="text"/>
5572                         <field name="id" reporter:datatype="id" />
5573                         <field name="org_unit" reporter:datatype="org_unit"/>
5574                         <field name="post_code"  reporter:datatype="text"/>
5575                         <field name="state"  reporter:datatype="text"/>
5576                         <field name="street1"  reporter:datatype="text"/>
5577                         <field name="street2"  reporter:datatype="text"/>
5578                         <field name="valid" reporter:datatype="bool"/>
5579                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5580                 </fields>
5581                 <links>
5582                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5583                 </links>
5584         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5585             <actions>
5586                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5587                 <retrieve/>
5588                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5589                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5590             </actions>
5591         </permacrud>
5592         </class>
5593         <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">
5594                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5595                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5596                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5597                         <field name="query_text" reporter:datatype="text"/>
5598                 </fields>
5599         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5600             <actions>
5601                 <retrieve/>
5602             </actions>
5603         </permacrud>
5604         </class>
5605
5606         <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">
5607                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5608                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5609                         <field name="owner" reporter:datatype="org_unit"/>
5610                         <field name="code" reporter:datatype="text"/>
5611                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5612                         <field name="create_date" reporter:datatype="timestamp"/>
5613                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5614                 </fields>
5615                 <links>
5616                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5617                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5618                 </links>
5619         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5620             <actions>
5621                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5622                 <retrieve/>
5623                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5624                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5625             </actions>
5626         </permacrud>
5627         </class>
5628         <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">
5629                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5630                         <field name="id" reporter:datatype="id"/>
5631                         <field name="grp" reporter:datatype="link"/>
5632                         <field name="pos" reporter:datatype="int"/>
5633                         <field name="query" reporter:datatype="link"/>
5634                 </fields>
5635                 <links>
5636                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5637                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5638                 </links>
5639         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5640             <actions>
5641                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5642                     <context link="grp" field="owner"/>
5643                 </create>
5644                 <retrieve/>
5645                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5646                     <context link="grp" field="owner"/>
5647                 </update>
5648                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5649                     <context link="grp" field="owner"/>
5650                 </delete>
5651             </actions>
5652         </permacrud>
5653         </class>
5654
5655         <!-- A note: Please update alhr and ahopl when updating ahr -->
5656         <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">
5657                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5658                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5659                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5660                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5661                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5662                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5663                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5664                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5665                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5666                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5667                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5668                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5669                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5670                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5671                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5672                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5673                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5674                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5675                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5676                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5677                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5678                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5679                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5680                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5681                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5682                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5683                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5684                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5685                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5686                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5687                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5688                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5689                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5690                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5691                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5692                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5693                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5694                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5695                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5696                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5697                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5698                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5699                 </fields>
5700                 <links>
5701                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5702                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5703                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5704                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5705                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5706                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5707                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5708                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5709                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5710                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5711                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5712                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5713                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5714                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5715                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5716                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5717                 </links>
5718                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5719                         <actions>
5720                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5721                         </actions>
5722                 </permacrud>
5723         </class>
5724         <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">
5725                 <oils_persist:source_definition><![CDATA[
5726                 SELECT
5727                         ahr.*,
5728                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
5729                                 copy_location_order_position,
5730                         CASE WHEN au.alias IS NOT NULL THEN
5731                                 au.alias
5732                         ELSE
5733                                 au.first_given_name
5734                         END AS usr_alias_or_first_given_name,
5735                         au.first_given_name AS usr_first_given_name,
5736                         au.second_given_name AS usr_second_given_name,
5737                         au.family_name AS usr_family_name,
5738                         au.prefix AS usr_prefix,
5739                         au.suffix AS usr_suffix,
5740                         au.alias AS usr_alias,
5741                         CASE WHEN au.alias IS NOT NULL THEN
5742                                 au.alias
5743                         ELSE
5744                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5745                                         COALESCE(au.family_name, ''),
5746                                         COALESCE(au.suffix, ''),
5747                                         ', ',
5748                                         COALESCE(au.prefix, ''),
5749                                         COALESCE(au.first_given_name, ''),
5750                                         COALESCE(au.second_given_name, '')
5751                                 ], ' '), E'\\s+,', ',')
5752                         END AS usr_alias_or_display_name,
5753                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
5754                                 COALESCE(au.family_name, ''),
5755                                 COALESCE(au.suffix, ''),
5756                                 ', ',
5757                                 COALESCE(au.prefix, ''),
5758                                 COALESCE(au.first_given_name, ''),
5759                                 COALESCE(au.second_given_name, '')
5760                         ], ' '), E'\\s+,', ',') AS usr_display_name,
5761                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
5762                                 AS call_number_label,
5763                         siss.label AS issuance_label,
5764                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
5765                         ahcm_1.copy_count AS potential_copies
5766                 FROM action.hold_request ahr
5767                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
5768                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
5769                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
5770                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
5771                 JOIN actor.usr au ON (au.id = ahr.usr)
5772                 JOIN (
5773                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
5774                         FROM asset.copy_location
5775                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
5776                 LEFT JOIN actor.usr_standing_penalty ausp 
5777                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
5778                 LEFT JOIN config.standing_penalty csp
5779                         ON (
5780                                 csp.id = ausp.standing_penalty AND 
5781                                 csp.block_list LIKE '%CAPTURE%' AND (
5782                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
5783                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
5784                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
5785                                         )
5786                                 )
5787                         )
5788                 JOIN (
5789                         SELECT COUNT(target_copy) AS copy_count, hold
5790                         FROM action.hold_copy_map
5791                         GROUP BY 2
5792                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
5793                 LEFT JOIN serial.issuance siss
5794                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
5795                 LEFT JOIN asset.copy_location_order acplo
5796                         ON (acp.location = acplo.location AND
5797                                 acp.circ_lib = acplo.org)
5798                 WHERE
5799                         ahr.capture_time IS NULL AND
5800                         ahr.cancel_time IS NULL AND
5801                         csp.id IS NULL AND
5802                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
5803                         acp.status IN (0,7)
5804                 ]]></oils_persist:source_definition>
5805                 <fields oils_persist:primary="id">
5806                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5807                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5808                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5809                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5810                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5811                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5812                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5813                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5814                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5815                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5816                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5817                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5818                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5819                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
5820                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
5821                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5822                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5823                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5824                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5825                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5826                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5827                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5828                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5829                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5830                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5831                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5832                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5833                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5834                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5835                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5836                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5837                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5838                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5839                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5840                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5841                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5842                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5843                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5844                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5845                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5846                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
5847                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
5848                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
5849                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
5850                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
5851                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
5852                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
5853                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
5854                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
5855                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
5856                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
5857                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
5858                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
5859                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
5860                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5861                 </fields>
5862                 <links>
5863                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5864                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5865                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5866                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5867                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5868                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5869                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5870                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5871                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5872                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5873                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5874                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5875                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5876                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5877                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5878                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
5879                 </links>
5880                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5881                         <actions>
5882                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
5883                         </actions>
5884                 </permacrud>
5885         </class>
5886         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
5887                 <oils_persist:source_definition>
5888                         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)
5889                 </oils_persist:source_definition>
5890                 <fields oils_persist:primary="id">
5891                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5892                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
5893                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5894                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5895                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5896                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5897                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5898                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5899                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5900                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5901                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5902                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5903                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
5904                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5905                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5906                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5907                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5908                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
5909                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5910                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5911                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5912                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
5913                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
5914                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
5915                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
5916                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
5917                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
5918                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
5919                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
5920                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
5921                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
5922                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
5923                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
5924                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
5925                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
5926                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
5927                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
5928                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
5929                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
5930                 </fields>
5931                 <links>
5932                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
5933                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
5934                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5935                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
5936                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
5937                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
5938                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
5939                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
5940                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
5941                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
5942                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
5943                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
5944                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
5945                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
5946                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
5947                 </links>
5948         </class>
5949
5950         <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">
5951                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
5952                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5953                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
5954                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5955                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
5956                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
5957                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
5958                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
5959                 </fields>
5960                 <links>
5961                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5962                 </links>
5963                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5964                         <actions>
5965                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
5966                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
5967                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
5968                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
5969                         </actions>
5970                 </permacrud>
5971         </class>
5972         <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">
5973                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
5974                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
5975                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
5976                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
5977                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
5978                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
5979                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
5980                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
5981                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
5982                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
5983                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
5984                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
5985                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
5986                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
5987                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
5988                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
5989                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
5990                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
5991                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
5992                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
5993                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
5994                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
5995                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
5996                         <field reporter:label="Item Selection Depth" name="selection_depth" />
5997                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
5998                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
5999                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6000                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6001                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6002                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6003                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6004                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6005                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6006                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6007                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6008                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6009                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6010                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6011                 </fields>
6012                 <links>
6013                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6014                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6015                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6016                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6017                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6018                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6019                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6020                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6021                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6022                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6023                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6024                 </links>
6025                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6026                         <actions>
6027                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6028                         </actions>
6029                 </permacrud>
6030         </class>
6031         <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">
6032                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6033                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6034                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6035                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6036                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6037                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6038                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6039                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6040                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6041                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6042                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6043                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6044                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6045                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6046                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6047                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6048                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6049                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6050                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6051                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6052                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6053                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6054                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6055                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6056                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6057                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6058                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6059                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6060                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6061                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6062                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6063                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6064                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6065                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6066                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6067                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6068                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6069                 </fields>
6070                 <links>
6071                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6072                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6073                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6074                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6075                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6076                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6077                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6078                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6079                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6080                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6081                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6082                 </links>
6083                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6084                         <actions>
6085                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6086                         </actions>
6087                 </permacrud>
6088         </class>
6089
6090         <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">
6091                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6092                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6093                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6094                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6095                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6096                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6097                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6098                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6099                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
6100                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6101                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6102                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6103                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6104                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6105                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
6106                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6107                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6108                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6109                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6110                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6111                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6112                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6113                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6114                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6115                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6116                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6117                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6118                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6119                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6120                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6121                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6122                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6123                 </fields>
6124                 <links>
6125                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6126                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6127                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6128                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6129                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6130                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6131                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6132                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6133                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6134                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6135                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6136                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6137                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6138                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6139                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6140                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6141                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6142                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6143                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6144                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6145                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6146                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6147                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6148                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6149                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6150                 </links>
6151         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6152             <actions>
6153                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6154                 <retrieve />
6155                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6156                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6157             </actions>
6158         </permacrud>
6159         </class>
6160         <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">
6161                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6162                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6163                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6164                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6165                 </fields>
6166                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6167                         <actions>
6168                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6169                                 <retrieve/>
6170                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6171                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6172                         </actions>
6173                 </permacrud>
6174         </class>
6175         <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">
6176                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6177                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6178                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6179                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6180                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6181                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6182                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6183                 </fields>
6184                 <links>
6185                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6186                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6187                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6188                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6189                 </links>
6190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6191                         <actions>
6192                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6193                                 <retrieve/>
6194                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6195                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6196                         </actions>
6197                 </permacrud>
6198         </class>
6199         <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">
6200                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6201                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6202                         <field name="btype" reporter:datatype="text"/>
6203                         <field name="id" reporter:datatype="id" />
6204                         <field name="name"  reporter:datatype="text"/>
6205                         <field name="description" reporter:datatype="text"/>
6206                         <field name="owner" reporter:datatype="link"/>
6207                         <field name="pub" reporter:datatype="bool"/>
6208                         <field name="create_time" reporter:datatype="timestamp" />
6209                 </fields>
6210                 <links>
6211                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6212                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6213                 </links>
6214         </class>
6215         <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">
6216                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6217                         <field name="id" reporter:datatype="id" />
6218                         <field name="bucket" reporter:datatype="link"/>
6219                         <field name="note" reporter:datatype="text" />
6220                 </fields>
6221                 <links>
6222                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6223                 </links>
6224         </class>
6225         <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">
6226                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6227                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6228                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6229                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6230                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6231                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6232                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6233                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6234                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6235                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6236                 </fields>
6237                 <links>
6238                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6239                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6240                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6241                 </links>
6242                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6243                         <actions>
6244                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6245                         </actions>
6246                 </permacrud>
6247         </class>
6248         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6249                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6250                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6251                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6252                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6253                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6254                 </fields>
6255                 <links>
6256                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6257                 </links>
6258                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6259                         <actions>
6260                                 <retrieve permission="VIEW_USER">
6261                                         <context link="usr" field="home_ou" />
6262                                 </retrieve>
6263                         </actions>
6264                 </permacrud>
6265         </class>
6266     <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">
6267         <fields oils_persist:primary="field">
6268             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6269             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6270             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6271         </fields>
6272         <links/>
6273         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6274             <actions>
6275                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6276                 <retrieve />
6277                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6278                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6279             </actions>
6280         </permacrud>
6281     </class>
6282         <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">
6283                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6284                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6285                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6286                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6287                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6288                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6289                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6290                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6291                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6292                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6293                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6294                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6295                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6296                 </fields>
6297                 <links>
6298                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6299                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6300                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6301                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6302                 </links>
6303         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6304             <actions>
6305                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6306                 <retrieve />
6307                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6308                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6309             </actions>
6310         </permacrud>
6311         </class>
6312         <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">
6313                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6314                         <field name="field" reporter:datatype="link"/>
6315                         <field name="id" reporter:datatype="id" />
6316                         <field name="source" reporter:datatype="link"/>
6317                         <field name="value"  reporter:datatype="text"/>
6318                 </fields>
6319                 <links>
6320                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6321                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6322                 </links>
6323         </class>
6324         <class id="cub" controller="open-ils.cstore" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6325                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6326                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6327                         <field name="btype" reporter:datatype="text"/>
6328                         <field name="id" reporter:datatype="id" />
6329                         <field name="name"  reporter:datatype="text"/>
6330                         <field name="description" reporter:datatype="text"/>
6331                         <field name="owner" reporter:datatype="link"/>
6332                         <field name="pub" reporter:datatype="bool"/>
6333                         <field name="create_time" reporter:datatype="timestamp" />
6334                 </fields>
6335                 <links>
6336                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6337                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6338                 </links>
6339         </class>
6340         <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">
6341                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6342                         <field name="id" reporter:datatype="id" />
6343                         <field name="bucket" reporter:datatype="link"/>
6344                         <field name="note" reporter:datatype="text" />
6345                 </fields>
6346                 <links>
6347                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6348                 </links>
6349         </class>
6350         <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">
6351                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6352                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6353                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6354                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6355                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6356                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6357                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6358                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6359                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6360                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6361                 </fields>
6362                 <links>
6363                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6364                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6365                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6366                 </links>
6367         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6368             <actions>
6369                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6370                     <context link="xact" jump="usr" field="home_ou"/>
6371                 </retrieve>
6372                         </actions>
6373                 </permacrud>
6374         </class>
6375         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6376                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6377                         <field name="id" reporter:datatype="id" />
6378                         <field name="ind1" />
6379                         <field name="ind2" />
6380                         <field name="record" />
6381                         <field name="subfield" />
6382                         <field name="tag" />
6383                         <field name="value" />
6384                 </fields>
6385                 <links>
6386                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6387                 </links>
6388         </class>
6389         <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">
6390                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6391                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6392                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6393                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6394                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6395                 </fields>
6396                 <links>
6397                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6398                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6399                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6400                 </links>
6401         </class>
6402         <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">
6403                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6404                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6405                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6406                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6407                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6408                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6409                 </fields>
6410                 <links>
6411                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6412                 </links>
6413         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6414             <actions>
6415                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6416                 <retrieve/>
6417                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6418                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6419             </actions>
6420         </permacrud>
6421
6422         </class>
6423         <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">
6424                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6425                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6426                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6427                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6428                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6429                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6430                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6431                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6432                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6433                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6434                 </fields>
6435                 <links>
6436                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6437                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6438                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6439                 </links>
6440         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6441             <actions>
6442                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6443                 <retrieve/>
6444                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6445                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6446             </actions>
6447         </permacrud>
6448         </class>
6449         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6450                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6451                         <field name="create_date" reporter:datatype="timestamp"/>
6452                         <field name="creator" reporter:datatype="link"/>
6453                         <field name="edit_date" reporter:datatype="timestamp"/>
6454                         <field name="editor" reporter:datatype="link"/>
6455                         <field name="id" reporter:datatype="id" />
6456                         <field name="pub" reporter:datatype="bool"/>
6457                         <field name="record" reporter:datatype="link"/>
6458                         <field name="value"  reporter:datatype="text"/>
6459                 </fields>
6460                 <links>
6461                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6462                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6463                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6464                 </links>
6465         </class>
6466         <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">
6467                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6468                         <field name="balance_owed" reporter:datatype="money" />
6469                         <field name="total_owed" reporter:datatype="money" />
6470                         <field name="total_paid" reporter:datatype="money" />
6471                         <field name="usr" reporter:datatype="link"/>
6472                 </fields>
6473                 <links>
6474                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6475                 </links>
6476         </class>
6477         <class id="mg" controller="open-ils.cstore" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6478                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6479                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6480                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6481                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6482                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6483                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6484                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6485                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6486                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6487                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6488                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6489                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6490                 </fields>
6491                 <links>
6492                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6493                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6494                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6495                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6496                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6497                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6498                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6499                 </links>
6500         </class>
6501         <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">
6502                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6503                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6504                         <field name="quality" reporter:datatype="int" />
6505                         <field name="source" reporter:datatype="text"/>
6506                         <field name="transcendant" reporter:datatype="bool"/>
6507                         <field name="can_have_copies" reporter:datatype="bool"/>
6508                 </fields>
6509                 <links/>
6510         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6511             <actions>
6512                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6513                 <retrieve/>
6514                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6515                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6516             </actions>
6517         </permacrud>
6518         </class>
6519         <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">
6520                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6521                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6522                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6523                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6524                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6525                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6526                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6527                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6528                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6529                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6530                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6531                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6532                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6533                 </fields>
6534                 <links>
6535                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6536                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6537                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6538                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6539                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6540                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6541                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6542                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6543                 </links>
6544                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6545                         <actions>
6546                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6547                                         <context link="usr" field="home_ou" />
6548                                 </retrieve>
6549                         </actions>
6550                 </permacrud>
6551         </class>
6552         <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">
6553                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6554                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6555                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6556                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6557                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6558                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6559                 </fields>
6560                 <links>
6561                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6562                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6563                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6564                 </links>
6565         </class>
6566         <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">
6567                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6568                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6569                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6570                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6571                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6572                 </fields>
6573                 <links>
6574                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6575                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6576                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6577                 </links>
6578         </class>
6579         <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">
6580                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6581                         <field name="bucket" reporter:datatype="link"/>
6582                         <field name="id" reporter:datatype="id" />
6583                         <field name="target_user" reporter:datatype="link"/>
6584                         <field name="create_time" reporter:datatype="timestamp" />
6585                         <field name="pos" reporter:datatype="int" />
6586                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6587                 </fields>
6588                 <links>
6589                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6590                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6591             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6592                 </links>
6593         </class>
6594         <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">
6595                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6596                         <field name="id" reporter:datatype="id" />
6597                         <field name="item" reporter:datatype="link"/>
6598                         <field name="note" reporter:datatype="text" />
6599                 </fields>
6600                 <links>
6601                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6602                 </links>
6603         </class>
6604         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6605                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6606                         <field name="balance_owed" reporter:datatype="money" />
6607                         <field name="total_owed" reporter:datatype="money" />
6608                         <field name="total_paid" reporter:datatype="money" />
6609                         <field name="usr" reporter:datatype="link"/>
6610                 </fields>
6611                 <links>
6612                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6613                 </links>
6614         </class>
6615         <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">
6616                 <fields oils_persist:primary="code" oils_persist:sequence="">
6617                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6618                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6619                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
6620                 </fields>
6621                 <links/>
6622         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6623             <actions>
6624                 <create permission="CREATE_MARC_CODE" global_required="true"/>
6625                 <retrieve/>
6626                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
6627                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
6628             </actions>
6629         </permacrud>
6630         </class>
6631         <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">
6632                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6633                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6634                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6635                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6636                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6637                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6638                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6639                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6640                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6641                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6642                 </fields>
6643                 <links>
6644                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6645                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6646                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6647                 </links>
6648         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6649             <actions>
6650                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6651                     <context link="xact" jump="usr" field="home_ou"/>
6652                 </retrieve>
6653                         </actions>
6654                 </permacrud>
6655         </class>
6656         <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">
6657                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6658                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6659                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6660                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6661                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6662                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6663                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6664                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
6665                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6666                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6667                 </fields>
6668                 <links>
6669                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6670                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6671                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6672                 </links>
6673         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6674             <actions>
6675                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6676                     <context link="xact" jump="usr" field="home_ou"/>
6677                 </retrieve>
6678                         </actions>
6679                 </permacrud>
6680         </class>
6681         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
6682                 <fields oils_persist:primary="id" oils_persist:sequence="">
6683                         <field name="checkin_lib" reporter:datatype="link"/>
6684                         <field name="checkin_staff" reporter:datatype="link"/>
6685                         <field name="checkin_time" reporter:datatype="timestamp"/>
6686                         <field name="circ_lib"  reporter:datatype="org_unit"/>
6687                         <field name="circ_staff" reporter:datatype="link"/>
6688                         <field name="desk_renewal" reporter:datatype="bool"/>
6689                         <field name="due_date" reporter:datatype="timestamp"/>
6690                         <field name="duration" reporter:datatype="interval"/>
6691                         <field name="duration_rule" reporter:datatype="link"/>
6692                         <field name="fine_interval" reporter:datatype="interval"/>
6693                         <field name="id" reporter:datatype="id" />
6694                         <field name="max_fine" reporter:datatype="money" />
6695                         <field name="max_fine_rule" reporter:datatype="link"/>
6696                         <field name="opac_renewal" reporter:datatype="bool"/>
6697                         <field name="phone_renewal" reporter:datatype="bool"/>
6698                         <field name="recurring_fine" reporter:datatype="money" />
6699                         <field name="recurring_fine_rule" reporter:datatype="link"/>
6700                         <field name="renewal_remaining" reporter:datatype="int" />
6701             <field name="grace_period" reporter:datatype="interval" />
6702                         <field name="stop_fines" reporter:datatype="text"/>
6703                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
6704                         <field name="target_copy" reporter:datatype="link"/>
6705                         <field name="usr" reporter:datatype="link"/>
6706                         <field name="xact_finish" reporter:datatype="timestamp" />
6707                         <field name="xact_start" reporter:datatype="timestamp" />
6708                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6709                 </fields>
6710                 <links>
6711                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6712                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
6713                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
6714                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
6715                 </links>
6716         </class>
6717         <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">
6718                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
6719                         <field name="field" reporter:datatype="link"/>
6720                         <field name="id" reporter:datatype="id" />
6721                         <field name="source" reporter:datatype="link"/>
6722                         <field name="value" reporter:datatype="text"/>
6723                 </fields>
6724                 <links>
6725                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6726                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6727                 </links>
6728         </class>
6729         <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">
6730                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
6731                         <field name="high" reporter:datatype="money" />
6732                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
6733                         <field name="low" reporter:datatype="money" />
6734                         <field name="name" reporter:datatype="text"/>
6735                         <field name="normal" reporter:datatype="money" />
6736                         <field name="recurrence_interval" reporter:datatype="interval"/>
6737             <field name="grace_period" reporter:datatype="interval" />
6738                 </fields>
6739                 <links/>
6740         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6741             <actions>
6742                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6743                 <retrieve/>
6744                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6745                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
6746             </actions>
6747         </permacrud>
6748         </class>
6749         <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">
6750                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6751                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6752                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6753                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6754                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
6755                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
6756                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
6757                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
6758                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6759                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
6760                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6761                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
6762                 </fields>
6763                 <links>
6764                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6765                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6766                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
6767                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6768                 </links>
6769         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6770             <actions>
6771                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6772                     <context link="xact" jump="usr" field="home_ou"/>
6773                 </retrieve>
6774                         </actions>
6775                 </permacrud>
6776         </class>
6777         <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">
6778                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
6779                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
6780                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6781                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6782                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
6783                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
6784                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
6785                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
6786                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
6787                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
6788                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
6789                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
6790                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
6791                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
6792                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
6793                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
6794                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
6795                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
6796                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
6797                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
6798                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
6799                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6800                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
6801                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
6802                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6803                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
6804                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
6805                         <field reporter:label="Price" name="price" reporter:datatype="money" />
6806                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
6807                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
6808                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
6809                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
6810                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6811                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
6812                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
6813                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6814                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6815                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6816                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6817                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
6818                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
6819                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
6820                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6821                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
6822                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
6823                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
6824                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
6825                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
6826                 </fields>
6827                 <links>
6828                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
6829                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
6830                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6831                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6832                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6833                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6834                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6835                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
6836                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
6837                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
6838                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
6839                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
6840                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
6841                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
6842                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
6843                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
6844                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6845                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
6846                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
6847                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
6848                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
6849                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6850                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
6851                 </links>
6852         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6853             <actions>
6854                 <create permission="CREATE_COPY">
6855                     <context link="call_number" field="owning_lib"/>
6856                 </create>
6857                 <retrieve/>
6858                 <update permission="UPDATE_COPY">
6859                     <context link="call_number" field="owning_lib"/>
6860                 </update>
6861                 <delete permission="DELETE_COPY">
6862                     <context link="call_number" field="owning_lib"/>
6863                 </delete>
6864             </actions>
6865         </permacrud>
6866         </class>
6867
6868         <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">
6869                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
6870                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
6871                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
6872                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
6873                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
6874                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
6875                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
6876                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
6877                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
6878                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
6879                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
6880                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
6881                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
6882                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="int"/>
6883                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
6884                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
6885                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
6886                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
6887                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
6888                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
6889                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
6890                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="text"/>
6891                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
6892                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
6893                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
6894                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
6895                 </fields>
6896                 <links>
6897                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6898                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6899                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6900                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
6901                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
6902                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
6903                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
6904                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
6905                 </links>
6906                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6907                         <actions>
6908                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6909                                 <retrieve />
6910                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6911                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
6912                         </actions>
6913                 </permacrud>
6914         </class>
6915
6916         <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">
6917                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
6918                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
6919                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6920                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6921                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
6922                 </fields>
6923                 <links/>
6924         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6925             <actions>
6926                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6927                 <retrieve/>
6928                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6929                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
6930             </actions>
6931         </permacrud>
6932         </class>
6933         <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">
6934                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
6935                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
6936                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6937                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
6938                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
6939                 </fields>
6940                 <links/>
6941         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6942             <actions>
6943                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6944                 <retrieve/>
6945                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6946                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
6947             </actions>
6948         </permacrud>
6949         </class>
6950         <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">
6951                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
6952                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6953                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6954                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6955                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6956                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
6957                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
6958                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
6959                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
6960                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
6961                 </fields>
6962                 <links>
6963                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
6964                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
6965                 </links>
6966         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6967             <actions>
6968                 <create permission="CREATE_PERM" global_required="true"/>
6969                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6970                 <update permission="UPDATE_PERM" global_required="true"/>
6971                 <delete permission="DELETE_PERM" global_required="true"/>
6972             </actions>
6973         </permacrud>
6974         </class>
6975         <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">
6976                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
6977                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
6978                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
6979                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
6980                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
6981                 </fields>
6982                 <links>
6983                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
6984                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
6985                 </links>
6986         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6987             <actions>
6988                 <create permission="ADMIN_SURVEY">
6989                     <context link="question" jump="survey" field="owner"/>
6990                 </create>
6991                 <retrieve/>
6992                 <update permission="ADMIN_SURVEY">
6993                     <context link="question" jump="survey" field="owner"/>
6994                 </update>
6995                 <delete permission="ADMIN_SURVEY">
6996                     <context link="question" jump="survey" field="owner"/>
6997                 </delete>
6998             </actions>
6999         </permacrud>
7000         </class>
7001         <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">
7002                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7003                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7004                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7005                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7006                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7007                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7008                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7009                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7010                 </fields>
7011                 <links>
7012                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7013                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7014                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7015                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7016                 </links>
7017                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7018                         <actions>
7019                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7020                         </actions>
7021                 </permacrud>
7022         </class>
7023         <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">
7024                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7025                         <field name="balance_owed" reporter:datatype="money" />
7026                         <field name="total_owed" reporter:datatype="money" />
7027                         <field name="total_paid" reporter:datatype="money" />
7028                         <field name="usr" reporter:datatype="link"/>
7029                 </fields>
7030                 <links>
7031                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7032                 </links>
7033         </class>
7034         <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">
7035                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7036                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7037                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7038                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7039                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7040                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7041                 </fields>
7042                 <links>
7043                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7044                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7045                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7046                 </links>
7047         </class>
7048         <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">
7049                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7050                         <field name="field" reporter:datatype="link"/>
7051                         <field name="id" reporter:datatype="id" />
7052                         <field name="source" reporter:datatype="link"/>
7053                         <field name="value" reporter:datatype="text"/>
7054                 </fields>
7055                 <links>
7056                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7057                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7058                 </links>
7059         </class>
7060         <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">
7061                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7062                         <field name="field" reporter:datatype="link"/>
7063                         <field name="id" reporter:datatype="id" />
7064                         <field name="source" reporter:datatype="link"/>
7065                         <field name="value" reporter:datatype="text"/>
7066                 </fields>
7067                 <links>
7068                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7069                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7070                 </links>
7071         </class>
7072         <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">
7073                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7074                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7075                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7076                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7077                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7078                 </fields>
7079                 <links>
7080                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7081                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7082                 </links>
7083         </class>
7084         <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">
7085                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7086                         <field name="depth" reporter:datatype="int" />
7087                         <field name="grantable" reporter:datatype="bool"/>
7088                         <field name="grp" reporter:datatype="link"/>
7089                         <field name="id" reporter:datatype="id" />
7090                         <field name="perm" reporter:datatype="link"/>
7091                 </fields>
7092                 <links>
7093                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7094                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7095                 </links>
7096         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7097             <actions>
7098                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7099                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7100                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7101                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7102             </actions>
7103         </permacrud>
7104         </class>
7105         <class id="ccb" controller="open-ils.cstore" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
7106                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7107                         <field name="items" oils_persist:virtual="true" />
7108                         <field name="btype" reporter:datatype="text"/>
7109                         <field name="id" reporter:datatype="id" />
7110                         <field name="name" reporter:datatype="text"/>
7111                         <field name="description" reporter:datatype="text"/>
7112                         <field name="owner" reporter:datatype="link"/>
7113                         <field name="pub" reporter:datatype="bool"/>
7114                         <field name="create_time" reporter:datatype="timestamp" />
7115                 </fields>
7116                 <links>
7117                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7118                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
7119                 </links>
7120         </class>
7121         <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">
7122                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
7123                         <field name="id" reporter:datatype="id" />
7124                         <field name="bucket" reporter:datatype="link"/>
7125                         <field name="note" reporter:datatype="text" />
7126                 </fields>
7127                 <links>
7128                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
7129                 </links>
7130         </class>
7131         <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">
7132                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
7133                         <field name="id" reporter:datatype="int" />
7134                         <field name="usr" reporter:datatype="link"/>
7135                         <field name="work_ou" reporter:datatype="link"/>
7136                 </fields>
7137                 <links>
7138                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7139                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
7140                 </links>
7141         </class>
7142         <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">
7143                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
7144                         <field name="depth" reporter:datatype="int"/>
7145                         <field name="grantable" reporter:datatype="bool"/>
7146                         <field name="id" reporter:datatype="id" />
7147                         <field name="perm" reporter:datatype="link"/>
7148                         <field name="usr" reporter:datatype="link"/>
7149                 </fields>
7150                 <links>
7151                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7152                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7153                 </links>
7154         </class>
7155         <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">
7156                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
7157                         <field name="object_id" reporter:datatype="text"/>
7158                         <field name="grantable" reporter:datatype="bool"/>
7159                         <field name="id" reporter:datatype="id" />
7160                         <field name="perm" reporter:datatype="link"/>
7161                         <field name="usr" reporter:datatype="link"/>
7162                         <field name="object_type" reporter:datatype="text"/>
7163                 </fields>
7164                 <links>
7165                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7166                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7167                 </links>
7168         </class>
7169         <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">
7170                 <fields oils_persist:primary="id" oils_persist:sequence="">
7171                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7172                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7173                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7174                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7175                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7176                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7177                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7178                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7179                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7180                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7181                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7182                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7183                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7184                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7185                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7186                 </fields>
7187                 <links>
7188                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7189                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7190                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7191                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7192                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7193                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7194                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7195                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7196                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7197                 </links>
7198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7199             <actions>
7200                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7201                     <context link="xact" jump="usr" field="home_ou"/>
7202                 </retrieve>
7203                         </actions>
7204                 </permacrud>
7205         </class>
7206         <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">
7207                 <fields oils_persist:primary="id" oils_persist:sequence="">
7208                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7209                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7210                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7211                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7212                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7213                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7214                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7215                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7216                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7217                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7218                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7219                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7220                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7221                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7222                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7223                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7224                 </fields>
7225                 <links>
7226                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7227                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7228                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7229                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7230                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7231                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7232                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7233                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7234                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7235                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7236                 </links>
7237         </class>
7238         <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">
7239                 <fields oils_persist:primary="id" oils_persist:sequence="">
7240                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7241                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7242                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7243                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7244                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7245                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7246                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7247                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7248                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7249                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7250                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7251                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7252                 </fields>
7253                 <links>
7254                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7255                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7256                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7257                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7258                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7259                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7260                 </links>
7261         </class>
7262         <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">
7263                 <fields oils_persist:primary="id" oils_persist:sequence="">
7264                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7265                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7266                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7267                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7268                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7269                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7270                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7271                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
7272                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7273                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7274                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7275                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7276                 </fields>
7277                 <links>
7278                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7279                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7280                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7281                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7282                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7283                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7284                 </links>
7285         </class>
7286         <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">
7287                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7288                         <field name="bucket" reporter:datatype="link"/>
7289                         <field name="id" reporter:datatype="id" />
7290                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7291                         <field name="create_time" reporter:datatype="timestamp" />
7292                         <field name="pos" reporter:datatype="int" />
7293                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7294                 </fields>
7295                 <links>
7296                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7297                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7298             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7299                 </links>
7300         </class>
7301         <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">
7302                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7303                         <field name="id" reporter:datatype="id" />
7304                         <field name="item" reporter:datatype="link"/>
7305                         <field name="note" reporter:datatype="text" />
7306                 </fields>
7307                 <links>
7308                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7309                 </links>
7310         </class>
7311         <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">
7312                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7313                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7314                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7315                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7316                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7317                 </fields>
7318                 <links>
7319                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7320                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7321                 </links>
7322                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7323                         <actions>
7324                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7325                         </actions>
7326                 </permacrud>
7327         </class>
7328     <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">
7329         <fields oils_persist:primary="field">
7330             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7331             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7332             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7333         </fields>
7334         <links/>
7335         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7336             <actions>
7337                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7338                 <retrieve />
7339                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7340                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7341             </actions>
7342         </permacrud>
7343     </class>
7344         <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">
7345                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7346                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7347                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7348                 </fields>
7349                 <links/>
7350         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7351             <actions>
7352                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7353                 <retrieve/>
7354                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7355                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7356             </actions>
7357         </permacrud>
7358         </class>
7359
7360
7361         <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">
7362                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7363                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7364                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7365                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7366                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7367                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7368                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7369                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7370                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7371                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7372                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7373                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7374                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7375                 </fields>
7376                 <links>
7377                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7378                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7379                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7380                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7381                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7382                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7383                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7384                 </links>
7385         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7386             <actions>
7387                 <create permission="TRANSIT_COPY">
7388                     <context link="target_copy" field="owner"/>
7389                 </create>
7390                 <retrieve/>
7391                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7392                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7393             </actions>
7394         </permacrud>
7395         </class>
7396         <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">
7397                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7398                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7399                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7400                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7401                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7402                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7403                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7404                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7405                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7406                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7407                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7408                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7409                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7410                 </fields>
7411                 <links>
7412                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7413                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7414                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7415                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7416                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7417                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7418                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7419                 </links>
7420         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7421             <actions>
7422                 <create permission="TRANSIT_COPY" context_field="owner">
7423                     <context link="target_copy" field="circ_lib"/>
7424                 </create>
7425                 <retrieve/>
7426                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7427                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7428             </actions>
7429         </permacrud>
7430         </class>
7431         <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">
7432                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7433                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7434                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7435                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7436                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7437                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7438                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7439                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7440                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7441                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7442                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7443                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
7444                 </fields>
7445                 <links>
7446                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7447                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7448                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7449                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
7450                 </links>
7451         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7452             <actions>
7453                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7454                     <context link="xact" jump="usr" field="home_ou"/>
7455                 </retrieve>
7456                         </actions>
7457                 </permacrud>
7458         </class>
7459         <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">
7460                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7461                         <field name="grp" />
7462                         <field name="id" reporter:datatype="id" />
7463                         <field name="usr" />
7464                 </fields>
7465                 <links>
7466                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7467                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7468                 </links>
7469         </class>
7470         <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">
7471                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7472                         <field name="id" reporter:datatype="id" />
7473                         <field name="fq_field" reporter:datatype="text"/>
7474                         <field name="identity_value" reporter:datatype="text"/>
7475                         <field name="translation" reporter:datatype="text"/>
7476                         <field name="string" reporter:datatype="text"/>
7477                 </fields>
7478                 <links>
7479                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7480                 </links>
7481         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7482             <actions>
7483                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7484                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7485                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7486                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7487             </actions>
7488         </permacrud>
7489         </class>
7490         <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">
7491                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7492                         <field name="id" reporter:datatype="id" />
7493                         <field name="fm_class" reporter:datatype="text"/>
7494                         <field name="field" reporter:datatype="text"/>
7495                         <field name="owner" reporter:datatype="org_unit"/>
7496                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7497                 </fields>
7498                 <links>
7499                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7500                 </links>
7501         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7502             <actions>
7503                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7504                 <retrieve/>
7505                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7506                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7507             </actions>
7508         </permacrud>
7509         </class>
7510         <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">
7511                 <fields oils_persist:primary="code">
7512                         <field name="code" reporter:datatype="id" />
7513                         <field name="marc_code" reporter:datatype="text"/>
7514                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7515                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7516                         <field name="rtl" reporter:datatype="bool"/>
7517                 </fields>
7518                 <links/>
7519         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7520             <actions>
7521                 <create permission="CREATE_LOCALE" global_required="true"/>
7522                 <retrieve/>
7523                 <update permission="UPDATE_LOCALE" global_required="true"/>
7524                 <delete permission="DELETE_LOCALE" global_required="true"/>
7525             </actions>
7526         </permacrud>
7527         </class>
7528         <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">
7529                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7530                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7531                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7532                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7533             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7534                 </fields>
7535                 <links>
7536                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7537                 </links>
7538         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7539             <actions>
7540                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7541                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7542                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7543                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7544             </actions>
7545         </permacrud>
7546         </class>
7547
7548         <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">
7549                 <fields oils_persist:primary="id">
7550                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7551                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7552                 </fields>
7553                 <links/>
7554         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7555             <actions>
7556                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7557                 <retrieve/>
7558                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7559                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7560             </actions>
7561         </permacrud>
7562         </class>
7563
7564         <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">
7565                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7566                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7567                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7568                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7569                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7570                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7571                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7572                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7573                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7574                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7575                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7576                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7577                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7578                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7579                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7580                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7581                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7582                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7583                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7584                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7585                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7586                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7587                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7588                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7589                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
7590                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
7591                 </fields>
7592                 <links>
7593                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7594                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
7595                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7596                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
7597                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
7598                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
7599                 </links>
7600         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7601             <actions>
7602                 <create permission="user_request.create">
7603                     <context link="usr" field="home_ou"/>
7604                                 </create>
7605                 <retrieve permission="user_request.view">
7606                     <context link="usr" field="home_ou"/>
7607                                 </retrieve>
7608                 <update permission="user_request.update">
7609                     <context link="usr" field="home_ou"/>
7610                                 </update>
7611                 <delete permission="user_request.delete">
7612                     <context link="usr" field="home_ou"/>
7613                                 </delete>
7614             </actions>
7615         </permacrud>
7616         </class>
7617
7618         <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">
7619                 <fields oils_persist:primary="code">
7620                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
7621                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7622                 </fields>
7623                 <links/>
7624         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7625             <actions>
7626                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7627                 <retrieve/>
7628                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7629                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7630             </actions>
7631         </permacrud>
7632         </class>
7633
7634         <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">
7635                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
7636                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
7637                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
7638                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
7639                         <field reporter:label="Ratio" name="ratio" />
7640                 </fields>
7641                 <links>
7642                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
7643                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
7644                 </links>
7645                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7646                         <actions>
7647                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7648                                 <retrieve/>
7649                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7650                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
7651                         </actions>
7652                 </permacrud>
7653         </class>
7654
7655         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
7656                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
7657                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
7658                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
7659                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
7660                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
7661                         <field reporter:label="Code" name="code" reporter:datatype="text" />
7662                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
7663                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
7664                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
7665                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
7666                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
7667                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
7668                         <field reporter:label="URL" name="url" reporter:datatype="text" />
7669                         <field reporter:label="Email" name="email" reporter:datatype="text" />
7670                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
7671                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
7672                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
7673                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
7674                 </fields>
7675                 <links>
7676                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
7677                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7678             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
7679             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
7680             <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
7681                 </links>
7682         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7683             <actions>
7684                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
7685                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
7686                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
7687                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
7688             </actions>
7689         </permacrud>
7690         </class>
7691
7692         <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">
7693                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
7694                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
7695                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
7696                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
7697                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
7698                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
7699                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
7700                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
7701                 </fields>
7702                 <links>
7703                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7704                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7705                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7706                 </links>
7707         </class>
7708
7709         <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">
7710                 <fields oils_persist:primary="code">
7711                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
7712                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7713                 </fields>
7714                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7715             <actions>
7716                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7717                 <retrieve/>
7718                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7719                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
7720             </actions>
7721                 </permacrud>
7722         </class>
7723
7724         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
7725                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
7726                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
7727                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
7728                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7729                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
7730                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
7731                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
7732                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
7733                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
7734                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
7735                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
7736                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7737                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
7738                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
7739                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
7740                 </fields>
7741                 <links>
7742                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
7743                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7744                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
7745                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
7746                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
7747                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
7748                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
7749                 </links>
7750         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7751             <actions>
7752                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
7753                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
7754                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
7755                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
7756             </actions>
7757         </permacrud>
7758         </class>
7759
7760         <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">
7761                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
7762                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7763                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7764                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7765                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
7766                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
7767                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
7768                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7769                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
7770                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7771                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7772                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7773                 </fields>
7774                 <links>
7775                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7776                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7777                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
7778                 </links>
7779         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7780             <actions>
7781                 <create   permission="ADMIN_INVOICE">
7782                                         <context link="invoice" field="receiver"/>
7783                                 </create>
7784                 <retrieve permission="ADMIN_INVOICE">
7785                                         <context link="invoice" field="receiver"/>
7786                                 </retrieve>
7787                 <update   permission="ADMIN_INVOICE">
7788                                         <context link="invoice" field="receiver"/>
7789                                 </update>
7790                                 <delete   permission="ADMIN_INVOICE">
7791                                         <context link="invoice" field="receiver"/>
7792                                 </delete>
7793             </actions>
7794         </permacrud>
7795         </class>
7796
7797         <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">
7798                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
7799                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7800                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
7801                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
7802                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
7803                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
7804                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
7805                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7806                         <field reporter:label="Note" name="note" reporter:datatype="text" />
7807                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
7808                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
7809                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
7810                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
7811                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
7812                         <field reporter:label="Target" name="target" reporter:datatype="int" />
7813                 </fields>
7814                 <links>
7815                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
7816                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
7817                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
7818                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
7819                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
7820                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
7821                 </links>
7822         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7823             <actions>
7824                 <create   permission="ADMIN_INVOICE">
7825                                         <context link="invoice" field="receiver"/>
7826                                 </create>
7827                 <retrieve permission="ADMIN_INVOICE">
7828                                         <context link="invoice" field="receiver"/>
7829                                 </retrieve>
7830                 <update   permission="ADMIN_INVOICE">
7831                                         <context link="invoice" field="receiver"/>
7832                                 </update>
7833                                 <delete   permission="ADMIN_INVOICE">
7834                                         <context link="invoice" field="receiver"/>
7835                                 </delete>
7836             </actions>
7837         </permacrud>
7838         </class>
7839
7840         <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">
7841                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
7842                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
7843                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7844                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7845                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7846                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7847                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7848                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
7849                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7850                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
7851                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
7852                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
7853                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7854                 </fields>
7855                 <links>
7856                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7857                 </links>
7858         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7859             <actions>
7860                 <create permission="ADMIN_PROVIDER">
7861                     <context link="provider" field="owner"/>
7862                 </create>
7863                 <retrieve permission="ADMIN_PROVIDER">
7864                     <context link="provider" field="owner"/>
7865                 </retrieve>
7866                 <update permission="ADMIN_PROVIDER">
7867                     <context link="provider" field="owner"/>
7868                 </update>
7869                 <delete permission="ADMIN_PROVIDER">
7870                     <context link="provider" field="owner"/>
7871                 </delete>
7872             </actions>
7873         </permacrud>
7874         </class>
7875
7876         <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">
7877                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
7878                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
7879                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
7880                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7881                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
7882                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
7883                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
7884         </fields>
7885                 <links>
7886                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
7887                 </links>
7888         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7889             <actions>
7890                 <create permission="ADMIN_PROVIDER">
7891                     <context link="provider" field="owner"/>
7892                 </create>
7893                 <retrieve permission="ADMIN_PROVIDER">
7894                     <context link="provider" field="owner"/>
7895                 </retrieve>
7896                 <update permission="ADMIN_PROVIDER">
7897                     <context link="provider" field="owner"/>
7898                 </update>
7899                 <delete permission="ADMIN_PROVIDER">
7900                     <context link="provider" field="owner"/>
7901                 </delete>
7902             </actions>
7903         </permacrud>
7904     </class>
7905         <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">
7906                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
7907                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
7908                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
7909                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
7910                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
7911                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
7912                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
7913                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
7914                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
7915                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
7916                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
7917                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
7918                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
7919                 </fields>
7920                 <links>
7921                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
7922                 </links>
7923         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7924             <actions>
7925                 <create permission="ADMIN_PROVIDER">
7926                     <context link="contact" jump='provider' field="owner"/>
7927                 </create>
7928                 <retrieve permission="ADMIN_PROVIDER">
7929                     <context link="contact" jump='provider' field="owner"/>
7930                 </retrieve>
7931                 <update permission="ADMIN_PROVIDER">
7932                     <context link="contact" jump='provider' field="owner"/>
7933                 </update>
7934                 <delete permission="ADMIN_PROVIDER">
7935                     <context link="contact" jump='provider' field="owner"/>
7936                 </delete>
7937             </actions>
7938         </permacrud>
7939         </class>
7940
7941         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
7942                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
7943                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
7944                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
7945                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
7946                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
7947                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
7948                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
7949                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
7950                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7951                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
7952                 </fields>
7953                 <links>
7954                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
7955                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
7956                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
7957                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
7958                 </links>
7959         </class>
7960
7961         <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">
7962                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
7963                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
7964                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
7965                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
7966                 </fields>
7967                 <links>
7968             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
7969                 </links>
7970                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7971                         <actions>
7972                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7973                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7974                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7975                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7976                         </actions>
7977                 </permacrud>
7978         </class>
7979
7980         <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">
7981                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
7982                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
7983                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
7984                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
7985                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
7986                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
7987                 </fields>
7988                 <links>
7989                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
7990                 </links>
7991                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7992                         <actions>
7993                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7994                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7995                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7996                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
7997                         </actions>
7998                 </permacrud>
7999         </class>
8000
8001         <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">
8002                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
8003                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8004                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8005                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8006                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8007                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8008                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8009                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8010                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
8011                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
8012                 </fields>
8013                 <links>
8014                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8015                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8016             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
8017             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
8018                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
8019                 </links>
8020         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8021             <actions>
8022                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8023                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
8024                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8025                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8026             </actions>
8027         </permacrud>
8028         </class>
8029
8030         <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">
8031                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
8032                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
8033                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
8034                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8035                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8036                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
8037                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
8038                 </fields>
8039                 <links>
8040                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8041                 </links>
8042                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8043                         <actions>
8044                                 <create permission="ADMIN_FUNDING_SOURCE">
8045                     <context link="funding_source" field="owner"/>
8046                 </create>
8047                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
8048                     <context link="funding_source" field="owner"/>
8049                 </retrieve>
8050                                 <update permission="ADMIN_FUNDING_SOURCE">
8051                     <context link="funding_source" field="owner"/>
8052                 </update>
8053                                 <delete permission="ADMIN_FUNDING_SOURCE">
8054                     <context link="funding_source" field="owner"/>
8055                 </delete>
8056                         </actions>
8057                 </permacrud>
8058         </class>
8059
8060         <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">
8061                 <fields oils_persist:primary="id">
8062                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
8063                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
8064                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
8065                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
8066                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8067                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8068                 </fields>
8069                 <links>
8070                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8071                 </links>
8072         </class>
8073
8074         <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">
8075                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
8076                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
8077                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8078                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
8079                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
8080                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8081                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
8082                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
8083                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8084                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
8085                 </fields>
8086                 <links>
8087                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8088                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8089                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
8090                 </links>
8091                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8092                         <actions>
8093                                 <create permission="ADMIN_ACQ_FUND">
8094                     <context link="fund" field="org"/>
8095                 </create>
8096                                 <retrieve permission="ADMIN_ACQ_FUND">
8097                     <context link="fund" field="org"/>
8098                 </retrieve>
8099                                 <update permission="ADMIN_ACQ_FUND">
8100                     <context link="fund" field="org"/>
8101                 </update>
8102                                 <delete permission="ADMIN_ACQ_FUND">
8103                     <context link="fund" field="org"/>
8104                 </delete>
8105                         </actions>
8106                 </permacrud>
8107         </class>
8108
8109         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
8110                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8111                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8112                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8113                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8114                         <field reporter:label="Year" name="year" reporter:datatype="int" />
8115                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8116                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8117                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8118                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8119                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8120                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8121                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8122                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8123                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8124                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
8125                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8126                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
8127                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
8128                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
8129                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
8130                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8131                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8132                 </fields>
8133                 <links>
8134                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8135                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8136             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
8137             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
8138             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
8139             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
8140             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
8141             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
8142             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
8143             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
8144             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
8145                 </links>
8146         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
8147             <actions>
8148                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
8149                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8150                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
8151                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
8152             </actions>
8153         </permacrud>
8154         </class>
8155
8156         <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">
8157                 <fields oils_persist:primary="fund">
8158                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8159                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8160                 </fields>
8161                 <links>
8162                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8163                 </links>
8164         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8165             <actions>
8166                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8167                                         <context link="fund" field="org" />
8168                 </retrieve>
8169             </actions>
8170         </permacrud>
8171         </class>
8172
8173         <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">
8174                 <fields oils_persist:primary="fund">
8175                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8176                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
8177                 </fields>
8178                 <links>
8179                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8180                 </links>
8181         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8182             <actions>
8183                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8184                                         <context link="fund" field="org" />
8185                 </retrieve>
8186             </actions>
8187         </permacrud>
8188         </class>
8189
8190         <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">
8191                 <fields oils_persist:primary="fund">
8192                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8193                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
8194                 </fields>
8195                 <links>
8196                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8197                 </links>
8198         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8199             <actions>
8200                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8201                                         <context link="fund" field="org" />
8202                 </retrieve>
8203             </actions>
8204         </permacrud>
8205         </class>
8206
8207         <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">
8208                 <fields oils_persist:primary="fund">
8209                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8210                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8211                 </fields>
8212                 <links>
8213                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8214                 </links>
8215         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8216             <actions>
8217                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8218                                         <context link="fund" field="org" />
8219                 </retrieve>
8220             </actions>
8221         </permacrud>
8222         </class>
8223
8224         <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">
8225                 <fields oils_persist:primary="fund">
8226                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8227                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
8228                 </fields>
8229                 <links>
8230                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8231                 </links>
8232         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8233             <actions>
8234                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8235                                         <context link="fund" field="org" />
8236                 </retrieve>
8237             </actions>
8238         </permacrud>
8239         </class>
8240
8241    <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">
8242         <fields oils_persist:primary="fund">
8243             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8244             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8245         </fields>
8246         <links>
8247             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8248         </links>
8249     </class>
8250
8251    <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">
8252         <fields oils_persist:primary="fund">
8253             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8254             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
8255         </fields>
8256         <links>
8257             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8258         </links>
8259     </class>
8260
8261    <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">
8262         <fields oils_persist:primary="fund">
8263             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8264             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8265         </fields>
8266         <links>
8267             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8268         </links>
8269     </class>
8270
8271    <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">
8272         <fields oils_persist:primary="fund">
8273             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8274             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
8275         </fields>
8276         <links>
8277             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8278         </links>
8279     </class>
8280
8281    <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">
8282         <fields oils_persist:primary="fund">
8283             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8284             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
8285         </fields>
8286         <links>
8287             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8288         </links>
8289     </class>
8290
8291         <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">
8292                 <fields oils_persist:primary="funding_source">
8293                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8294                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8295                 </fields>
8296                 <links>
8297                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8298                 </links>
8299         </class>
8300
8301         <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">
8302                 <fields oils_persist:primary="funding_source">
8303                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8304                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8305                 </fields>
8306                 <links>
8307                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8308                 </links>
8309         </class>
8310
8311         <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">
8312                 <fields oils_persist:primary="funding_source">
8313                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8314                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8315                 </fields>
8316                 <links>
8317                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8318                 </links>
8319         </class>
8320
8321         <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">
8322                 <fields oils_persist:primary="fund">
8323                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8324                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8325                 </fields>
8326                 <links>
8327                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8328                 </links>
8329         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8330             <actions>
8331                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8332                                         <context link="fund" field="org" />
8333                 </retrieve>
8334             </actions>
8335         </permacrud>
8336     </class>
8337     <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">
8338         <oils_persist:source_definition><![CDATA[
8339             SELECT
8340                 acqf.*,
8341                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8342                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8343                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8344                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8345             FROM
8346                 acq.fund acqf
8347                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8348                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8349                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8350                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8351         ]]></oils_persist:source_definition>
8352         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8353             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8354             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8355             <field reporter:label="Name" name="name" reporter:datatype="text" />
8356             <field reporter:label="Year" name="year" reporter:datatype="int" />
8357             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8358             <field reporter:label="Code" name="code" reporter:datatype="text" />
8359             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8360             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8361             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8362             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8363             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8364
8365             <!-- non fund-native fields -->
8366             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8367             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8368             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8369             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8370         </fields>
8371         <links>
8372             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8373             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8374             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8375         </links>
8376         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8377             <actions>
8378                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8379             </actions>
8380         </permacrud>
8381         </class>
8382         <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">
8383                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8384                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8385                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8386                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8387                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8388                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8389                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8390                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8391                 </fields>
8392                 <links>
8393                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8394                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8395                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8396                 </links>
8397                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8398                         <actions>
8399                                 <create permission="ADMIN_ACQ_FUND">
8400                     <context link="fund" field="org"/>
8401                 </create>
8402                                 <retrieve permission="ADMIN_ACQ_FUND">
8403                     <context link="fund" field="org"/>
8404                 </retrieve>
8405                                 <update permission="ADMIN_ACQ_FUND">
8406                     <context link="fund" field="org"/>
8407                 </update>
8408                                 <delete permission="ADMIN_ACQ_FUND">
8409                     <context link="fund" field="org"/>
8410                 </delete>
8411                         </actions>
8412                 </permacrud>
8413         </class>
8414
8415     <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">
8416         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8417             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8418             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8419             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8420             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8421             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8422             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8423             <field reporter:label="Note" name="note" reporter:datatype="text" />
8424             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8425         </fields>
8426         <links>
8427             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8428             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8429             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8430         </links>
8431                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8432                         <actions>
8433                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8434                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8435                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8436                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8437                         </actions>
8438                 </permacrud>
8439     </class>
8440
8441         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8442                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8443                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8444                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8445                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8446                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8447                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8448                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8449                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8450                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8451                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8452                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8453                 </fields>
8454                 <links>
8455                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8456                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8457                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8458                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8459                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8460                 </links>
8461                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8462                         <actions>
8463                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8464                         </actions>
8465                 </permacrud>
8466         </class>
8467
8468         <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">
8469                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8470                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8471                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8472                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8473                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8474                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8475                 </fields>
8476                 <links>
8477                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8478                 </links>
8479                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8480                         <actions>
8481                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8482                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8483                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8484                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8485                         </actions>
8486                 </permacrud>
8487         </class>
8488
8489         <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">
8490                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8491                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8492                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8493                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8494                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8495                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8496                         <field reporter:label="State" name="state" reporter:datatype="text" />
8497                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8498                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8499                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8500                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8501                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8502                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8503                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8504                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8505                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8506                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8507                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8508                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8509                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
8510                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8511                 </fields>
8512                 <links>
8513                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8514                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8515                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8516                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8517                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8518                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8519                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8520                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8521                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8522                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8523                 </links>
8524                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8525                         <actions>
8526                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8527                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8528                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8529                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8530                         </actions>
8531                 </permacrud>
8532         </class>
8533
8534         <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">
8535                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8536                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8537                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8538                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8539                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8540                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8541                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8542                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8543                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8544                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8545                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8546                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8547                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8548                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8549                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8550                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8551                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8552                 </fields>
8553                 <links>
8554                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8555                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8556                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8557                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8558                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8559                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8560                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8561                 </links>
8562                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8563             <actions>
8564                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8565             </actions>
8566                 </permacrud>
8567         </class>
8568
8569         <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">
8570                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8571                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8572                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8573                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8574                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8575                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8576                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8577                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8578                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8579                 </fields>
8580                 <links>
8581                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8582                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8583                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8584                 </links>
8585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8586             <actions>
8587                 <create permission="CREATE_PURCHASE_ORDER">
8588                     <context link="purchase_order" field="ordering_agency"/>
8589                 </create>
8590                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8591                     <context link="purchase_order" field="ordering_agency"/>
8592                 </retrieve>
8593                 <update permission="CREATE_PURCHASE_ORDER">
8594                     <context link="purchase_order" field="ordering_agency"/>
8595                 </update>
8596                 <delete permission="CREATE_PURCHASE_ORDER">
8597                     <context link="purchase_order" field="ordering_agency"/>
8598                 </delete>
8599             </actions>
8600                 </permacrud>
8601         </class>
8602
8603         <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">
8604                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
8605                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8606                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8607                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8608                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
8609                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
8610                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
8611                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8612                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
8613                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
8614                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8615                 </fields>
8616                 <links>
8617                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8618                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8619                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8620                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8621                 </links>
8622                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8623             <actions>
8624                 <create permission="CREATE_PURCHASE_ORDER">
8625                     <context link="purchase_order" field="ordering_agency"/>
8626                 </create>
8627                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8628                     <context link="purchase_order" field="ordering_agency"/>
8629                 </retrieve>
8630                 <update permission="CREATE_PURCHASE_ORDER">
8631                     <context link="purchase_order" field="ordering_agency"/>
8632                 </update>
8633                 <delete permission="CREATE_PURCHASE_ORDER">
8634                     <context link="purchase_order" field="ordering_agency"/>
8635                 </delete>
8636             </actions>
8637                 </permacrud>
8638         </class>
8639
8640         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
8641                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
8642                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
8643                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
8644                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
8645                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8646                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8647                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8648                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8649                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
8650                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
8651                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
8652                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
8653                         <field reporter:label="State" name="state" reporter:datatype="text" />
8654                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8655                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8656                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
8657                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8658                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8659                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8660                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
8661                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
8662                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
8663                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
8664                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
8665                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
8666                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
8667                 </fields>
8668                 <links>
8669                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8670                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8671                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8672                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8673                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8674                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8675                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8676                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
8677                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
8678                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
8679                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8680                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
8681                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8682                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
8683                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
8684                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8685                 </links>
8686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8687                         <actions>
8688                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
8689                                         <context link="purchase_order" field="ordering_agency"/>
8690                                         <context link="picklist" field="org_unit"/>
8691                                 </retrieve>
8692                         </actions>
8693                 </permacrud>
8694         </class>
8695
8696         <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">
8697                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
8698                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8699                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8700                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8701                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
8702                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8703                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8704                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
8705                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8706                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8707                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
8708                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
8709                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8710                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8711                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
8712                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
8713                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
8714                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8715                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
8716                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8717                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
8718                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
8719                 </fields>
8720                 <links>
8721                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
8722                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8723                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8724                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
8725                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8726                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8727                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
8728                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
8729                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8730                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
8731                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
8732                 </links>
8733                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8734                         <actions>
8735                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
8736                                         <context link="purchase_order" field="ordering_agency"/>
8737                                         <context link="picklist" field="org_unit"/>
8738                                 </retrieve>
8739                         </actions>
8740                 </permacrud>
8741         </class>
8742
8743         <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">
8744                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
8745                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
8746                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
8747                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
8748                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
8749                 </fields>
8750                 <links>
8751                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8752                 </links>
8753                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8754                         <actions>
8755                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8756                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
8757                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8758                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
8759                         </actions>
8760                 </permacrud>
8761         </class>
8762
8763         <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">
8764                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
8765                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
8766                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
8767                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8768                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8769                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8770                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8771                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8772                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
8773                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8774                 </fields>
8775                 <links>
8776                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8777                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8778                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8779                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
8780                 </links>
8781         </class>
8782
8783         <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">
8784                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
8785                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
8786                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
8787                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
8788                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
8789                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
8790                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
8791                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
8792                 </fields>
8793                 <links>
8794                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8795                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
8796                 </links>
8797         </class>
8798
8799         <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">
8800                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
8801                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
8802                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
8803                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
8804                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
8805                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
8806                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
8807                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
8808                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8809                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
8810                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
8811                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
8812                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
8813                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8814                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
8815                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8816                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
8817                 </fields>
8818                 <links>
8819                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8820                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
8821                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8822                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8823                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
8824                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
8825                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
8826                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8827                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
8828                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
8829                 </links>
8830         </class>
8831
8832         <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">
8833                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8834                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8835                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8836                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8837                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8838                 </fields>
8839                 <links/>
8840                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8841                         <actions>
8842                                 <retrieve />
8843                         </actions>
8844                 </permacrud>
8845         </class>
8846
8847         <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">
8848                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8849                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8850                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8851                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8852                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8853                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8854             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8855                 </fields>
8856                 <links/>
8857         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8858             <actions>
8859                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8860                 <retrieve />
8861                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8862                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
8863             </actions>
8864         </permacrud>
8865         </class>
8866
8867         <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">
8868                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8869                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8870                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8871                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8872                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8873                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8874                 </fields>
8875                 <links/>
8876         </class>
8877         <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">
8878                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8879                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8880                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8881                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8882                         <field reporter:label="User" name="usr" reporter:datatype="link" />
8883                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8884                 </fields>
8885                 <links>
8886                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8887                 </links>
8888         </class>
8889
8890         <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">
8891             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8892                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8893                 <field reporter:label="Code" name="code" reporter:datatype="text" />
8894                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8895                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
8896                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8897                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8898         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
8899
8900             </fields>
8901             <links>
8902                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8903             </links>
8904             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8905                 <actions>
8906                     <create permission="ADMIN_PROVIDER">
8907                         <context link="provider" field="owner"/>
8908                     </create>
8909                     <retrieve permission="ADMIN_PROVIDER">
8910                         <context link="provider" field="owner"/>
8911                     </retrieve>
8912                     <update permission="ADMIN_PROVIDER">
8913                         <context link="provider" field="owner"/>
8914                     </update>
8915                     <delete permission="ADMIN_PROVIDER">
8916                         <context link="provider" field="owner"/>
8917                     </delete>
8918                 </actions>
8919             </permacrud>
8920         </class>
8921         
8922         <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">
8923             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
8924                 <field reporter:label="ID" name="id" reporter:datatype="id" />
8925                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8926                 <field reporter:label="Name" name="name" reporter:datatype="text" />
8927                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
8928             </fields>
8929             <links>
8930                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8931             </links>
8932             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8933                 <actions>
8934                     <create permission="ADMIN_PROVIDER">
8935                         <context link="provider" field="owner"/>
8936                     </create>
8937                     <retrieve permission="ADMIN_PROVIDER">
8938                         <context link="provider" field="owner"/>
8939                     </retrieve>
8940                     <update permission="ADMIN_PROVIDER">
8941                         <context link="provider" field="owner"/>
8942                     </update>
8943                     <delete permission="ADMIN_PROVIDER">
8944                         <context link="provider" field="owner"/>
8945                     </delete>
8946                 </actions>
8947             </permacrud>
8948         </class>
8949         
8950         <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">
8951             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
8952                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
8953                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8954                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
8955                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
8956                 </fields>
8957                 <links/>
8958         </class>
8959
8960         <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">
8961                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
8962                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
8963                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
8964                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
8965                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
8966                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
8967                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
8968                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
8969                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
8970                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
8971                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
8972                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
8973                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
8974                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
8975                 </fields>
8976                 <links>
8977                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8978                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8979                 </links>
8980         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8981             <actions>
8982                 <create permission="ADMIN_PROVIDER">
8983                     <context link="provider" field="owner"/>
8984                 </create>
8985                 <retrieve permission="ADMIN_PROVIDER">
8986                     <context link="provider" field="owner"/>
8987                 </retrieve>
8988                 <update permission="ADMIN_PROVIDER">
8989                     <context link="provider" field="owner"/>
8990                 </update>
8991                 <delete permission="ADMIN_PROVIDER">
8992                     <context link="provider" field="owner"/>
8993                 </delete>
8994             </actions>
8995         </permacrud>
8996         </class>
8997
8998         <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">
8999                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
9000                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
9001                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
9002                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
9003                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
9004                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
9005                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
9006                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
9007                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
9008                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
9009                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
9010                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
9011                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
9012                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
9013                 </fields>
9014                 <links>
9015                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
9016                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9017                 </links>
9018         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9019             <actions>
9020                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9021                     <context link="account" jump="provider" field="owner"/>
9022                 </retrieve>
9023                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9024                     <context link="account" jump="provider" field="owner"/>
9025                 </update>
9026                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9027                     <context link="account" jump="provider" field="owner"/>
9028                 </delete>
9029             </actions>
9030         </permacrud>
9031         </class>
9032
9033
9034         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
9035                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
9036                         <field name="id" reporter:datatype="id" />
9037                         <field name="parent" reporter:datatype="link"/>
9038                         <field name="owner" reporter:datatype="link"/>
9039                         <field name="create_time" reporter:datatype="timestamp"/>
9040                         <field name="name" reporter:datatype="text"/>
9041                         <field name="shared" reporter:datatype="bool"/>
9042                         <field name="share_with" reporter:datatype="link"/>
9043                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9044                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
9045                 </fields>
9046                 <links>
9047                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9048                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
9049                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
9050                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9051                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
9052                 </links>
9053         </class>
9054         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
9055                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
9056                         <field name="id" reporter:datatype="id" />
9057                         <field name="parent" reporter:datatype="link"/>
9058                         <field name="owner" reporter:datatype="link"/>
9059                         <field name="create_time" reporter:datatype="timestamp"/>
9060                         <field name="name" reporter:datatype="text"/>
9061                         <field name="shared" reporter:datatype="bool"/>
9062                         <field name="share_with" reporter:datatype="link"/>
9063                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9064                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
9065                 </fields>
9066                 <links>
9067                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9068                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
9069                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
9070                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9071                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
9072                 </links>
9073         </class>
9074         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
9075                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
9076                         <field name="id" reporter:datatype="id" />
9077                         <field name="parent" reporter:datatype="link"/>
9078                         <field name="owner" reporter:datatype="link"/>
9079                         <field name="create_time" reporter:datatype="timestamp"/>
9080                         <field name="name" reporter:datatype="text"/>
9081                         <field name="shared" reporter:datatype="bool"/>
9082                         <field name="share_with" reporter:datatype="link"/>
9083                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9084                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9085                 </fields>
9086                 <links>
9087                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9088                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
9089                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
9090                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9091                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
9092                 </links>
9093         </class>
9094         <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">
9095                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
9096                         <field name="id" reporter:datatype="id" />
9097                         <field name="owner" reporter:datatype="link"/>
9098                         <field name="create_time" reporter:datatype="timestamp"/>
9099                         <field name="name" reporter:datatype="text"/>
9100                         <field name="data" reporter:datatype="text"/>
9101                         <field name="folder" reporter:datatype="link"/>
9102                         <field name="description" reporter:datatype="text"/>
9103                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9104                 </fields>
9105                 <links>
9106                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9107                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
9108                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
9109                 </links>
9110         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9111             <actions>
9112                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9113                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9114                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9115                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9116             </actions>
9117         </permacrud>
9118         </class>
9119         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
9120                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
9121                         <field name="id" reporter:datatype="id" />
9122                         <field name="owner" reporter:datatype="link"/>
9123                         <field name="create_time" reporter:datatype="timestamp"/>
9124                         <field name="template" reporter:datatype="link"/>
9125                         <field name="data" reporter:datatype="text"/>
9126                         <field name="folder" reporter:datatype="link"/>
9127                         <field name="recur" reporter:datatype="bool"/>
9128                         <field name="recurrence" reporter:datatype="interval"/>
9129                         <field name="name" reporter:datatype="text"/>
9130                         <field name="description" reporter:datatype="text"/>
9131                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
9132                 </fields>
9133                 <links>
9134                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9135                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
9136                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
9137                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
9138                 </links>
9139         </class>
9140         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
9141                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
9142                         <field name="id" reporter:datatype="id" />
9143                         <field name="runner" reporter:datatype="link"/>
9144                         <field name="start_time" reporter:datatype="timestamp"/>
9145                         <field name="complete_time" reporter:datatype="timestamp"/>
9146                         <field name="run_time" reporter:datatype="timestamp"/>
9147                         <field name="email" reporter:datatype="text"/>
9148                         <field name="excel_format" reporter:datatype="bool"/>
9149                         <field name="csv_format" reporter:datatype="bool"/>
9150                         <field name="html_format" reporter:datatype="bool"/>
9151                         <field name="error_code" reporter:datatype="int"/>
9152                         <field name="error_text" reporter:datatype="text"/>
9153                         <field name="report" reporter:datatype="link"/>
9154                         <field name="folder" reporter:datatype="link"/>
9155                         <field name="chart_pie" reporter:datatype="bool"/>
9156                         <field name="chart_bar" reporter:datatype="bool"/>
9157                         <field name="chart_line" reporter:datatype="bool"/>
9158                 </fields>
9159                 <links>
9160                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
9161                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
9162                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
9163                 </links>
9164         </class>
9165         <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">
9166                 <fields oils_persist:primary="id">
9167                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9168                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9169                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9170                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9171                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9172                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9173                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9174                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9175                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9176                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9177                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9178                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9179                 </fields>
9180                 <links>
9181                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9182                 </links>
9183                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9184                         <actions>
9185                                 <retrieve />
9186                         </actions>
9187                 </permacrud>
9188         </class>
9189         <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">
9190                 <fields oils_persist:primary="id">
9191                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9192                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9193                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9194                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9195                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9196                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9197                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9198                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9199                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9200                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9201                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9202                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9203                 </fields>
9204                 <links>
9205                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9206                 </links>
9207         </class>
9208         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
9209                 <fields oils_persist:primary="id">
9210                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9211                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
9212                         <field reporter:label="Fingerprint" name="fingerprint" />
9213                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9214                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9215                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9216                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9217                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
9218                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9219                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9220                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9221                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
9222                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
9223                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
9224                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9225                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9226                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
9227                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
9228                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
9229                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
9230                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
9231                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
9232                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9233                 </fields>
9234                 <links>
9235                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
9236                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9237                 </links>
9238         </class>
9239         <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">
9240                 <fields oils_persist:primary="id">
9241                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
9242                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
9243                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
9244                 </fields>
9245                 <links>
9246                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
9247                 </links>
9248         </class>
9249         <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">
9250                 <fields oils_persist:primary="id">
9251                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
9252                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
9253                 </fields>
9254                 <links>
9255                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
9256                 </links>
9257         </class>
9258         <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">
9259                 <fields oils_persist:primary="id">
9260                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
9261                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
9262                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
9263                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
9264                 </fields>
9265                 <links>
9266                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
9267                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
9268                 </links>
9269         </class>
9270         <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">
9271                 <fields oils_persist:primary="xact">
9272                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9273                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
9274                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
9275                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
9276                 </fields>
9277                 <links>
9278                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9279                 </links>
9280         </class>
9281         <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">
9282                 <fields oils_persist:primary="xact">
9283                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9284                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
9285                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
9286                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
9287                 </fields>
9288                 <links>
9289                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9290                 </links>
9291         </class>
9292         <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)">
9293                 <fields oils_persist:primary="id">
9294                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
9295                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
9296                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
9297                 </fields>
9298                 <links>
9299                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9300                 </links>
9301         </class>
9302         <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">
9303                 <fields oils_persist:primary="id">
9304                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9305                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9306                 </fields>
9307                 <links>
9308                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9309                 </links>
9310         </class>
9311         <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">
9312                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9313                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9314                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9315                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9316                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9317                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9318                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9319                 </fields>
9320                 <links>
9321                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9322                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9323                 </links>
9324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9325                         <actions>
9326                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9327                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9328                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9329                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9330                         </actions>
9331                 </permacrud>
9332         </class>
9333         <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">
9334                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9335                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9336                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9337                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9338                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9339                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9340                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9341                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9342                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9343                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9344                 </fields>
9345                 <links>
9346                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9347                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9348                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9349                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9350                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9351                 </links>
9352                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9353                         <actions>
9354                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9355                                         <context link="formula" field="owner"/>
9356                                 </create>
9357                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9358                                         <context link="formula" field="owner"/>
9359                                 </retrieve>
9360                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9361                                         <context link="formula" field="owner"/>
9362                                 </update>
9363                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9364                                         <context link="formula" field="owner"/>
9365                                 </delete>
9366                         </actions>
9367                 </permacrud>
9368         </class>
9369
9370         <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">
9371                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9372                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9373                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9374                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9375                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9376                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9377                 </fields>
9378                 <links>
9379                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9380                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9381                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9382                 </links>
9383                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9384                         <actions>
9385                                 <create permission="CREATE_PURCHASE_ORDER">
9386                                         <context link="formula" field="owner"/>
9387                 </create>
9388                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9389                                         <context link="formula" field="owner"/>
9390                 </retrieve>
9391                                 <update permission="CREATE_PURCHASE_ORDER">
9392                                         <context link="formula" field="owner"/>
9393                 </update>
9394                                 <delete permission="CREATE_PURCHASE_ORDER">
9395                                         <context link="formula" field="owner"/>
9396                 </delete>
9397                         </actions>
9398                 </permacrud>
9399         </class>
9400
9401         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9402                 <fields oils_persist:primary="id">
9403                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9404                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9405                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9406                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9407                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9408                 </fields>
9409                 <links>
9410                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9411                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9412                 </links>
9413         </class>
9414
9415         <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">
9416                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9417                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9418                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9419                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9420                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9421                 </fields>
9422                 <links>
9423                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9424                 </links>
9425                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9426                         <actions>
9427                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9428                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9429                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9430                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9431                         </actions>
9432                 </permacrud>
9433         </class>
9434
9435         <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">
9436                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9437                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9438                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9439                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9440                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9441                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9442                 </fields>
9443                 <links>
9444                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9445                 </links>
9446                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9447                         <actions>
9448                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9449                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9450                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9451                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9452                         </actions>
9453                 </permacrud>
9454         </class>
9455
9456         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9457                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9458                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9459                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9460                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9461                 </fields>
9462                 <links>
9463                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9464                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9465                 </links>
9466         </class>
9467
9468         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9469                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9470                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9471                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9472                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9473                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9474                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9475                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9476                 </fields>
9477                 <links>
9478                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9479                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9480                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9481                 </links>
9482         </class>
9483
9484         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9485                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9486                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9487                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9488                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9489                 </fields>
9490                 <links>
9491                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9492                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9493                 </links>
9494         </class>
9495
9496         <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">
9497                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9498                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9499                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9500                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9501                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9502                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9503                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9504                 </fields>
9505                 <links>
9506                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9507                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9508                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9509                 </links>
9510         </class>
9511
9512         <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">
9513                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
9514                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
9515                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9516                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
9517                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9518                 </fields>
9519                 <links>
9520                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9521                 </links>
9522                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9523             <actions>
9524                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9525                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
9526                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9527                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
9528             </actions>
9529                 </permacrud>
9530         </class>
9531
9532         <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">
9533                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
9534                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
9535                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
9536                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
9537                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
9538                 </fields>
9539                 <links>
9540                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9541                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
9542                 </links>
9543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9544                         <actions>
9545                                 <create permission="ADMIN_CLAIM_POLICY">
9546                                         <context link="claim_policy" field="org_unit"/>
9547                 </create>
9548                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
9549                                         <context link="claim_policy" field="org_unit"/>
9550                 </retrieve>
9551                                 <update permission="ADMIN_CLAIM_POLICY">
9552                                         <context link="claim_policy" field="org_unit"/>
9553                 </update>
9554                                 <delete permission="ADMIN_CLAIM_POLICY">
9555                                         <context link="claim_policy" field="org_unit"/>
9556                 </delete>
9557                         </actions>
9558                 </permacrud>
9559         </class>
9560
9561     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
9562         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
9563             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9564             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
9565             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9566             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
9567             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
9568             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
9569             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
9570             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
9571             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
9572             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
9573             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
9574             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
9575             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
9576             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
9577             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9578             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
9579         </fields>
9580         <links>
9581             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
9582         </links>
9583     </class>
9584
9585     <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">
9586         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
9587             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9588             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9589             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9590             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
9591             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9592         </fields>
9593     </class>
9594
9595     <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">
9596         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9597             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9598             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9599             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9600             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9601             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9602             <field reporter:label="City" name="city" reporter:datatype="text"/>
9603             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9604             <field reporter:label="State" name="state" reporter:datatype="text"/>
9605             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9606             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9607             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9608         </fields>
9609     </class>
9610
9611     <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">
9612         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
9613             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9614             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9615             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9616             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
9617             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
9618             <field reporter:label="City" name="city" reporter:datatype="text"/>
9619             <field reporter:label="County" name="county"  reporter:datatype="text"/>
9620             <field reporter:label="State" name="state" reporter:datatype="text"/>
9621             <field reporter:label="Country" name="country" reporter:datatype="text"/>
9622             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
9623             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9624         </fields>
9625     </class>
9626
9627     <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">
9628         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
9629             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9630             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9631             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9632             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
9633             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
9634             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9635         </fields>
9636     </class>
9637
9638     <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">
9639         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
9640             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
9641             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
9642             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
9643             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
9644             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
9645             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
9646         </fields>
9647     </class>
9648
9649         <class id="afs" controller="open-ils.cstore" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
9650                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
9651                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
9652                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
9653                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9654                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
9655                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
9656                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
9657                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
9658                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
9659                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
9660                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
9661                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
9662                 </fields>
9663                 <links>
9664                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9665                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9666                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9667                 </links>
9668         </class>
9669
9670         <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">
9671                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
9672                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
9673                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
9674                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
9675                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
9676                 </fields>
9677                 <links>
9678                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
9679                 </links>
9680         </class>
9681
9682     <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">
9683         <fields>
9684             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9685             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9686             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9687         </fields>
9688                 <links>
9689                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9690                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9691                 </links>
9692     </class>
9693
9694     <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">
9695         <fields>
9696             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9697             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
9698         </fields>
9699                 <links>
9700                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9701                 </links>
9702     </class>
9703
9704     <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">
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="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">
9717         <fields>
9718             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9719             <field reporter:label="Max Loop" name="max" 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="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
9727                 <oils_persist:source_definition>
9728
9729             SELECT  DISTINCT l.*
9730               FROM  action.unfulfilled_hold_loops l
9731                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
9732               WHERE l.count = m.max
9733
9734                 </oils_persist:source_definition>
9735         <fields>
9736             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
9737             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
9738             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
9739         </fields>
9740                 <links>
9741                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
9742                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9743                 </links>
9744     </class>
9745
9746         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
9747                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
9748                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
9749                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
9750                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
9751                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
9752                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
9753                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
9754                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
9755                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
9756                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
9757                 </fields>
9758                 <links>
9759                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
9760                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
9761                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
9762                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
9763                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
9764                 </links>
9765         </class>
9766
9767         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
9768                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
9769                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
9770                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
9771                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9772                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
9773                 </fields>
9774                 <links>
9775                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
9776                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
9777                 </links>
9778         </class>
9779
9780         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
9781                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
9782                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
9783                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
9784                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
9785                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
9786                 </fields>
9787                 <links>
9788                 </links>
9789         </class>
9790
9791         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
9792                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
9793                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
9794                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
9795                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9796                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
9797                 </fields>
9798                 <links>
9799                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
9800                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
9801                 </links>
9802         </class>
9803         
9804         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
9805                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
9806                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
9807                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
9808                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
9809                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
9810                 </fields>
9811                 <links>
9812                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
9813                 </links>
9814         </class>
9815         
9816         <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">
9817                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
9818                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
9819                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9820                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9821                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
9822                 </fields>
9823                 <links>
9824                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9825                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
9826                 </links>
9827         </class>
9828
9829         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
9830                 <fields oils_persist:primary="name">
9831                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
9832                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
9833                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
9834                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9835                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
9836                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
9837                 </fields>
9838                 <links>
9839                 </links>
9840         </class>
9841
9842         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
9843                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9844                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9845                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
9846                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9847                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9848                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9849                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9850                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9851                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9852                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9853                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
9854                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
9855                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
9856                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
9857                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
9858                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9859                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9860                 </fields>
9861                 <links>
9862                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9863                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9864                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
9865                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
9866                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9867                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
9868                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9869                 </links>
9870         </class>
9871
9872         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
9873                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
9874                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
9875                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9876                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9877                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
9878                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
9879                 </fields>
9880                 <links>
9881                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9882                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
9883                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
9884                 </links>
9885         </class>
9886
9887         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
9888                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
9889                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
9890                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
9891                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
9892                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
9893                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
9894                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
9895                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
9896                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
9897                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9898                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
9899                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
9900                 </fields>
9901                 <links>
9902                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
9903                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
9904                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
9905                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
9906                 </links>
9907         </class>
9908
9909         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
9910                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
9911                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
9912                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
9913                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9914                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
9915                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
9916                 </fields>
9917                 <links>
9918                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
9919                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
9920                 </links>
9921         </class>
9922
9923         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
9924                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
9925                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
9926                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9927                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9928                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9929                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
9930                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
9931                 </fields>
9932                 <links>
9933                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9934                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9935                 </links>
9936         </class>
9937
9938         <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">
9939                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
9940                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
9941                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
9942                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9943                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
9944                 </fields>
9945                 <links>
9946                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
9947                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
9948                 </links>
9949         </class>
9950
9951         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
9952                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9953                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9954                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9955                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9956                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9957                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
9958                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9959                 </fields>
9960                 <links>
9961                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9962                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
9963                 </links>
9964         </class>
9965
9966         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
9967                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9968                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9969                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9970                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9971                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9972                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
9973                 </fields>
9974                 <links>
9975                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9976                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
9977                 </links>
9978         </class>
9979
9980         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
9981                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9982                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9983                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9984                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9985                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
9986                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
9987                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
9988                 </fields>
9989                 <links>
9990                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
9991                 </links>
9992         </class>
9993
9994         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
9995                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
9996                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
9997                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
9998                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
9999                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10000                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10001                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10002                 </fields>
10003                 <links>
10004                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10005                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10006                 </links>
10007         </class>
10008
10009         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
10010                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10011                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10012                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10013                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10014                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10015                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10016                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10017                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10018                 </fields>
10019                 <links>
10020                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10021                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10022                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10023                 </links>
10024         </class>
10025
10026         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
10027                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10028                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10029                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10030                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10031                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10032                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10033                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10034                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10035                 </fields>
10036                 <links>
10037                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10038                 </links>
10039         </class>
10040
10041         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
10042                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10043                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10044                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10045                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10046                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10047                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10048                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10049                 </fields>
10050                 <links>
10051                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10052                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10053                 </links>
10054         </class>
10055
10056         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
10057                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10058                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10059                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10060                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10061                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10062                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10063                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10064                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10065                 </fields>
10066                 <links>
10067                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10068                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10069                 </links>
10070         </class>
10071
10072         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
10073                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10074                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10075                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10076                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10077                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10078                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10079                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10080                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10081                 </fields>
10082                 <links>
10083                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10084                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10085                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10086                 </links>
10087         </class>
10088
10089         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
10090                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10091                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10092                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10093                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10094                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10095                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10096                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10097                 </fields>
10098                 <links>
10099                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10100                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10101                 </links>
10102         </class>
10103
10104         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
10105                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10106                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10107                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10108                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10109                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10110                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10111                 </fields>
10112                 <links>
10113                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10114                 </links>
10115         </class>
10116
10117         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
10118                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10119                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10120                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10121                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10122                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10123                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10124                 </fields>
10125                 <links>
10126                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10127                 </links>
10128         </class>
10129
10130         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
10131                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10132                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10133                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10134                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10135                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10136                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10137                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10138                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10139                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10140                 </fields>
10141                 <links>
10142                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10143                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10144                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10145                 </links>
10146         </class>
10147
10148         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
10149                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10150                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10151                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10152                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10153                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10154                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10155                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10156                 </fields>
10157                 <links>
10158                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10159                 </links>
10160         </class>
10161
10162         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
10163                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10164                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10165                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10166                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10167                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10168                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10169                 </fields>
10170                 <links>
10171                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10172                 </links>
10173         </class>
10174
10175         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
10176                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10177                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10178                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10179                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10180                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10181                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10182                 </fields>
10183                 <links>
10184                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10185                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10186                 </links>
10187         </class>
10188
10189         <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">
10190                 <fields oils_persist:primary="id">
10191                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
10192                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
10193                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
10194                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
10195                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
10196                 </fields>
10197                 <links>
10198                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
10199                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10200                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
10201                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
10202                 </links>
10203         </class>
10204
10205         <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">
10206                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
10207                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10208                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
10209                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10210                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
10211                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10212                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10213                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
10214                 </fields>
10215                 <links/>
10216                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10217                         <actions>
10218                                 <retrieve/>
10219                         </actions>
10220                 </permacrud>
10221         </class>
10222
10223         <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">
10224                 <fields oils_persist:primary="ptype_key">
10225                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
10226                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10227                 </fields>
10228                 <links/>
10229                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10230                         <actions>
10231                                 <retrieve/>
10232                         </actions>
10233                 </permacrud>
10234         </class>
10235
10236         <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">
10237                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
10238                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10239                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
10240                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10241                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10242                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10243                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10244                 </fields>
10245                 <links>
10246                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
10247                 </links>
10248                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10249                         <actions>
10250                                 <retrieve/>
10251                         </actions>
10252                 </permacrud>
10253         </class>
10254
10255         <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">
10256                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
10257                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10258                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
10259                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
10260                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10261                 </fields>
10262                 <links>
10263                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10264                 </links>
10265                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10266                         <actions>
10267                                 <retrieve/>
10268                         </actions>
10269                 </permacrud>
10270         </class>
10271
10272     <class
10273         id="uvs"
10274         controller="open-ils.cstore open-ils.pcrud"
10275         oils_obj:fieldmapper="url_verify::session"
10276         oils_persist:tablename="url_verify.session"
10277         reporter:label="URL Verification Session"
10278     >
10279         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
10280             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
10281             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10282                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
10283             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10284             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
10285             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10286             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
10287             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
10288             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
10289         </fields>
10290
10291         <links>
10292             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10293             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10294             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
10295             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
10296             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
10297         </links>
10298
10299         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10300             <actions>
10301                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
10302             </actions>
10303         </permacrud>
10304
10305     </class>
10306
10307     <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">
10308         <oils_persist:source_definition>
10309             SELECT
10310                 cbrebi.id AS id,  -- so we can have a pkey in our view
10311                 uvs.id AS session,
10312                 uvs.owning_lib,
10313                 cbrebi.target_biblio_record_entry
10314             FROM url_verify.session uvs
10315             JOIN container.biblio_record_entry_bucket cbreb
10316                 ON (uvs.container = cbreb.id)
10317             JOIN container.biblio_record_entry_bucket_item cbrebi
10318                 ON (cbrebi.bucket = cbreb.id)
10319         </oils_persist:source_definition>
10320         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10321             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10322             <field reporter:label="Session" name="session" reporter:datatype="link" />
10323             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10324             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10325         </fields>
10326         <links>
10327             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10328             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10329             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10330         </links>
10331         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10332             <actions>
10333                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10334             </actions>
10335         </permacrud>
10336     </class>
10337
10338     <class
10339         id="uvus"
10340         controller="open-ils.cstore open-ils.pcrud"
10341         oils_obj:fieldmapper="url_verify::url_selector"
10342         oils_persist:tablename="url_verify.url_selector"
10343         reporter:label="URL Verification URL Selector"
10344     >
10345         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10346             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10347             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10348                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10349             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10350         </fields>
10351
10352         <links>
10353             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10354             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10355         </links>
10356
10357         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10358             <actions>
10359                 <create permission="URL_VERIFY">
10360                     <context link="session" field="owning_lib"/>
10361                 </create>
10362                 <retrieve permission="URL_VERIFY">
10363                     <context link="session" field="owning_lib"/>
10364                 </retrieve>
10365                 <update permission="URL_VERIFY">
10366                     <context link="session" field="owning_lib"/>
10367                 </update>
10368                 <delete permission="URL_VERIFY">
10369                     <context link="session" field="owning_lib"/>
10370                 </delete>
10371             </actions>
10372         </permacrud>
10373
10374     </class>
10375
10376     <class
10377         id="uvu"
10378         controller="open-ils.cstore open-ils.pcrud"
10379         oils_obj:fieldmapper="url_verify::url"
10380         oils_persist:tablename="url_verify.url"
10381         reporter:label="URL Verification URL"
10382     >
10383         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10384             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10385                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10386                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10387                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10388                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10389             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10390             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10391             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10392             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10393             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10394             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10395             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10396             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10397             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10398             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10399             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10400             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10401             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10402         </fields>
10403
10404         <links>
10405             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10406             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10407             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10408             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10409             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10410         </links>
10411
10412         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10413             <actions>
10414                 <create permission="URL_VERIFY">
10415                     <context link="session" field="owning_lib"/>
10416                 </create>
10417                 <retrieve permission="URL_VERIFY">
10418                     <context link="session" field="owning_lib"/>
10419                 </retrieve>
10420                 <update permission="URL_VERIFY">
10421                     <context link="session" field="owning_lib"/>
10422                 </update>
10423                 <delete permission="URL_VERIFY">
10424                     <context link="session" field="owning_lib"/>
10425                 </delete>
10426             </actions>
10427         </permacrud>
10428
10429     </class>
10430
10431     <class
10432         id="uvva"
10433         controller="open-ils.cstore open-ils.pcrud"
10434         oils_obj:fieldmapper="url_verify::verification_attempt"
10435         oils_persist:tablename="url_verify.verification_attempt"
10436         reporter:label="URL Verification Attempt"
10437     >
10438         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10439             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10440                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10441                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10442             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10443             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10444         </fields>
10445
10446         <links>
10447             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10448             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10449         </links>
10450
10451         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10452             <actions>
10453                 <create permission="URL_VERIFY">
10454                     <context link="session" field="owning_lib"/>
10455                 </create>
10456                 <retrieve permission="URL_VERIFY">
10457                     <context link="session" field="owning_lib"/>
10458                 </retrieve>
10459                 <update permission="URL_VERIFY">
10460                     <context link="session" field="owning_lib"/>
10461                 </update>
10462                 <delete permission="URL_VERIFY">
10463                     <context link="session" field="owning_lib"/>
10464                 </delete>
10465             </actions>
10466         </permacrud>
10467
10468     </class>
10469
10470     <class
10471         id="uvuv"
10472         controller="open-ils.cstore open-ils.pcrud"
10473         oils_obj:fieldmapper="url_verify::url_verification"
10474         oils_persist:tablename="url_verify.url_verification"
10475         reporter:label="URL Verification"
10476     >
10477         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
10478             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
10479                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
10480                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
10481             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
10482             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
10483             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
10484             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
10485                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
10486         </fields>
10487
10488         <links>
10489             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
10490             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
10491             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
10492         </links>
10493
10494         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10495             <actions>
10496                 <create permission="URL_VERIFY">
10497                     <context link="attempt" jump="session" field="owning_lib"/>
10498                 </create>
10499                 <retrieve permission="URL_VERIFY">
10500                     <context link="attempt" jump="session" field="owning_lib"/>
10501                 </retrieve>
10502                 <update permission="URL_VERIFY">
10503                     <context link="attempt" jump="session" field="owning_lib"/>
10504                 </update>
10505                 <delete permission="URL_VERIFY">
10506                     <context link="attempt" jump="session" field="owning_lib"/>
10507                 </delete>
10508             </actions>
10509         </permacrud>
10510
10511     </class>
10512
10513         <class
10514                 id="cfdi"
10515                 controller="open-ils.cstore open-ils.pcrud"
10516                 oils_obj:fieldmapper="config::filter_dialog_interface"
10517                 oils_persist:tablename="config.filter_dialog_interface"
10518                 reporter:label="FilterDialog Interface">
10519                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
10520                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
10521                         <field reporter:label="Description" name="description" reporter:datatype="text" />
10522                 </fields>
10523                 <links>
10524                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
10525                 </links>
10526                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10527                         <actions>
10528                                 <retrieve />
10529                         </actions>
10530                 </permacrud>
10531         </class>
10532
10533         <class
10534                 id="cfdfs"
10535                 controller="open-ils.cstore open-ils.pcrud"
10536                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
10537                 oils_persist:tablename="config.filter_dialog_filter_set"
10538                 reporter:label="FilterDialog Filter Set">
10539                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
10540                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10541                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
10542                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10543                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10544                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
10545                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10546                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
10547                 </fields>
10548                 <links>
10549                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10550                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10551                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
10552                 </links>
10553                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10554                         <actions>
10555                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10556                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10557                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10558                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
10559                         </actions>
10560                 </permacrud>
10561
10562         </class>
10563
10564         <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">
10565                 <fields oils_persist:primary="code">
10566                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
10567                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
10568                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
10569                 </fields>
10570                 <links/>
10571                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10572                         <actions>
10573                                 <retrieve/>
10574                         </actions>
10575                 </permacrud>
10576         </class>
10577
10578         <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">
10579                 <oils_persist:source_definition>
10580
10581             SELECT  b.id,
10582                     MAX(dcp.edit_date) AS last_delete_date
10583              FROM   biblio.record_entry b
10584                     JOIN asset.call_number cn ON (cn.record = b.id)
10585                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
10586              WHERE  NOT b.deleted
10587              GROUP BY b.id
10588              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
10589
10590                 </oils_persist:source_definition>
10591                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10592                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10593                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
10594                 </fields>
10595                 <links>
10596                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10597                 </links>
10598                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10599                         <actions>
10600                                 <retrieve/>
10601                         </actions>
10602                 </permacrud>
10603         </class>
10604
10605         <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">
10606                 <oils_persist:source_definition>
10607
10608             -- -- 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.
10609             -- -- 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
10610             -- -- may not.
10611             -- SELECT
10612             --     bre.id AS bib_id,
10613             --     COALESCE( z.copy_count, 0 ) AS copy_count,
10614             --     COALESCE( z.hold_count, 0 ) AS hold_count,
10615             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
10616             -- FROM (
10617                 SELECT
10618                     y.bre AS id,
10619                     COALESCE( x.copy_count, 0 ) AS copy_count,
10620                     y.hold_count AS hold_count,
10621                     (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
10622                 FROM (
10623                         SELECT
10624                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
10625                             COUNT(*) AS hold_count
10626                         FROM action.hold_request h
10627                         WHERE
10628                             cancel_time IS NULL
10629                             AND fulfillment_time IS NULL
10630                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
10631                         GROUP BY 1
10632                     )y LEFT JOIN (
10633                         SELECT 
10634                             (SELECT id
10635                                 FROM biblio.record_entry 
10636                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
10637                             ) AS bre, 
10638                             COUNT(*) AS copy_count
10639                         FROM asset.copy
10640                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
10641                         WHERE copy.holdable 
10642                             AND NOT copy.deleted 
10643                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
10644                         GROUP BY 1
10645                     )x ON x.bre = y.bre
10646                 -- )z RIGHT JOIN (
10647                 --     SELECT id
10648                 --     FROM biblio.record_entry
10649                 --     WHERE NOT deleted
10650                 -- )bre ON (z.bib_id = bre.id)
10651                 
10652
10653                 </oils_persist:source_definition>
10654                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10655                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
10656                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
10657                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
10658                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
10659                 </fields>
10660                 <links>
10661                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10662                 </links>
10663                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10664                         <actions>
10665                                 <retrieve/>
10666                         </actions>
10667                 </permacrud>
10668         </class>
10669
10670         <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">
10671                 <oils_persist:source_definition>
10672             SELECT *,
10673                 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,
10674                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10675             FROM
10676                 (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
10677                     FROM
10678                         action.hold_request ahr
10679                         JOIN reporter.hold_request_record rhrr USING (id)
10680                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10681                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10682                     WHERE
10683                         ahr.cancel_time IS NULL
10684                         AND ahr.fulfillment_time IS NULL
10685                     GROUP BY bib_record, pickup_lib
10686                 )x
10687                 JOIN
10688                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10689                     FROM
10690                         action.hold_request ahr
10691                         JOIN reporter.hold_request_record rhrr USING (id)
10692                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10693                     WHERE
10694                         ahr.cancel_time IS NULL
10695                         AND ahr.fulfillment_time IS NULL
10696                     GROUP BY bib_record
10697                 )y
10698                 USING (id)
10699                 </oils_persist:source_definition>
10700                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10701                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10702                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
10703                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
10704                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
10705                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10706                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10707                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
10708                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10709                 </fields>
10710                 <links>
10711                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10712                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
10713                 </links>
10714                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10715                         <actions>
10716                                 <retrieve/>
10717                         </actions>
10718                 </permacrud>
10719         </class>
10720
10721         <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) ">
10722                 <oils_persist:source_definition>
10723             WITH counts_at_ou AS (
10724                 SELECT bib_record, pickup_lib, count(DISTINCT ahr.id) AS holds_at_pickup_library, 
10725                     COALESCE(count(DISTINCT ac.id),0) as copy_count_at_pickup_library
10726                 FROM action.hold_request ahr
10727                 JOIN reporter.hold_request_record rhrr USING (id)
10728                 LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10729                 LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
10730                 WHERE ahr.cancel_time IS NULL
10731                 AND ahr.fulfillment_time IS NULL
10732                 GROUP BY bib_record, pickup_lib
10733             )
10734             SELECT *,
10735                 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,
10736                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
10737             FROM
10738                 (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
10739                 FROM actor.org_unit aou
10740                 JOIN counts_at_ou cao ON (cao.pickup_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))) 
10741                 GROUP BY bib_record, pickup_lib_or_desc
10742                 )x
10743                 JOIN
10744                 (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
10745                     FROM
10746                         action.hold_request ahr
10747                         JOIN reporter.hold_request_record rhrr USING (id)
10748                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
10749                     WHERE
10750                         ahr.cancel_time IS NULL
10751                         AND ahr.fulfillment_time IS NULL
10752                     GROUP BY bib_record
10753                 )y
10754                 USING (id)
10755                 </oils_persist:source_definition>
10756                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10757                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
10758                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
10759                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
10760                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
10761                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
10762                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
10763                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
10764                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
10765                 </fields>
10766                 <links>
10767                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
10768                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
10769                 </links>
10770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10771                         <actions>
10772                                 <retrieve/>
10773                         </actions>
10774                 </permacrud>
10775         </class>
10776
10777         <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">
10778                 <oils_persist:source_definition>
10779             SELECT
10780                 ac.id,
10781                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
10782                 MAX(actac.xact_start) AS last_circ
10783             FROM asset.copy ac
10784                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10785             GROUP BY ac.id
10786
10787             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
10788             --SELECT
10789             --    ac.id,
10790             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
10791             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
10792             --FROM asset.copy ac
10793             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
10794             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
10795             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
10796                 </oils_persist:source_definition>
10797                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
10798                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
10799                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
10800                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
10801                 </fields>
10802                 <links>
10803                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
10804                 </links>
10805                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10806                         <actions>
10807                                 <retrieve/>
10808                         </actions>
10809                 </permacrud>
10810         </class>
10811
10812         <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">
10813                 <fields oils_persist:primary="id">
10814                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
10815                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
10816                 </fields>
10817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10818                         <actions>
10819                                 <retrieve/>
10820                         </actions>
10821                 </permacrud>
10822         </class>
10823
10824         <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">
10825                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
10826                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10827                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
10828                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10829                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10830                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10831                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10832                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10833                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
10834                 </fields>
10835                 <links>
10836                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
10837                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10838                 </links>
10839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10840                         <actions>
10841                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10842                                 <retrieve/>
10843                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10844                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10845                         </actions>
10846                 </permacrud>
10847         </class>
10848
10849         <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">
10850                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
10851                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
10852                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
10853                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
10854                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
10855                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
10856                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
10857                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
10858                 </fields>
10859                 <links>
10860                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
10861                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
10862                 </links>
10863                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10864                         <actions>
10865                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10866                                 <retrieve/>
10867                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10868                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
10869                         </actions>
10870                 </permacrud>
10871         </class>
10872
10873
10874         <!-- ********************************************************************************************************************* -->
10875         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
10876         <!-- ********************************************************************************************************************* -->
10877         <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">
10878                 <fields oils_persist:primary="id">
10879                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
10880                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
10881                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
10882                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10883                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
10884                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
10885                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
10886                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
10887                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
10888                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
10889                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
10890                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
10891                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
10892                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
10893                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10894                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
10895                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
10896                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
10897                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
10898                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
10899                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
10900                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
10901                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
10902                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
10903                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
10904                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
10905                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
10906                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
10907                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
10908                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
10909                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
10910                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
10911                 </fields>
10912                 <links>
10913                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
10914                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
10915                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
10916                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
10917                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
10918                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
10919                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
10920                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
10921                 </links>
10922         </class>
10923
10924         <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">
10925                 <fields oils_persist:primary="id">
10926                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10927                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10928                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10929                 </fields>
10930                 <links>
10931                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10932                 </links>
10933         </class>
10934
10935         <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">
10936                 <fields oils_persist:primary="id">
10937                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
10938                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
10939                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
10940                 </fields>
10941                 <links>
10942                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
10943                 </links>
10944         </class>
10945
10946         <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">
10947                 <fields oils_persist:primary="id">
10948                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
10949
10950                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
10951                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
10952                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
10953
10954                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
10955                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
10956                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
10957
10958                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
10959                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
10960
10961                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
10962                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
10963                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
10964
10965                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
10966                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
10967
10968                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
10969                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
10970                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
10971
10972                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
10973                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
10974                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
10975
10976                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
10977                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
10978                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
10979                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
10980
10981                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
10982                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
10983
10984                 </fields>
10985                 <links>
10986                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
10987                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10988                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
10989                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
10990                 </links>
10991         </class>
10992
10993         <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">
10994                 <oils_persist:source_definition>
10995
10996             SELECT
10997                 po.ordering_agency AS ordering_agency,
10998                 po.id AS purchase_order,
10999                 li.id AS lineitem,
11000                 lid.id AS lineitem_detail,
11001                 cpa.id AS claim_policy_action
11002             FROM
11003                 acq.lineitem_detail lid
11004                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
11005                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
11006                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
11007                 JOIN acq.claim_policy_action cpa ON (
11008                     cpa.claim_policy = cp.id
11009
11010                     -- we only care about claim policy actions whose claim
11011                     -- interval we'd reached or exceeded
11012                     AND (NOW() - cpa.action_interval) &gt; po.order_date
11013
11014                     -- filter out all claim policy actions where claim events
11015                     -- have occurred on or after the action's action_interval
11016                     AND NOT EXISTS (
11017                         SELECT 1
11018                         FROM
11019                             acq.claim_event evt
11020                             JOIN acq.claim claim ON (
11021                                 claim.id = evt.claim
11022                                 AND claim.lineitem_detail = lid.id
11023                             )
11024                         WHERE
11025                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
11026                     )
11027                 )
11028             WHERE
11029                 lid.cancel_reason IS NULL
11030                 AND li.cancel_reason IS NULL -- belt/suspenders
11031                 AND po.cancel_reason IS NULL -- belt/suspenders
11032                 AND lid.recv_time IS NULL
11033                 AND po.state = 'on-order'
11034             ORDER BY 1, 2, 3, 4, 5
11035
11036                 </oils_persist:source_definition>
11037                 <fields>
11038                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
11039                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
11040                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11041                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11042                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
11043                 </fields>
11044                 <links>
11045                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
11046                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
11047                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11048                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11049                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
11050                 </links>
11051         </class>
11052         <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">
11053                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11054                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11055                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11056                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11057                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11058                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11059                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11060                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11061                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11062                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11063                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11064                 </fields>
11065                 <links>
11066                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11067                 </links>
11068     </class>
11069         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
11070                 <oils_persist:source_definition>
11071             SELECT * FROM acq.lineitem_summary 
11072                                 WHERE item_count > (invoice_count + cancel_count)
11073         </oils_persist:source_definition>
11074                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11075                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11076                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11077                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11078                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11079                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11080                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11081                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11082                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11083                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11084                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11085                 </fields>
11086                 <links>
11087                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11088                 </links>
11089     </class>
11090         <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">
11091                 <oils_persist:source_definition>
11092
11093                         SELECT  t.*
11094                           FROM  action.transit_copy t
11095                                 JOIN actor.org_unit AS s ON (t.source = s.id)
11096                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
11097                           WHERE s.parent_ou &lt;&gt; d.parent_ou
11098
11099                 </oils_persist:source_definition>
11100                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
11101                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
11102                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
11103                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
11104                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
11105                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
11106                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
11107                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
11108                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
11109                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
11110                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
11111                 </fields>
11112                 <links>
11113                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
11114                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
11115                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
11116                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
11117                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11118                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
11119                 </links>
11120         </class>
11121
11122     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
11123                 <oils_persist:source_definition>
11124
11125         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
11126                 SELECT
11127                         cp.id as copy,
11128                         COUNT(circ.id),
11129                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11130                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11131                 FROM
11132                         asset.copy cp
11133                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
11134                 GROUP BY 1, 3, 4
11135                 UNION ALL
11136                 SELECT
11137                         cp.id as copy,
11138                         COUNT(circ.id),
11139                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11140                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11141                 FROM
11142                         asset.copy cp
11143                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
11144                 GROUP BY 1, 3, 4
11145                 UNION ALL
11146                 SELECT
11147                         id as copy,
11148                         circ_count,
11149                         -1 AS year,
11150                         false as is_renewal
11151                 FROM
11152                         extend_reporter.legacy_circ_count
11153         )x GROUP BY 1, 3, 4
11154
11155                 </oils_persist:source_definition>
11156         <fields>
11157             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
11158             <field reporter:label="Count" name="count" reporter:datatype="int"/>
11159             <field reporter:label="Year" name="year" reporter:datatype="int"/>
11160             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
11161         </fields>
11162                 <links>
11163                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
11164                 </links>
11165                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11166                         <actions>
11167                                 <retrieve/>
11168                         </actions>
11169                 </permacrud>
11170     </class>
11171
11172         <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">
11173                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
11174                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
11175                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
11176                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
11177                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
11178                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
11179                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
11180                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
11181                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
11182                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
11183                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
11184                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
11185                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
11186                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
11187                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
11188                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
11189                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
11190                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
11191                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
11192                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
11193                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
11194                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
11195                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
11196                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
11197                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
11198                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
11199                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
11200                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
11201                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
11202                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
11203                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
11204                 </fields>
11205                 <links>
11206                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
11207                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
11208                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
11209                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11210                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
11211                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11212                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11213                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
11214                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
11215                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
11216                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
11217                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
11218                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
11219                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
11220                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
11221                 </links>
11222         </class>
11223
11224     <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">
11225         <fields oils_persist:primary="id">
11226             <field reporter:label="Title" name="title" reporter:datatype="text"/>
11227             <field reporter:label="Author" name="author" reporter:datatype="text"/>
11228             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
11229             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11230             <field reporter:label="Price" name="price" reporter:datatype="money"/>
11231             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11232             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
11233             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
11234             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11235             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
11236             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11237             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
11238             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
11239             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
11240             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11241             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11242             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
11243             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
11244             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
11245             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
11246             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
11247             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
11248             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11249             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
11250             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
11251             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
11252             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
11253             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
11254             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
11255             <field reporter:label="Status" name="status" reporter:datatype="link"/>
11256             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
11257             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
11258             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
11259             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
11260         </fields>
11261         <links>
11262             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11263             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11264             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11265             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11266             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
11267             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
11268             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
11269             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
11270         </links>
11271     </class>
11272
11273     <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">
11274         <fields oils_persist:primary="id">
11275             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11276             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11277             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11278             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11279         </fields>
11280         <links>
11281             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11282             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11283         </links>
11284     </class>
11285
11286     <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">
11287         <fields oils_persist:primary="owning_lib">
11288             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11289             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11290             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11291         </fields>
11292         <links>
11293             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11294         </links>
11295     </class>
11296
11297     <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">
11298         <fields oils_persist:primary="id">
11299             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11300             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11301             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11302             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11303             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11304         </fields>
11305         <links>
11306             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11307             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11308             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11309         </links>
11310     </class>
11311
11312     <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">
11313         <fields oils_persist:primary="circ_lib">
11314             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11315             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11316             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11317             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11318         </fields>
11319         <links>
11320             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11321             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11322         </links>
11323     </class>
11324
11325     <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">
11326         <fields oils_persist:primary="id">
11327             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11328             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11329             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11330             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11331             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11332         </fields>
11333         <links>
11334             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11335             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11336             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11337         </links>
11338     </class>
11339
11340     <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">
11341         <fields oils_persist:primary="home_ou">
11342             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11343             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11344             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11345             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11346         </fields>
11347         <links>
11348             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11349             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11350         </links>
11351     </class>
11352         <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">
11353                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
11354                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
11355                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
11356                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
11357                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
11358                 </fields>
11359                 <links>
11360                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11361                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
11362                 </links>
11363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11364                         <actions>
11365                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11366                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
11367                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11368                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11369                         </actions>
11370                 </permacrud>
11371         </class>
11372         <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">
11373                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11374                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11375                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11376                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11377                 </fields>
11378                 <links>
11379                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11380                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11381                         </links>
11382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11383                 <actions>
11384                                 <create permission="ADMIN_ACQ_FUND_TAG">
11385                                         <context link="tag" field="owner"/>
11386                                 </create>
11387                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11388                                         <context link="tag" field="owner"/>
11389                                 </retrieve>
11390                                 <update permission="ADMIN_ACQ_FUND_TAG">
11391                                         <context link="tag" field="owner"/>
11392                                 </update>
11393                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11394                                         <context link="tag" field="owner"/>
11395                                 </delete>
11396                         </actions>
11397                 </permacrud>
11398         </class>
11399         <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">
11400                 <oils_persist:source_definition><![CDATA[
11401                 SELECT
11402                         poi.purchase_order AS purchase_order,
11403                         ii.invoice AS invoice,
11404                         NULL AS lineitem,
11405                         poi.id AS po_item,
11406                         NULL AS picklist
11407                 FROM
11408                         acq.po_item poi
11409                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11410                 UNION SELECT
11411                         jub.purchase_order AS purchase_order,
11412                         ie.invoice AS invoice,
11413                         jub.id AS lineitem,
11414                         NULL AS po_item,
11415                         jub.picklist AS picklist
11416                 FROM
11417                         acq.lineitem jub
11418                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11419                 UNION SELECT
11420                         ii.purchase_order AS purchase_order,
11421                         ii.invoice AS invoice,
11422                         NULL AS lineitem,
11423                         NULL AS po_item,
11424                         NULL AS picklist
11425                 FROM
11426                         acq.invoice_item ii
11427                 WHERE ii.po_item IS NULL
11428                 UNION SELECT
11429                         ie.purchase_order AS purchase_order,
11430                         ie.invoice AS invoice,
11431                         NULL AS lineitem,
11432                         NULL AS po_item,
11433                         NULL AS picklist
11434                 FROM
11435                         acq.invoice_entry ie
11436                 WHERE ie.lineitem IS NULL
11437                 UNION SELECT
11438                         NULL AS purchase_order,
11439                         NULL AS invoice,
11440                         jub.id AS lineitem,
11441                         NULL AS po_item,
11442                         jub.picklist AS picklist
11443                 FROM
11444                         acq.lineitem jub
11445                 WHERE jub.purchase_order IS NULL
11446                 ]]></oils_persist:source_definition>
11447                 <fields>
11448                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11449                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11450                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11451                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11452                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
11453                 </fields>
11454                 <links>
11455                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
11456                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
11457                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
11458                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
11459                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
11460                 </links>
11461         </class>
11462         <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">
11463                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
11464                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11465                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
11466                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
11467                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
11468                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
11469                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
11470                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
11471                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
11472                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
11473                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
11474                 </fields>
11475                 <links>
11476                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
11477                 </links>
11478                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11479                         <actions>
11480                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11481                                 <retrieve/>
11482                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11483                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
11484                         </actions>
11485                 </permacrud>
11486         </class>
11487
11488         <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">
11489                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
11490                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11491                         <field name="date_applied" reporter:datatype="timestamp"/>
11492                         <field name="org" reporter:datatype="org_unit"/>
11493                         <field name="original_value" reporter:datatype="text"/>
11494                         <field name="new_value" reporter:datatype="text"/>
11495                         <field name="field_name" reporter:datatype="link"/>
11496                 </fields>
11497                 <links>
11498                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
11499                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
11500                 </links>
11501                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11502                         <actions>
11503                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
11504                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
11505                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11506                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
11507                         </actions>
11508                 </permacrud>
11509         </class>
11510         <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">
11511                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11512                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11513                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11514                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11515                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11516                 </fields>
11517                 <links>
11518                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11519                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
11520                 </links>
11521         </class>
11522         <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">
11523                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
11524                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11525                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
11526                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
11527                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11528                 </fields>
11529                 <links>
11530                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
11531                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
11532                 </links>
11533         </class>
11534         <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">
11535                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
11536                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11537                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11538                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
11539                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
11540                 </fields>
11541                 <links>
11542                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
11543                 </links>
11544                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11545                         <actions>
11546                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11547                                 <retrieve/>
11548                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11549                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
11550                         </actions>
11551                 </permacrud>
11552         </class>
11553         <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">
11554                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
11555                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11556                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
11557                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
11558                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
11559                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
11560                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
11561                 </fields>
11562                 <links>
11563                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
11564                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
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="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">
11576         <oils_persist:source_definition>
11577         SELECT ahcm.target_copy AS id,count(*) AS count
11578          FROM
11579          action.hold_request ahr,
11580          action.hold_copy_map ahcm
11581          WHERE
11582          ahr.cancel_time IS NULL AND
11583          ahr.fulfillment_time IS NULL AND
11584          ahr.capture_time IS NULL AND
11585          ahr.id = ahcm.hold
11586          GROUP BY ahcm.target_copy
11587         </oils_persist:source_definition>
11588         <fields oils_persist:primary="id">
11589             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11590             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
11591         </fields>
11592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11593             <actions>
11594                <retrieve/>
11595             </actions>
11596         </permacrud>
11597         </class>
11598
11599         <!-- ********************************************************************************************************************* -->
11600
11601 </IDL>
11602
11603 <!--
11604     vim:noet:ts=4:sw=4:
11605 -->