]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/examples/fm_IDL.xml
LP#1744996 Track bib record merges
[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="Owning Library" name="owning_lib" reporter:datatype="text"/>
424                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="text"/>
425                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
426                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
427                         <field reporter:label="Shelving Location" name="location" reporter:datatype="text"/>
428                         <field reporter:label="Circulate" name="circulate" reporter:datatype="text"/>
429                         <field reporter:label="Deposit" name="deposit" reporter:datatype="text"/>
430                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
431                         <field reporter:label="Reference" name="ref" reporter:datatype="text"/>
432                         <field reporter:label="Holdable" name="holdable" reporter:datatype="text"/>
433                         <field reporter:label="Price" name="price" reporter:datatype="text"/>
434                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
435                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="text"/>
436                         <field reporter:label="Circulate As MARC Type" name="circ_as_type" reporter:datatype="text"/>
437                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
438                         <field reporter:label="Public Note" name="pub_note" reporter:datatype="text"/>
439                         <field reporter:label="Private Note" name="priv_note" reporter:datatype="text"/>
440                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="text"/>
441                         <field reporter:label="Copy Number" name="copy_number" reporter:datatype="text"/>
442                         <field reporter:label="Overlay Match ID" name="internal_id" reporter:datatype="text"/>
443                         <field reporter:label="Stat Cat Data" name="stat_cat_data" reporter:datatype="text"/>
444                         <field reporter:label="Parts Data" name="parts_data" reporter:datatype="text"/>
445                 </fields>
446                 <links>
447                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
448                 </links>
449                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
450                         <actions>
451                                 <create permission="CREATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
452                                 <retrieve permission="CREATE_IMPORT_ITEM_ATTR_DEF UPDATE_IMPORT_ITEM_ATTR_DEF DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
453                                 <update permission="UPDATE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
454                                 <delete permission="DELETE_IMPORT_ITEM_ATTR_DEF ADMIN_IMPORT_ITEM_ATTR_DEF" context_field="owner"/>
455                         </actions>
456                 </permacrud>
457         </class>
458
459         <class id="vbq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_queue" oils_persist:tablename="vandelay.bib_queue" reporter:label="Import/Overlay Bib Queue">
460                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
461                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
462                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
463                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
464                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
465                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
466                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
467                         <field reporter:label="Item Import Attribute Definition" name="item_attr_def" reporter:datatype="link"/>
468                         <field reporter:label="Match Bucket" name="match_bucket" reporter:datatype="link"/>
469                 </fields>
470                 <links>
471                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
472                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
473                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
474                         <link field="match_bucket" reltype="has_a" key="id" map="" class="cbreb"/>
475                 </links>
476                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
477                         <actions>
478                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
479                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
480                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
481                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
482                         </actions>
483                 </permacrud>
484         </class>
485
486         <class id="vie" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_error" oils_persist:tablename="vandelay.import_error" reporter:label="Import/Overlay Error Definitions">
487                 <fields oils_persist:primary="code">
488                         <field reporter:label="Error Code" name="code" reporter:selector="description" reporter:datatype="id"/>
489                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
490                 </fields>
491                 <links>
492                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
493                         <link field="item_attr_def" reltype="has_a" key="id" map="" class="viiad"/>
494                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
495                 </links>
496                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
497                         <actions>
498                                 <retrieve/>
499                         </actions>
500                 </permacrud>
501         </class>
502
503         <class id="vqbr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record" oils_persist:tablename="vandelay.queued_bib_record" reporter:label="Queued Bib Record">
504                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
505                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
506                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
507                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
508                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
509                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
510                         <field reporter:label="Bib Source" name="bib_source" reporter:datatype="link"/>
511                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
512                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
513                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
514                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
515                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
516                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
517                         <field reporter:label="Import Items" name="import_items" oils_persist:virtual="true" reporter:datatype="link"/>
518                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
519                 </fields>
520                 <links>
521                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
522                         <link field="queue" reltype="has_a" key="id" map="" class="vbq"/>
523                         <link field="bib_source" reltype="has_a" key="id" map="" class="cbs"/>
524                         <link field="imported_as" reltype="has_a" key="id" map="" class="bre"/>
525             <link field="attributes" reltype="has_many" key="record" map="" class="vqbra"/>
526             <link field="matches" reltype="has_many" key="queued_record" map="" class="vbm"/>
527             <link field="import_items" reltype="has_many" key="record" map="" class="vii"/>
528                 </links>
529                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
530                         <actions>
531                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
532                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
533                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
534                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
535                         </actions>
536                 </permacrud>
537         </class>
538
539         <class id="vqbrad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_attr_definition" oils_persist:tablename="vandelay.bib_attr_definition" reporter:label="Queued Bib Record Attribute Definition">
540                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_attr_definition_id_seq">
541                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
542                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
543                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
544                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
545                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
546                 </fields>
547                 <links/>
548                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
549                         <actions>
550                                 <create permission="CREATE_BIB_IMPORT_FIELD_DEF" global_required="true"/>
551                 <retrieve/>
552                                 <update permission="UPDATE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
553                                 <delete permission="DELETE_BIB_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
554                         </actions>
555                 </permacrud>
556         </class>
557
558         <class id="vqbra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_bib_record_attr" oils_persist:tablename="vandelay.queued_bib_record_attr" reporter:label="Queued Bib Record Attribute">
559                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_bib_record_attr_id_seq">
560                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
561                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
562                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
563                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
564                 </fields>
565                 <links>
566                         <link field="record" reltype="has_a" key="id" map="" class="vqbr"/>
567                         <link field="field" reltype="has_a" key="id" map="" class="vqbrad"/>
568                 </links>
569                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
570                         <actions>
571                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
572                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
573                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
574                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
575                         </actions>
576                 </permacrud>
577         </class>
578
579         <class id="vbm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::bib_match" oils_persist:tablename="vandelay.bib_match" reporter:label="Queued Bib Record Match">
580                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.bib_match_id_seq">
581                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
582                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
583                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
584                         <field reporter:label="Quality" name="quality" reporter:datatype="text"/>
585                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
586                 </fields>
587                 <links>
588                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
589                         <link field="eg_record" reltype="has_a" key="id" map="" class="bre"/>
590                 </links>
591                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
592                         <actions>
593                                 <create permission="CREATE_BIB_IMPORT_QUEUE" global_required="true"/>
594                                 <retrieve permission="CREATE_BIB_IMPORT_QUEUE UPDATE_BIB_IMPORT_QUEUE DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
595                                 <update permission="UPDATE_BIB_IMPORT_QUEUE" global_required="true"/>
596                                 <delete permission="DELETE_BIB_IMPORT_QUEUE" global_required="true"/>
597                         </actions>
598                 </permacrud>
599         </class>
600
601         <class id="vaq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_queue" oils_persist:tablename="vandelay.authority_queue" reporter:label="Import/Overlay Authority Queue">
602                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queue_id_seq">
603                         <field reporter:label="Queue ID" name="id" reporter:selector="name" reporter:datatype="id"/>
604                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
605                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
606                         <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
607                         <field reporter:label="Type" name="queue_type" reporter:datatype="text"/>
608                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
609                 </fields>
610                 <links>
611                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
612                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
613                 </links>
614                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
615                         <actions>
616                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
617                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
618                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
619                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
620                         </actions>
621                 </permacrud>
622         </class>
623
624         <class id="vqar" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record" oils_persist:tablename="vandelay.queued_authority_record" reporter:label="Queued Authority Record">
625                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_record_id_seq">
626                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
627                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
628                         <field reporter:label="Import Time" name="import_time" reporter:datatype="timestamp"/>
629                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
630                         <field reporter:label="Queue" name="queue" reporter:datatype="link"/>
631                         <field reporter:label="Final Target Record" name="imported_as" reporter:datatype="link"/>
632                         <field reporter:label="Import Error" name="import_error" reporter:datatype="link"/>
633                         <field reporter:label="Import Error Detail" name="error_detail" reporter:datatype="text"/>
634                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
635                         <field reporter:label="Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link"/>
636                         <field reporter:label="Matches" name="matches" oils_persist:virtual="true" reporter:datatype="link"/>
637                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
638                 </fields>
639                 <links>
640                         <link field="import_error" reltype="has_a" key="code" map="" class="vie"/>
641                         <link field="queue" reltype="has_a" key="id" map="" class="vaq"/>
642                         <link field="imported_as" reltype="has_a" key="id" map="" class="are"/>
643             <link field="attributes" reltype="has_many" key="record" map="" class="vqara"/>
644             <link field="matches" reltype="has_many" key="queued_record" map="" class="vam"/>
645                 </links>
646                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
647                         <actions>
648                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
649                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
650                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
651                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
652                         </actions>
653                 </permacrud>
654         </class>
655
656         <class id="vqarad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_attr_definition" oils_persist:tablename="vandelay.authority_attr_definition" reporter:label="Queued Authority Record Attribute Definition">
657                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_attr_definition_id_seq">
658                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
659                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
660                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
661                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
662                         <field reporter:label="Remove RegExp" name="remove" reporter:datatype="text"/>
663                 </fields>
664                 <links/>
665                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
666                         <actions>
667                                 <create permission="CREATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
668                 <retrieve/>
669                                 <update permission="UPDATE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
670                                 <delete permission="DELETE_AUTHORITY_IMPORT_IMPORT_FIELD_DEF" global_required="true"/>
671                         </actions>
672                 </permacrud>
673         </class>
674
675         <class id="vqara" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::queued_authority_record_attr" oils_persist:tablename="vandelay.queued_authority_record_attr" reporter:label="Queued Authority Record Attribute">
676                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.queued_authority_record_attr_id_seq">
677                         <field reporter:label="Attribute ID" name="id" reporter:datatype="id"/>
678                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
679                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
680                         <field reporter:label="Value" name="attr_value" reporter:datatype="text"/>
681                 </fields>
682                 <links>
683                         <link field="record" reltype="has_a" key="id" map="" class="vqar"/>
684                         <link field="field" reltype="has_a" key="id" map="" class="vqarad"/>
685                 </links>
686                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
687                         <actions>
688                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
689                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
690                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
691                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
692                         </actions>
693                 </permacrud>
694         </class>
695
696         <class id="vam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::authority_match" oils_persist:tablename="vandelay.authority_match" reporter:label="Queued Authority Record Match">
697                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.authority_match_id_seq">
698                         <field reporter:label="Match ID" name="id" reporter:datatype="id"/>
699                         <field reporter:label="Queued Record" name="queued_record" reporter:datatype="link"/>
700                         <field reporter:label="Evergreen Record" name="eg_record" reporter:datatype="link"/>
701                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
702                         <field reporter:label="Match Score" name="match_score" reporter:datatype="text"/>
703                 </fields>
704                 <links>
705                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqar"/>
706                         <link field="eg_record" reltype="has_a" key="id" map="" class="are"/>
707                 </links>
708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
709                         <actions>
710                                 <create permission="CREATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
711                                 <retrieve permission="CREATE_AUTHORITY_IMPORT_QUEUE UPDATE_AUTHORITY_IMPORT_QUEUE DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
712                                 <update permission="UPDATE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
713                                 <delete permission="DELETE_AUTHORITY_IMPORT_QUEUE" global_required="true"/>
714                         </actions>
715                 </permacrud>
716         </class>
717
718         <class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
719                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
720                         <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
721                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
722                         <field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
723                         <field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
724                 </fields>
725                 <links>
726                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
727                 </links>
728                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
729                         <actions>
730                                 <create permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
731                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET" context_field="owner"/>
732                                 <update permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
733                                 <delete permission="ADMIN_IMPORT_MATCH_SET" context_field="owner"/>
734                         </actions>
735                 </permacrud>
736         </class>
737
738         <class id="vmsp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_point" oils_persist:tablename="vandelay.match_set_point" reporter:label="Record Matching Definition">
739                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_point_id_seq">
740                         <field reporter:label="Match Definition ID" name="id" reporter:datatype="id"/>
741                         <field reporter:label="Expression Tree Parent" name="parent" reporter:datatype="link"/>
742                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
743                         <field reporter:label="Boolean Operator" name="bool_op" reporter:datatype="text"/>
744                         <field reporter:label="Coded Field" name="svf" reporter:datatype="link"/>
745                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
746                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
747             <field reporter:label="Negate" name="negate"  reporter:datatype="bool"/>
748                         <field reporter:label="Importance" name="quality" reporter:datatype="int"/>
749                         <field reporter:label="Expression Tree Children" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
750                         <field reporter:label="Authority Heading" name="heading" reporter:datatype="bool"/>
751                 </fields>
752                 <links>
753                         <link field="parent" reltype="has_a" key="id" map="" class="vmsp"/>
754                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
755                         <link field="svf" reltype="has_a" key="id" map="" class="crad"/>
756                         <link field="children" reltype="has_many" key="parent" map="" class="vmsp"/>
757                 </links>
758                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
759                         <actions>
760                                 <create permission="ADMIN_IMPORT_MATCH_SET">
761                     <context link="match_set" field="owner"/>
762                                 </create>
763                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET VIEW_IMPORT_MATCH_SET">
764                     <context link="match_set" field="owner"/>
765                                 </retrieve>
766                                 <update permission="ADMIN_IMPORT_MATCH_SET">
767                     <context link="match_set" field="owner"/>
768                                 </update>
769                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
770                     <context link="match_set" field="owner"/>
771                                 </delete>
772                         </actions>
773                 </permacrud>
774         </class>
775
776         <class id="vmsq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set_quality" oils_persist:tablename="vandelay.match_set_quality" reporter:label="Record Quality Metric">
777                 <fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_quality_id_seq">
778                         <field reporter:label="Quality Metric ID" name="id" reporter:datatype="id"/>
779                         <field reporter:label="Match Set" name="match_set" reporter:datatype="link"/>
780                         <field reporter:label="Record Attribute" name="svf" reporter:datatype="text"/>
781                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
782                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
783                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
784                         <field reporter:label="Quality" name="quality" reporter:datatype="int"/>
785                 </fields>
786                 <links>
787                         <link field="match_set" reltype="has_a" key="id" map="" class="vms"/>
788                 </links>
789                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
790                         <actions>
791                                 <create permission="ADMIN_IMPORT_MATCH_SET">
792                     <context link="match_set" field="owner"/>
793                                 </create>
794                                 <retrieve permission="ADMIN_IMPORT_MATCH_SET">
795                     <context link="match_set" field="owner"/>
796                                 </retrieve>
797                                 <update permission="ADMIN_IMPORT_MATCH_SET">
798                     <context link="match_set" field="owner"/>
799                                 </update>
800                                 <delete permission="ADMIN_IMPORT_MATCH_SET">
801                     <context link="match_set" field="owner"/>
802                                 </delete>
803                         </actions>
804                 </permacrud>
805         </class>
806
807         <class id="auoi" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_org_unit_opt_in" oils_persist:tablename="actor.usr_org_unit_opt_in" reporter:label="User Sharing Opt-in">
808                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_org_unit_opt_in_id_seq">
809                         <field reporter:label="Opt-in ID" name="id" reporter:datatype="id"/>
810                         <field reporter:label="Workstation" name="opt_in_ws" reporter:datatype="link"/>
811                         <field reporter:label="Staff Member" name="staff" reporter:datatype="link"/>
812                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
813                         <field reporter:label="Allowed Org Unit" name="org_unit" reporter:datatype="link"/>
814                         <field reporter:label="Opt-in Date/Time" name="opt_in_ts" reporter:datatype="timestamp"/>
815                 </fields>
816                 <links>
817                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
818                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
819                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
820                         <link field="opt_in_ws" reltype="has_a" key="id" map="" class="aws"/>
821                 </links>
822         </class>
823
824     <class id="cgf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::global_flag" oils_persist:tablename="config.global_flag" reporter:label="Global Flags and Settings" oils_persist:field_safe="true">
825         <fields oils_persist:primary="name">
826             <field reporter:label="Name" name="name" reporter:datatype="text"/>
827             <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
828             <field reporter:label="Value" name="value"  reporter:datatype="text"/>
829             <field reporter:label="Enabled" name="enabled"  reporter:datatype="bool"/>
830         </fields>
831         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
832             <actions>
833                 <create   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
834                 <retrieve permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
835                 <update   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
836                 <delete   permission="ADMIN_GLOBAL_FLAG" global_required="true"/>
837             </actions>
838         </permacrud>
839     </class>
840
841     <class id="cin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::index_normalizer" oils_persist:tablename="config.index_normalizer" reporter:label="Indexing Normalizer" oils_persist:field_safe="true">
842         <fields oils_persist:primary="id">
843             <field reporter:label="ID" name="id" reporter:datatype="id"/>
844             <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
845             <field reporter:label="Description" name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
846             <field reporter:label="Function" name="func"  reporter:datatype="text"/>
847             <field reporter:label="Required Parameter Count" name="param_count"  reporter:datatype="int"/>
848         </fields>
849         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
850             <actions>
851                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
852                 <retrieve/>
853                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
854                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
855             </actions>
856         </permacrud>
857     </class>
858
859         <class id="cmfinm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::metabib_field_index_norm_map" oils_persist:tablename="config.metabib_field_index_norm_map" reporter:label="Metabib Field to Indexing Normalizer Map" oils_persist:field_safe="true">
860                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_index_norm_map_id_seq">
861                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
862                         <field reporter:label="Metabib Field" name="field" reporter:datatype="link"/>
863                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
864                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
865                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
866                 </fields>
867                 <links>
868                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
869                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
870                 </links>
871         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
872             <actions>
873                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
874                 <retrieve/>
875                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
876                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
877             </actions>
878         </permacrud>
879         </class>
880
881         <class id="cmrcfmt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_format" oils_persist:tablename="config.marc_format" reporter:label="MARC Formats" oils_persist:field_safe="true">
882                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_format_id_seq">
883                         <field reporter:label="ID"   name="id" reporter:datatype="id" reporter:selector="name" />
884                         <field reporter:label="Code" name="code" reporter:datatype="text" oils_obj:required="true"/>
885                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
886         </fields>
887         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
888             <actions>
889                 <create permission="ADMIN_TAG_TABLE" global_required="true"/>
890                 <retrieve/>
891                 <update permission="ADMIN_TAG_TABLE" global_required="true"/>
892                 <delete permission="ADMIN_TAG_TABLE" global_required="true"/>
893             </actions>
894         </permacrud>
895         </class>
896
897         <class id="cmrcfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_field" oils_persist:tablename="config.marc_field" reporter:label="MARC Fields" oils_persist:field_safe="true">
898                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_field_id_seq">
899                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
900                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
901                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true" />
902                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
903                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
904                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
905                         <field reporter:label="Fixed Field?" name="fixed_field" reporter:datatype="bool"/>
906                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
907                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
908                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
909                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
910         </fields>
911                 <links>
912                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
913                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
914         </links>
915         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
916             <actions>
917                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
918                 <retrieve/>
919                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
920                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
921             </actions>
922         </permacrud>
923         </class>
924
925         <class id="cmrcsubfld" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::marc_subfield" oils_persist:tablename="config.marc_subfield" reporter:label="MARC Subfields" oils_persist:subfield_safe="true">
926                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc_subfield_id_seq">
927                         <field reporter:label="ID"   name="id" reporter:datatype="id"/>
928                         <field reporter:label="MARC Format" name="marc_format" reporter:datatype="link" oils_obj:required="true"/>
929                         <field reporter:label="MARC Record Type" name="marc_record_type" reporter:datatype="text" oils_obj:required="true"/>
930                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text" oils_obj:required="true"/>
931                         <field reporter:label="MARC Subfield" name="code" reporter:datatype="text" oils_obj:required="true"/>
932                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
933                         <field reporter:label="Repeatable?" name="repeatable" reporter:datatype="bool"/>
934                         <field reporter:label="Mandatory?" name="mandatory" reporter:datatype="bool"/>
935                         <field reporter:label="Hidden?" name="hidden" reporter:datatype="bool"/>
936                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
937         </fields>
938                 <links>
939                         <link field="marc_format" reltype="has_a" key="id" map="" class="cmrcfmt"/>
940                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
941         </links>
942         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
943             <actions>
944                 <create permission="ADMIN_TAG_TABLE" context_field="owner"/>
945                 <retrieve/>
946                 <update permission="ADMIN_TAG_TABLE" context_field="owner"/>
947                 <delete permission="ADMIN_TAG_TABLE" context_field="owner"/>
948             </actions>
949         </permacrud>
950         </class>
951
952         <class id="crad" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_definition" oils_persist:tablename="config.record_attr_definition" reporter:label="SVF Record Attribute Defintion" oils_persist:field_safe="true">
953                 <fields oils_persist:primary="name">
954                         <field reporter:label="Name" name="name" reporter:datatype="id" reporter:selector="label"  oils_obj:required="true"/>
955                         <field reporter:label="Label" name="label" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
956                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
957                         <field reporter:label="Multi-valued?" name="multi" reporter:datatype="bool"/>
958                         <field reporter:label="Filter?" name="filter" reporter:datatype="bool"/>
959                         <field reporter:label="Sorter?" name="sorter" reporter:datatype="bool"/>
960                         <field reporter:label="Composite attribute?" name="composite" reporter:datatype="bool"/>
961                         <field reporter:label="MARC Tag" name="tag" reporter:datatype="text"/>
962                         <field reporter:label="MARC Subfields" name="sf_list" reporter:datatype="text"/>
963                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text"/>
964                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
965                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
966                         <field reporter:label="Starting Position" name="start_pos" reporter:datatype="int"/>
967                         <field reporter:label="String Length" name="string_len" reporter:datatype="int"/>
968                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
969                         <field reporter:label="Physical Characteristic" name="phys_char_sf" reporter:datatype="text"/>
970                         <field reporter:label="Vocabulary URI" name="vocabulary" reporter:datatype="text"/>
971                         <field reporter:label="Normalizers" name="normalizers" reporter:datatype="link" oils_persist:virtual="true"/>
972                 </fields>
973                 <links>
974                         <link field="format" reltype="has_a" key="name" map="" class="cxt"/>
975                         <link field="normalizers" reltype="has_many" key="name" map="" class="crainm"/>
976                 </links>
977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
978             <actions>
979                 <create permission="ADMIN_SVF" global_required="true"/>
980                 <retrieve/>
981                 <update permission="ADMIN_SVF" global_required="true"/>
982                 <delete permission="ADMIN_SVF" global_required="true"/>
983             </actions>
984         </permacrud>
985         </class>
986
987         <class id="csc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::sms_carrier" oils_persist:tablename="config.sms_carrier" reporter:label="SMS Carrier" oils_persist:field_safe="true">
988                 <fields oils_persist:primary="id" oils_persist:sequence="config.sms_carrier_id_seq">
989                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
990                         <field reporter:label="Region" name="region" reporter:datatype="text" oils_persist:i18n="true"/>
991                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
992             <field reporter:label="Active" name="active" reporter:datatype="bool" oils_persist:i18n="true"/>
993                         <field reporter:label="Email Gateway" name="email_gateway" reporter:datatype="text" oils_persist:i18n="true"/>
994                 </fields>
995                 <links/>
996         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
997             <actions>
998                 <create permission="ADMIN_SMS_CARRIER" global_required="true"/>
999                 <retrieve/>
1000                 <update permission="ADMIN_SMS_CARRIER" global_required="true"/>
1001                 <delete permission="ADMIN_SMS_CARRIER" global_required="true"/>
1002             </actions>
1003         </permacrud>
1004         </class>
1005
1006         <class id="ccraed" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::composite_attr_entry_definition" oils_persist:tablename="config.composite_attr_entry_definition" reporter:label="Composite Attribute Definitions" oils_persist:field_safe="true">
1007                 <fields oils_persist:primary="coded_value">
1008                         <field reporter:label="Coded Value" name="coded_value" reporter:datatype="id" oils_obj:required="true"/>
1009                         <field reporter:label="Defintion" name="definition" reporter:datatype="text"  oils_obj:required="true"/>
1010                 </fields>
1011                 <links>
1012                         <link field="coded_value" reltype="has_a" key="id" map="" class="ccvm"/>
1013                 </links>
1014         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1015             <actions>
1016                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1017                 <retrieve/>
1018                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1019                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1020             </actions>
1021         </permacrud>
1022         </class>
1023
1024         <class id="murav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::uncontrolled_record_attr_value" oils_persist:tablename="metabib.uncontrolled_record_attr_value" reporter:label="Uncontrolled Record Attribute Values" oils_persist:field_safe="true">
1025                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.uncontrolled_record_attr_value_id_seq">
1026                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1027                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1028                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1029                 </fields>
1030                 <links>
1031                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1032                 </links>
1033         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1034             <actions>
1035                 <retrieve/>
1036             </actions>
1037         </permacrud>
1038         </class>
1039
1040
1041         <class id="mrs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_sorter" oils_persist:tablename="metabib.record_sorter" reporter:label="Record Sort Values" oils_persist:field_safe="true">
1042                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.record_sorter_id_seq">
1043                         <field reporter:label="ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1044                         <field reporter:label="Bib Record ID" name="source" reporter:datatype="int" oils_obj:required="true"/>
1045                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1046                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1047                 </fields>
1048                 <links>
1049                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1050                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1051                 </links>
1052         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1053             <actions>
1054                 <retrieve/>
1055             </actions>
1056         </permacrud>
1057         </class>
1058
1059
1060         <class id="mravl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_vector_list" oils_persist:tablename="metabib.record_attr_vector_list" reporter:label="MVF Record Attribute Vectors" oils_persist:field_safe="true">
1061                 <fields oils_persist:primary="source">
1062                         <field reporter:label="Record ID" name="source" reporter:datatype="id" oils_obj:required="true"/>
1063                         <field reporter:label="Vector" name="vlist" reporter:datatype="text"  oils_obj:required="true"/> <!-- Actually an int[], but this is the best we can do in fm_IDL.xml -->
1064                 </fields>
1065                 <links>
1066                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
1067                 </links>
1068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1069             <actions>
1070                 <retrieve/>
1071             </actions>
1072         </permacrud>
1073         </class>
1074
1075         <class id="mraf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr_flat" oils_persist:tablename="metabib.record_attr_flat" reporter:label="MVF Record Attribute Flat List" oils_persist:field_safe="true">
1076                 <fields>
1077                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1078                         <field reporter:label="Attribute" name="attr" reporter:datatype="text"  oils_obj:required="true"/>
1079                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true"/>
1080                 </fields>
1081                 <links>
1082                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1083                 </links>
1084         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1085             <actions>
1086                 <retrieve/>
1087             </actions>
1088         </permacrud>
1089         </class>
1090
1091         <class id="mra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="metabib::record_attr" oils_persist:tablename="metabib.record_attr" reporter:label="SVF Record Attribute" oils_persist:field_safe="true" oils_persist:readonly="true">
1092                 <fields oils_persist:primary="id">
1093                         <field reporter:label="Record ID" name="id" reporter:datatype="id" oils_obj:required="true"/>
1094                         <field reporter:label="Attributes" name="attrs" reporter:datatype="text"  oils_obj:required="true"/>
1095                 </fields>
1096                 <links>
1097                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
1098                 </links>
1099         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1100             <actions>
1101                 <retrieve/>
1102             </actions>
1103         </permacrud>
1104         </class>
1105
1106         <class id="crainm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::record_attr_index_norm_map" oils_persist:tablename="config.record_attr_index_norm_map" reporter:label="SVF Record Attribute to Indexing Normalizer Map" oils_persist:field_safe="true">
1107                 <fields oils_persist:primary="id" oils_persist:sequence="config.record_attr_index_norm_map_id_seq">
1108                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
1109                         <field reporter:label="SVF Attribute" name="attr" reporter:datatype="link"/>
1110                         <field reporter:label="Normalizer" name="norm" reporter:datatype="link"/>
1111                         <field reporter:label="Parameters (JSON Array)" name="params" reporter:datatype="text"/>
1112                         <field reporter:label="Order of Application" name="pos" reporter:datatype="int"/>
1113                 </fields>
1114                 <links>
1115                         <link field="attr" reltype="has_a" key="name" map="" class="crad"/>
1116                         <link field="norm" reltype="has_a" key="id" map="" class="cin"/>
1117                 </links>
1118         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1119             <actions>
1120                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1121                 <retrieve/>
1122                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1123                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
1124             </actions>
1125         </permacrud>
1126         </class>
1127
1128         <class id="ccvm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::coded_value_map" oils_persist:tablename="config.coded_value_map" reporter:label="SVF Record Attribute Coded Value Map" oils_persist:field_safe="true">
1129                 <fields oils_persist:primary="id" oils_persist:sequence="config.coded_value_map_id_seq">
1130                         <field reporter:label="ID" name="id" reporter:datatype="id"  oils_obj:required="true" reporter:selector="value"/>
1131                         <field reporter:label="SVF Attribute" name="ctype" reporter:datatype="link"  oils_obj:required="true"/>
1132                         <field reporter:label="Code" name="code" reporter:datatype="text"  oils_obj:required="true"/>
1133                         <field reporter:label="Value" name="value" reporter:datatype="text"  oils_obj:required="true" oils_persist:i18n="true"/>
1134                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1135                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
1136                         <field reporter:label="Search Label" name="search_label" reporter:datatype="text" oils_persist:i18n="true"/>
1137             <field reporter:label="Is Simple Selector" name="is_simple" reporter:datatype="bool"/>
1138             <field reporter:label="Concept URI" name="concept_uri" reporter:datatype="text"/>
1139             <field reporter:label="Composite Definition" name="composite_def" oils_persist:virtual="true" reporter:datatype="link"/>
1140                 </fields>
1141                 <links>
1142                         <link field="ctype" reltype="has_a" key="name" map="" class="crad"/>
1143                         <link field="composite_def" reltype="might_have" key="coded_value" map="" class="ccraed"/>
1144                 </links>
1145         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1146             <actions>
1147                 <create permission="ADMIN_CODED_VALUE" global_required="true"/>
1148                 <retrieve/>
1149                 <update permission="ADMIN_CODED_VALUE" global_required="true"/>
1150                 <delete permission="ADMIN_CODED_VALUE" global_required="true"/>
1151             </actions>
1152         </permacrud>
1153         </class>
1154
1155         <class id="cracct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::remote_account" oils_persist:tablename="config.remote_account" reporter:label="Remote (3rd party) Account">
1156                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq">
1157                         <field name="id"            reporter:datatype="id"   reporter:label="ID"/>
1158                         <field name="label"         reporter:datatype="text" reporter:label="Label"/>
1159                         <field name="host"          reporter:datatype="text" reporter:label="Host"/>
1160                         <field name="username"      reporter:datatype="text" reporter:label="Username"/>
1161                         <field name="password"      reporter:datatype="text" reporter:label="Password"/>
1162                         <field name="account"       reporter:datatype="text" reporter:label="Account"/>
1163                         <field name="path"          reporter:datatype="text" reporter:label="Path"/>
1164                         <field name="owner"         reporter:datatype="link" reporter:label="Owner"/>
1165                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
1166                 </fields>
1167                 <links>
1168                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1169                 </links>
1170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1171             <actions>
1172                 <create   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1173                 <retrieve permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1174                 <update   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1175                 <delete   permission="ADMIN_CONFIG_REMOTE_ACCOUNT" context_field="owner"/>
1176             </actions>
1177         </permacrud>
1178         </class>
1179
1180     <class id="czs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_source" oils_persist:tablename="config.z3950_source" reporter:label="Z39.50 Source">
1181         <fields oils_persist:primary="name">
1182             <field reporter:label="Z39.50 Source" name="name" reporter:datatype="id"/>
1183             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1184             <field reporter:label="Host" name="host"  reporter:datatype="text"/>
1185             <field reporter:label="Port" name="port"  reporter:datatype="int"/>
1186             <field reporter:label="DB" name="db"  reporter:datatype="text"/>
1187             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
1188             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
1189             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
1190             <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
1191             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
1192         </fields>
1193         <links>
1194             <link field="attrs" reltype="has_many" key="source" map="" class="cza"/>
1195             <link field="use_perm" reltype="has_a" key="id" map="" class="ppl"/>
1196         </links>
1197         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1198             <actions>
1199                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1200                 <retrieve/>
1201                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1202                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1203             </actions>
1204         </permacrud>
1205     </class>
1206
1207     <class id="cza" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::z3950_attr" oils_persist:tablename="config.z3950_attr" reporter:label="Z39.50 Attribute">
1208         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_attr_id_seq">
1209             <field reporter:label="Z39.50 Attribute ID" name="id" reporter:datatype="id" reporter:selector="label"/>
1210             <field reporter:label="Z39.50 Source" name="source" reporter:datatype="link"/>
1211             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1212             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1213             <field reporter:label="Code" name="code"  reporter:datatype="int"/>
1214             <field reporter:label="Format" name="format"  reporter:datatype="int"/>
1215             <field reporter:label="Truncation" name="truncation"  reporter:datatype="int"/>
1216         </fields>
1217         <links>
1218             <link field="source" reltype="has_a" key="name" map="" class="czs"/>
1219         </links>
1220         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1221             <actions>
1222                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1223                 <retrieve/>
1224                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1225                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1226             </actions>
1227         </permacrud>
1228     </class>
1229
1230     <class id="czifm" controller="open-ils.cstore open-ils.pcrud" 
1231                         oils_obj:fieldmapper="config::z3950_index_field_map" 
1232                         oils_persist:tablename="config.z3950_index_field_map" 
1233                         reporter:label="Z39.50 Index Field Map">
1234         <fields oils_persist:primary="id" oils_persist:sequence="config.z3950_index_field_map_id_seq">
1235             <field reporter:label="Map ID" name="id" reporter:datatype="id"/>
1236             <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1237             <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
1238             <field reporter:label="Record Attribute" name="record_attr" reporter:datatype="link"/>
1239             <field reporter:label="Z39.50 Attribute" name="z3950_attr"  reporter:datatype="link"/>
1240             <field reporter:label="Z39.50 Attribute Type" name="z3950_attr_type" reporter:datatype="text"/>
1241         </fields>
1242         <links>
1243             <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
1244             <link field="record_attr" reltype="has_a" key="name" map="" class="crad"/>
1245             <link field="z3950_attr" reltype="has_a" key="id" map="" class="cza"/>
1246         </links>
1247         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1248             <actions>
1249                 <create permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1250                 <retrieve/>
1251                 <update permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1252                 <delete permission="ADMIN_Z3950_SOURCE" global_required="true"/>
1253             </actions>
1254         </permacrud>
1255     </class>
1256
1257
1258         <class id="ateo" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_output" oils_persist:tablename="action_trigger.event_output" reporter:label="Event Output">
1259                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_output_id_seq">
1260                         <field reporter:label="Output ID" name="id" reporter:datatype="id"/>
1261                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp"/>
1262                         <field reporter:label="Data" name="data" reporter:datatype="text"/>
1263                         <field reporter:label="Is Error" name="is_error" reporter:datatype="bool"/>
1264                         <field reporter:label="Events" name="events" oils_persist:virtual="true"  reporter:datatype="link"/>
1265                         <field reporter:label="Error Events" name="error_events" oils_persist:virtual="true"  reporter:datatype="link"/>
1266                 </fields>
1267                 <links>
1268             <link field="events" reltype="has_many" key="template_output" map="" class="atev"/>
1269             <link field="error_events" reltype="has_many" key="error_output" map="" class="atev"/>
1270                 </links>
1271                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1272                         <actions>
1273                                 <retrieve/>
1274                                 <delete permission="ADMIN_TRIGGER_TEMPLATE_OUTPUT DELETE_TRIGGER_TEMPLATE_OUTPUT" global_required="true"/>
1275                         </actions>
1276                 </permacrud>
1277         </class>
1278
1279         <class id="ath" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::hook" oils_persist:tablename="action_trigger.hook" reporter:label="Trigger Hook Point">
1280                 <fields oils_persist:primary="key">
1281                         <field reporter:label="Hook Key" name="key" reporter:datatype="text"/>
1282                         <field reporter:label="Core Type" name="core_type" reporter:datatype="text"/>
1283                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1284                         <field reporter:label="Passive" name="passive"  reporter:datatype="bool"/>
1285                 </fields>
1286                 <links/>
1287                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1288                         <actions>
1289                                 <create permission="ADMIN_TRIGGER_HOOK CREATE_TRIGGER_HOOK" global_required="true"/>
1290                                 <retrieve/>
1291                                 <update permission="ADMIN_TRIGGER_HOOK UPDATE_TRIGGER_HOOK" global_required="true"/>
1292                                 <delete permission="ADMIN_TRIGGER_HOOK DELETE_TRIGGER_HOOK" global_required="true"/>
1293                         </actions>
1294                 </permacrud>
1295         </class>
1296
1297         <class id="atcol" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::collector" oils_persist:tablename="action_trigger.collector" reporter:label="Trigger Environment Collector">
1298                 <fields oils_persist:primary="module">
1299                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1300                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1301                 </fields>
1302                 <links/>
1303         </class>
1304
1305         <class id="atval" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::validator" oils_persist:tablename="action_trigger.validator" reporter:label="Trigger Condition Validator">
1306                 <fields oils_persist:primary="module">
1307                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1308                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1309                 </fields>
1310                 <links/>
1311                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1312                         <actions>
1313                                 <create permission="ADMIN_TRIGGER_VALIDATOR CREATE_TRIGGER_VALIDATOR" global_required="true"/>
1314                                 <retrieve/>
1315                                 <update permission="ADMIN_TRIGGER_VALIDATOR UPDATE_TRIGGER_VALIDATOR" global_required="true"/>
1316                                 <delete permission="ADMIN_TRIGGER_VALIDATOR DELETE_TRIGGER_VALIDATOR" global_required="true"/>
1317                         </actions>
1318                 </permacrud>
1319         </class>
1320
1321         <class id="atreact" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::reactor" oils_persist:tablename="action_trigger.reactor" reporter:label="Trigger Event Reactor">
1322                 <fields oils_persist:primary="module">
1323                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1324                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1325                 </fields>
1326                 <links/>
1327                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1328                         <actions>
1329                                 <create permission="ADMIN_TRIGGER_REACTOR CREATE_TRIGGER_REACTOR" global_required="true"/>
1330                                 <retrieve/>
1331                                 <update permission="ADMIN_TRIGGER_REACTOR UPDATE_TRIGGER_REACTOR" global_required="true"/>
1332                                 <delete permission="ADMIN_TRIGGER_REACTOR DELETE_TRIGGER_REACTOR" global_required="true"/>
1333                         </actions>
1334                 </permacrud>
1335         </class>
1336
1337         <class id="atclean" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::cleanup" oils_persist:tablename="action_trigger.cleanup" reporter:label="Trigger Event Cleanup">
1338                 <fields oils_persist:primary="module">
1339                         <field reporter:label="Module Name" name="module" reporter:datatype="text"/>
1340                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1341                 </fields>
1342                 <links/>
1343                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1344                         <actions>
1345                                 <create permission="ADMIN_TRIGGER_CLEANUP CREATE_TRIGGER_CLEANUP" global_required="true"/>
1346                                 <retrieve/>
1347                                 <update permission="ADMIN_TRIGGER_CLEANUP UPDATE_TRIGGER_CLEANUP" global_required="true"/>
1348                                 <delete permission="ADMIN_TRIGGER_CLEANUP DELETE_TRIGGER_CLEANUP" global_required="true"/>
1349                         </actions>
1350                 </permacrud>
1351         </class>
1352
1353         <class id="atenv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::environment" oils_persist:tablename="action_trigger.environment" reporter:label="Trigger Event Environment Entry">
1354                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.environment_id_seq">
1355                         <field reporter:label="Environment ID" name="id" reporter:datatype="id"/>
1356                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1357                         <field reporter:label="Field Path" name="path" reporter:datatype="text"/>
1358                         <field reporter:label="Collector" name="collector" reporter:datatype="link"/>
1359                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
1360                 </fields>
1361                 <links>
1362                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1363                         <link field="collector" reltype="has_a" key="id" map="" class="atcol"/>
1364                 </links>
1365                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1366                         <actions>
1367                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1368                     <context link="event_def" field="owner"/>
1369                 </create>
1370                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1371                     <context link="event_def" field="owner"/>
1372                 </retrieve>
1373                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1374                     <context link="event_def" field="owner"/>
1375                 </update>
1376                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1377                     <context link="event_def" field="owner"/>
1378                 </delete>
1379                         </actions>
1380                 </permacrud>
1381         </class>
1382
1383         <class id="atevdef" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_definition" oils_persist:tablename="action_trigger.event_definition" reporter:label="Trigger Event Definition">
1384                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_definition_id_seq">
1385                         <field reporter:label="Definition ID" name="id" reporter:datatype="id"/>
1386                         <field reporter:label="Enabled" name="active" reporter:datatype="bool"/>
1387                         <field reporter:label="Owning Library" name="owner"  reporter:datatype="org_unit"/>
1388                         <field reporter:label="Hook" name="hook"  reporter:datatype="link"/>
1389                         <field reporter:label="Validator" name="validator"  reporter:datatype="link"/>
1390                         <field reporter:label="Reactor" name="reactor"  reporter:datatype="link"/>
1391                         <field reporter:label="Success Cleanup" name="cleanup_success"  reporter:datatype="link"/>
1392                         <field reporter:label="Failure Cleanup" name="cleanup_failure"  reporter:datatype="link"/>
1393                         <field reporter:label="Processing Delay" name="delay"  reporter:datatype="interval"/>
1394                         <field reporter:label="Max Event Validity Delay" name="max_delay"  reporter:datatype="interval"/>
1395                         <field reporter:label="Processing Delay Context Field" name="delay_field"  reporter:datatype="text"/>
1396                         <field reporter:label="Processing Group Context Field" name="group_field"  reporter:datatype="text"/>
1397                         <field reporter:label="Template" name="template"  reporter:datatype="text"/>
1398                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
1399                         <field reporter:label="Granularity" name="granularity"  reporter:datatype="text"/>
1400                         <field reporter:label="Opt-In User Field" name="usr_field"  reporter:datatype="text"/>
1401                         <field reporter:label="Opt-In Setting Type" name="opt_in_setting"  reporter:datatype="link"/>
1402                         <field reporter:label="Event Repeatability Delay" name="repeat_delay"  reporter:datatype="interval"/>
1403                         <field reporter:label="Message Template" name="message_template" reporter:datatype="text"/>
1404                         <field reporter:label="Message Title" name="message_title" reporter:datatype="text"/>
1405                         <field reporter:label="Message User Path" name="message_usr_path" reporter:datatype="text"/>
1406                         <field reporter:label="Message Library Path" name="message_library_path" reporter:datatype="text"/>
1407                         <field reporter:label="Environment Entries" name="env" oils_persist:virtual="true"  reporter:datatype="link"/>
1408                         <field reporter:label="Parameters" name="params" oils_persist:virtual="true"  reporter:datatype="link"/>
1409                         <field reporter:label="Retention Interval" name="retention_interval" reporter:datatype="interval"/>
1410                 </fields>
1411                 <links>
1412                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
1413                         <link field="hook" reltype="has_a" key="key" map="" class="ath"/>
1414                         <link field="validator" reltype="has_a" key="module" map="" class="atval"/>
1415                         <link field="reactor" reltype="has_a" key="module" map="" class="atreact"/>
1416                         <link field="cleanup_success" reltype="has_a" key="module" map="" class="atclean"/>
1417                         <link field="cleanup_failure" reltype="has_a" key="module" map="" class="atclean"/>
1418                         <link field="env" reltype="has_many" key="event_def" map="" class="atenv"/>
1419                         <link field="params" reltype="has_many" key="event_def" map="" class="atevparam"/>
1420                         <link field="opt_in_setting" reltype="has_a" key="name" map="" class="cust"/>
1421                 </links>
1422                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1423                         <actions>
1424                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1425                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF" context_field="owner"/>
1426                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF" context_field="owner"/>
1427                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF" context_field="owner"/>
1428                         </actions>
1429                 </permacrud>
1430         </class>
1431
1432         <class id="atev" controller="open-ils.cstore" oils_obj:fieldmapper="action_trigger::event" oils_persist:tablename="action_trigger.event" reporter:label="Trigger Event Entry">
1433                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_id_seq">
1434                         <field reporter:label="Event ID" name="id" reporter:datatype="id"/>
1435                         <field reporter:label="Target ID" name="target" reporter:datatype="int"/>
1436                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1437                         <field reporter:label="Add Time" name="add_time" reporter:datatype="timestamp"/>
1438                         <field reporter:label="Run Time" name="run_time" reporter:datatype="timestamp"/>
1439                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
1440                         <field reporter:label="Update Time" name="update_time" reporter:datatype="timestamp"/>
1441                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
1442                         <field reporter:label="State" name="state" reporter:datatype="text"/>
1443                         <field reporter:label="User Data" name="user_data" reporter:datatype="text"/>
1444                         <field reporter:label="Template Output" name="template_output" reporter:datatype="link"/>
1445                         <field reporter:label="Error Output" name="error_output" reporter:datatype="text"/>
1446                         <field reporter:label="Asynchronous Output" name="async_output" reporter:datatype="link"/>
1447                         <field reporter:label="Update Process" name="update_process" reporter:datatype="int"/>
1448                 </fields>
1449                 <links>
1450                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1451                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo"/>
1452                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo"/>
1453                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo"/>
1454                 </links>
1455         </class>
1456
1457         <class id="atevparam" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::event_param" oils_persist:tablename="action_trigger.event_params" reporter:label="Trigger Event Parameter">
1458                 <fields oils_persist:primary="id" oils_persist:sequence="action_trigger.event_params_id_seq">
1459                         <field reporter:label="Parameter ID" name="id" reporter:datatype="id"/>
1460                         <field reporter:label="Event Definition" name="event_def" reporter:datatype="link"/>
1461                         <field reporter:label="Parameter Name" name="param" reporter:datatype="text"/>
1462                         <field reporter:label="Parameter Value" name="value" reporter:datatype="text"/>
1463                 </fields>
1464                 <links>
1465                         <link field="event_def" reltype="has_a" key="id" map="" class="atevdef"/>
1466                 </links>
1467                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1468                         <actions>
1469                                 <create permission="ADMIN_TRIGGER_EVENT_DEF CREATE_TRIGGER_EVENT_DEF">
1470                     <context link="event_def" field="owner"/>
1471                 </create>
1472                                 <retrieve permission="ADMIN_TRIGGER_EVENT_DEF VIEW_TRIGGER_EVENT_DEF">
1473                     <context link="event_def" field="owner"/>
1474                 </retrieve>
1475                                 <update permission="ADMIN_TRIGGER_EVENT_DEF UPDATE_TRIGGER_EVENT_DEF">
1476                     <context link="event_def" field="owner"/>
1477                 </update>
1478                                 <delete permission="ADMIN_TRIGGER_EVENT_DEF DELETE_TRIGGER_EVENT_DEF">
1479                     <context link="event_def" field="owner"/>
1480                 </delete>
1481                         </actions>
1482                 </permacrud>
1483         </class>
1484
1485         <class id="atul" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action_trigger::user_log" reporter:label="Action Trigger User Log" oils_persist:readonly="true">
1486                 <oils_persist:source_definition><![CDATA[
1487                 SELECT  atevdef.hook,
1488                         atevdef.name,
1489                         atevdef.reactor,
1490                         atev.id,
1491                         atev.event_def,
1492                         atev.add_time,
1493                         atev.run_time,
1494                         atev.start_time,
1495                         atev.update_time,
1496                         atev.complete_time,
1497                         atev.update_process,
1498                         atev.state,
1499                         atev.user_data,
1500                         atev.template_output,
1501                         atev.error_output,
1502                         atev.async_output,
1503                         targ_circ.id AS target_circ,
1504                         targ_ahr.id AS target_hold,
1505                         COALESCE(
1506                                 targ_circ.circ_lib,
1507                                 targ_ahr.pickup_lib
1508                         ) AS perm_lib
1509                 FROM action_trigger.event atev
1510                 JOIN action_trigger.event_definition atevdef ON
1511                         (atevdef.id = atev.event_def)
1512                 JOIN action_trigger.hook ath ON
1513                         (ath.key = atevdef.hook)
1514                 LEFT JOIN action.circulation targ_circ ON
1515                         (ath.core_type = 'circ' AND targ_circ.id = atev.target)
1516                 LEFT JOIN action.hold_request targ_ahr ON
1517                         (ath.core_type = 'ahr' AND targ_ahr.id = atev.target)
1518                 WHERE atev.add_time > NOW() - (SELECT MAX(value) FROM (
1519                         SELECT value::INTERVAL FROM actor.org_unit_ancestor_setting(
1520                                 'circ.staff.max_visible_event_age',
1521                                 COALESCE(targ_circ.circ_lib, targ_ahr.pickup_lib)
1522                         ) UNION
1523                         SELECT '1000 YEARS'::INTERVAL AS value
1524                 ) ous)
1525                 ]]></oils_persist:source_definition>
1526                 <fields oils_persist:primary="id">
1527                         <field reporter:label="Hook" name="hook" reporter:datatype="link" />
1528                         <field reporter:label="Name" name="name" reporter:datatype="text" />
1529                         <field reporter:label="Reactor" name="reactor" reporter:datatype="text" />
1530                         <field reporter:label="Event ID" name="id" reporter:datatype="id" />
1531                         <field reporter:label="Event Definition ID" name="event_def" reporter:datatype="int" />
1532                         <field reporter:label="Event Add Time" name="add_time" reporter:datatype="timestamp" />
1533                         <field reporter:label="Event Run Time" name="run_time" reporter:datatype="timestamp" />
1534                         <field reporter:label="Event Start Time" name="start_time" reporter:datatype="timestamp" />
1535                         <field reporter:label="Event Update Time" name="update_time" reporter:datatype="timestamp" />
1536                         <field reporter:label="Event Complete Time" name="complete_time" reporter:datatype="timestamp" />
1537                         <field reporter:label="Event Update PID" name="update_process" reporter:datatype="int" />
1538                         <field reporter:label="Event State" name="state" reporter:datatype="text" />
1539                         <field reporter:label="Event User Data" name="user_data" reporter:datatype="text" />
1540                         <field reporter:label="Event Template Output" name="template_output" reporter:datatype="link" />
1541                         <field reporter:label="Event Error Output" name="error_output" reporter:datatype="link" />
1542                         <field reporter:label="Event Async Output" name="async_output" reporter:datatype="link" />
1543                         <field reporter:label="Target Circulation" name="target_circ" reporter:datatype="link" />
1544                         <field reporter:label="Target Hold" name="target_hold" reporter:datatype="link" />
1545                         <field reporter:label="Permission Context" name="perm_lib" reporter:datatype="org_unit" />
1546                 </fields>
1547                 <links>
1548                         <link field="hook" reltype="has_a" key="key" map="" class="ath" />
1549                         <link field="template_output" reltype="has_a" key="id" map="" class="ateo" />
1550                         <link field="error_output" reltype="has_a" key="id" map="" class="ateo" />
1551                         <link field="async_output" reltype="has_a" key="id" map="" class="ateo" />
1552                         <link field="target_circ" reltype="has_a" key="id" map="" class="circ" />
1553                         <link field="target_hold" reltype="has_a" key="id" map="" class="ahr" />
1554                         <link field="perm_lib" reltype="has_a" key="id" map="" class="aou" />
1555                 </links>
1556                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1557                         <actions>
1558                                 <retrieve permission="VIEW_TRIGGER_EVENT" context_field="perm_lib" />
1559                         </actions>
1560                 </permacrud>
1561         </class>
1562
1563         <class id="aws" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::workstation" oils_persist:tablename="actor.workstation" reporter:label="Workstation">
1564                 <fields oils_persist:primary="id" oils_persist:sequence="actor.workstation_id_seq">
1565                         <field reporter:label="Workstation ID" name="id" reporter:datatype="id"/>
1566                         <field reporter:label="Workstation Name" name="name" reporter:datatype="text"/>
1567                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1568                         <field reporter:label="Toolbars" name="toolbars" oils_persist:virtual="true" reporter:datatype="link"/>
1569                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
1570                 </fields>
1571                 <links>
1572                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1573                         <link field="toolbars" reltype="has_many" key="ws" map="" class="atb"/>
1574                         <link field="circulations" reltype="has_many" key="workstation" map="" class="circ"/>
1575                 </links>
1576                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1577                         <actions>
1578                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib" />
1579                         </actions>
1580                 </permacrud>
1581         </class>
1582
1583         <class id="ccm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_modifier" oils_persist:tablename="config.circ_modifier" reporter:label="Circulation Modifier">
1584                 <fields oils_persist:primary="code">
1585                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1586                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1587                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
1588                         <field reporter:label="SIP2 Media Type" name="sip2_media_type" reporter:datatype="text" oils_persist:i18n="true"/>
1589                         <field reporter:label="Magnetic Media" name="magnetic_media" reporter:datatype="bool"/>
1590                         <field reporter:label="Average Wait Time" name="avg_wait_time" reporter:datatype="interval"/>
1591                 </fields>
1592                 <links/>
1593         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1594             <actions>
1595                 <create permission="ADMIN_CIRC_MOD" global_required="true"/>
1596                 <retrieve/>
1597                 <update permission="ADMIN_CIRC_MOD" global_required="true"/>
1598                 <delete permission="ADMIN_CIRC_MOD" global_required="true"/>
1599             </actions>
1600         </permacrud>
1601         </class>
1602
1603         <class id="aiit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_item_type" oils_persist:tablename="acq.invoice_item_type" reporter:label="Non-bibliographic Invoice Item Type" oils_persist:field_safe="true">
1604                 <fields oils_persist:primary="code">
1605                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1606                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1607                         <field reporter:label="Prorate?" name="prorate" reporter:datatype="bool"/>
1608                         <field reporter:label="Blanket?" name="blanket" reporter:datatype="bool"/>
1609                 </fields>
1610                 <links/>
1611         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1612             <actions>
1613                 <create permission="CREATE_INVOICE_ITEM_TYPE" global_required="true"/>
1614                 <retrieve/>
1615                 <update permission="UPDATE_INVOICE_ITEM_TYPE" global_required="true"/>
1616                 <delete permission="DELETE_INVOICE_ITEM_TYPE" global_required="true"/>
1617             </actions>
1618         </permacrud>
1619         </class>
1620
1621         <class id="acqim" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice_method" oils_persist:tablename="acq.invoice_method" reporter:label="Invoice Method used by Vendor" oils_persist:field_safe="true">
1622                 <fields oils_persist:primary="code">
1623                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1624                         <field reporter:label="Label" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1625                 </fields>
1626                 <links/>
1627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1628             <actions>
1629                 <create permission="ADMIN_INVOICE_METHOD CREATE_INVOICE_METHOD" global_required="true"/>
1630                 <retrieve/>
1631                 <update permission="ADMIN_INVOICE_METHOD UPDATE_INVOICE_METHOD" global_required="true"/>
1632                 <delete permission="ADMIN_INVOICE_METHOD DELETE_INVOICE_METHOD" global_required="true"/>
1633             </actions>
1634         </permacrud>
1635         </class>
1636
1637         <class id="ccpbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_type" oils_persist:tablename="container.copy_bucket_type" reporter:label="Copy Bucket Type" oils_persist:field_safe="true">
1638                 <fields oils_persist:primary="code">
1639                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1640                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1641                 </fields>
1642                 <links/>
1643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1644             <actions>
1645                 <create permission="CREATE_COPY_BTYPE" global_required="true"/>
1646                 <retrieve/>
1647                 <update permission="UPDATE_COPY_BTYPE" global_required="true"/>
1648                 <delete permission="DELETE_COPY_BTYPE" global_required="true"/>
1649             </actions>
1650         </permacrud>
1651         </class>
1652
1653         <class id="ccnbt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_type" oils_persist:tablename="container.call_number_bucket_type" reporter:label="Call Number Bucket Type" oils_persist:field_safe="true">
1654                 <fields oils_persist:primary="code">
1655                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1656                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1657                 </fields>
1658                 <links/>
1659         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1660             <actions>
1661                 <create permission="CREATE_CN_BTYPE" global_required="true"/>
1662                 <retrieve/>
1663                 <update permission="UPDATE_CN_BTYPE" global_required="true"/>
1664                 <delete permission="DELETE_CN_BTYPE" global_required="true"/>
1665             </actions>
1666         </permacrud>
1667         </class>
1668
1669         <class id="bpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_type" oils_persist:tablename="biblio.peer_type" reporter:label="Bibliographic Record Peer Type" oils_persist:field_safe="true">
1670                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_type_id_seq">
1671                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1672                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
1673                 </fields>
1674                 <links/>
1675         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1676             <actions>
1677                 <create permission="CREATE_BIB_PTYPE" global_required="true"/>
1678                 <retrieve/>
1679                 <update permission="UPDATE_BIB_PTYPE" global_required="true"/>
1680                 <delete permission="DELETE_BIB_PTYPE" global_required="true"/>
1681             </actions>
1682         </permacrud>
1683         </class>
1684
1685         <class id="bpbcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="biblio::peer_bib_copy_map" oils_persist:tablename="biblio.peer_bib_copy_map" reporter:label="Bibliographic Record Peer Copy Map">
1686                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.peer_bib_copy_map_id_seq">
1687                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
1688                         <field reporter:label="Peer Type" name="peer_type" reporter:datatype="link"/>
1689                         <field reporter:label="Peer Record" name="peer_record" reporter:datatype="link"/>
1690                         <field reporter:label="Target Copy" name="target_copy" reporter:datatype="link"/>
1691                 </fields>
1692         <links>
1693             <link field="peer_type" reltype="has_a" key="id" map="" class="bpt"/>
1694             <link field="peer_record" reltype="has_a" key="id" map="" class="bre"/>
1695             <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
1696         </links>
1697         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1698             <actions>
1699                 <create permission="UPDATE_COPY">
1700                     <context link="target_copy" field="circ_lib"/>
1701                 </create>
1702                 <retrieve/>
1703                 <update permission="UPDATE_COPY">
1704                     <context link="target_copy" field="circ_lib"/>
1705                 </update>
1706                 <delete permission="UPDATE_COPY">
1707                     <context link="target_copy" field="circ_lib"/>
1708                 </delete>
1709             </actions>
1710         </permacrud>
1711         </class>
1712
1713         <class id="cbrebt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_type" oils_persist:tablename="container.biblio_record_entry_bucket_type" reporter:label="Bibliographic Record Bucket Type" oils_persist:field_safe="true">
1714                 <fields oils_persist:primary="code">
1715                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1716                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1717                 </fields>
1718                 <links/>
1719         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1720             <actions>
1721                 <create permission="CREATE_BIB_BTYPE" global_required="true"/>
1722                 <retrieve/>
1723                 <update permission="UPDATE_BIB_BTYPE" global_required="true"/>
1724                 <delete permission="DELETE_BIB_BTYPE" global_required="true"/>
1725             </actions>
1726         </permacrud>
1727         </class>
1728
1729         <class id="cubt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_type" oils_persist:tablename="container.user_bucket_type" reporter:label="User Bucket Type" oils_persist:field_safe="true">
1730                 <fields oils_persist:primary="code">
1731                         <field reporter:label="Code" name="code" reporter:selector="name" reporter:datatype="id"/>
1732                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
1733                 </fields>
1734                 <links/>
1735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1736             <actions>
1737                 <create permission="CREATE_USER_BTYPE" global_required="true"/>
1738                 <retrieve/>
1739                 <update permission="UPDATE_USER_BTYPE" global_required="true"/>
1740                 <delete permission="DELETE_USER_BTYPE" global_required="true"/>
1741             </actions>
1742         </permacrud>
1743         </class>
1744
1745         <class id="cvrfm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::videorecording_format_map" oils_persist:tablename="config.videorecording_format_map" reporter:label="Videorecording Format" oils_persist:field_safe="true">
1746                 <fields oils_persist:primary="code">
1747                         <field reporter:label="Code" name="code" reporter:selector="value" reporter:datatype="id"/>
1748                         <field reporter:label="Format" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
1749                 </fields>
1750                 <links/>
1751         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1752             <actions>
1753                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
1754                 <retrieve/>
1755                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
1756                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
1757             </actions>
1758         </permacrud>
1759         </class>
1760
1761     <class id="chmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_weights" oils_persist:tablename="config.hold_matrix_weights" reporter:label="Hold Matrix Weights">
1762         <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_weights_id_seq">
1763             <field reporter:label="Hold Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1764             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1765             <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="float"/>
1766             <field reporter:label="Request Library" name="request_ou" reporter:datatype="float"/>
1767             <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="float"/>
1768             <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="float"/>
1769             <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="float"/>
1770             <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="float"/>
1771             <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="float"/>
1772             <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="float"/>
1773             <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="float"/>
1774             <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="float"/>
1775             <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="float"/>
1776             <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="float"/>
1777             <field reporter:label="Juvenile?" name="juvenile_flag" oils_persist:primitive="string" reporter:datatype="float"/>
1778             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1779             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1780         </fields>
1781         <links/>
1782         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1783             <actions>
1784                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1785                 <retrieve/>
1786                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1787                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1788             </actions>
1789         </permacrud>
1790     </class>
1791
1792     <class id="ccmw" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_weights" oils_persist:tablename="config.circ_matrix_weights" reporter:label="Circ Matrix Weights">
1793         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_weights_id_seq">
1794             <field reporter:label="Circ Weights ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1795             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1796             <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="float"/>
1797             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="float"/>
1798             <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="float"/>
1799             <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="float"/>
1800             <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="float"/>
1801             <field reporter:label="Permission Group" name="grp" reporter:datatype="float"/>
1802             <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="float"/>
1803             <field reporter:label="Copy Location" name="copy_location" reporter:datatype="float"/>
1804             <field reporter:label="MARC Type" name="marc_type" reporter:datatype="float"/>
1805             <field reporter:label="MARC Form" name="marc_form" reporter:datatype="float"/>
1806             <field reporter:label="MARC Bib Level" name="marc_bib_level" reporter:datatype="float"/>
1807             <field reporter:label="Videorecording Format" name="marc_vr_format" reporter:datatype="float"/>
1808             <field reporter:label="Reference?" name="ref_flag" reporter:datatype="float"/>
1809             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="float"/>
1810             <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="float"/>
1811             <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="float"/>
1812             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="float"/>
1813         </fields>
1814         <links/>
1815         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1816             <actions>
1817                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1818                 <retrieve/>
1819                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1820                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1821             </actions>
1822         </permacrud>
1823     </class>
1824
1825     <class id="cwa" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::weight_assoc" oils_persist:tablename="config.weight_assoc" reporter:label="Matrix Weight Association">
1826         <fields oils_persist:primary="id" oils_persist:sequence="config.weight_assoc_id_seq">
1827             <field reporter:label="Assoc ID" name="id" reporter:datatype="id"/>
1828             <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1829             <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
1830             <field reporter:label="Circ Weights" name="circ_weights" reporter:datatype="link"/>
1831             <field reporter:label="Hold Weights" name="hold_weights" reporter:datatype="link"/>
1832         </fields>
1833         <links>
1834             <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1835             <link field="circ_weights" reltype="has_a" key="id" map="" class="ccmw"/>
1836             <link field="hold_weights" reltype="has_a" key="id" map="" class="chmw"/>
1837         </links>
1838         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1839             <actions>
1840                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1841                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1842                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1843                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT ADMIN_HOLD_MATRIX_MATCHPOINT" context_field='org_unit'/>
1844             </actions>
1845         </permacrud>
1846     </class>
1847
1848         <class id="chmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::hold_matrix_matchpoint" oils_persist:tablename="config.hold_matrix_matchpoint" reporter:label="Hold Matrix Matchpoint">
1849                 <fields oils_persist:primary="id" oils_persist:sequence="config.hold_matrix_matchpoint_id_seq">
1850                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1851                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1852                         <field reporter:label="Strict OU matches?" name="strict_ou_match" reporter:datatype="bool"/>
1853                         <field reporter:label="User Home Library" name="user_home_ou" reporter:datatype="org_unit"/>
1854                         <field reporter:label="Request Library" name="request_ou" reporter:datatype="org_unit"/>
1855                         <field reporter:label="Pickup Library" name="pickup_ou" reporter:datatype="org_unit"/>
1856                         <field reporter:label="Owning Library" name="item_owning_ou" reporter:datatype="org_unit"/>
1857                         <field reporter:label="Item Circ Library" name="item_circ_ou" reporter:datatype="org_unit"/>
1858                         <field reporter:label="User Permission Group" name="usr_grp" reporter:datatype="link"/>
1859                         <field reporter:label="Requestor Permission Group" name="requestor_grp" reporter:datatype="link"/>
1860                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1861                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1862                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1863                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1864                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1865                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1866             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1867                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
1868                         <field reporter:label="Range is from Owning Lib?" name="distance_is_from_owner" reporter:datatype="bool"/>
1869                         <field reporter:label="Transit Range" name="transit_range" reporter:datatype="link"/>
1870                         <field reporter:label="Max Holds" name="max_holds" reporter:datatype="int"/>
1871                         <field reporter:label="Max includes Frozen" name="include_frozen_holds" reporter:datatype="bool"/>
1872                         <field reporter:label="Copy Age Hold Protection Rule" name="age_hold_protect_rule" reporter:datatype="link"/>
1873                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1874                 </fields>
1875                 <links>
1876                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1877                         <link field="request_ou" reltype="has_a" key="id" map="" class="aou"/>
1878                         <link field="pickup_ou" reltype="has_a" key="id" map="" class="aou"/>
1879                         <link field="item_owning_ou" reltype="has_a" key="id" map="" class="aou"/>
1880                         <link field="item_circ_ou" reltype="has_a" key="id" map="" class="aou"/>
1881                         <link field="usr_grp" reltype="has_a" key="id" map="" class="pgt"/>
1882                         <link field="requestor_grp" reltype="has_a" key="id" map="" class="pgt"/>
1883                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1884                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1885                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1886                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1887                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1888                         <link field="age_hold_protect_rule" reltype="has_a" key="id" map="" class="crahp"/>
1889             <link field="transit_range" reltype="has_a" key="id" map="" class="aout"/>
1890                 </links>
1891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1892             <actions>
1893                 <create permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1894                 <retrieve permission="ADMIN_HOLD_MATRIX_MATCHPOINT VIEW_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1895                 <update permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1896                 <delete permission="ADMIN_HOLD_MATRIX_MATCHPOINT" global_required="true"/>
1897             </actions>
1898         </permacrud>
1899         </class>
1900
1901         <class id="ccmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_matchpoint" oils_persist:tablename="config.circ_matrix_matchpoint" reporter:label="Circulation Matrix Matchpoint">
1902                 <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_matchpoint_id_seq">
1903                         <field reporter:label="Matchpoint ID" name="id" reporter:datatype="id"/>
1904                         <field reporter:label="Renewal?" name="is_renewal" reporter:datatype="bool"/>
1905                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
1906                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" oils_obj:required="true"/>
1907                         <field reporter:label="Copy Circ Lib" name="copy_circ_lib" reporter:datatype="org_unit"/>
1908                         <field reporter:label="Copy Owning Lib" name="copy_owning_lib" reporter:datatype="org_unit"/>
1909                         <field reporter:label="User Home Lib" name="user_home_ou" reporter:datatype="org_unit"/>
1910                         <field reporter:label="Permission Group" name="grp" reporter:datatype="link" oils_obj:required="true"/>
1911                         <field reporter:label="Circulation Modifier" name="circ_modifier" oils_persist:primitive="string" reporter:datatype="link"/>
1912                         <field reporter:label="Copy Location" name="copy_location" reporter:datatype="link"/>
1913                         <field reporter:label="MARC Type" name="marc_type" oils_persist:primitive="string" reporter:datatype="link"/>
1914                         <field reporter:label="MARC Form" name="marc_form" oils_persist:primitive="string" reporter:datatype="link"/>
1915                         <field reporter:label="MARC Bib Level" name="marc_bib_level" oils_persist:primitive="string" reporter:datatype="link"/>
1916                         <field reporter:label="Videorecording Format" name="marc_vr_format" oils_persist:primitive="string" reporter:datatype="link"/>
1917                         <field reporter:label="Reference?" name="ref_flag" reporter:datatype="bool"/>
1918             <field reporter:label="Juvenile?" name="juvenile_flag" reporter:datatype="bool"/>
1919                         <field reporter:label="User Age: Lower Bound" name="usr_age_lower_bound" reporter:datatype="text"/>
1920                         <field reporter:label="User Age: Upper Bound" name="usr_age_upper_bound" reporter:datatype="text"/>
1921             <field reporter:label="Item Age &lt;" name="item_age" reporter:datatype="text"/>
1922                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
1923                         <field reporter:label="Duration Rule" name="duration_rule" reporter:datatype="link"/>
1924                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
1925                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
1926             <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
1927             <field reporter:label="Renewals Override" name="renewals" reporter:datatype="int"/>
1928             <field reporter:label="Grace Period Override" name="grace_period" reporter:datatype="interval"/>
1929                         <field reporter:label="Script Test" name="script_test" reporter:datatype="text"/>
1930                         <field name="total_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Total Copy/Hold Ratio"/>
1931                         <field name="available_copy_hold_ratio" reporter:datatype="float" reporter:label="Minimum Available Copy/Hold Ratio"/>
1932                         <field name="description" reporter:datatype="text" reporter:label="Description"/>
1933                 </fields>
1934                 <links>
1935                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
1936                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
1937                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1938                         <link field="user_home_ou" reltype="has_a" key="id" map="" class="aou"/>
1939                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
1940                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
1941                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
1942                         <link field="marc_type" reltype="has_a" key="code" map="" class="citm"/>
1943                         <link field="marc_form" reltype="has_a" key="code" map="" class="cifm"/>
1944                         <link field="marc_bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
1945                         <link field="marc_vr_format" reltype="has_a" key="code" map="" class="cvrfm"/>
1946                         <link field="duration_rule" reltype="has_a" key="id" map="" class="crcd"/>
1947                         <link field="max_fine_rule" reltype="has_a" key="id" map="" class="crmf"/>
1948                         <link field="recurring_fine_rule" reltype="has_a" key="id" map="" class="crrf"/>
1949             <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
1950                 </links>
1951         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1952             <actions>
1953                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1954                 <retrieve permission="ADMIN_CIRC_MATRIX_MATCHPOINT VIEW_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1955                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1956                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field='org_unit'/>
1957             </actions>
1958         </permacrud>
1959         </class>
1960
1961     <class id="cclg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_group" oils_persist:tablename="config.circ_limit_group" reporter:label="Circulation Limit Group">
1962         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_group_id_seq">
1963             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1964             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1965             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1966         </fields>
1967         <links/>
1968         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1969             <actions>
1970                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1971                 <retrieve/>
1972                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1973                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" global_required="true"/>
1974             </actions>
1975         </permacrud>
1976     </class>
1977
1978     <class id="ccls" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set" oils_persist:tablename="config.circ_limit_set" reporter:label="Circulation Limit Set">
1979         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_id_seq">
1980             <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
1981             <field reporter:label="Name" name="name" reporter:datatype="text"/>
1982             <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
1983             <field reporter:label="Items Out" name="items_out" reporter:datatype="int"/>
1984             <field reporter:label="Min Depth" name="depth" reporter:datatype="int"/>
1985             <field reporter:label="Global" name="global" reporter:datatype="bool"/>
1986             <field reporter:label="Description" name="description" reporter:datatype="text"/>
1987         </fields>
1988         <links>
1989             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
1990         </links>
1991         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
1992             <actions>
1993                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1994                 <retrieve/>
1995                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1996                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT" context_field="owning_lib"/>
1997             </actions>
1998         </permacrud>
1999     </class>
2000
2001     <class id="ccmlsm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_matrix_limit_set_map" oils_persist:tablename="config.circ_matrix_limit_set_map" reporter:label="Circulation Matrix Limit Set Map">
2002         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_matrix_limit_set_map_id_seq">
2003             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2004             <field reporter:label="Matchpoint" name="matchpoint" reporter:datatype="link"/>
2005             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2006             <field reporter:label="Fallthrough" name="fallthrough" reporter:datatype="bool"/>
2007             <field reporter:label="Active" name="active" reporter:datatype="bool"/>
2008         </fields>
2009         <links>
2010             <link field="matchpoint" reltype="has_a" key="id" map="" class="ccmm"/>
2011             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2012         </links>
2013         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2014             <actions>
2015                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2016                     <context link="matchpoint" field="org_unit"/>
2017                 </create>
2018                 <retrieve/>
2019                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2020                     <context link="matchpoint" field="org_unit"/>
2021                 </update>
2022                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2023                     <context link="matchpoint" field="org_unit"/>
2024                 </delete>
2025             </actions>
2026         </permacrud>
2027     </class>
2028
2029     <class id="cclscmm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_circ_mod_map" oils_persist:tablename="config.circ_limit_set_circ_mod_map" reporter:label="Circulation Limit Set Circ Mod Map">
2030         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_circ_mod_map_id_seq">
2031             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2032             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2033             <field reporter:label="Circulation Modifier" name="circ_mod" reporter:datatype="link"/>
2034         </fields>
2035         <links>
2036             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2037             <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
2038         </links>
2039         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2040             <actions>
2041                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2042                     <context link="limit_set" field="owning_lib"/>
2043                 </create>
2044                 <retrieve/>
2045                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2046                     <context link="limit_set" field="owning_lib"/>
2047                 </update>
2048                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2049                     <context link="limit_set" field="owning_lib"/>
2050                 </delete>
2051             </actions>
2052         </permacrud>
2053     </class>
2054     <class id="cclsacpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_copy_loc_map" oils_persist:tablename="config.circ_limit_set_copy_loc_map" reporter:label="Circulation Limit Set Copy Location Map">
2055         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_copy_loc_map_id_seq">
2056             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2057             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2058             <field reporter:label="Copy Location" name="copy_loc" reporter:datatype="link"/>
2059         </fields>
2060         <links>
2061             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2062             <link field="copy_loc" reltype="has_a" key="id" map="" class="acpl"/>
2063         </links>
2064         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2065             <actions>
2066                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2067                     <context link="limit_set" field="owning_lib"/>
2068                 </create>
2069                 <retrieve/>
2070                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2071                     <context link="limit_set" field="owning_lib"/>
2072                 </update>
2073                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2074                     <context link="limit_set" field="owning_lib"/>
2075                 </delete>
2076             </actions>
2077         </permacrud>
2078     </class>
2079
2080     <class id="cclsgm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::circ_limit_set_group_map" oils_persist:tablename="config.circ_limit_set_group_map" reporter:label="Circulation Limit Set Group Map">
2081         <fields oils_persist:primary="id" oils_persist:sequence="config.circ_limit_set_group_map_id_seq">
2082             <field reporter:label="ID" name="id" reporter:datatype="id"/>
2083             <field reporter:label="Limit Set" name="limit_set" reporter:datatype="link"/>
2084             <field reporter:label="Limit Group" name="limit_group" reporter:datatype="link"/>
2085             <field reporter:label="Check Only" name="check_only" reporter:datatype="bool"/>
2086         </fields>
2087         <links>
2088             <link field="limit_set" reltype="has_a" key="id" map="" class="ccls"/>
2089             <link field="limit_group" reltype="has_a" key="id" map="" class="cclg"/>
2090         </links>
2091         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2092             <actions>
2093                 <create permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2094                     <context link="limit_set" field="owning_lib"/>
2095                 </create>
2096                 <retrieve/>
2097                 <update permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2098                     <context link="limit_set" field="owning_lib"/>
2099                 </update>
2100                 <delete permission="ADMIN_CIRC_MATRIX_MATCHPOINT">
2101                     <context link="limit_set" field="owning_lib"/>
2102                 </delete>
2103             </actions>
2104         </permacrud>
2105     </class>
2106
2107         <class id="cit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::identification_type" oils_persist:tablename="config.identification_type" reporter:label="Identification Type">
2108                 <fields oils_persist:primary="id" oils_persist:sequence="config.identification_type_id_seq">
2109                         <field reporter:label="Identification ID" name="id" reporter:selector="name" reporter:datatype="id"/>
2110                         <field reporter:label="Identification Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
2111                 </fields>
2112                 <links/>
2113         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2114             <actions>
2115                 <create permission="ADMIN_IDENT_TYPE" global_required="true"/>
2116                 <retrieve/>
2117                 <update permission="ADMIN_IDENT_TYPE" global_required="true"/>
2118                 <delete permission="ADMIN_IDENT_TYPE" global_required="true"/>
2119             </actions>
2120         </permacrud>
2121         </class>
2122
2123         <class id="asvq" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey_question" oils_persist:tablename="action.survey_question" reporter:label="User Survey Question">
2124                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_question_id_seq">
2125                         <field reporter:label="Answers" name="answers" oils_persist:virtual="true" reporter:datatype="link"/>
2126                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
2127                         <field reporter:label="Question ID" name="id" reporter:datatype="id" />
2128                         <field reporter:label="Question" name="question" reporter:datatype="text"/>
2129                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2130                 </fields>
2131                 <links>
2132                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2133                         <link field="responses" reltype="has_many" key="question" map="" class="asvr"/>
2134                         <link field="answers" reltype="has_many" key="question" map="" class="asva"/>
2135                 </links>
2136         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2137             <actions>
2138                 <create permission="ADMIN_SURVEY">
2139                     <context link="survey" field="owner"/>
2140                 </create>
2141                 <retrieve/>
2142                 <update permission="ADMIN_SURVEY">
2143                     <context link="survey" field="owner"/>
2144                 </update>
2145                 <delete permission="ADMIN_SURVEY">
2146                     <context link="survey" field="owner"/>
2147                 </delete>
2148             </actions>
2149         </permacrud>
2150         </class>
2151         <class id="mbts" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::billable_transaction_summary" oils_persist:tablename="money.materialized_billable_xact_summary" reporter:label="Billable Transaction Summary" oils_persist:readonly="true">
2152                 <fields oils_persist:primary="id" oils_persist:sequence="">
2153                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2154                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2155                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2156                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2157                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2158                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2159                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2160                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2161                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2162                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2163                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2164                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2165                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2166                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2167                 </fields>
2168                 <links>
2169                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2170                 </links>
2171                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2172                         <actions>
2173                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2174                                         <context link="usr" field="home_ou" />
2175                                 </retrieve>
2176                         </actions>
2177                 </permacrud>
2178         </class>
2179         <class id="mbtslv" controller="open-ils.cstore" oils_obj:fieldmapper="money::billable_transaction_summary_location_view" oils_persist:tablename="money.billable_xact_summary_location_view" reporter:label="Billable Transaction Summary with Billing Location" oils_persist:readonly="true" reporter:core="true">
2180                 <fields oils_persist:primary="id" oils_persist:sequence="">
2181                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
2182                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id"/>
2183                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
2184                         <field reporter:label="Last Billing Timestamp" name="last_billing_ts" reporter:datatype="timestamp"/>
2185                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
2186                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
2187                         <field reporter:label="Last Payment Timestamp" name="last_payment_ts" reporter:datatype="timestamp"/>
2188                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
2189                         <field reporter:label="Total Owed" name="total_owed" reporter:datatype="money"/>
2190                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
2191                         <field reporter:label="Billed User" name="usr" reporter:datatype="link"/>
2192                         <field reporter:label="Transaction Finish Time" name="xact_finish" reporter:datatype="timestamp" />
2193                         <field reporter:label="Transaction Start Time" name="xact_start" reporter:datatype="timestamp" />
2194                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
2195                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
2196                 </fields>
2197                 <links>
2198                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2199                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
2200                 </links>
2201         </class>
2202         <class id="aum" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message" oils_persist:tablename="actor.usr_message" reporter:label="User Message">
2203                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2204                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2205                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2206                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2207                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2208                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2209                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2210                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2211                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2212                 </fields>
2213                 <links>
2214                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2215                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2216                 </links>
2217                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2218                         <actions> <!-- created magically, so no create action -->
2219                                 <retrieve permission="VIEW_USER" context_field="sending_lib" />
2220                                 <update permission="UPDATE_USER" context_field="sending_lib" />
2221                                 <delete permission="UPDATE_USER" context_field="sending_lib" />
2222                         </actions>
2223                 </permacrud>
2224         </class>
2225         <class id="auml" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_message_limited" oils_persist:tablename="actor.usr_message_limited" reporter:label="User Message (Limited Access)">
2226                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_message_id_seq">
2227                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2228                         <field reporter:label="Read Date/Time" name="read_date" reporter:datatype="timestamp"/>
2229                         <field reporter:label="Creating Library" name="sending_lib" reporter:datatype="link"/>
2230                         <field reporter:label="Message ID" name="id" reporter:datatype="id" />
2231                         <field reporter:label="Deleted?" name="deleted" reporter:datatype="bool"/>
2232                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
2233                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2234                         <field reporter:label="Message" name="message" reporter:datatype="text"/>
2235                 </fields>
2236                 <links>
2237                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2238                         <link field="sending_lib" reltype="has_a" key="id" map="" class="aou"/>
2239                 </links>
2240                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2241                         <actions> <!-- created magically, so no create action -->
2242                                 <retrieve permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2243                                 <update   permission="UPDATE_USER" context_field="sending_lib" owning_user="usr"/>
2244                         </actions>
2245                 </permacrud>
2246         </class>
2247         <class id="aun" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_note" oils_persist:tablename="actor.usr_note" reporter:label="User Note">
2248                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_note_id_seq">
2249                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
2250                         <field reporter:label="Creating Staff" name="creator" reporter:datatype="link"/>
2251                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
2252                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
2253                         <field reporter:label="Note Title" name="title" reporter:datatype="text"/>
2254                         <field reporter:label="User" name="usr" reporter:datatype="link" />
2255                         <field reporter:label="Note Content" name="value" reporter:datatype="text"/>
2256                 </fields>
2257                 <links>
2258                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2259                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2260                 </links>
2261         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2262             <actions>
2263                 <create permission="UPDATE_USER" context_field="owner">
2264                     <context link="usr" field="home_ou"/>
2265                 </create>
2266                                 <!-- note: public notes are still accessible via API -->
2267                 <retrieve permission="UPDATE_USER">
2268                     <context link="usr" field="home_ou"/>
2269                                 </retrieve>
2270                 <update permission="UPDATE_USER">
2271                     <context link="usr" field="home_ou"/>
2272                                 </update>
2273                 <delete permission="UPDATE_USER">
2274                     <context link="usr" field="home_ou"/>
2275                                 </delete>
2276             </actions>
2277         </permacrud>
2278         </class>
2279         <class id="aupr" controller="open-ils.cstore" oils_obj:fieldmapper="actor::usr_password_reset" oils_persist:tablename="actor.usr_password_reset" reporter:label="User password reset requests">
2280                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_password_reset_id_seq">
2281                         <field reporter:label="Request ID" name="id" reporter:datatype="id"/>
2282                         <field reporter:label="UUID" name="uuid" reporter:datatype="text"/>
2283                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2284                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
2285                         <field reporter:label="Was Reset?" name="has_been_reset" reporter:datatype="bool"/>
2286                 </fields>
2287                 <links>
2288                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2289                 </links>
2290         </class>
2291         <class id="aus" controller="open-ils.cstore" oils_obj:fieldmapper="actor::user_setting" oils_persist:tablename="actor.usr_setting" reporter:label="User Setting">
2292                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_setting_id_seq">
2293                         <field reporter:label="Setting ID" name="id" reporter:datatype="id" />
2294                         <field reporter:label="Name" name="name" reporter:datatype="link"/>
2295                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
2296                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
2297                 </fields>
2298                 <links>
2299                         <link field="name" reltype="has_a" key="name" map="" class="cust"/>
2300                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2301                 </links>
2302         </class>
2303         <class id="mafe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::author_field_entry" oils_persist:tablename="metabib.author_field_entry" reporter:label="Author Field Entry">
2304                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.author_field_entry_id_seq">
2305                         <field name="field" reporter:datatype="link"/>
2306                         <field name="id" reporter:datatype="id" />
2307                         <field name="source" reporter:datatype="link"/>
2308                         <field name="value" reporter:datatype="text"/>
2309                 </fields>
2310                 <links>
2311                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
2312                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2313                 </links>
2314         </class>
2315         <class id="aihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::in_house_use" oils_persist:tablename="action.in_house_use" reporter:core="true" reporter:label="In House Use">
2316                 <fields oils_persist:primary="id" oils_persist:sequence="action.in_house_use_id_seq">
2317                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2318                         <field reporter:label="Item" name="item" reporter:datatype="int" />
2319                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2320                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2321                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2322                 </fields>
2323                 <links>
2324                         <link field="item" reltype="has_a" key="id" map="" class="acp"/>
2325                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2326                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2327                 </links>
2328                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2329                         <actions>
2330                                 <retrieve/>
2331                         </actions>
2332                 </permacrud>
2333         </class>
2334         <class id="ancihu" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::non_cat_in_house_use" oils_persist:tablename="action.non_cat_in_house_use" reporter:core="true" reporter:label="Non-cataloged In House Use">
2335                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cat_in_house_use_id_seq">
2336                         <field reporter:label="Use ID" name="id" reporter:datatype="id" />
2337                         <field reporter:label="Item Type" name="item_type" reporter:datatype="link"/>
2338                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
2339                         <field reporter:label="Recording Staff" name="staff" reporter:datatype="link"/>
2340                         <field reporter:label="Use Date/Time" name="use_time" reporter:datatype="timestamp"/>
2341                 </fields>
2342                 <links>
2343                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
2344                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
2345                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
2346                 </links>
2347                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2348                         <actions>
2349                                 <retrieve/>
2350                         </actions>
2351                 </permacrud>
2352         </class>
2353         <class id="atc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::transit_copy" oils_persist:tablename="action.transit_copy" reporter:core="true" reporter:label="Copy Transit">
2354                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
2355                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="bool"/>
2356                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
2357                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
2358                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
2359                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
2360                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
2361                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
2362                         <field reporter:label="Prev Destination" name="prev_dest" reporter:datatype="org_unit"/>
2363                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
2364                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
2365                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
2366                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
2367                 </fields>
2368                 <links>
2369                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
2370                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
2371                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
2372                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
2373                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
2374                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2375                 </links>
2376         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2377             <actions>
2378                 <create permission="TRANSIT_COPY" context_field="owner">
2379                     <context link="target_copy" field="circ_lib"/>
2380                 </create>
2381                 <retrieve/>
2382                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
2383                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
2384             </actions>
2385         </permacrud>
2386         </class>
2387         <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">
2388                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_response_id_seq">
2389                         <field reporter:label="Answer" name="answer" reporter:datatype="link"/>
2390                         <field reporter:label="Answer Date/Time" name="answer_date" reporter:datatype="timestamp"/>
2391                         <field reporter:label="Effective Answer Date/Time" name="effective_date" reporter:datatype="timestamp"/>
2392                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
2393                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
2394                         <field reporter:label="Response Group ID" name="response_group_id" reporter:datatype="int" />
2395                         <field reporter:label="Survey" name="survey" reporter:datatype="link"/>
2396                         <field reporter:label="Responding User" name="usr" reporter:datatype="link"/>
2397                 </fields>
2398                 <links>
2399                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
2400                         <link field="survey" reltype="has_a" key="id" map="" class="asv"/>
2401                         <link field="answer" reltype="has_a" key="id" map="" class="asva"/>
2402                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
2403                 </links>
2404         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2405             <actions>
2406                 <create permission="ADMIN_SURVEY">
2407                     <context link="survey" field="owner"/>
2408                 </create>
2409                 <retrieve permission="VIEW_USER">
2410                     <context link="usr" field="home_ou"/>
2411                 </retrieve>
2412                 <update permission="ADMIN_SURVEY">
2413                     <context link="survey" field="owner"/>
2414                 </update>
2415                 <delete permission="ADMIN_SURVEY">
2416                     <context link="survey" field="owner"/>
2417                 </delete>
2418             </actions>
2419         </permacrud>
2420         </class>
2421         <class id="ccbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket_item" oils_persist:tablename="container.copy_bucket_item" reporter:label="Copy Bucket Item">
2422                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_id_seq">
2423                         <field name="bucket" />
2424                         <field name="id" reporter:datatype="id" />
2425                         <field name="target_copy" reporter:datatype="link"/>
2426                         <field name="create_time" reporter:datatype="timestamp" />
2427                         <field name="pos" reporter:datatype="int" />
2428                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
2429                 </fields>
2430                 <links>
2431                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
2432                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
2433             <link field="notes" reltype="has_many" map="" key="item" class="ccbin"/>
2434                 </links>
2435                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2436                         <actions>
2437                                 <retrieve permission="ADMIN_COPY_BUCKET">
2438                     <context link="bucket" owning_lib="owning_lib"/>
2439                 </retrieve>
2440             </actions>
2441         </permacrud>
2442         </class>
2443         <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">
2444                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_item_note_id_seq">
2445                         <field name="id" reporter:datatype="id" />
2446                         <field name="item" reporter:datatype="link"/>
2447                         <field name="note" reporter:datatype="text" />
2448                 </fields>
2449                 <links>
2450                         <link field="item" reltype="has_a" key="id" map="" class="ccbi"/>
2451                 </links>
2452         </class>
2453
2454         <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">
2455                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_id_seq">
2456                         <field reporter:label="Control Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2457                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2458                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2459                         <field reporter:label="Controlling Authority Fields" name="authority_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2460                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2461                 </fields>
2462                 <links>
2463                         <link field="authority_fields" reltype="has_many" key="control_set" map="" class="acsaf"/>
2464                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2465                 </links>
2466                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2467                         <actions>
2468                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2469                                 <retrieve/>
2470                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2471                                 <delete permission="DELETE_AUTHORITY_CONTROL_SET" global_required="true"/>
2472                         </actions>
2473                 </permacrud>
2474         </class>
2475
2476         <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">
2477                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_authority_field_id_seq">
2478                         <field reporter:label="Control Set Authority Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2479                         <field reporter:label="Main Entry" name="main_entry" reporter:datatype="link"/>
2480                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2481                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2482                         <field reporter:label="Subfield List" name="sf_list" reporter:datatype="text" />
2483                         <field reporter:label="Subfield List for Display" name="display_sf_list" reporter:datatype="text" />
2484                         <field reporter:label="Non-filing Indicator" name="nfi" reporter:datatype="text" />
2485                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2486                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2487                         <field reporter:label="Linking Subfield" name="linking_subfield" reporter:datatype="text" />
2488                         <field reporter:label="Subordinate Entries" name="sub_entries" reporter:datatype="link" oils_persist:virtual="true"/>
2489                         <field reporter:label="Controlled Bib Fields" name="bib_fields" reporter:datatype="link" oils_persist:virtual="true"/>
2490                         <field reporter:label="Thesauri" name="thesauri" reporter:datatype="link" oils_persist:virtual="true"/>
2491                         <field reporter:label="Browse Axis Maps" name="axis_maps" reporter:datatype="link" oils_persist:virtual="true"/>
2492                         <field reporter:label="Joiner" name="joiner" reporter:datatype="text" />
2493                         <field reporter:label="Heading Field" name="heading_field" reporter:datatype="link" />
2494                 </fields>
2495                 <links>
2496                         <link field="axis_maps" reltype="has_many" key="field" map="" class="abaafm"/>
2497                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2498                         <link field="bib_fields" reltype="has_many" key="authority_field" map="" class="acsbf"/>
2499                         <link field="thesauri" reltype="has_many" key="control_set" map="" class="at"/>
2500                         <link field="main_entry" reltype="has_a" key="id" map="" class="acsaf"/>
2501                         <link field="sub_entries" reltype="has_many" key="main_entry" map="" class="acsaf"/>
2502                         <link field="heading" reltype="has_a" key="id" map="" class="ahf"/>
2503                 </links>
2504                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2505                         <actions>
2506                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2507                                 <retrieve/>
2508                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2509                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2510                         </actions>
2511                 </permacrud>
2512         </class>
2513
2514         <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">
2515                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_id_seq">
2516                         <field reporter:label="Controlled Bib Field ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2517                         <field reporter:label="Controlling Authority Field" name="authority_field" reporter:datatype="link"/>
2518                         <field reporter:label="Tag" name="tag" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.{3}$"/>
2519                 </fields>
2520                 <links>
2521                         <link field="authority_field" reltype="has_a" key="id" map="" class="acsaf"/>
2522                 </links>
2523                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2524                         <actions>
2525                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2526                                 <retrieve/>
2527                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2528                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2529                         </actions>
2530                 </permacrud>
2531         </class>
2532
2533         <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">
2534                 <fields oils_persist:primary="id" oils_persist:sequence="authority.control_set_bib_field_metabib_field_map_id_seq">
2535                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
2536                         <field reporter:label="Bib Field" name="bib_field" reporter:datatype="link"/>
2537                         <field reporter:label="Metabib Field" name="metabib_field" reporter:datatype="link"/>
2538                 </fields>
2539                 <links>
2540                         <link field="bib_field" reltype="has_a" key="id" map="" class="acsbf"/>
2541                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
2542                 </links>
2543                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2544                         <actions>
2545                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2546                                 <retrieve/>
2547                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2548                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2549                         </actions>
2550                 </permacrud>
2551         </class>
2552
2553         <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">
2554                 <fields oils_persist:primary="code">
2555                         <field reporter:label="Thesaurus Code" name="code" reporter:datatype="id" reporter:selector="name"/>
2556                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2557                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true" />
2558                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2559                         <field reporter:label="Short Code" name="short_code" reporter:datatype="text" />
2560                         <field reporter:label="URI" name="uri" reporter:datatype="text" />
2561                 </fields>
2562                 <links>
2563                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2564                 </links>
2565                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2566                         <actions>
2567                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2568                                 <retrieve/>
2569                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2570                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2571                         </actions>
2572                 </permacrud>
2573         </class>
2574
2575         <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">
2576                 <fields oils_persist:primary="code">
2577                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name" oils_obj:validate="^\S+$"/>
2578                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" oils_obj:required="true"/>
2579                         <field reporter:label="Sorter Attribute" name="sorter" reporter:datatype="link"/>
2580                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
2581                         <field reporter:label="Authority Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2582                         <field reporter:label="Authority Field Maps" name="maps" reporter:datatype="link" oils_persist:virtual="true"/>
2583                 </fields>
2584                 <links>
2585                         <link field="sorter" reltype="has_a" key="name" map="" class="crad"/>
2586                         <link field="fields" reltype="has_many" key="axis" map="field" class="abaafm"/>
2587                         <link field="maps" reltype="has_many" key="axis" map="" class="abaafm"/>
2588                 </links>
2589                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2590                         <actions>
2591                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2592                                 <retrieve/>
2593                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2594                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2595                         </actions>
2596                 </permacrud>
2597         </class>
2598
2599     <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">
2600         <fields oils_persist:primary="id" oils_persist:sequence="authority.browse_axis_authority_field_map_id_seq">
2601             <field reporter:label="Axis Authority Field Map ID" name="id" reporter:datatype="id"/>
2602             <field reporter:label="Authority Field" name="field" oils_obj:required="true" reporter:datatype="link"/>
2603             <field reporter:label="Axis" name="axis" reporter:datatype="link" oils_obj:required="true"/>
2604         </fields>
2605         <links>
2606             <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
2607             <link field="axis" reltype="has_a" key="code" map="" class="aba"/>
2608         </links>
2609         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2610             <actions>
2611                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2612                 <retrieve/>
2613                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2614                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2615             </actions>
2616         </permacrud>
2617     </class>
2618
2619         <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">
2620                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_entry_id_seq">
2621                         <field name="active" reporter:datatype="bool"/>
2622                         <field name="create_date" reporter:datatype="timestamp"/>
2623                         <field name="creator" />
2624                         <field name="deleted" reporter:datatype="bool"/>
2625                         <field name="edit_date" reporter:datatype="timestamp"/>
2626                         <field name="editor" />
2627                         <field name="id" reporter:datatype="id" />
2628                         <field name="last_xact_id" />
2629                         <field name="marc" />
2630                         <field name="source" />
2631                         <field reporter:label="Control Set" name="control_set" reporter:datatype="link"/>
2632                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
2633                         <field name="heading" />
2634                         <field name="simple_heading" />
2635                         <field name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
2636                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2637                         <field name="bib_links" oils_persist:virtual="true" reporter:datatype="link"/>
2638                 </fields>
2639                 <links>
2640                         <link field="control_set" reltype="has_a" key="id" map="" class="acs"/>
2641                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
2642                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
2643                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
2644                         <link field="notes" reltype="has_many" key="record" map="" class="arn"/>
2645                         <link field="bib_links" reltype="has_many" key="authority" map="" class="abl"/>
2646                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="ard"/>
2647                 </links>
2648                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2649                         <actions>
2650                                 <create permission="CREATE_AUTHORITY_RECORD IMPORT_MARC" global_required="true"/>
2651                                 <retrieve/>
2652                                 <update permission="UPDATE_AUTHORITY_RECORD" global_required="true"/>
2653                                 <delete permission="DELETE_AUTHORITY_RECORD" global_required="true"/>
2654                         </actions>
2655                 </permacrud>
2656         </class>
2657         <class id="ard" controller="open-ils.cstore" oils_obj:fieldmapper="authority::record_descriptor" oils_persist:tablename="authority.rec_descriptor" reporter:label="Authority Record Descriptor">
2658                 <fields oils_persist:primary="id" oils_persist:sequence="authority.rec_descriptor_id_seq">
2659                         <field name="char_encoding" />
2660                         <field name="id" />
2661                         <field name="record" />
2662                         <field name="record_status" />
2663                         <field name="thesaurus" />
2664                 </fields>
2665                 <links>
2666                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2667                         <link field="thesaurus" reltype="might_have" key="code" map="" class="at"/>
2668                 </links>
2669         </class>
2670         <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">
2671                 <fields oils_persist:primary="id" oils_persist:sequence="authority.bib_linking_id_seq">
2672                         <field name="id" reporter:datatype="id" />
2673                         <field name="bib" reporter:datatype="link" />
2674                         <field name="authority" reporter:datatype="link" />
2675                 </fields>
2676                 <links>
2677                         <link field="bib" reltype="has_a" key="id" map="" class="bre"/>
2678                         <link field="authority" reltype="has_a" key="id" map="" class="are"/>
2679                 </links>
2680         </class>
2681         <class id="ash" controller="open-ils.cstore" oils_obj:fieldmapper="authority::simple_heading" oils_persist:tablename="authority.simple_heading" reporter:label="Authority Simple Heading">
2682                 <fields oils_persist:primary="id" oils_persist:sequence="authority.simple_heading_id_seq">
2683                         <field name="id" reporter:datatype="id" />
2684                         <field name="record" reporter:datatype="link" />
2685                         <field name="atag" reporter:datatype="link" />
2686                         <field name="value" reporter:datatype="text" />
2687                 </fields>
2688                 <links>
2689                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
2690                         <link field="atag" reltype="has_a" key="id" map="" class="acsaf"/>
2691                 </links>
2692         </class>
2693
2694         <class id="ahf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="authority::heading_field" oils_persist:tablename="authority.heading_field" reporter:label="Authority Heading Fields">
2695                 <fields oils_persist:primary="id" oils_persist:sequence="authority.heading_fields_id_seq">
2696                         <field name="id" reporter:datatype="id" />
2697                         <field name="heading_type" reporter:datatype="text" reporter:label="Heading Type" />
2698                         <field name="heading_purpose" reporter:datatype="text" reporter:label="Heading Purpose" />
2699                         <field name="label" reporter:datatype="text" reporter:label="Heading Field Label" />
2700                         <field name="format" reporter:datatype="text" reporter:label="Heading XSLT Format" />
2701                         <field name="heading_xpath" reporter:datatype="text" reporter:label="Heading XPath" />
2702                         <field name="component_xpath" reporter:datatype="text" reporter:label="Heading Component XPath" />
2703                         <field name="type_xpath" reporter:datatype="text" reporter:label="Related/Variant Type XPath" />
2704                         <field name="thesaurus_xpath" reporter:datatype="text" reporter:label="Thesaurus XPath" />
2705                         <field name="thesaurus_override_xpath" reporter:datatype="text" reporter:label="Thesaurus Override XPath" />
2706                         <field name="joiner" reporter:datatype="text" reporter:label="Joiner string" />
2707                 </fields>
2708                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2709                         <actions>
2710                                 <create permission="CREATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2711                                 <retrieve/>
2712                                 <update permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2713                                 <delete permission="UPDATE_AUTHORITY_CONTROL_SET" global_required="true"/>
2714                         </actions>
2715                 </permacrud>
2716         </class>
2717
2718         <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">
2719                 <fields oils_persist:primary="code" oils_persist:sequence="">
2720                         <field reporter:label="Language Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2721                         <field reporter:label="Language" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
2722                 </fields>
2723                 <links/>
2724         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2725             <actions>
2726                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2727                 <retrieve/>
2728                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2729                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2730             </actions>
2731         </permacrud>
2732         </class>
2733         <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">
2734                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
2735                         <field name="accepting_usr" />
2736                         <field name="amount" reporter:datatype="money" />
2737                         <field name="amount_collected" reporter:datatype="money" />
2738                         <field name="approval_code" reporter:datatype="text"/>
2739                         <field name="cash_drawer" reporter:datatype="link"/>
2740                         <field name="cc_number" reporter:datatype="text"/>
2741                         <field name="cc_order_number" reporter:datatype="text"/>
2742                         <field name="cc_processor" reporter:datatype="text"/>
2743                         <field name="id" reporter:datatype="id" />
2744                         <field name="note" reporter:datatype="text"/>
2745                         <field name="payment_ts" reporter:datatype="timestamp"/>
2746                         <field name="xact" reporter:datatype="link"/>
2747                         <field name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
2748                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
2749                 </fields>
2750                 <links>
2751                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
2752                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
2753                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
2754                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
2755                 </links>
2756         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2757             <actions>
2758                 <retrieve permission="VIEW_USER_TRANSACTIONS">
2759                     <context link="xact" jump="usr" field="home_ou"/>
2760                 </retrieve>
2761                         </actions>
2762                 </permacrud>
2763         </class>
2764         <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">
2765                 <fields oils_persist:primary="name">
2766                         <field reporter:label="Name" name="name" reporter:datatype="text" />
2767                         <field reporter:label="Namespace URI" name="namespace_uri" reporter:datatype="text"/>
2768                         <field reporter:label="Namespace Prefix" name="prefix" reporter:datatype="text"/>
2769                         <field reporter:label="XSLT" name="xslt" reporter:datatype="text" />
2770                 </fields>
2771                 <links/>
2772         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2773             <actions>
2774                 <create permission="CREATE_XML_TRANSFORM" global_required="true"/>
2775                 <retrieve/>
2776                 <update permission="UPDATE_XML_TRANSFORM" global_required="true"/>
2777                 <delete permission="DELETE_XML_TRANSFORM" global_required="true"/>
2778             </actions>
2779         </permacrud>
2780         </class>
2781
2782         <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">
2783                 <fields oils_persist:primary="alias">
2784                         <field reporter:label="Alias (RegExp)" name="alias" reporter:datatype="text"/>
2785                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2786                         <field reporter:label="Field" name="field" reporter:datatype="link"/>
2787                 </fields>
2788                 <links>
2789                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2790                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
2791                 </links>
2792         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2793             <actions>
2794                 <create permission="CREATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2795                 <retrieve/>
2796                 <update permission="UPDATE_METABIB_SEARCH_ALIAS" global_required="true"/>
2797                 <delete permission="DELETE_METABIB_SEARCH_ALIAS" global_required="true"/>
2798             </actions>
2799         </permacrud>
2800         </class>
2801
2802         <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">
2803                 <fields oils_persist:primary="name">
2804                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2805                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2806                         <field reporter:label="Buoyant?" name="buoyant" reporter:datatype="bool" />
2807                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2808                         <field reporter:label="Combined?" name="combined" reporter:datatype="bool" />
2809                         <field reporter:label="A Weight" name="a_weight" reporter:datatype="float" />
2810                         <field reporter:label="B Weight" name="b_weight" reporter:datatype="float" />
2811                         <field reporter:label="C Weight" name="c_weight" reporter:datatype="float" />
2812                         <field reporter:label="D Weight" name="d_weight" reporter:datatype="float" />
2813                         <field reporter:label="Fields" name="fields" reporter:datatype="link" oils_persist:virtual="true"/>
2814                 </fields>
2815                 <links>
2816                         <link field="fields" reltype="has_many" key="name" map="" class="cmf"/>
2817                 </links>
2818         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2819             <actions>
2820                 <create permission="CREATE_METABIB_CLASS" global_required="true"/>
2821                 <retrieve/>
2822                 <update permission="UPDATE_METABIB_CLASS" global_required="true"/>
2823                 <delete permission="DELETE_METABIB_CLASS" global_required="true"/>
2824             </actions>
2825         </permacrud>
2826         </class>
2827
2828         <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">
2829                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_id_seq">
2830                         <field reporter:label="Class" name="field_class" reporter:datatype="link"/>
2831                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="label"/>
2832                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2833                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
2834                         <field reporter:label="XPath" name="xpath" reporter:datatype="text"/>
2835                         <field reporter:label="Weight" name="weight" reporter:datatype="int" />
2836                         <field reporter:label="Format" name="format" reporter:datatype="link"/>
2837                         <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
2838                         <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
2839                         <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
2840                         <field reporter:label="Display XPath" name="display_xpath" reporter:datatype="text" />
2841                         <field reporter:label="Browse Field" name="browse_field" reporter:datatype="bool" />
2842                         <field reporter:label="Browse XPath" name="browse_xpath" reporter:datatype="text" />
2843                         <field reporter:label="Restrict?" name="restrict" reporter:datatype="bool" />
2844                         <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
2845                         <field reporter:label="Display Field Map" name="display_field_map" oils_persist:virtual="true" reporter:datatype="link"/>
2846                 </fields>
2847                 <links>
2848                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
2849                         <link field="display_field_map" reltype="might_have" key="field" map="" class="cdfm"/>
2850                 </links>
2851         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2852             <actions>
2853                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
2854                 <retrieve/>
2855                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
2856                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
2857             </actions>
2858         </permacrud>
2859         </class>
2860         <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">
2861                 <fields oils_persist:primary="id" oils_persist:sequence="config.best_hold_order_id_seq">
2862                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
2863                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
2864                         <field reporter:label="Capture Lib to Pickup Lib Proximity" name="pprox" reporter:datatype="int" />
2865                         <field reporter:label="Circ Lib to Request Lib Proximity" name="hprox" reporter:datatype="int" />
2866                         <field reporter:label="Adjusted Circ Lib to Pickup Lib Proximity" name="aprox" reporter:datatype="int" />
2867                         <field reporter:label="Adjusted Capture Location to Pickup Lib Proximity" name="approx" reporter:datatype="int" />
2868                         <field reporter:label="Hold Priority" name="priority" reporter:datatype="int" />
2869                         <field reporter:label="Hold Cut-in-line State" name="cut" reporter:datatype="int" />
2870                         <field reporter:label="Hold Selection Depth" name="depth" reporter:datatype="int" />
2871                         <field reporter:label="Copy Has Circulated From Home Lately" name="htime" reporter:datatype="int" />
2872                         <field reporter:label="Hold Request Time" name="rtime" reporter:datatype="int" />
2873                         <field reporter:label="Copy Has Been Home At All Lately" name="shtime" reporter:datatype="int" />
2874                 </fields>
2875                 <links>
2876                 </links>
2877                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2878                         <actions>
2879                                 <create permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2880                                 <retrieve permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2881                                 <update permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2882                                 <delete permission="ADMIN_HOLD_CAPTURE_SORT" global_required="true"/>
2883                         </actions>
2884                 </permacrud>
2885         </class>
2886         <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">
2887                 <fields oils_persist:primary="id" oils_persist:sequence="config.biblio_fingerprint_id_seq">
2888                         <field name="id" reporter:datatype="id" />
2889                         <field name="name" reporter:datatype="text"/>
2890                         <field name="xpath" reporter:datatype="text"/>
2891                         <field name="format" reporter:datatype="link"/>
2892                         <field name="first_word" reporter:datatype="bool" />
2893                 </fields>
2894                 <links/>
2895         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2896             <actions>
2897                 <create permission="CREATE_BIBLIO_FINGERPRINT" global_required="true"/>
2898                 <retrieve/>
2899                 <update permission="UPDATE_BIBLIO_FINGERPRINT" global_required="true"/>
2900                 <delete permission="DELETE_BIBLIO_FINGERPRINT" global_required="true"/>
2901             </actions>
2902         </permacrud>
2903         </class>
2904         <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">
2905                 <fields oils_persist:primary="code" oils_persist:sequence="">
2906                         <field reporter:label="Audience Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2907                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
2908                         <field reporter:label="Audience" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2909                 </fields>
2910                 <links/>
2911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2912             <actions>
2913                 <create permission="CREATE_MARC_CODE" global_required="true"/>
2914                 <retrieve/>
2915                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
2916                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
2917             </actions>
2918         </permacrud>
2919         </class>
2920         <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">
2921                 <fields oils_persist:primary="code" oils_persist:sequence="">
2922                         <field reporter:label="Item Form Code" name="code" reporter:selector="value" reporter:datatype="text"/>
2923                         <field reporter:label="Item Form" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
2924                 </fields>
2925                 <links/>
2926         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2927             <actions>
2928                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
2929                 <retrieve/>
2930                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
2931                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
2932             </actions>
2933         </permacrud>
2934         </class>
2935     <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">
2936         <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_class_id_seq">
2937             <field reporter:label="Call number class ID" name="id" reporter:datatype="id"/>
2938             <field reporter:label="Name" name="name" reporter:datatype="text"/>
2939             <field reporter:label="Normalizer function" name="normalizer" reporter:datatype="text"/>
2940             <field reporter:label="Call number fields" name="field" reporter:datatype="text"/>
2941         </fields>
2942         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2943             <actions>
2944                 <retrieve/>
2945             </actions>
2946         </permacrud>
2947     </class>
2948         <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">
2949                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_suffix_id_seq">
2950                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2951                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2952                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2953                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2954                 </fields>
2955                 <links>
2956                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2957                 </links>
2958         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2959             <actions>
2960                 <create permission="CREATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2961                 <retrieve/>
2962                 <update permission="UPDATE_VOLUME_SUFFIX" context_field="owning_lib"/>
2963                 <delete permission="DELETE_VOLUME_SUFFIX" context_field="owning_lib"/>
2964             </actions>
2965         </permacrud>
2966         </class>
2967         <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">
2968                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_prefix_id_seq">
2969                         <field reporter:label="ID" name="id" reporter:datatype="id" />
2970                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
2971                         <field reporter:label="Label Sort Key" name="label_sortkey" reporter:datatype="text"/>
2972                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2973                 </fields>
2974                 <links>
2975                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
2976                 </links>
2977         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
2978             <actions>
2979                 <create permission="CREATE_VOLUME_PREFIX" context_field="owning_lib"/>
2980                 <retrieve/>
2981                 <update permission="UPDATE_VOLUME_PREFIX" context_field="owning_lib"/>
2982                 <delete permission="DELETE_VOLUME_PREFIX" context_field="owning_lib"/>
2983             </actions>
2984         </permacrud>
2985         </class>
2986         <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">
2987                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_id_seq">
2988                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
2989                         <field reporter:label="Create Date/Time" name="create_date" reporter:datatype="timestamp"/>
2990                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
2991                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
2992                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
2993                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
2994                         <field reporter:label="Call Number/Volume ID" name="id" reporter:datatype="id" />
2995                         <field reporter:label="Call Number Label" name="label" reporter:datatype="text"/>
2996                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
2997                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
2998                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
2999                         <field reporter:label="URI Maps" name="uri_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3000                         <field reporter:label="URIs" name="uris" oils_persist:virtual="true" reporter:datatype="link"/>
3001                         <field reporter:label="Call Number Sort Key" name="label_sortkey" reporter:datatype="text"/>
3002                         <field reporter:label="Classification Scheme" name="label_class" reporter:datatype="link"/>
3003                         <field reporter:label="Prefix" name="prefix" reporter:datatype="link"/>
3004                         <field reporter:label="Suffix" name="suffix" reporter:datatype="link"/>
3005                 </fields>
3006                 <links>
3007                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3008                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3009                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3010                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
3011                         <link field="notes" reltype="has_many" key="call_number" map="" class="acnn"/>
3012                         <link field="copies" reltype="has_many" key="call_number" map="" class="acp"/>
3013                         <link field="uris" reltype="has_many" key="call_number" map="uri" class="auricnm"/>
3014                         <link field="uri_maps" reltype="has_many" key="call_number" map="" class="auricnm"/>
3015                         <link field="label_class" reltype="has_a" key="id" map="" class="acnc"/>
3016                         <link field="prefix" reltype="has_a" key="id" map="" class="acnp"/>
3017                         <link field="suffix" reltype="has_a" key="id" map="" class="acns"/>
3018                 </links>
3019         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3020             <actions>
3021                 <create permission="CREATE_VOLUME" context_field="owning_lib"/>
3022                 <retrieve/>
3023                 <update permission="UPDATE_VOLUME" context_field="owning_lib"/>
3024                 <delete permission="DELETE_VOLUME" context_field="owning_lib"/>
3025             </actions>
3026         </permacrud>
3027         </class>
3028         <class id="auri" controller="open-ils.cstore" oils_obj:fieldmapper="asset::uri" oils_persist:tablename="asset.uri" reporter:label="Electronic Access URI">
3029                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_id_seq">
3030                         <field reporter:label="URI ID" name="id" reporter:datatype="id"/>
3031                         <field reporter:label="URI" name="href" reporter:datatype="text"/>
3032                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
3033                         <field reporter:label="Use Information" name="use_restriction" reporter:datatype="text"/>
3034                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3035                         <field reporter:label="Call Number Maps" name="call_number_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3036                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3037                 </fields>
3038                 <links>
3039                         <link field="call_numbers" reltype="has_many" key="uri" map="call_number" class="auricnm"/>
3040                         <link field="call_number_maps" reltype="has_many" key="uri" map="" class="auricnm"/>
3041         </links>
3042         </class>
3043         <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">
3044                 <fields oils_persist:primary="id" oils_persist:sequence="asset.uri_call_number_map_id_seq">
3045                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3046                         <field reporter:label="URI" name="uri" reporter:datatype="int"/>
3047                         <field reporter:label="Call Number" name="call_number" reporter:datatype="text"/>
3048                 </fields>
3049                 <links>
3050                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
3051                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
3052                 </links>
3053         </class>
3054         <class id="cst" controller="open-ils.cstore" oils_obj:fieldmapper="config::standing" oils_persist:tablename="config.standing" reporter:label="Standing Penalty">
3055                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_id_seq">
3056                         <field name="id" reporter:datatype="id" />
3057                         <field name="value" oils_persist:i18n="true" />
3058                 </fields>
3059                 <links/>
3060         </class>
3061         <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">
3062                 <fields oils_persist:primary="usr" oils_persist:sequence="">
3063                         <field name="balance_owed" reporter:datatype="money" />
3064                         <field name="total_owed" reporter:datatype="money" />
3065                         <field name="total_paid" reporter:datatype="money" />
3066                         <field name="usr" reporter:datatype="link"/>
3067                 </fields>
3068                 <links>
3069                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3070         </links>
3071         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3072             <actions>
3073                 <retrieve permission="VIEW_USER">
3074                     <context link="usr" field="home_ou"/>
3075                 </retrieve>
3076             </actions>
3077         </permacrud>
3078         </class>
3079         <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">
3080                 <fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
3081                         <field name="collector" />
3082                         <field name="enter_time" reporter:datatype="timestamp"/>
3083                         <field name="id" reporter:datatype="id" />
3084                         <field name="location" reporter:datatype="link"/>
3085                         <field name="usr" reporter:datatype="link"/>
3086                 </fields>
3087                 <links>
3088                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3089                         <link field="collector" reltype="has_a" key="id" map="" class="au"/>
3090                         <link field="location" reltype="has_a" key="id" map="" class="aou"/>
3091                 </links>
3092         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3093             <actions>
3094                 <create permission="money.collections_tracker.create" context_field="location"/>
3095                 <retrieve permission="money.collections_tracker.create" context_field="location"/> 
3096                 <delete permission="money.collections_tracker.create" context_field="location"/>
3097             </actions>
3098         </permacrud>
3099         </class>
3100         <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">
3101                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry_id_seq">
3102                         <field reporter:label="Call Numbers" name="call_numbers" oils_persist:virtual="true" reporter:datatype="link"/>
3103                         <field reporter:label="Fixed Field Entry" name="fixed_fields" oils_persist:virtual="true" reporter:datatype="link"/>
3104                         <field reporter:label="Is Active?" name="active" reporter:datatype="bool"/>
3105                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3106                         <field reporter:label="Record Creator" name="creator" reporter:datatype="link"/>
3107                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool"/>
3108                         <field reporter:label="Last Edit Data/Time" name="edit_date" reporter:datatype="timestamp"/>
3109                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
3110                         <field reporter:label="Fingerprint" name="fingerprint"  reporter:datatype="text"/>
3111                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
3112                         <field reporter:label="Last Transaction ID" name="last_xact_id"  reporter:datatype="text"/>
3113                         <field reporter:label="MARC21Slim" name="marc"  reporter:datatype="text"/>
3114                         <field reporter:label="Overall Quality" name="quality" reporter:datatype="int" />
3115                         <field reporter:label="Record Source" name="source" reporter:datatype="link"/>
3116                         <field reporter:label="TCN Source" name="tcn_source"  reporter:datatype="text"/>
3117                         <field reporter:label="TCN Value" name="tcn_value"  reporter:datatype="text"/>
3118                         <field reporter:label="Owner" name="owner"  reporter:datatype="org_unit"/>
3119                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
3120                         <field reporter:label="Metarecord" name="metarecord" oils_persist:virtual="true" reporter:datatype="link"/>
3121                         <field reporter:label="Language Code" name="language" oils_persist:virtual="true" reporter:datatype="link"/>
3122                         <field reporter:label="Non-MARC Record Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3123                         <field reporter:label="Indexed Keyword Field Entries" name="keyword_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3124                         <field reporter:label="Indexed Subject Field Entries" name="subject_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3125                         <field reporter:label="Indexed Title Field Entries" name="title_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3126                         <field reporter:label="Indexed Identifier Field Entries" name="identifier_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3127                         <field reporter:label="Indexed Author Field Entries" name="author_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3128                         <field reporter:label="Indexed Series Field Entries" name="series_field_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3129                         <field reporter:label="Flattened MARC Fields " name="full_record_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3130                         <field reporter:label="Simple Record Extracts " name="simple_record" oils_persist:virtual="true" reporter:datatype="link"/>
3131                         <field reporter:label="Authority Links" name="authority_links" oils_persist:virtual="true" reporter:datatype="link"/>
3132                         <field reporter:label="Subscriptions" name="subscriptions" oils_persist:virtual="true" reporter:datatype="link"/>
3133                         <field reporter:label="SVF Attributes" name="attrs" oils_persist:virtual="true" reporter:datatype="link"/>
3134                         <field reporter:label="MVF Attributes" name="mattrs" oils_persist:virtual="true" reporter:datatype="link"/>
3135                         <field reporter:label="Display Fields" name="display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3136                         <field reporter:label="Flat Display Entries" name="flat_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3137                         <field reporter:label="Compressed Display Entries" name="compressed_display_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3138                         <field reporter:label="Wide Display Entries" name="wide_display_entry" oils_persist:virtual="true" reporter:datatype="link"/>
3139                         <field reporter:label="Merge Date" name="merge_date" reporter:datatype="timestamp"/>
3140                         <field reporter:label="Merged To" name="merged_to" reporter:datatype="link"/>
3141                 </fields>
3142                 <links>
3143                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3144                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
3145                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3146                         <link field="simple_record" reltype="might_have" key="id" map="" class="rmsr"/>
3147                         <link field="metarecord" reltype="might_have" key="source" map="metarecord" class="mmrsm"/>
3148                         <link field="call_numbers" reltype="has_many" key="record" map="" class="acn"/>
3149                         <link field="keyword_field_entries" reltype="has_many" key="source" map="" class="mkfe"/>
3150                         <link field="fixed_fields" reltype="might_have" key="record" map="" class="mrd"/>
3151                         <link field="language" reltype="might_have" key="record" map="item_lang" class="mrd"/>
3152                         <link field="subject_field_entries" reltype="has_many" key="source" map="" class="msfe"/>
3153                         <link field="title_field_entries" reltype="has_many" key="source" map="" class="mtfe"/>
3154                         <link field="identifier_field_entries" reltype="has_many" key="source" map="" class="mife"/>
3155                         <link field="notes" reltype="has_many" key="record" map="" class="bren"/>
3156                         <link field="author_field_entries" reltype="has_many" key="source" map="" class="mafe"/>
3157                         <link field="series_field_entries" reltype="has_many" key="source" map="" class="msefe"/>
3158                         <link field="full_record_entries" reltype="has_many" key="record" map="" class="mfr"/>
3159                         <link field="authority_links" reltype="has_many" key="bib" map="" class="abl"/>
3160                         <link field="subscriptions" reltype="has_many" key="record_entry" map="" class="ssub"/>
3161                         <link field="attrs" reltype="might_have" key="id" map="" class="mra"/>
3162                         <link field="mattrs" reltype="might_have" key="id" map="" class="mraf"/>
3163                         <link field="source" reltype="has_a" key="id" map="" class="cbs"/>
3164                         <link field="display_entries" reltype="has_many" key="source" map="" class="mde"/>
3165                         <link field="flat_display_entries" reltype="has_many" key="source" map="" class="mfde"/>
3166                         <link field="compressed_display_entries" reltype="has_many" key="source" map="" class="mcde"/>
3167                         <link field="wide_display_entry" reltype="might_have" key="source" map="" class="mwde"/>
3168                         <link field="merged_to" reltype="has_a" key="id" map="" class="bre"/>
3169                 </links>
3170         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3171             <actions>
3172                 <create permission="CREATE_MARC IMPORT_MARC" global_required="true"/>
3173                 <retrieve/>
3174                 <update permission="UPDATE_MARC" global_required="true"/>
3175                 <!-- 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. -->
3176                 <delete permission="DELETE_RECORD" global_required="true"/>
3177             </actions>
3178         </permacrud>
3179         </class>
3180         <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">
3181                 <fields oils_persist:primary="id">
3182                         <field name="dow_0_close" />
3183                         <field name="dow_0_open" />
3184                         <field name="dow_1_close" />
3185                         <field name="dow_1_open" />
3186                         <field name="dow_2_close" />
3187                         <field name="dow_2_open" />
3188                         <field name="dow_3_close" />
3189                         <field name="dow_3_open" />
3190                         <field name="dow_4_close" />
3191                         <field name="dow_4_open" />
3192                         <field name="dow_5_close" />
3193                         <field name="dow_5_open" />
3194                         <field name="dow_6_close" />
3195                         <field name="dow_6_open" />
3196                         <field name="id" reporter:datatype="id" />
3197                         <field name="org_unit" oils_persist:virtual="true" reporter:datatype="org_unit"/>
3198                 </fields>
3199                 <links>
3200                         <link field="id" reltype="might_have" key="id" map="" class="aou"/>
3201                 </links>
3202         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3203             <actions>
3204                 <create permission="CREATE_HOURS_OF_OPERATION" context_field="id"/>
3205                 <retrieve/>
3206                 <update permission="UPDATE_HOURS_OF_OPERATION" context_field="id"/>
3207                 <delete permission="DELETE_HOURS_OF_OPERATION" context_field="id"/>
3208             </actions>
3209         </permacrud>
3210         </class>
3211         <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">
3212                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.monograph_part_id_seq">
3213                         <field name="id" reporter:datatype="id" />
3214                         <field name="record" reporter:datatype="link"/>
3215                         <field name="label" reporter:datatype="text"/>
3216                         <field name="label_sortkey" reporter:datatype="text"/>
3217                         <field name="deleted" reporter:datatype="bool"/>
3218                 </fields>
3219                 <links>
3220                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3221                 </links>
3222         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3223             <actions>
3224                 <create permission="CREATE_MONOGRAPH_PART" global_required="true"/>
3225                 <retrieve/>
3226                 <update permission="UPDATE_MONOGRAPH_PART" global_required="true"/>
3227                 <delete permission="DELETE_MONOGRAPH_PART" global_required="true"/>
3228             </actions>
3229         </permacrud>
3230         </class>
3231         <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">
3232                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_part_map_id_seq">
3233                         <field name="id" reporter:datatype="id" />
3234                         <field name="target_copy" reporter:datatype="link" />
3235                         <field name="part" reporter:datatype="link"/>
3236                 </fields>
3237                 <links>
3238                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
3239                         <link field="part" reltype="has_a" key="id" map="" class="bmp"/>
3240                 </links>
3241         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3242             <actions>
3243                 <create permission="MAP_MONOGRAPH_PART" global_required="true"/>
3244                 <retrieve/>
3245                 <update permission="MAP_MONOGRAPH_PART" global_required="true"/>
3246                 <delete permission="MAP_MONOGRAPH_PART" global_required="true"/>
3247             </actions>
3248         </permacrud>
3249         </class>
3250         <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">
3251                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_closed_id_seq">
3252                         <field name="close_end" reporter:datatype="timestamp" />
3253                         <field name="close_start" reporter:datatype="timestamp" />
3254                         <field name="id" reporter:datatype="id" />
3255                         <field name="org_unit" reporter:datatype="org_unit"/>
3256                         <field name="reason" reporter:datatype="text"/>
3257                         <field name="full_day" reporter:datatype="bool"/>
3258                         <field name="multi_day" reporter:datatype="bool"/>
3259                 </fields>
3260                 <links>
3261                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3262                 </links>
3263         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3264             <actions>
3265                 <create permission="CREATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3266                 <retrieve/>
3267                 <update permission="UPDATE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3268                 <delete permission="DELETE_ORG_UNIT_CLOSING" context_field="org_unit"/>
3269             </actions>
3270         </permacrud>
3271         </class>
3272         <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">
3273                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_circ_duration_id_seq">
3274                         <field name="extended" reporter:datatype="interval"/>
3275                         <field name="id" reporter:datatype="id" reporter:selector="name"/>
3276                         <field name="max_renewals" reporter:datatype="int" />
3277                         <field name="name" reporter:datatype="text"/>
3278                         <field name="normal" reporter:datatype="interval"/>
3279                         <field name="shrt" reporter:datatype="interval"/>
3280                 </fields>
3281                 <links>
3282                 </links>
3283         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3284             <actions>
3285                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3286                 <retrieve/>
3287                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3288                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3289             </actions>
3290         </permacrud>
3291         </class>
3292
3293         <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">
3294                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_id_seq">
3295                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
3296                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
3297             <field reporter:label="Always Use?" name="forceto" reporter:datatype="bool"/>
3298                         <field reporter:label="Current Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3299             <field reporter:label="Owner" name="owner" reporter:datatype="org_unit"/>
3300                 </fields>
3301                 <links>
3302             <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
3303                 </links>
3304                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3305             <actions>
3306                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3307                 <retrieve/>
3308                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3309                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3310             </actions>
3311                 </permacrud>
3312         </class>
3313
3314         <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">
3315                 <fields oils_persist:primary="id" oils_persist:sequence="config.hard_due_date_values_id_seq">
3316                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
3317                         <field reporter:label="Hard Due Date" name="hard_due_date" reporter:datatype="link"/>
3318                         <field reporter:label="Ceiling Date" name="ceiling_date" reporter:datatype="timestamp"/>
3319             <field reporter:label="Active Date" name="active_date" reporter:datatype="timestamp"/>
3320                 </fields>
3321                 <links>
3322                         <link field="hard_due_date" reltype="has_a" key="id" map="" class="chdd"/>
3323                 </links>
3324                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3325             <actions>
3326                 <create permission="CREATE_CIRC_DURATION" global_required="true"/>
3327                 <retrieve/>
3328                 <update permission="UPDATE_CIRC_DURATION" global_required="true"/>
3329                 <delete permission="DELETE_CIRC_DURATION" global_required="true"/>
3330             </actions>
3331                 </permacrud>
3332         </class>
3333
3334         <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">
3335                 <fields oils_persist:primary="id" oils_persist:sequence="">
3336                         <field name="balance_owed" reporter:datatype="money"/>
3337                         <field name="id" reporter:datatype="id" />
3338                         <field name="last_billing_note" reporter:datatype="text"/>
3339                         <field name="last_billing_ts" reporter:datatype="timestamp"/>
3340                         <field name="last_billing_type" reporter:datatype="text"/>
3341                         <field name="last_payment_note" reporter:datatype="text"/>
3342                         <field name="last_payment_ts" reporter:datatype="timestamp"/>
3343                         <field name="last_payment_type" reporter:datatype="text"/>
3344                         <field name="total_owed" reporter:datatype="money"/>
3345                         <field name="total_paid" reporter:datatype="money"/>
3346                         <field name="usr" reporter:datatype="link"/>
3347                         <field name="xact_finish" reporter:datatype="timestamp" />
3348                         <field name="xact_start" reporter:datatype="timestamp" />
3349                         <field name="xact_type" reporter:datatype="text"/>
3350                         <field name="xact" oils_persist:virtual="true" reporter:datatype="link"/>
3351                         <field name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
3352                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
3353                         <field name="reservation" oils_persist:virtual="true" reporter:datatype="link"/>
3354                         <field name="billing_location" reporter:datatype="link"/>
3355                 </fields>
3356                 <links>
3357                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3358                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
3359                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
3360                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
3361                         <link field="reservation" reltype="might_have" key="id" map="" class="bresv"/>
3362                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
3363                 </links>
3364                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3365                         <actions>
3366                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3367                                         <context link="usr" field="home_ou" />
3368                                 </retrieve>
3369                         </actions>
3370                 </permacrud>
3371         </class>
3372         <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">
3373                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_id_seq">
3374                         <field reporter:label="All Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
3375                         <field reporter:label="All Library Cards" name="cards" oils_persist:virtual="true" reporter:datatype="link"/>
3376                         <field reporter:label="All Circulations" name="checkouts" oils_persist:virtual="true" reporter:datatype="link"/>
3377                         <field reporter:label="All Hold Requests" name="hold_requests" oils_persist:virtual="true" reporter:datatype="link"/>
3378                         <field reporter:label="All Permissions" name="permissions" oils_persist:virtual="true" reporter:datatype="link"/>
3379                         <field reporter:label="All User Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
3380                         <field reporter:label="Standing Penalties" name="standing_penalties" oils_persist:virtual="true" reporter:datatype="link"/>
3381                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
3382                         <field reporter:label="Survey Responses" name="survey_responses" oils_persist:virtual="true" reporter:datatype="link"/>
3383                         <field reporter:label="Workstation Org Unit" name="ws_ou" oils_persist:virtual="true" reporter:datatype="link"/>
3384                         <field reporter:label="Workstation ID" name="wsid" oils_persist:virtual="true" reporter:datatype="link"/>
3385                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
3386                         <field reporter:label="Alert Message" name="alert_message"  reporter:datatype="text"/>
3387                         <field reporter:label="Barred" name="barred" reporter:datatype="bool"/>
3388                         <field reporter:label="Physical Address" name="billing_address" reporter:datatype="link"/>
3389                         <field reporter:label="Current Library Card" name="card" reporter:datatype="link"/>
3390                         <field reporter:label="Claims-returned Count" name="claims_returned_count" reporter:datatype="int" />
3391                         <field reporter:label="Claims Never Checked Out Count" name="claims_never_checked_out_count" reporter:datatype="int" />
3392                         <field reporter:label="Record Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3393                         <field reporter:label="User Credit Balance" name="credit_forward_balance" reporter:datatype="money" />
3394                         <field reporter:label="Daytime Phone" name="day_phone"  reporter:datatype="text"/>
3395                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
3396                         <field reporter:label="Email Address" name="email"  reporter:datatype="text"/>
3397                         <field reporter:label="Evening Phone" name="evening_phone"  reporter:datatype="text"/>
3398                         <field reporter:label="Privilege Expiration Date" name="expire_date" reporter:datatype="timestamp"/>
3399                         <field reporter:label="Last Name" name="family_name"  reporter:datatype="text"/>
3400                         <field reporter:label="First Name" name="first_given_name"  reporter:datatype="text"/>
3401                         <field reporter:label="Home Library" name="home_ou" reporter:datatype="org_unit"/>
3402                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
3403                         <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="link"/>
3404                         <field reporter:label="Secondary Identification Type" name="ident_type2" reporter:datatype="link"/>
3405                         <field reporter:label="Primary Identification" name="ident_value"  reporter:datatype="text"/>
3406                         <field reporter:label="Secondary Identification" name="ident_value2"  reporter:datatype="text"/>
3407                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
3408                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
3409                         <field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
3410                         <field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
3411                         <field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
3412                         <field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
3413                         <field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
3414                         <field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
3415                         <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
3416                         <field reporter:label="Middle Name" name="second_given_name"  reporter:datatype="text"/>
3417                         <field reporter:label="Standing (unused)" name="standing" reporter:datatype="link"/>
3418                         <field reporter:label="Suffix" name="suffix"  reporter:datatype="text"/>
3419                         <field reporter:label="Is Super User" name="super_user" reporter:datatype="bool"/>
3420                         <field reporter:label="Family Linkage or other Group" name="usrgroup" reporter:datatype="int"/>
3421                         <field reporter:label="OPAC/Staff Client User Name" name="usrname"  reporter:datatype="text"/>
3422                         <field reporter:label="OPAC/Staff Client Holds Alias" name="alias"  reporter:datatype="text"/>
3423                         <field reporter:label="Juvenile" name="juvenile"  reporter:datatype="bool"/>
3424                         <field reporter:label="Record Last Update Time" name="last_update_time" reporter:datatype="timestamp"/>
3425                         <field reporter:label="Additional Permission Groups" name="groups" oils_persist:virtual="true" reporter:datatype="link"/>
3426                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
3427                         <field reporter:label="User Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
3428                         <field reporter:label="Demographic Info" name="demographic" oils_persist:virtual="true" reporter:datatype="link"/>
3429                         <field reporter:label="Billable Transactions" name="billable_transactions" oils_persist:virtual="true" reporter:datatype="link"/>
3430                         <field reporter:label="Money Summary" name="money_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3431                         <field reporter:label="Open Billable Transactions" name="open_billable_transactions_summary" oils_persist:virtual="true" reporter:datatype="link"/>
3432                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
3433                         <field reporter:label="Circulations Performed as Staff" name="performed_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
3434                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
3435                         <field reporter:label="Reservations" name="reservations" oils_persist:virtual="true" reporter:datatype="link"/>
3436                         <field reporter:label="User Activity Entries" name="usr_activity" oils_persist:virtual="true" reporter:datatype="link"/>
3437                         <field reporter:label="User/Working Location Map" name="usr_work_ou_map" oils_persist:virtual="true" reporter:datatype="link"/>
3438                 </fields>
3439                 <links>
3440                         <link field="demographic" reltype="might_have" key="id" map="" class="rud"/>
3441                         <link field="net_access_level" reltype="has_a" key="id" map="" class="cnal"/>
3442                         <link field="profile" reltype="has_a" key="id" map="" class="pgt"/>
3443                         <link field="ident_type" reltype="has_a" key="id" map="" class="cit"/>
3444                         <link field="billing_address" reltype="has_a" key="id" map="" class="aua"/>
3445                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aua"/>
3446                         <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
3447                         <link field="standing" reltype="has_a" key="id" map="" class="cst"/>
3448                         <link field="card" reltype="has_a" key="id" map="" class="ac"/>
3449                         <link field="ident_type2" reltype="has_a" key="id" map="" class="cit"/>
3450                         <link field="stat_cat_entries" reltype="has_many" key="target_usr" map="" class="actscecm"/>
3451                         <link field="groups" reltype="has_many" key="usr" map="grp" class="pugm"/>
3452                         <link field="usrgroup" reltype="has_many" key="usrgroup" map="" class="au"/>
3453                         <link field="checkouts" reltype="has_many" key="usr" map="" class="circ"/>
3454                         <link field="hold_requests" reltype="has_many" key="usr" map="" class="ahr"/>
3455                         <link field="permissions" reltype="has_many" key="usr" map="perm" class="pupm"/>
3456                         <link field="settings" reltype="has_many" key="usr" map="" class="aus"/>
3457                         <link field="billable_transactions" reltype="has_many" key="usr" map="" class="mbt"/>
3458                         <link field="open_billable_transactions_summary" reltype="has_many" key="usr" map="" class="mobts"/>
3459                         <link field="money_summary" reltype="might_have" key="usr" map="" class="mus"/>
3460                         <link field="standing_penalties" reltype="has_many" key="usr" map="" class="ausp"/>
3461                         <link field="addresses" reltype="has_many" key="usr" map="" class="aua"/>
3462                         <link field="survey_responses" reltype="has_many" key="usr" map="" class="asvr"/>
3463                         <link field="notes" reltype="has_many" key="usr" map="" class="aun"/>
3464                         <link field="checkins" reltype="has_many" key="checkin_staff" map="" class="circ"/>
3465                         <link field="cards" reltype="has_many" key="usr" map="" class="ac"/>
3466                         <link field="performed_circulations" reltype="has_many" key="circ_staff" map="" class="circ"/>
3467                         <link field="fund_alloc_pcts" reltype="has_many" key="allocator" map="" class="acqfap"/>
3468                         <link field="reservations" reltype="has_many" key="usr" map="" class="bresv"/>
3469                         <link field="usr_activity" reltype="has_many" key="usr" map="" class="auact"/>
3470                         <link field="usr_work_ou_map" reltype="has_many" key="usr" map="" class="puwoum"/>
3471                 </links>
3472                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3473                         <actions>
3474                                 <retrieve permission="VIEW_USER" context_field="home_ou" />
3475                         </actions>
3476                 </permacrud>
3477         </class>
3478         <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">
3479                 <fields oils_persist:primary="id" oils_persist:sequence="config.usr_activity_type_id_seq">
3480                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3481                         <field name="ewho" reporter:label="Event Caller" reporter:datatype="text"/>
3482                         <field name="ewhat" reporter:label="Event Type" reporter:datatype="text"/>
3483                         <field name="ehow" reporter:label="Event Mechanism" reporter:datatype="text"/>
3484                         <field name="label" reporter:label="Label" reporter:datatype="text"/>
3485                         <field name="egroup" reporter:label="Activity Group" reporter:datatype="text"/>
3486                         <field name="enabled" reporter:label="Enabled" reporter:datatype="bool"/>
3487                         <field name="transient" reporter:label="Transient" reporter:datatype="bool"/>
3488         </fields>
3489                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3490                         <actions>
3491                                 <create permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3492                                 <retrieve/>
3493                                 <update permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3494                                 <delete permission="ADMIN_USER_ACTIVITY_TYPE" global_required="true"/>
3495                         </actions>
3496                 </permacrud>
3497         </class>
3498         <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">
3499                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_activity_id_seq">
3500                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3501                         <field name="usr" reporter:label="User" reporter:datatype="link" />
3502                         <field name="etype" reporter:label="Activity Type" reporter:datatype="link" />
3503                         <field name="event_time" reporter:label="Event Time" reporter:datatype="timestamp" />
3504         </fields>
3505         <links>
3506                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
3507                         <link field="etype" reltype="has_a" key="id" map="" class="cuat"/>
3508                 </links>
3509                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3510                         <actions>
3511                                 <retrieve permission="RUN_REPORTS">
3512                                         <context link="usr" field="home_ou" />
3513                                 </retrieve>
3514                         </actions>
3515                 </permacrud>
3516         </class>
3517         <class id="atb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::toolbar" oils_persist:tablename="actor.toolbar" reporter:label="Custom Toolbar">
3518                 <fields oils_persist:primary="id" oils_persist:sequence="actor.toolbar_id_seq">
3519                         <field name="id" reporter:label="ID" reporter:datatype="id" />
3520                         <field name="usr" reporter:label="Owning User" reporter:datatype="link" />
3521                         <field name="org" reporter:label="Owning Org Unit" reporter:datatype="link" />
3522                         <field name="ws" reporter:label="Owning Workstation" reporter:datatype="link" />
3523                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true" />
3524                         <field name="layout" reporter:label="Layout" reporter:datatype="text" />
3525         </fields>
3526         <links>
3527                         <link field="usr" reltype="might_have" key="id" map="" class="au"/>
3528                         <link field="org" reltype="might_have" key="id" map="" class="aou"/>
3529                         <link field="ws" reltype="might_have" key="id" map="" class="aws"/>
3530                 </links>
3531                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3532                         <actions>
3533                                 <retrieve permission="ADMIN_TOOLBAR STAFF_LOGIN" context_field="org">
3534                                         <context link="usr" field="home_ou" />
3535                                         <context link="ws" field="owning_lib" />
3536                                 </retrieve>
3537                                 <create permission="ADMIN_TOOLBAR" context_field="org">
3538                                         <context link="usr" field="home_ou" />
3539                                         <context link="ws" field="owning_lib" />
3540                                 </create>
3541                                 <update permission="ADMIN_TOOLBAR" context_field="org">
3542                                         <context link="usr" field="home_ou" />
3543                                         <context link="ws" field="owning_lib" />
3544                                 </update>
3545                                 <delete permission="ADMIN_TOOLBAR" context_field="org">
3546                                         <context link="usr" field="home_ou" />
3547                                         <context link="ws" field="owning_lib" />
3548                                 </delete>
3549                         </actions>
3550                 </permacrud>
3551         </class>
3552         <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">
3553                 <fields oils_persist:primary="name">
3554                         <field name="name" reporter:datatype="text"/>
3555                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3556                 </fields>
3557                 <links/>
3558                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3559                         <actions>
3560                                 <create permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3561                                 <retrieve/>
3562                                 <update permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3563                                 <delete permission="ADMIN_USER_SETTING_GROUP" global_required="true"/>
3564                         </actions>
3565                 </permacrud>
3566         </class>
3567         <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">
3568                 <fields oils_persist:primary="name">
3569                         <field name="name" reporter:label="Name" reporter:datatype="text"/>
3570                         <field name="label" reporter:label="Label" reporter:datatype="text" oils_persist:i18n="true"/>
3571                         <field name="description" reporter:label="Description" reporter:datatype="text" oils_persist:i18n="true"/>
3572                         <field name="datatype" reporter:label="Datatype" reporter:datatype="text"/>
3573                         <field name="fm_class" reporter:label="Fieldmapper Class" reporter:datatype="text"/>
3574                         <field name="grp" reporter:label="Settings Group" reporter:datatype="link"/>
3575                         <field name="opac_visible" reporter:label="OPAC/Patron Visible" reporter:datatype="bool"/>
3576                         <field name="reg_default" reporter:label="Registration Default" reporter:datatype="text"/>
3577                 </fields>
3578                 <links>
3579                         <link field="name" reltype="has_many" key="name" map="" class="aus"/>
3580                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3581                 </links>
3582                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3583                         <actions>
3584                                 <create permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3585                                 <retrieve/>
3586                                 <update permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3587                                 <delete permission="ADMIN_USER_SETTING_TYPE" global_required="true"/>
3588                         </actions>
3589                 </permacrud>
3590         </class>
3591         <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">
3592                 <fields oils_persist:primary="name">
3593                         <field name="name" reporter:datatype="text"/>
3594                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
3595                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
3596                         <field name="datatype" reporter:datatype="text"/>
3597                         <field name="view_perm" reporter:datatype="link"/>
3598                         <field name="update_perm" reporter:datatype="link"/>
3599                         <field name="fm_class" reporter:datatype="text"/>
3600                         <field name="grp" reporter:datatype="link"/>
3601                 </fields>
3602                 <links>
3603                         <link field="name" reltype="has_many" key="name" map="" class="aous"/>
3604                         <link field="view_perm" reltype="has_a" key="id" map="" class="ppl"/>
3605                         <link field="update_perm" reltype="has_a" key="id" map="" class="ppl"/>
3606                         <link field="grp" reltype="has_a" key="name" map="" class="csg"/>
3607                 </links>
3608                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3609                         <actions>
3610                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3611                                 <retrieve/>
3612                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3613                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE" global_required="true"/>
3614                         </actions>
3615                 </permacrud>
3616         </class>
3617         <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">
3618                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_setting_id_seq">
3619                         <field name="id" />
3620                         <field name="name"  reporter:datatype="text"/>
3621                         <field name="org_unit" reporter:datatype="org_unit"/>
3622                         <field name="value"  reporter:datatype="text"/>
3623                 </fields>
3624                 <links>
3625                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
3626                         <link field="name" reltype="has_a" key="name" map="" class="coust"/>
3627                 </links>
3628         </class>
3629         <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">
3630                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_note_id_seq">
3631                         <field reporter:label="Note Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
3632                         <field reporter:label="Note Creator" name="creator" reporter:datatype="link"/>
3633                         <field reporter:label="Note ID" name="id" reporter:datatype="id" />
3634                         <field reporter:label="Copy" name="owning_copy" reporter:datatype="link"/>
3635                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
3636                         <field reporter:label="Note Title" name="title"  reporter:datatype="text"/>
3637                         <field reporter:label="Note Content" name="value"  reporter:datatype="text"/>
3638                 </fields>
3639                 <links>
3640                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
3641                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
3642                 </links>
3643         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3644             <actions>
3645                 <create permission="CREATE_COPY_NOTE">
3646                     <context link="owning_copy" field="circ_lib"/>
3647                 </create>
3648                 <retrieve permission="VIEW_COPY_NOTES">
3649                     <context link="owning_copy" field="circ_lib"/>
3650                 </retrieve>
3651                 <update permission="UPDATE_COPY_NOTE">
3652                     <context link="owning_copy" field="circ_lib"/>
3653                 </update>
3654                 <delete permission="DELETE_COPY_NOTE">
3655                     <context link="owning_copy" field="circ_lib"/>
3656                 </delete>
3657             </actions>
3658         </permacrud>
3659         </class>
3660         <class id="mfr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::full_rec" oils_persist:tablename="metabib.full_rec" reporter:label="Flattened MARC Fields">
3661                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.full_rec_id_seq">
3662                         <field reporter:label="Field ID" name="id" reporter:datatype="id" />
3663                         <field reporter:label="Indicator 1" name="ind1" oils_persist:primitive="string"  reporter:datatype="text"/>
3664                         <field reporter:label="Indicator 2" name="ind2" oils_persist:primitive="string"  reporter:datatype="text"/>
3665                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
3666                         <field reporter:label="Subfield" name="subfield" oils_persist:primitive="string"  reporter:datatype="text"/>
3667                         <field reporter:label="Tag" name="tag"  reporter:datatype="text"/>
3668                         <field reporter:label="Normalized Value" name="value"  reporter:datatype="text"/>
3669                 </fields>
3670                 <links>
3671                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
3672                 </links>
3673         </class>
3674         <class id="mmr" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::metarecord" oils_persist:tablename="metabib.metarecord" reporter:label="Metarecord">
3675                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_id_seq">
3676                         <field name="fingerprint"  reporter:datatype="text"/>
3677                         <field name="id" reporter:datatype="id" />
3678                         <field name="master_record" reporter:datatype="link"/>
3679                         <field name="mods"  reporter:datatype="text"/>
3680                         <field name="source_records" oils_persist:virtual="true" reporter:datatype="link"/>
3681                 </fields>
3682                 <links>
3683                         <link field="master_record" reltype="has_a" key="id" map="" class="bre"/>
3684                         <link field="source_records" reltype="has_many" key="metarecord" map="source" class="mmrsm"/>
3685                 </links>
3686         </class>
3687         <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">
3688                 <fields oils_persist:primary="id" oils_persist:sequence="config.net_access_level_id_seq">
3689                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
3690                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
3691                 </fields>
3692                 <links/>
3693         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3694             <actions>
3695                 <create permission="CREATE_NET_ACCESS_LEVEL" global_required="true"/>
3696                 <retrieve/>
3697                 <update permission="UPDATE_NET_ACCESS_LEVEL" global_required="true"/>
3698                 <delete permission="DELETE_NET_ACCESS_LEVEL" global_required="true"/>
3699             </actions>
3700         </permacrud>
3701         </class>
3702         <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">
3703                 <fields oils_persist:primary="id" oils_persist:sequence="permission.perm_list_id_seq">
3704                         <field name="code"  reporter:datatype="text"/>
3705                         <field name="description"  reporter:datatype="text" oils_persist:i18n="true"/>
3706                         <field name="id" reporter:selector="code" reporter:datatype="id"/>
3707                 </fields>
3708                 <links/>
3709         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3710             <actions>
3711                 <create permission="CREATE_PERM" global_required="true"/>
3712                 <retrieve permission="CREATE_PERM UPDATE_PERM DELETE_PERM" global_required="true"/>
3713                 <update permission="UPDATE_PERM" global_required="true"/>
3714                 <delete permission="DELETE_PERM" global_required="true"/>
3715             </actions>
3716         </permacrud>
3717         </class>
3718         <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">
3719                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.metarecord_source_map_id_seq">
3720                         <field name="id" reporter:datatype="id" />
3721                         <field name="metarecord" reporter:datatype="link"/>
3722                         <field name="source" reporter:datatype="link"/>
3723                 </fields>
3724                 <links>
3725                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3726                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
3727                 </links>
3728         </class>
3729         <class id="mde" controller="open-ils.cstore open-ils.pcrud" 
3730                         oils_obj:fieldmapper="metabib::display_entry" 
3731                         oils_persist:tablename="metabib.display_entry" 
3732                         oils_persist:field_safe="true"
3733                         reporter:label="Display Field Entry" oils_persist:readonly="true">
3734                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.display_entry_id_seq">
3735                         <field name="id" reporter:datatype="id" />
3736                         <field name="field" reporter:datatype="link"/>
3737                         <field name="source" reporter:datatype="link"/>
3738                         <field name="value"  reporter:datatype="text"/>
3739                 </fields>
3740                 <links>
3741                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3742                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3743                 </links>
3744                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3745                         <actions>
3746                                 <retrieve/>
3747                         </actions>
3748                 </permacrud>
3749         </class>
3750         <class id="mfde" controller="open-ils.cstore open-ils.pcrud" 
3751                 oils_persist:tablename="metabib.flat_display_entry"
3752                 oils_obj:fieldmapper="metabib::flat_display_entry" 
3753                 oils_persist:field_safe="true"
3754                 reporter:label="Flat Display Entry" 
3755                 oils_persist:readonly="true">
3756                 <fields>
3757                         <field name="source" reporter:datatype="id" />
3758                         <field name="name" reporter:datatype="text"/>
3759                         <field name="multi" reporter:datatype="bool"/>
3760                         <field name="label" reporter:datatype="text"/>
3761                         <field name="field" reporter:datatype="link"/>
3762                         <field name="value" reporter:datatype="text"/>
3763                 </fields>
3764                 <links>
3765                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3766                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3767                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
3768                 </links>
3769                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3770                         <actions>
3771                                 <retrieve/>
3772                         </actions>
3773                 </permacrud>
3774         </class>
3775         <class id="mcde" controller="open-ils.cstore open-ils.pcrud" 
3776                 oils_persist:tablename="metabib.compressed_display_entry"
3777                 oils_obj:fieldmapper="metabib::compressed_display_entry" 
3778                 oils_persist:field_safe="true"
3779                 reporter:label="Compressed Display Entry" 
3780                 oils_persist:readonly="true">
3781                 <fields>
3782                         <field name="source" reporter:datatype="id" />
3783                         <field name="name" reporter:datatype="text"/>
3784                         <field name="multi" reporter:datatype="bool"/>
3785                         <field name="label" reporter:datatype="text"/>
3786                         <field name="field" reporter:datatype="link"/>
3787                         <field name="value" reporter:datatype="text"/>
3788                 </fields>
3789                 <links>
3790                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3791                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3792                         <link field="name" reltype="has_a" key="name" map="" class="cdfm"/>
3793                 </links>
3794                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3795                         <actions>
3796                                 <retrieve/>
3797                         </actions>
3798                 </permacrud>
3799         </class>
3800         <class id="mwde" controller="open-ils.cstore open-ils.pcrud" 
3801                 oils_persist:tablename="metabib.wide_display_entry"
3802                 oils_obj:fieldmapper="metabib::wide_display_entry" 
3803                 oils_persist:field_safe="true"
3804                 reporter:label="Wide Display Entry" 
3805                 oils_persist:readonly="true">
3806                 <fields oils_persist:primary="source">
3807                         <field name="source" reporter:label="Record ID" reporter:datatype="id" />
3808                         <field name="title" reporter:label="Title" reporter:datatype="text"/>
3809                         <field name="author" reporter:label="Author" reporter:datatype="text"/>
3810                         <field name="subject" reporter:label="Subject" reporter:datatype="text"/>
3811                         <field name="creators" reporter:label="Creators" reporter:datatype="text"/>
3812                         <field name="isbn" reporter:label="ISBN" reporter:datatype="text"/>
3813                         <!-- TODO add all well-known fields -->
3814                 </fields>
3815                 <links>
3816                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3817                 </links>
3818                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3819                         <actions>
3820                                 <retrieve/>
3821                         </actions>
3822                 </permacrud>
3823         </class>
3824
3825         <class id="cdfm" controller="open-ils.cstore open-ils.pcrud" 
3826                 oils_persist:tablename="config.display_field_map"
3827                 oils_obj:fieldmapper="config::display_field_map"
3828                 oils_persist:field_safe="true"
3829                 reporter:label="Display Field Map" 
3830                 oils_persist:readonly="true">
3831                 <fields oils_persist:primary="name">
3832                         <field name="name" reporter:datatype="text"/>
3833                         <field name="field" reporter:datatype="link"/>
3834                         <field name="multi" reporter:datatype="bool"/>
3835                 </fields>
3836                 <links>
3837                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3838                 </links>
3839                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3840                         <actions>
3841                                 <retrieve/>
3842                                 <create permission="CREATE_METABIB_FIELD" global_required="true"/>
3843                                 <update permission="UPDATE_METABIB_FIELD" global_required="true"/>
3844                                 <delete permission="DELETE_METABIB_FIELD" global_required="true"/>
3845                         </actions>
3846                 </permacrud>
3847         </class>
3848
3849         <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">
3850                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.facet_entry_id_seq">
3851                         <field name="id" reporter:datatype="id" />
3852                         <field name="field" reporter:datatype="link"/>
3853                         <field name="source" reporter:datatype="link"/>
3854                         <field name="value"  reporter:datatype="text"/>
3855                 </fields>
3856                 <links>
3857                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3858                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3859                 </links>
3860         </class>
3861         <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">
3862                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_id_seq">
3863                         <field name="id" reporter:datatype="id" />
3864                         <field name="value" reporter:datatype="text"/>
3865                         <field name="def_maps" oils_persist:virtual="true" reporter:datatype="link"/>
3866                 </fields>
3867                 <links>
3868                         <link field="def_maps" reltype="has_many" key="entry" map="" class="mbedm"/>
3869                 </links>
3870         </class>
3871         <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">
3872                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_def_map_id_seq">
3873                         <field name="id" reporter:datatype="id" />
3874                         <field name="entry" reporter:datatype="link"/>
3875                         <field name="def" reporter:datatype="link"/>
3876                         <field name="source" reporter:datatype="link"/>
3877                 </fields>
3878                 <links>
3879                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3880                         <link field="def" reltype="has_a" key="id" map="" class="cmf"/>
3881                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3882                 </links>
3883         </class>
3884         <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">
3885                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.browse_entry_simple_heading_map_id_seq">
3886                         <field name="id" reporter:datatype="id" />
3887                         <field name="entry" reporter:datatype="link"/>
3888                         <field name="simple_heading" reporter:datatype="link"/>
3889                 </fields>
3890                 <links>
3891                         <link field="entry" reltype="has_a" key="id" map="" class="mbe"/>
3892                         <link field="simple_heading" reltype="has_a" key="id" map="" class="ash"/>
3893                 </links>
3894         </class>
3895         <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">
3896                 <oils_persist:source_definition>
3897                         SELECT * FROM metabib.author_field_entry
3898                                                 UNION ALL
3899                         SELECT * FROM metabib.keyword_field_entry
3900                                                 UNION ALL
3901                         SELECT * FROM metabib.identifier_field_entry
3902                                                 UNION ALL
3903                         SELECT * FROM metabib.title_field_entry
3904                                                 UNION ALL
3905                         SELECT * FROM metabib.subject_field_entry
3906                                                 UNION ALL
3907                         SELECT * FROM metabib.series_field_entry
3908                 </oils_persist:source_definition>
3909                 <fields>
3910                         <field name="field" reporter:datatype="link"/>
3911                         <field name="id" reporter:datatype="id" />
3912                         <field name="source" reporter:datatype="link"/>
3913                         <field name="value"  reporter:datatype="text"/>
3914                 </fields>
3915                 <links>
3916                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3917                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3918                 </links>
3919         </class>
3920         <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">
3921                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.keyword_field_entry_id_seq">
3922                         <field name="field" reporter:datatype="link"/>
3923                         <field name="id" reporter:datatype="id" />
3924                         <field name="source" reporter:datatype="link"/>
3925                         <field name="value"  reporter:datatype="text"/>
3926                 </fields>
3927                 <links>
3928                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
3929                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
3930                 </links>
3931         </class>
3932         <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">
3933                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3934                         <field name="accepting_usr" reporter:datatype="link"/>
3935                         <field name="amount" reporter:datatype="money" />
3936                         <field name="amount_collected" reporter:datatype="money" />
3937                         <field name="cash_drawer" reporter:datatype="link"/>
3938                         <field name="id" reporter:datatype="id" />
3939                         <field name="note"  reporter:datatype="text"/>
3940                         <field name="payment_ts" reporter:datatype="timestamp"/>
3941                         <field name="xact" reporter:datatype="link"/>
3942                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3943                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3944                 </fields>
3945                 <links>
3946                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3947                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3948                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
3949                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3950                 </links>
3951         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3952             <actions>
3953                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3954                     <context link="xact" jump="usr" field="home_ou"/>
3955                 </retrieve>
3956                         </actions>
3957                 </permacrud>
3958         </class>
3959         <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">
3960                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3961                         <field name="accepting_usr" reporter:datatype="link"/>
3962                         <field name="amount" reporter:datatype="money" />
3963                         <field name="amount_collected" reporter:datatype="money" />
3964                         <field name="id" reporter:datatype="id" />
3965                         <field name="note"  reporter:datatype="text"/>
3966                         <field name="payment_ts" reporter:datatype="timestamp"/>
3967                         <field name="xact" reporter:datatype="link"/>
3968                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3969                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3970                 </fields>
3971                 <links>
3972                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3973                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
3974                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
3975                 </links>
3976         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
3977             <actions>
3978                 <retrieve permission="VIEW_USER_TRANSACTIONS">
3979                     <context link="xact" jump="usr" field="home_ou"/>
3980                 </retrieve>
3981                         </actions>
3982                 </permacrud>
3983         </class>
3984         <class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
3985                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
3986                         <field name="accepting_usr" reporter:datatype="link"/>
3987                         <field name="amount" reporter:datatype="money" />
3988                         <field name="amount_collected" reporter:datatype="money" />
3989                         <field name="id" reporter:datatype="id" />
3990                         <field name="note"  reporter:datatype="text"/>
3991                         <field name="payment_ts" reporter:datatype="timestamp"/>
3992                         <field name="xact" reporter:datatype="link"/>
3993                         <field name="billing" reporter:datatype="link"/>
3994                         <field name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
3995                         <field name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
3996                 </fields>
3997                 <links>
3998                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
3999                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
4000                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
4001                         <link field="billing" reltype="might_have" key="id" class="mb"/>
4002                 </links>
4003         </class>
4004         <class id="mrd" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::record_descriptor" oils_persist:tablename="metabib.rec_descriptor" reporter:label="Basic Record Descriptor">
4005                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.rec_descriptor_id_seq">
4006                         <field reporter:label="Audn" name="audience" oils_persist:primitive="string"  reporter:datatype="text"/>
4007                         <field reporter:label="BLvl" name="bib_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4008                         <field reporter:label="Cat Form" name="cat_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4009                         <field reporter:label="Character Encoding" name="char_encoding" oils_persist:primitive="string"  reporter:datatype="text"/>
4010                         <field reporter:label="Ctrl" name="control_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4011                         <field reporter:label="ELvl" name="enc_level" oils_persist:primitive="string"  reporter:datatype="text"/>
4012                         <field reporter:label="Descriptor ID" name="id" reporter:datatype="id" />
4013                         <field reporter:label="Form" name="item_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4014                         <field reporter:label="Lang" name="item_lang" oils_persist:primitive="string"  reporter:datatype="text"/>
4015                         <field reporter:label="Type" name="item_type" oils_persist:primitive="string"  reporter:datatype="text"/>
4016                         <field reporter:label="LitF" name="lit_form" oils_persist:primitive="string"  reporter:datatype="text"/>
4017                         <field reporter:label="Pub Status" name="pub_status" oils_persist:primitive="string"  reporter:datatype="text"/>
4018                         <field reporter:label="Bib Record Entry" name="record" reporter:datatype="link"/>
4019                         <field reporter:label="TMat" name="type_mat" oils_persist:primitive="string"  reporter:datatype="text"/>
4020                         <field reporter:label="Video Recording Format" name="vr_format" oils_persist:primitive="string"  reporter:datatype="text"/>
4021                         <field reporter:label="Date1" name="date1" oils_persist:primitive="string"  reporter:datatype="text"/>
4022                         <field reporter:label="Date2" name="date2" oils_persist:primitive="string"  reporter:datatype="text"/>
4023                 </fields>
4024                 <links>
4025                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4026                         <link field="item_lang" reltype="has_a" key="code" map="" class="clm"/>
4027                         <link field="item_type" reltype="has_a" key="code" map="" class="citm"/>
4028                         <link field="bib_level" reltype="has_a" key="code" map="" class="cblvl"/>
4029                         <link field="item_form" reltype="has_a" key="code" map="" class="cifm"/>
4030                         <link field="audience" reltype="has_a" key="code" map="" class="cam"/>
4031                         <link field="lit_form" reltype="has_a" key="code" map="" class="clfm"/>
4032                 </links>
4033         </class>
4034
4035         <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">
4036                 <fields oils_persist:primary="id" oils_persist:sequence="config.standing_penalty_id_seq">
4037                         <field reporter:label="Penalty ID" name="id" reporter:selector="name" reporter:datatype="id"/>
4038                         <field reporter:label="Name" name="name"  reporter:datatype="text"/>
4039                         <field reporter:label="Label" name="label"  reporter:datatype="text" oils_persist:i18n="true"/>
4040                         <field reporter:label="Block List" name="block_list" reporter:datatype="text"/>
4041                         <field reporter:label="Staff Alert" name="staff_alert" reporter:datatype="bool"/>
4042                         <field reporter:label="Org Depth" name="org_depth" reporter:datatype="int"/>
4043                         <field reporter:label="Ignore Proximity" name="ignore_proximity" reporter:datatype="int"/>
4044                 </fields>
4045                 <links/>
4046         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4047             <actions>
4048                 <create permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4049                 <retrieve permission="ADMIN_STANDING_PENALTY VIEW_STANDING_PENALTY" global_required="true"/>
4050                 <update permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4051                 <delete permission="ADMIN_STANDING_PENALTY" global_required="true"/>
4052             </actions>
4053         </permacrud>
4054         </class>
4055         <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">
4056                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_penalty_threshold_id_seq">
4057                         <field name="id" reporter:selector="name" reporter:datatype="id" reporter:label="ID"/>
4058                         <field name="grp"  reporter:datatype="link" reporter:label="Group"/>
4059                         <field name="penalty"  reporter:datatype="link" reporter:label="Penalty"/>
4060                         <field name="threshold" reporter:datatype="float" reporter:label="Threshold"/>
4061                         <field name="org_unit" reporter:datatype="org_unit" reporter:label="Org Unit"/>
4062                 </fields>
4063                 <links>
4064                         <link field="penalty" reltype="has_a" key="id" map="" class="csp"/>
4065                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
4066                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4067         </links>
4068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4069             <actions>
4070                 <create permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4071                 <retrieve permission="VIEW_GROUP_PENALTY_THRESHOLD ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4072                 <update permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4073                 <delete permission="ADMIN_GROUP_PENALTY_THRESHOLD" context_field='org_unit'/>
4074             </actions>
4075         </permacrud>
4076         </class>
4077         <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">
4078                 <fields oils_persist:primary="id" oils_persist:sequence="config.copy_status_id_seq">
4079                         <field name="holdable" reporter:datatype="bool"/>
4080                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
4081                         <field name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
4082                         <field name="opac_visible" reporter:datatype="bool"/>
4083             <field name="copy_active" reporter:datatype="bool"/>
4084             <field name="restrict_copy_delete" reporter:datatype="bool"/>
4085             <field name="is_available" reporter:datatype="bool"/>
4086                 </fields>
4087                 <links/>
4088         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4089             <actions>
4090                 <create permission="CREATE_COPY_STATUS" global_required="true"/>
4091                 <retrieve/>
4092                 <update permission="UPDATE_COPY_STATUS" global_required="true"/>
4093                 <delete permission="DELETE_COPY_STATUS" global_required="true"/>
4094             </actions>
4095         </permacrud>
4096         </class>
4097         <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">
4098                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_standing_penalty_id_seq">
4099                         <field name="id" reporter:datatype="id" reporter:label="ID" />
4100                         <field name="set_date" reporter:datatype="timestamp" reporter:label="Set Date"/>
4101                         <field name="usr" reporter:datatype="link" reporter:label="User"/>
4102                         <field name="staff" reporter:datatype="link" reporter:label="Staff"/>
4103                         <field name="standing_penalty" reporter:datatype="link" reporter:label="Standing Penalty"/>
4104                         <field name="org_unit" reporter:datatype="link" reporter:label="Org Unit"/>
4105                         <field name="stop_date" reporter:datatype="timestamp" reporter:label="Stop Date"/>
4106                         <field name="note" reporter:datatype="text" reporter:label="Note"/>
4107                 </fields>
4108                 <links>
4109                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4110                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
4111                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
4112                         <link field="standing_penalty" reltype="has_a" key="id" map="" class="csp"/>
4113                 </links>
4114                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4115                         <actions>
4116                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4117                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4118                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4119                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4120                         </actions>
4121                 </permacrud>
4122         </class>
4123         <class id="aua" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::user_address" oils_persist:tablename="actor.usr_address" reporter:label="User Address">
4124                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_address_id_seq">
4125                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
4126                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4127                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4128                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4129                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
4130                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4131                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4132                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4133                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4134                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4135                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
4136                         <field reporter:label="Within City Limits?" name="within_city_limits" reporter:datatype="bool"/>
4137                         <field reporter:label="Replaces" name="replaces" reporter:datatype="link"/>
4138                         <field reporter:label="Pending" name="pending" reporter:datatype="bool"/>
4139                 </fields>
4140                 <links>
4141                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4142                         <link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
4143                 </links>
4144                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4145                         <actions>
4146                                 <create permission="UPDATE_USER"><context link="usr" field="home_ou"/></create>
4147                                 <retrieve permission="VIEW_USER"><context link="usr" field="home_ou"/></retrieve>
4148                                 <update permission="UPDATE_USER"><context link="usr" field="home_ou"/></update>
4149                                 <delete permission="UPDATE_USER"><context link="usr" field="home_ou"/></delete>
4150                         </actions>
4151                 </permacrud>
4152         </class>
4153         <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">
4154                 <fields oils_persist:primary="id" oils_persist:sequence="actor.address_alert_id_seq">
4155                         <field reporter:label="Address Alert ID" name="id" reporter:datatype="id" />
4156                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
4157                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
4158                         <field reporter:label="Match All Fields" name="match_all" reporter:datatype="bool" />
4159                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text" oils_obj:required="true"/>
4160                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
4161                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
4162                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
4163                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
4164                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
4165                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
4166                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
4167                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="bool"/>
4168                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="bool"/>
4169                 </fields>
4170                 <links>
4171                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4172                 </links>
4173                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4174                         <actions>
4175                                 <create   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4176                                 <retrieve context_field='owner' permission="ADMIN_ADDRESS_ALERT VIEW_ADDRESS_ALERT CREATE_USER"/>
4177                                 <update   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4178                                 <delete   context_field='owner' permission="ADMIN_ADDRESS_ALERT"/>
4179                         </actions>
4180                 </permacrud>
4181         </class>
4182
4183
4184         <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">
4185                 <fields oils_persist:primary="id" oils_persist:sequence="actor.usr_saved_search_id_seq">
4186                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4187                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
4188                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
4189                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
4190                         <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
4191                         <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
4192                         <field reporter:label="Target" name="target" reporter:datatype="text"/>
4193                 </fields>
4194                 <links>
4195                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4196                 </links>
4197         </class>
4198
4199         <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">
4200                 <fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
4201                         <field name="call_number" />
4202                         <field name="create_date" reporter:datatype="timestamp"/>
4203                         <field name="creator" reporter:datatype="link"/>
4204                         <field name="id" reporter:datatype="id" />
4205                         <field name="pub" reporter:datatype="bool"/>
4206                         <field name="title"  reporter:datatype="text"/>
4207                         <field name="value"  reporter:datatype="text"/>
4208                 </fields>
4209                 <links>
4210                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
4211                 </links>
4212         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4213             <actions>
4214                 <create permission="CREATE_VOLUME_NOTE">
4215                     <context link="call_number" field="owning_lib"/>
4216                 </create>
4217                 <retrieve permission="VIEW_VOLUME_NOTES">
4218                     <context link="call_number" field="owning_lib"/>
4219                 </retrieve>
4220                 <update permission="UPDATE_VOLUME_NOTE">
4221                     <context link="call_number" field="owning_lib"/>
4222                 </update>
4223                 <delete permission="DELETE_VOLUME_NOTE">
4224                     <context link="call_number" field="owning_lib"/>
4225                 </delete>
4226             </actions>
4227         </permacrud>
4228         </class>
4229         <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">
4230                 <fields oils_persist:primary="id" oils_persist:sequence="authority.record_note_id_seq">
4231                         <field name="create_date" reporter:datatype="timestamp"/>
4232                         <field name="creator" reporter:datatype="link"/>
4233                         <field name="edit_date" reporter:datatype="timestamp"/>
4234                         <field name="editor" reporter:datatype="link"/>
4235                         <field name="id" reporter:datatype="id" />
4236                         <field name="record" reporter:datatype="link"/>
4237                         <field name="value" reporter:datatype="text"/>
4238                 </fields>
4239                 <links>
4240                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
4241                 </links>
4242         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4243             <actions>
4244                 <create permission="CREATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4245                 <retrieve/>
4246                 <update permission="UPDATE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4247                 <delete permission="DELETE_AUTHORITY_RECORD_NOTE" global_required='true'/>
4248             </actions>
4249         </permacrud>
4250         </class>
4251         <class id="ocirccount" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_count" reporter:label="Open Circulation Count" oils_persist:readonly="true">
4252         <oils_persist:source_definition>
4253 SELECT  usr,
4254         SUM(
4255             CASE
4256                 WHEN (
4257                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4258                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4259                 ) THEN 1
4260                 ELSE 0
4261             END
4262         ) AS out,
4263
4264         SUM(
4265             CASE
4266                 WHEN (
4267                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4268                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4269                 ) THEN 1
4270                 ELSE 0
4271             END
4272         ) AS overdue,
4273
4274         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost,
4275         SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned,
4276         SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN 1 ELSE 0 END) AS long_overdue
4277   FROM  action.circulation
4278   WHERE checkin_time IS NULL
4279   GROUP BY 1
4280         </oils_persist:source_definition>
4281         <fields oils_persist:primary="usr">
4282             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4283             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4284             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4285             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4286             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4287             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4288         </fields>
4289         <links>
4290             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4291         </links>
4292         </class>
4293         <class id="ocirclist" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circ_list" reporter:label="Open Circulation List" oils_persist:readonly="true">
4294         <oils_persist:source_definition>
4295 SELECT  usr,
4296         STRING_AGG(
4297             CASE
4298                 WHEN (
4299                     ((fine_interval >= '1 day' AND due_date >= 'today') OR (fine_interval &lt; '1 day'  AND due_date > 'now'))
4300                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4301                 ) THEN id::TEXT
4302                 ELSE '0'
4303             END
4304         ,',') AS out,
4305
4306         STRING_AGG(
4307             CASE
4308                 WHEN (
4309                     ((fine_interval >= '1 day' AND due_date &lt; 'today') OR (fine_interval &lt; '1 day'  AND due_date &lt; 'now'))
4310                     AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
4311                 ) THEN id::TEXT
4312                 ELSE '0'
4313             END
4314         ,',') AS overdue,
4315
4316         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost,
4317         STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned,
4318         STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE') THEN id::TEXT ELSE '0' END,',') AS long_overdue
4319   FROM  action.circulation
4320   WHERE checkin_time IS NULL
4321   GROUP BY 1
4322         </oils_persist:source_definition>
4323         <fields oils_persist:primary="usr">
4324             <field reporter:label="User ID" name="usr" reporter:datatype="link"/>
4325             <field reporter:label="Out" name="out" reporter:datatype="text"/>
4326             <field reporter:label="Overdue" name="overdue" reporter:datatype="text"/>
4327             <field reporter:label="Lost" name="lost" reporter:datatype="text"/>
4328             <field reporter:label="Claims Returned" name="claims_returned" reporter:datatype="text"/>
4329             <field reporter:label="Long Overdue" name="long_overdue" reporter:datatype="text"/>
4330         </fields>
4331         <links>
4332             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4333         </links>
4334         </class>
4335         <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">
4336                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4337                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4338                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4339                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4340                         <field reporter:label="Checkout / Renewal Library" name="circ_lib"  reporter:datatype="org_unit"/>
4341                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4342                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4343                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4344                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4345                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4346                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4347                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4348                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4349                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4350                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4351                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4352                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4353                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4354                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4355                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4356                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4357                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4358                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4359                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4360                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4361                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4362                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4363                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4364                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4365                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4366                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4367                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4368                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4369                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4370                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4371                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4372                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4373                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4374                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4375                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4376                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4377                 </fields>
4378                 <links>
4379                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4380                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4381                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4382                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4383                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4384                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4385                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4386                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4387                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4388                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4389                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4390                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4391                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4392                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4393                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4394                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4395                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4396                         <link field="parent_circ" reltype="has_a" key="id" map="" class="circ"/>
4397                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4398                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4399                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4400                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4401                 </links>
4402                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4403                         <actions>
4404                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4405                         </actions>
4406                 </permacrud>
4407         </class>
4408         <class id="aacct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_combined_types" oils_persist:tablename="action.all_circulation_combined_types" reporter:core="true" reporter:label="All Circulation Combined Types" oils_persist:readonly="true">
4409                 <fields>
4410                         <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
4411                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4412                         <field reporter:label="Circ ID" name="id" reporter:datatype="int" />
4413                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4414                         <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
4415                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
4416                         <field reporter:label="Item Type" name="item_type" reporter:datatype="text"/>
4417                 </fields>
4418                 <links>
4419                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4420                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4421                 </links>
4422                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4423                         <actions>
4424                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4425                         </actions>
4426                 </permacrud>
4427         </class>
4428         <class id="aacs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::all_circulation_slim" oils_persist:tablename="action.all_circulation_slim" reporter:core="true" reporter:label="Combined Aged and Active circulations" oils_persist:readonly="true">
4429                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4430                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4431                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4432                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4433                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4434                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4435                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4436                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4437                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4438                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4439                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4440                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4441                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4442                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4443                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4444                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4445                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4446                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4447                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4448                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4449                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4450                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4451                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4452                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4453                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4454                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4455                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4456                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4457                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4458                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4459                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4460                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4461                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4462                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4463                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4464                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4465                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4466                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4467                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4468                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4469                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4470                 </fields>
4471                 <links>
4472                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4473                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4474                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4475                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4476                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4477                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4478                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4479                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4480                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4481                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4482                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4483                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4484                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4485                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4486                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4487                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4488                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4489                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4490                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4491                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4492                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4493                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4494                 </links>
4495                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4496                         <actions>
4497                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4498                         </actions>
4499                 </permacrud>
4500         </class>
4501
4502         <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">
4503                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4504                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4505                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4506                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4507                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4508                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4509                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4510                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4511                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4512                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4513                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4514                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4515                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4516                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4517                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4518                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4519                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4520                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4521                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4522                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4523                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4524                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4525                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4526                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4527                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4528                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4529                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4530                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4531                         <field reporter:label="Checkin Scan Time" name="checkin_scan_time" reporter:datatype="timestamp"/>
4532                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4533                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
4534                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4535                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4536                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4537                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4538                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4539                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4540                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4541                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4542                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4543                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4544                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4545                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4546                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4547                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4548                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4549                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4550                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4551                         <field reporter:label="Linked Active Circulation" name="active_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4552                         <field reporter:label="Linked Aged Circulation" name="aged_circ" oils_persist:virtual="true" reporter:datatype="link"/>
4553                 </fields>
4554                 <links>
4555                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4556                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4557                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4558                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4559                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4560                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4561                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4562                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4563                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4564                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4565                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4566                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4567                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4568                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4569                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4570                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4571                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4572                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4573                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4574                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4575                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4576                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4577                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4578                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
4579                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
4580                         <link field="active_circ" reltype="might_have" key="id" map="" class="circ"/>
4581                         <link field="aged_circ" reltype="might_have" key="id" map="" class="acirc"/>
4582                         <link field="parent_circ" reltype="might_have" key="id" map="" class="acirc"/>
4583                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4584                 </links>
4585                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4586                         <actions>
4587                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
4588                         </actions>
4589                 </permacrud>
4590         </class>
4591         <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">
4592                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4593                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
4594                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
4595                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
4596                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
4597                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
4598                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
4599                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
4600                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
4601                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
4602                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4603                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
4604                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
4605                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
4606                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
4607                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
4608                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
4609                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
4610                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
4611                         <field reporter:label="Grace Period" name="grace_period" reporter:datatype="interval" />
4612                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
4613                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
4614                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4615                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
4616                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
4617                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
4618                         <field reporter:label="Record Creation Date/Time" name="create_time" reporter:datatype="timestamp" />
4619                         <field reporter:label="Workstation" name="workstation" reporter:datatype="link"/>
4620                         <field reporter:label="Checkin Workstation" name="checkin_workstation" reporter:datatype="link"/>
4621                         <field reporter:label="Checkin Scan Date/Time" name="checkin_scan_time" reporter:datatype="timestamp" />
4622                         <field reporter:label="Parent Circulation" name="parent_circ" reporter:datatype="link"/>
4623                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4624                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4625                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
4626                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="text"/>
4627                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4628                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4629                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
4630                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
4631                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
4632                         <field reporter:label="Call Number" name="copy_call_number" reporter:datatype="link"/>
4633                         <field reporter:label="Shelving Location" name="copy_location" reporter:datatype="link"/>
4634                         <field reporter:label="Copy Owning Library" name="copy_owning_lib" reporter:datatype="link"/>
4635                         <field reporter:label="Copy Circulating Library" name="copy_circ_lib" reporter:datatype="link"/>
4636                         <field reporter:label="Bib Record" name="copy_bib_record" reporter:datatype="link"/>
4637                         <field reporter:label="Archived Patron Stat-Cat Entries" name="aaactsc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4638                         <field reporter:label="Archived Copy Stat-Cat Entries" name="aaasc_entries" oils_persist:virtual="true" reporter:datatype="link"/>
4639                 </fields>
4640                 <links>
4641                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
4642                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
4643                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
4644                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4645                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
4646                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4647                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4648                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4649                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
4650                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
4651                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
4652                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
4653                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4654                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4655                         <link field="copy_call_number" reltype="has_a" key="id" map="" class="acn"/>
4656                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
4657                         <link field="copy_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4658                         <link field="copy_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
4659                         <link field="copy_bib_record" reltype="has_a" key="id" map="" class="bre"/>
4660                         <link field="workstation" reltype="has_a" key="id" map="" class="aws"/>
4661                         <link field="checkin_workstation" reltype="has_a" key="id" map="" class="aws"/>
4662                         <link field="parent_circ" reltype="might_have" key="id" map="" class="circ"/>
4663                         <link field="renewals" reltype="has_many" key="parent_circ" map="" class="circ"/>
4664                         <link field="aaactsc_entries" reltype="has_many" key="xact" map="" class="aaactsc"/>
4665                         <link field="aaasc_entries" reltype="has_many" key="xact" map="" class="aaasc"/>
4666                 </links>
4667         </class>
4668         <class id="auch" 
4669                 controller="open-ils.cstore" 
4670                 oils_obj:fieldmapper="action::user_circ_history" 
4671                 oils_persist:tablename="action.usr_circ_history" 
4672                 reporter:label="User Checkout History">
4673                 <fields oils_persist:primary="id" oils_persist:sequence="action.usr_circ_history_id_seq">
4674                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
4675                         <!-- prevent reporting on the user that owns the checkout history -->
4676                         <field reporter:label="User" name="usr" reporter:datatype="link" suppress_controller="open-ils.reporter-store"/>
4677                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
4678                         <field reporter:label="Checkin Time" name="checkin_time" reporter:datatype="timestamp" />
4679                         <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp" />
4680                         <field reporter:label="Checkout Time" name="xact_start" reporter:datatype="timestamp" />
4681                         <field reporter:label="Source Circulation" name="source_circ" reporter:datatype="link" />
4682                 </fields>
4683                 <links>
4684                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4685                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4686                         <link field="source_circ" reltype="has_a" key="id" map="" class="circ"/>
4687                 </links>
4688         </class>
4689         <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">
4690                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
4691                         <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
4692                         <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
4693                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4694                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4695                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4696                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4697                         <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
4698                         <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
4699                         <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
4700                         <field reporter:label="Inter-booking and Inter-circulation Interval" name="elbow_room" reporter:datatype="interval"/>
4701                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
4702                         <field reporter:label="Resource Attributes" name="resource_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
4703                         <field reporter:label="Target Resource Types" name="tgt_rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
4704                 </fields>
4705                 <links>
4706                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4707                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
4708                         <link field="resources" reltype="has_many" key="type" map="" class="brsrc"/>
4709                         <link field="resource_attrs" reltype="has_many" key="type" map="" class="bra"/>
4710                         <link field="tgt_rsrc_types" reltype="has_many" key="type" map="" class="bresv"/>
4711                 </links>
4712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4713                         <actions>
4714                                 <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4715                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4716                                 <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4717                                 <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
4718                         </actions>
4719                 </permacrud>
4720         </class>
4721
4722         <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
4723                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
4724                         <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
4725                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4726                         <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
4727                         <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
4728                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
4729                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
4730                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
4731                         <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
4732                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4733                         <field reporter:label="Reservation Target Resources" name="tgt_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4734                         <field reporter:label="Reservation Current Resources" name="curr_rsrcs" oils_persist:virtual="true" reporter:datatype="link"/>
4735                         <field reporter:label="Catalog Item" name="catalog_item" oils_persist:virtual="true" reporter:datatype="link"/>
4736                 </fields>
4737                 <links>
4738                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4739                         <link field="type" reltype="has_a" key="id" map="" class="brt"/>
4740                         <link field="attr_maps" reltype="has_many" key="resource" map="" class="bram"/>
4741                         <link field="tgt_rsrcs" reltype="has_many" key="targeted_resource" map="" class="bresv"/>
4742                         <link field="curr_rsrcs" reltype="has_many" key="current_resource" map="" class="bresv"/>
4743                 </links>
4744                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4745                         <actions>
4746                                 <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4747                                 <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4748                                 <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4749                                 <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
4750                         </actions>
4751                 </permacrud>
4752         </class>
4753         
4754         <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">
4755                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
4756                         <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
4757                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4758                         <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
4759                         <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
4760                         <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
4761                         <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
4762                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4763                 </fields>
4764                 <links>
4765                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4766                         <link field="resource_type" reltype="has_a" key="id" map="" class="brt"/>
4767                         <link field="valid_values" reltype="has_many" key="attr" map="" class="brav"/>
4768                         <link field="attr_maps" reltype="has_many" key="attr" map="" class="bram"/>
4769                 </links>
4770                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4771                         <actions>
4772                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4773                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4774                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4775                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
4776                         </actions>
4777                 </permacrud>
4778         </class>
4779         
4780         <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">
4781                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
4782                         <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
4783                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
4784                         <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
4785                         <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
4786                         <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4787                         <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4788                 </fields>
4789                 <links>
4790                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
4791                         <link field="attr" reltype="has_a" key="id" map="" class="bra"/>
4792                         <link field="attr_maps" reltype="has_many" key="id" map="" class="bram"/>
4793                         <link field="attr_val_maps" reltype="has_many" key="attr_value" map="" class="bravm"/>
4794                 </links>
4795                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4796                         <actions>
4797                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4798                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4799                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4800                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
4801                         </actions>
4802                 </permacrud>
4803         </class>
4804         
4805         <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">
4806                 <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
4807                         <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
4808                         <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
4809                         <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
4810                         <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
4811                 </fields>
4812                 <links>
4813                         <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
4814                         <link field="resource_attr" reltype="has_a" key="id" map="" class="bra"/>
4815                         <link field="value" reltype="has_a" key="id" map="" class="brav"/>
4816                 </links>
4817                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4818                         <actions>
4819                                 <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4820                     <context link="resource" field="owner" />
4821                 </create>
4822                                 <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4823                     <context link="resource" field="owner" />
4824                 </retrieve>
4825                                 <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4826                     <context link="resource" field="owner" />
4827                 </update>
4828                                 <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
4829                     <context link="resource" field="owner" />
4830                 </delete>
4831                         </actions>
4832                 </permacrud>
4833         </class>
4834         
4835         <class id="bresv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::reservation" oils_persist:tablename="booking.reservation" reporter:label="Reservation">
4836                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
4837                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
4838                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
4839                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
4840                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
4841                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
4842                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
4843                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
4844                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
4845                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
4846                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
4847                         <field reporter:label="Request Time" name="request_time" reporter:datatype="timestamp"/>
4848                         <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
4849                         <field reporter:label="End Time" name="end_time" reporter:datatype="timestamp"/>
4850                         <field reporter:label="Capture Time" name="capture_time" reporter:datatype="timestamp"/>
4851                         <field reporter:label="Cancel Time" name="cancel_time" reporter:datatype="timestamp"/>
4852                         <field reporter:label="Pickup Time" name="pickup_time" reporter:datatype="timestamp"/>
4853                         <field reporter:label="Return Time" name="return_time" reporter:datatype="timestamp"/>
4854                         <field reporter:label="Booking Interval" name="booking_interval" reporter:datatype="interval"/>
4855                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
4856                         <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
4857                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
4858                         <field reporter:label="Target Resource Type" name="target_resource_type" reporter:datatype="link"/>
4859                         <field reporter:label="Target Resource" name="target_resource" reporter:datatype="link"/>
4860                         <field reporter:label="Current Resource" name="current_resource" reporter:datatype="link"/>
4861                         <field reporter:label="Request Library" name="request_lib" reporter:datatype="link"/>
4862                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link"/>
4863                         <field reporter:label="Capture Staff" name="capture_staff" reporter:datatype="link"/>
4864                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
4865                         <field reporter:label="Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
4866                 </fields>
4867                 <links>
4868                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
4869                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
4870                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
4871                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
4872                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
4873                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
4874                         <link field="target_resource_type" reltype="has_a" key="id" map="" class="brt"/>
4875                         <link field="target_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4876                         <link field="current_resource" reltype="has_a" key="id" map="" class="brsrc"/>
4877                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
4878                         <link field="pickup_lib" reltype="might_have" key="id" map="" class="aou"/>
4879                         <link field="capture_staff" reltype="might_have" key="id" map="" class="au"/>
4880                         <link field="attr_val_maps" reltype="has_many" key="reservation" map="" class="bravm"/>
4881                 </links>
4882                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4883                         <actions>
4884                                 <create permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4885                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4886                                 <update permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4887                                 <delete permission="ADMIN_BOOKING_RESERVATION" global_required='true'/>
4888                         </actions>
4889                 </permacrud>
4890         </class>
4891         
4892         <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">
4893                 <fields oils_persist:primary="id" oils_persist:sequence="booking.reservation_attr_value_map_id_seq">
4894                         <field reporter:label="Reservation Attribute Value Map" name="id" reporter:datatype="id"/>
4895                         <field reporter:label="Reservation" name="reservation" reporter:datatype="link"/>
4896                         <field reporter:label="Attribute Map" name="attr_value" reporter:datatype="link"/>
4897                 </fields>
4898                 <links>
4899                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
4900                         <link field="attr_value" reltype="has_a" key="id" map="" class="brav"/>
4901                 </links>
4902                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4903                         <actions>
4904                                 <create permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4905                                 <retrieve permission="STAFF_LOGIN" global_required='true'/>
4906                                 <update permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4907                                 <delete permission="ADMIN_BOOKING_RESERVATION_ATTR_MAP" global_required='true'/>
4908                         </actions>
4909                 </permacrud>
4910         </class>
4911
4912         <class id="ccnbi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket_item" oils_persist:tablename="container.call_number_bucket_item" reporter:label="Call Number Bucket Item">
4913                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_id_seq">
4914                         <field name="bucket" reporter:datatype="link"/>
4915                         <field name="id" reporter:datatype="id" />
4916                         <field name="target_call_number" reporter:datatype="link" />
4917                         <field name="create_time" reporter:datatype="timestamp" />
4918                         <field name="pos" reporter:datatype="int" />
4919                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
4920                 </fields>
4921                 <links>
4922                         <link field="target_call_number" reltype="has_a" key="id" map="" class="acn"/>
4923                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
4924             <link field="notes" reltype="has_many" map="" key="item" class="ccnbin"/>
4925                 </links>
4926                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4927                         <actions>
4928                                 <retrieve permission="ADMIN_CALLNUMBER_BUCKET">
4929                     <context link="bucket" owning_lib="owning_lib"/>
4930                 </retrieve>
4931             </actions>
4932         </permacrud>
4933         </class>
4934         <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">
4935                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_item_note_id_seq">
4936                         <field name="id" reporter:datatype="id" />
4937                         <field name="item" reporter:datatype="link"/>
4938                         <field name="note" reporter:datatype="text" />
4939                 </fields>
4940                 <links>
4941                         <link field="item" reltype="has_a" key="id" map="" class="ccnbi"/>
4942                 </links>
4943         </class>
4944         <class id="cbreb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket" oils_persist:tablename="container.biblio_record_entry_bucket" reporter:label="Bibliographic Record Entry Bucket">
4945                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_id_seq">
4946                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
4947                         <field name="btype" reporter:datatype="text"/>
4948                         <field name="id" reporter:datatype="id" />
4949                         <field name="name" reporter:datatype="text"/>
4950                         <field name="description" reporter:datatype="text"/>
4951                         <field name="owner" reporter:datatype="link"/>
4952                         <field name="pub" reporter:datatype="bool"/>
4953                         <field name="create_time" reporter:datatype="timestamp" />
4954                         <field name="owning_lib" reporter:datatype="org_unit" />
4955                 </fields>
4956                 <links>
4957                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
4958                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
4959                         <link field="items" reltype="has_many" key="bucket" map="" class="cbrebi"/>
4960                 </links>
4961                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
4962                         <actions>
4963                                 <create permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4964                                 <retrieve permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4965                                 <update permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4966                                 <delete permission="CREATE_BIB_BUCKET ADMIN_BIB_BUCKET" context="owning_lib" owning_user="owner"/>
4967                         </actions>
4968                 </permacrud>
4969         </class>
4970         <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">
4971                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_note_id_seq">
4972                         <field name="id" reporter:datatype="id" />
4973                         <field name="bucket" reporter:datatype="link"/>
4974                         <field name="note" reporter:datatype="text" />
4975                 </fields>
4976                 <links>
4977                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
4978                 </links>
4979         </class>
4980         <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">
4981                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_copy_map_id_seq">
4982                         <field name="hold" reporter:datatype="link"/>
4983                         <field name="id" reporter:datatype="id" />
4984                         <field name="target_copy" reporter:datatype="link"/>
4985                         <field name="proximity" reporter:datatype="number"/>
4986                 </fields>
4987                 <links>
4988                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
4989                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
4990                 </links>
4991         </class>
4992         <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">
4993                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_notification_id_seq">
4994                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
4995                         <field reporter:label="Notification ID" name="id" reporter:datatype="id" />
4996                         <field reporter:label="Notification Method" name="method"  reporter:datatype="text"/>
4997                         <field reporter:label="Notification Note" name="note"  reporter:datatype="text"/>
4998                         <field reporter:label="Notifying Staff" name="notify_staff" reporter:datatype="link"/>
4999                         <field reporter:label="Notification Date/Time" name="notify_time" reporter:datatype="timestamp"/>
5000                 </fields>
5001                 <links>
5002                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
5003                         <link field="notify_staff" reltype="has_a" key="id" map="" class="au"/>
5004                 </links>
5005         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5006             <actions>
5007                 <create permission="CREATE_HOLD_NOTIFICATION">
5008                                         <context link="hold" jump="usr" field="home_ou" />
5009                                 </create>
5010                 <retrieve permission="VIEW_HOLD_NOTIFICATION">
5011                                         <context link="hold" jump="usr" field="home_ou" />
5012                                 </retrieve>
5013                 <update permission="CREATE_HOLD_NOTIFICATION">
5014                                         <context link="hold" jump="usr" field="home_ou" />
5015                                 </update>
5016                 <delete permission="CREATE_HOLD_NOTIFICATION">
5017                                         <context link="hold" jump="usr" field="home_ou" />
5018                                 </delete>
5019             </actions>
5020         </permacrud>
5021         </class>
5022         <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">
5023                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_id_seq">
5024                         <field reporter:label="Can Circulate?" name="circulate"  reporter:datatype="bool"/>
5025                         <field reporter:label="Is Holdable?" name="holdable" reporter:datatype="bool"/>
5026                         <field reporter:label="Hold Capture Requires Verification" name="hold_verify" reporter:datatype="bool"/>
5027                         <field reporter:label="Location ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5028                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5029                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5030                         <field reporter:label="Owning Org Unit" name="owning_lib"  reporter:datatype="org_unit"/>
5031                         <field reporter:label="Copy Location Orders" name="orders" oils_persist:virtual="true" reporter:datatype="link"/>
5032                         <field reporter:label="Copies" name="copies" oils_persist:virtual="true" reporter:datatype="link"/>
5033                         <field reporter:label="Label Prefix" name="label_prefix"  reporter:datatype="text" oils_persist:i18n="true"/>
5034                         <field reporter:label="Label Suffix" name="label_suffix"  reporter:datatype="text" oils_persist:i18n="true"/>
5035                         <field reporter:label="Checkin Alert" name="checkin_alert" reporter:datatype="bool" />
5036                         <field reporter:label="Is Deleted?" name="deleted" reporter:datatype="bool" />
5037                         <field reporter:label="URL" name="url" reporter:datatype="text" />
5038                 </fields>
5039                 <links>
5040                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5041                         <link field="distribution_formula_entries" reltype="has_many" key="location" map="" class="acqdfe"/>
5042                         <link field="orders" reltype="has_many" key="location" map="" class="acplo"/>
5043                         <link field="copies" reltype="has_many" key="location" map="" class="acp"/>
5044                 </links>
5045         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5046             <actions>
5047                 <create permission="CREATE_COPY_LOCATION" context_field="owning_lib"/>
5048                 <retrieve/>
5049                 <update permission="UPDATE_COPY_LOCATION" context_field="owning_lib"/>
5050                 <delete permission="DELETE_COPY_LOCATION" context_field="owning_lib"/>
5051             </actions>
5052         </permacrud>
5053         </class>
5054         <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">
5055                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_id_seq">
5056                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5057                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
5058                         <field reporter:label="Is OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
5059                         <field reporter:label="Owning Org Unit" name="owner"  reporter:datatype="org_unit"/>
5060             <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5061             <field reporter:label="Display Above Orgs" name="top" reporter:datatype="bool"/>
5062             <field reporter:label="Copy Location Mappings" name="location_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5063                 </fields>
5064                 <links>
5065                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5066                         <link field="location_maps" reltype="has_many" key="lgroup" map="" class="acplgm"/>
5067                 </links>
5068         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5069             <actions>
5070                 <create permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5071                 <retrieve/>
5072                 <update permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5073                 <delete permission="ADMIN_COPY_LOCATION_GROUP" context_field="owner"/>
5074             </actions>
5075         </permacrud>
5076         </class>
5077         <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">
5078                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_group_map_id_seq">
5079                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
5080             <field reporter:label="Group" name="lgroup" reporter:datatype="link"/>
5081             <field reporter:label="Copy Location" name="location" reporter:datatype="link"/>
5082                 </fields>
5083                 <links>
5084                         <link field="lgroup" reltype="has_a" key="id" map="" class="acplg"/>
5085                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5086                 </links>
5087         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5088             <actions>
5089                 <create permission="ADMIN_COPY_LOCATION_GROUP">
5090                                         <context link="lgroup" field="owner" />
5091                 </create>
5092                 <retrieve/>
5093                 <update permission="ADMIN_COPY_LOCATION_GROUP">
5094                                         <context link="lgroup" field="owner" />
5095                 </update>
5096                 <delete permission="ADMIN_COPY_LOCATION_GROUP">
5097                                         <context link="lgroup" field="owner" />
5098                 </delete>
5099             </actions>
5100         </permacrud>
5101         </class>
5102
5103     <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">
5104         <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_location_order_id_seq">
5105             <field reporter:label="Location Order ID" name="id" reporter:datatype="id"/>
5106             <field reporter:label="Location ID" name="location" reporter:datatype="link"/>
5107             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit"/>
5108             <field reporter:label="Position" name="position" reporter:datatype="int"/>
5109         </fields>
5110         <links>
5111             <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5112             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
5113         </links>
5114         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5115             <actions>
5116                                 <create permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5117                 <retrieve/>
5118                                 <update permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5119                                 <delete permission="ADMIN_COPY_LOCATION_ORDER" context_field="org"/>
5120             </actions>
5121         </permacrud>
5122     </class>
5123
5124         <class id="svr" controller="open-ils.cstore" oils_obj:fieldmapper="serial::virtual_record" oils_persist:virtual="true" reporter:label="Serial Virtual Record">
5125                 <fields>
5126                         <field name="sre_id" oils_persist:virtual="true" />
5127                         <field name="location" oils_persist:virtual="true" />
5128                         <field name="owning_lib" oils_persist:virtual="true" />
5129                         <field name="basic_holdings" oils_persist:virtual="true" />
5130                         <field name="basic_holdings_add" oils_persist:virtual="true" />
5131                         <field name="supplement_holdings" oils_persist:virtual="true" />
5132                         <field name="supplement_holdings_add" oils_persist:virtual="true" />
5133                         <field name="index_holdings" oils_persist:virtual="true" />
5134                         <field name="index_holdings_add" oils_persist:virtual="true" />
5135                         <field name="online" oils_persist:virtual="true" />
5136                         <field name="missing" oils_persist:virtual="true" />
5137                         <field name="incomplete" oils_persist:virtual="true" />
5138                 </fields>
5139         </class>
5140
5141         <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">
5142                 <fields oils_persist:primary="id" oils_persist:sequence="serial.record_entry_id_seq">
5143                         <field reporter:label="Is Active" name="active" reporter:datatype="bool"/>
5144                         <field reporter:label="Bib Record" name="record" reporter:datatype="link"/>
5145                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5146                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5147                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5148                         <field reporter:label="Edit date" name="edit_date" reporter:datatype="timestamp"/>
5149                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5150                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5151                         <field reporter:label="Last Transaction ID" name="last_xact_id" reporter:datatype="text"/>
5152                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
5153                         <field reporter:label="Source" name="source" reporter:datatype="int"/>
5154                         <field reporter:label="Owning Org Unit" name="owning_lib" reporter:datatype="org_unit"/>
5155                 </fields>
5156                 <links>
5157                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
5158                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5159                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5160                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5161                 </links>
5162                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5163                         <actions>
5164                                 <create permission="CREATE_MFHD_RECORD" context_field="owning_lib"/>
5165                                 <retrieve/>
5166                                 <update permission="UPDATE_MFHD_RECORD" context_field="owning_lib"/>
5167                                 <delete permission="DELETE_MFHD_RECORD" context_field="owning_lib"/>
5168                         </actions>
5169                 </permacrud>
5170         </class>
5171
5172         <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">
5173                 <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
5174                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5175                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5176                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
5177                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5178                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5179                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5180                         <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
5181                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
5182                         <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
5183                         <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
5184                         <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
5185                         <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
5186                         <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
5187                         <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
5188                         <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
5189                         <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
5190                         <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
5191                         <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
5192                         <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
5193                 </fields>
5194                 <links>
5195                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5196                 </links>
5197                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5198                         <actions>
5199                                 <create permission="ADMIN_SERIAL_CAPTION_PATTERN">
5200                                         <context link="subscription" field="owning_lib" />
5201                                 </create>
5202                                 <retrieve />
5203                                 <update permission="ADMIN_SERIAL_CAPTION_PATTERN">
5204                                         <context link="subscription" field="owning_lib" />
5205                                 </update>
5206                                 <delete permission="ADMIN_SERIAL_CAPTION_PATTERN">
5207                                         <context link="subscription" field="owning_lib" />
5208                                 </delete>
5209                         </actions>
5210                 </permacrud>
5211         </class>
5212
5213         <class id="ssub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
5214                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
5215                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5216                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
5217                         <field reporter:label="Start Date" name="start_date" reporter:datatype="timestamp"/>
5218                         <field reporter:label="End Date" name="end_date" reporter:datatype="timestamp"/>
5219                         <field reporter:label="Bibliographic Record Entry" name="record_entry" reporter:datatype="link"/>
5220                         <field reporter:label="Expected Date Offset" name="expected_date_offset" reporter:datatype="interval"/>
5221                         <field reporter:label="Distributions" name="distributions" oils_persist:virtual="true" reporter:datatype="link"/>
5222                         <field reporter:label="Issuances" name="issuances" oils_persist:virtual="true" reporter:datatype="link"/>
5223                         <field reporter:label="Captions and Patterns" name="scaps" oils_persist:virtual="true" reporter:datatype="link"/>
5224                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5225                 </fields>
5226                 <links>
5227                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5228                         <link field="record_entry" reltype="has_a" key="id" map="" class="bre"/>
5229                         <link field="distributions" reltype="has_many" key="subscription" map="" class="sdist"/>
5230                         <link field="issuances" reltype="has_many" key="subscription" map="" class="siss"/>
5231                         <link field="scaps" reltype="has_many" key="subscription" map="" class="scap"/>
5232                         <link field="notes" reltype="has_many" key="subscription" map="" class="ssubn"/>
5233                 </links>
5234                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5235                         <actions>
5236                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5237                                 <retrieve />
5238                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5239                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib"/>
5240                         </actions>
5241                 </permacrud>
5242         </class>
5243
5244         <class id="ssubn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::subscription_note" oils_persist:tablename="serial.subscription_note" reporter:label="Subscription Note">
5245                 <fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_note_id_seq">
5246                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5247                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5248                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5249                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5250                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5251                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5252                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5253                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5254                 </fields>
5255                 <links>
5256                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5257                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5258                 </links>
5259                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5260                         <actions>
5261                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5262                     <context link="subscription" field="owning_lib"/>
5263                 </create>
5264                                 <retrieve />
5265                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5266                     <context link="subscription" field="owning_lib"/>
5267                 </update>
5268                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION" context_field="owning_lib">
5269                     <context link="subscription" field="owning_lib"/>
5270                 </delete>
5271                         </actions>
5272                 </permacrud>
5273         </class>
5274
5275         <class id="sdist" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::distribution" oils_persist:tablename="serial.distribution" reporter:label="Distribution">
5276                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_id_seq">
5277                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5278                         <field reporter:label="Legacy Record Entry" name="record_entry" reporter:datatype="link"/>
5279                         <field reporter:label="Summary Method" name="summary_method" reporter:datatype="text"/>
5280                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5281                         <field reporter:label="Holding Lib" name="holding_lib" reporter:datatype="org_unit"/>
5282                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5283                         <field reporter:label="Receive Call Number" name="receive_call_number" reporter:datatype="link"/>
5284                         <field reporter:label="Receive Unit Template" name="receive_unit_template" reporter:datatype="link"/>
5285                         <field reporter:label="Bind Call Number" name="bind_call_number" reporter:datatype="link"/>
5286                         <field reporter:label="Bind Unit Template" name="bind_unit_template" reporter:datatype="link"/>
5287                         <field reporter:label="Unit Label Prefix" name="unit_label_prefix" reporter:datatype="text"/>
5288                         <field reporter:label="Unit Label Suffix" name="unit_label_suffix" reporter:datatype="text"/>
5289                         <field reporter:label="Display Grouping" name="display_grouping" reporter:datatype="text"/>
5290                         <field reporter:label="Streams" name="streams" oils_persist:virtual="true" reporter:datatype="link"/>
5291                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5292                         <field reporter:label="Basic Issue Summary" name="basic_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5293                         <field reporter:label="Supplemental Issue Summary" name="supplement_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5294                         <field reporter:label="Index Issue Summary" name="index_summary" oils_persist:virtual="true" reporter:datatype="link"/>
5295                 </fields>
5296                 <links>
5297                         <link field="record_entry" reltype="has_a" key="id" map="" class="sre"/>
5298                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5299                         <link field="holding_lib" reltype="has_a" key="id" map="" class="aou"/>
5300                         <link field="receive_call_number" reltype="has_a" key="id" map="" class="acn"/>
5301                         <link field="receive_unit_template" reltype="has_a" key="id" map="" class="act"/>
5302                         <link field="bind_call_number" reltype="has_a" key="id" map="" class="acn"/>
5303                         <link field="bind_unit_template" reltype="has_a" key="id" map="" class="act"/>
5304                         <link field="streams" reltype="has_many" key="distribution" map="" class="sstr"/>
5305                         <link field="notes" reltype="has_many" key="distribution" map="" class="sdistn"/>
5306                         <link field="basic_summary" reltype="might_have" key="distribution" map="" class="sbsum"/>
5307                         <link field="supplement_summary" reltype="might_have" key="distribution" map="" class="sssum"/>
5308                         <link field="index_summary" reltype="might_have" key="distribution" map="" class="sisum"/>
5309                 </links>
5310                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5311                         <actions>
5312                                 <create permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5313                                 <retrieve />
5314                                 <update permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5315                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION" context_field="holding_lib" />
5316                         </actions>
5317                 </permacrud>
5318         </class>
5319
5320         <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">
5321                 <fields oils_persist:primary="id" oils_persist:sequence="serial.distribution_note_id_seq">
5322                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5323                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5324                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5325                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5326                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5327                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5328                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5329                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5330                 </fields>
5331                 <links>
5332                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5333                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5334                 </links>
5335                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5336                         <actions>
5337                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5338                                         <context link="distribution" field="holding_lib" />
5339                                 </create>
5340                                 <retrieve permission="ADMIN_SERIAL_DISTRIBUTION">
5341                                         <context link="distribution" field="holding_lib" />
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="sstr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::stream" oils_persist:tablename="serial.stream" reporter:label="Stream">
5354                 <fields oils_persist:primary="id" oils_persist:sequence="serial.stream_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="Routing Label" name="routing_label" reporter:datatype="text"/>
5358                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5359                         <field reporter:label="Routing List Users" name="routing_list_users" oils_persist:virtual="true" reporter:datatype="link"/>
5360                 </fields>
5361                 <links>
5362                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5363                         <link field="items" reltype="has_many" key="stream" map="" class="sitem"/>
5364                         <link field="routing_list_users" reltype="has_many" key="stream" map="" class="srlu"/>
5365                 </links>
5366                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5367                         <actions>
5368                                 <create permission="ADMIN_SERIAL_STREAM">
5369                                         <context link="distribution" field="holding_lib" />
5370                                 </create>
5371                                 <retrieve />
5372                                 <update permission="ADMIN_SERIAL_STREAM">
5373                                         <context link="distribution" field="holding_lib" />
5374                                 </update>
5375                                 <delete permission="ADMIN_SERIAL_STREAM">
5376                                         <context link="distribution" field="holding_lib" />
5377                                 </delete>
5378                         </actions>
5379                 </permacrud>
5380         </class>
5381
5382         <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">
5383                 <fields oils_persist:primary="id" oils_persist:sequence="serial.routing_list_user_id_seq">
5384                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5385                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5386                         <field reporter:label="Position" name="pos" reporter:datatype="int"/>
5387                         <field reporter:label="Reader" name="reader" reporter:datatype="link"/>
5388                         <field reporter:label="Department" name="department" reporter:datatype="text"/>
5389                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
5390                 </fields>
5391                 <links>
5392                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5393                         <link field="reader" reltype="has_a" key="id" map="" class="au"/>
5394                 </links>
5395                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5396                         <actions>
5397                                 <create permission="ADMIN_SERIAL_STREAM">
5398                                         <context link="stream" jump="distribution" field="holding_lib" />
5399                                 </create>
5400                                 <retrieve permission="RECEIVE_SERIAL">
5401                                         <context link="stream" jump="distribution" field="holding_lib" />
5402                                 </retrieve>
5403                                 <update permission="ADMIN_SERIAL_STREAM">
5404                                         <context link="stream" jump="distribution" field="holding_lib" />
5405                                 </update>
5406                                 <delete permission="ADMIN_SERIAL_STREAM">
5407                                         <context link="stream" jump="distribution" field="holding_lib" />
5408                                 </delete>
5409                         </actions>
5410                 </permacrud>
5411         </class>
5412
5413         <class id="siss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::issuance" oils_persist:tablename="serial.issuance" reporter:label="Issuance">
5414                 <fields oils_persist:primary="id" oils_persist:sequence="serial.issuance_id_seq">
5415                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5416                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5417                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5418                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5419                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5420                         <field reporter:label="Subscription" name="subscription" reporter:datatype="link"/>
5421                         <field reporter:label="Caption/Pattern" name="caption_and_pattern" reporter:datatype="link"/>
5422                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
5423                         <field reporter:label="Date Published" name="date_published" reporter:datatype="timestamp"/>
5424                         <field reporter:label="Holding Code" name="holding_code" reporter:datatype="text"/>
5425                         <field reporter:label="Holding Type" name="holding_type" reporter:datatype="text"/>
5426                         <field reporter:label="Holding Link ID" name="holding_link_id" reporter:datatype="int"/>
5427                         <field reporter:label="Items" name="items" oils_persist:virtual="true" reporter:datatype="link" />
5428                 </fields>
5429                 <links>
5430                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5431                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5432                         <link field="subscription" reltype="has_a" key="id" map="" class="ssub"/>
5433                         <link field="caption_and_pattern" reltype="has_a" key="id" map="" class="scap"/>
5434                         <link field="items" reltype="has_many" key="issuance" map="" class="sitem"/>
5435                 </links>
5436                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5437                         <actions>
5438                                 <create permission="ADMIN_SERIAL_SUBSCRIPTION">
5439                                         <context link="subscription" field="owning_lib" />
5440                                 </create>
5441                                 <retrieve/>
5442                                 <update permission="ADMIN_SERIAL_SUBSCRIPTION">
5443                                         <context link="subscription" field="owning_lib" />
5444                                 </update>
5445                                 <delete permission="ADMIN_SERIAL_SUBSCRIPTION">
5446                                         <context link="subscription" field="owning_lib" />
5447                                 </delete>
5448                         </actions>
5449                 </permacrud>
5450         </class>
5451
5452         <class id="sunit" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::unit" oils_persist:tablename="serial.unit" reporter:label="Unit">
5453                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
5454                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5455                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
5456                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
5457                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
5458                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
5459                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
5460                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
5461                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
5462                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
5463                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
5464                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
5465                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
5466                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
5467                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
5468                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
5469                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
5470                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
5471                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
5472                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
5473                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
5474                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
5475                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
5476                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
5477                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
5478                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
5479                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
5480                         <field reporter:label="Price" name="price" reporter:datatype="money" />
5481                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
5482                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
5483                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
5484                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
5485                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
5486                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
5487                         <field reporter:label="Sort Key" name="sort_key" reporter:datatype="text"/>
5488                         <field reporter:label="Summary Contents" name="summary_contents" reporter:datatype="text"/>
5489                         <field reporter:label="Detailed Contents" name="detailed_contents" reporter:datatype="text"/>
5490                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5491                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
5492                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
5493                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
5494                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
5495                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
5496                 </fields>
5497                 <links>
5498                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
5499                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
5500                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
5501                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5502                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5503                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
5504                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5505                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
5506                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
5507                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
5508                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
5509                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
5510                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
5511                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
5512                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
5513                 </links>
5514                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5515                         <actions>
5516                                 <create permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5517                                 <retrieve/>
5518                                 <update permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5519                                 <delete permission="RECEIVE_SERIAL ADMIN_SERIAL_SUBSCRIPTION" context_field="circ_lib" />
5520                         </actions>
5521                 </permacrud>
5522         </class>
5523
5524         <class id="sitem" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item" oils_persist:tablename="serial.item" reporter:label="Item">
5525                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_id_seq">
5526                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5527                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5528                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
5529                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5530                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
5531                         <field reporter:label="Issuance" name="issuance" reporter:datatype="link"/>
5532                         <field reporter:label="Stream" name="stream" reporter:datatype="link"/>
5533                         <field reporter:label="Unit" name="unit" reporter:datatype="link"/>
5534                         <field reporter:label="URI" name="uri" reporter:datatype="link"/>
5535                         <field reporter:label="Date Expected" name="date_expected" reporter:datatype="timestamp"/>
5536                         <field reporter:label="Date Received" name="date_received" reporter:datatype="timestamp"/>
5537                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
5538                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
5539                         <field reporter:label="Shadowed?" name="shadowed" reporter:datatype="bool"/>
5540                 </fields>
5541                 <links>
5542                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5543                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
5544                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5545                         <link field="stream" reltype="has_a" key="id" map="" class="sstr"/>
5546                         <link field="unit" reltype="has_a" key="id" map="" class="sunit"/>
5547                         <link field="uri" reltype="has_a" key="id" map="" class="auri"/>
5548                         <link field="notes" reltype="has_many" key="item" map="" class="sin"/>
5549                 </links>
5550                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5551                         <actions>
5552                                 <create permission="ADMIN_SERIAL_ITEM">
5553                                         <context link="stream" jump="distribution" field="holding_lib" />
5554                                 </create>
5555                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5556                                         <context link="stream" jump="distribution" field="holding_lib" />
5557                                 </retrieve>
5558                                 <update permission="ADMIN_SERIAL_ITEM">
5559                                         <context link="stream" jump="distribution" field="holding_lib" />
5560                                 </update>
5561                                 <delete permission="ADMIN_SERIAL_ITEM">
5562                                         <context link="stream" jump="distribution" field="holding_lib" />
5563                                 </delete>
5564                         </actions>
5565                 </permacrud>
5566         </class>
5567
5568         <class id="sin" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::item_note" oils_persist:tablename="serial.item_note" reporter:label="Item Note">
5569                 <fields oils_persist:primary="id" oils_persist:sequence="serial.item_note_id_seq">
5570                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
5571                         <field reporter:label="Item" name="item" reporter:datatype="link"/>
5572                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
5573                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
5574                         <field reporter:label="Public?" name="pub" reporter:datatype="bool"/>
5575                         <field reporter:label="Alert?" name="alert" reporter:datatype="bool"/>
5576                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
5577                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
5578                 </fields>
5579                 <links>
5580                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
5581                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
5582                 </links>
5583                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5584                         <actions>
5585                                 <create permission="ADMIN_SERIAL_ITEM">
5586                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5587                                 </create>
5588                                 <retrieve permission="ADMIN_SERIAL_ITEM">
5589                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5590                                 </retrieve>
5591                                 <update permission="ADMIN_SERIAL_ITEM">
5592                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5593                                 </update>
5594                                 <delete permission="ADMIN_SERIAL_ITEM">
5595                                         <context link="item" jump="stream.distribution" field="holding_lib" />
5596                                 </delete>
5597                         </actions>
5598                 </permacrud>
5599         </class>
5600         <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">
5601                 <fields>
5602                         <field name="summary_type" reporter:label="Summary Type" reporter:datatype="text" />
5603                         <field name="id" reporter:label="Native ID" reporter:datatype="int" /><!-- not datatype="id", because id is not unique in this view -->
5604                         <field name="distribution" reporter:label="Distribution" reporter:datatype="link" />
5605                         <field name="generated_coverage" reporter:label="Generated Coverage" reporter:datatype="text" />
5606                         <field name="show_generated" reporter:label="Show Generated?" reporter:datatype="bool" />
5607                 </fields>
5608                 <links>
5609                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5610                 </links>
5611         </class>
5612         <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">
5613                 <fields oils_persist:primary="id" oils_persist:sequence="serial.materialized_holding_code_id_seq">
5614                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5615                         <field name="issuance" reporter:label="Issuance" reporter:datatype="link" />
5616                         <field name="holding_type" reporter:label="Holding Type" reporter:datatype="text" />
5617                         <field name="ind1" reporter:label="First Indicator" reporter:datatype="text" />
5618                         <field name="ind2" reporter:label="Second Indicator" reporter:datatype="text" />
5619                         <field name="subfield" reporter:label="Subfield" reporter:datatype="text" />
5620                         <field name="value" reporter:label="Value" reporter:datatype="text" oils_obj:validate="^\w$" />
5621                 </fields>
5622                 <links>
5623                         <link field="issuance" reltype="has_a" key="id" map="" class="siss"/>
5624                 </links>
5625         </class>
5626         <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">
5627                 <fields oils_persist:primary="id" oils_persist:sequence="serial.basic_summary_id_seq">
5628                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5629                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5630                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5631                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5632                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5633                 </fields>
5634                 <links>
5635                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5636                 </links>
5637                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5638                         <actions>
5639                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5640                                         <context link="distribution" field="holding_lib" />
5641                                 </create>
5642                                 <retrieve/>
5643                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5644                                         <context link="distribution" field="holding_lib" />
5645                                 </update>
5646                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5647                                         <context link="distribution" field="holding_lib" />
5648                                 </delete>
5649                         </actions>
5650                 </permacrud>
5651         </class>
5652
5653         <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">
5654                 <fields oils_persist:primary="id" oils_persist:sequence="serial.supplement_summary_id_seq">
5655                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5656                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5657                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5658                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5659                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5660                 </fields>
5661                 <links>
5662                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5663                 </links>
5664                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5665                         <actions>
5666                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5667                                         <context link="distribution" field="holding_lib" />
5668                                 </create>
5669                                 <retrieve/>
5670                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5671                                         <context link="distribution" field="holding_lib" />
5672                                 </update>
5673                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5674                                         <context link="distribution" field="holding_lib" />
5675                                 </delete>
5676                         </actions>
5677                 </permacrud>
5678         </class>
5679
5680         <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">
5681                 <fields oils_persist:primary="id" oils_persist:sequence="serial.index_summary_id_seq">
5682                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5683                         <field reporter:label="Distribution" name="distribution" reporter:datatype="link"/>
5684                         <field reporter:label="Generated Coverage" name="generated_coverage" reporter:datatype="text"/>
5685                         <field reporter:label="Textual Holdings" name="textual_holdings" reporter:datatype="text"/>
5686                         <field reporter:label="Show Generated?" name="show_generated" reporter:datatype="bool"/>
5687                 </fields>
5688                 <links>
5689                         <link field="distribution" reltype="has_a" key="id" map="" class="sdist"/>
5690                 </links>
5691                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5692                         <actions>
5693                                 <create permission="ADMIN_SERIAL_DISTRIBUTION">
5694                                         <context link="distribution" field="holding_lib" />
5695                                 </create>
5696                                 <retrieve/>
5697                                 <update permission="ADMIN_SERIAL_DISTRIBUTION">
5698                                         <context link="distribution" field="holding_lib" />
5699                                 </update>
5700                                 <delete permission="ADMIN_SERIAL_DISTRIBUTION">
5701                                         <context link="distribution" field="holding_lib" />
5702                                 </delete>
5703                         </actions>
5704                 </permacrud>
5705         </class>
5706
5707         <class id="spt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::pattern_template" oils_persist:tablename="serial.pattern_template" reporter:label="Prediction Pattern Template">
5708                 <fields oils_persist:primary="id" oils_persist:sequence="serial.pattern_template_id_seq">
5709                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5710                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
5711                         <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text" oils_obj:required="true"/>
5712                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
5713                         <field reporter:label="Share Depth" name="share_depth"  reporter:datatype="int"/>
5714                 </fields>
5715                 <links>
5716                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5717                 </links>
5718                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5719                         <actions>
5720                                 <create permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5721                                 <retrieve/>
5722                                 <update permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5723                                 <delete permission="ADMIN_SERIAL_PATTERN_TEMPLATE" context_field="owning_lib"/>
5724                         </actions>
5725                 </permacrud>
5726         </class>
5727
5728         <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">
5729                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_copy_map_id_seq">
5730                         <field name="id" reporter:datatype="id" />
5731                         <field name="owning_copy" reporter:datatype="link"/>
5732                         <field name="stat_cat" reporter:datatype="link"/>
5733                         <field name="stat_cat_entry" reporter:datatype="link"/>
5734                 </fields>
5735                 <links>
5736                         <link field="owning_copy" reltype="has_a" key="id" map="" class="acp"/>
5737                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="asce"/>
5738                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
5739                 </links>
5740                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5741                         <actions>
5742                                 <retrieve/>
5743                         </actions>
5744                 </permacrud>
5745         </class>
5746         <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">
5747                 <fields oils_persist:primary="code">
5748                         <field reporter:label="Item Type Code" name="code" reporter:selector="value" reporter:datatype="text"/>
5749                         <field reporter:label="Item Type" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5750                 </fields>
5751                 <links/>
5752         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5753             <actions>
5754                 <create permission="ADMIN_MARC_CODE" global_required="true"/>
5755                 <retrieve/>
5756                 <update permission="ADMIN_MARC_CODE" global_required="true"/>
5757                 <delete permission="ADMIN_MARC_CODE" global_required="true"/>
5758             </actions>
5759         </permacrud>
5760         </class>
5761         <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">
5762                 <fields oils_persist:primary="code">
5763                         <field reporter:label="Bib Level Code" name="code"  reporter:datatype="text"/>
5764                         <field reporter:label="Bib Level" name="value"  reporter:datatype="text" oils_persist:i18n="true"/>
5765                 </fields>
5766                 <links/>
5767         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5768             <actions>
5769                 <create permission="CREATE_MARC_CODE" global_required="true"/>
5770                 <retrieve/>
5771                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
5772                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
5773             </actions>
5774         </permacrud>
5775         </class>
5776         <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">
5777                 <fields oils_persist:primary="id" oils_persist:sequence="search.relevance_adjustment_id_seq">
5778                         <field reporter:label="ID" name="id"  reporter:datatype="id"/>
5779                         <field reporter:label="Active" name="active"  reporter:datatype="bool"/>
5780                         <field reporter:label="Index Field" name="field"  reporter:datatype="link"/>
5781                         <field reporter:label="Bump Type" name="bump_type"  reporter:datatype="text"/>
5782                         <field reporter:label="Multiplier" name="multiplier"  reporter:datatype="number"/>
5783                 </fields>
5784                 <links>
5785             <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
5786         </links>
5787         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5788             <actions>
5789                 <create permission="CREATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5790                 <retrieve permission="CREATE_RELEVANCE_ADJUSTMENT UPDATE_RELEVANCE_ADJUSTMENT DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5791                 <update permission="UPDATE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5792                 <delete permission="DELETE_RELEVANCE_ADJUSTMENT" global_required="true"/>
5793             </actions>
5794         </permacrud>
5795         </class>
5796         <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">
5797                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_id_seq">
5798                         <field name="id" reporter:datatype="id" />
5799                         <field name="name" reporter:datatype="text"/>
5800                 </fields>
5801                 <links/>
5802         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5803             <actions>
5804                 <create permission="CREATE_LASSO" global_required="true"/>
5805                 <retrieve permission="CREATE_LASSO UPDATE_LASSO DELETE_LASSO" global_required="true"/>
5806                 <update permission="UPDATE_LASSO" global_required="true"/>
5807                 <delete permission="DELETE_LASSO" global_required="true"/>
5808             </actions>
5809         </permacrud>
5810         </class>
5811         <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">
5812                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_lasso_map_id_seq">
5813                         <field name="id" reporter:datatype="id" />
5814                         <field name="lasso" reporter:datatype="link"/>
5815                         <field name="org_unit" reporter:datatype="org_unit"/>
5816                 </fields>
5817                 <links>
5818                         <link field="lasso" reltype="has_a" key="id" map="" class="lasso"/>
5819                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5820                 </links>
5821         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5822             <actions>
5823                 <create permission="CREATE_LASSO_MAP" global_required="true"/>
5824                 <retrieve permission="CREATE_LASSO_MAP UPDATE_LASSO_MAP DELETE_LASSO_MAP" global_required="true"/>
5825                 <update permission="UPDATE_LASSO_MAP" global_required="true"/>
5826                 <delete permission="DELETE_LASSO_MAP" global_required="true"/>
5827             </actions>
5828         </permacrud>
5829         </class>
5830         <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">
5831                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_adjustment_id_seq">
5832                         <field name="id" reporter:label="ID" reporter:datatype="id" />
5833                         <field name="item_circ_lib" reporter:label="Item Circ Lib" reporter:datatype="org_unit"/>
5834                         <field name="item_owning_lib" reporter:label="Item Owning Lib" reporter:datatype="org_unit"/>
5835                         <field name="hold_pickup_lib" reporter:label="Hold Pickup Lib" reporter:datatype="org_unit"/>
5836                         <field name="hold_request_lib" reporter:label="Hold Request Lib" reporter:datatype="org_unit"/>
5837                         <field name="copy_location" reporter:label="Copy Location" reporter:datatype="link"/>
5838                         <field name="circ_mod" reporter:label="Circ Modifier" reporter:datatype="link"/>
5839                         <field name="pos" reporter:label="Position" reporter:datatype="int" />
5840                         <field name="absolute_adjustment" reporter:label="Absolute adjustment?" reporter:datatype="bool" />
5841                         <field name="prox_adjustment" reporter:label="Proximity Adjustment" reporter:datatype="number" />
5842                 </fields>
5843                 <links>
5844                         <link field="item_circ_lib" reltype="has_a" key="id" map="" class="aou"/>
5845                         <link field="item_owning_lib" reltype="has_a" key="id" map="" class="aou"/>
5846                         <link field="hold_pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
5847                         <link field="hold_request_lib" reltype="has_a" key="id" map="" class="aou"/>
5848                         <link field="circ_mod" reltype="has_a" key="code" map="" class="ccm"/>
5849                         <link field="copy_location" reltype="has_a" key="id" map="" class="acpl"/>
5850                 </links>
5851         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5852             <actions>
5853                 <create permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5854                 <retrieve permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5855                 <update permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5856                 <delete permission="ADMIN_PROXIMITY_ADJUSTMENT" global_required="true"/>
5857             </actions>
5858         </permacrud>
5859         </class>
5860         <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">
5861                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5862                         <field name="id" reporter:datatype="id" />
5863                         <field name="from_org" reporter:datatype="org_unit"/>
5864                         <field name="to_org" reporter:datatype="org_unit"/>
5865                         <field name="prox" reporter:datatype="int" />
5866                 </fields>
5867                 <links>
5868                         <link field="from_org" reltype="has_a" key="id" map="" class="aou"/>
5869                         <link field="to_org" reltype="has_a" key="id" map="" class="aou"/>
5870                 </links>
5871         </class>
5872         <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">
5873                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_proximity_id_seq">
5874                         <field reporter:label="ID" name="id" reporter:datatype="id" />
5875                         <field reporter:label="Relevance" name="rel" reporter:datatype="float"/>
5876                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
5877                         <field reporter:label="Total Results" name="total" reporter:datatype="int" />
5878                         <field reporter:label="Checked" name="checked" reporter:datatype="int"/>
5879                         <field reporter:label="Visible" name="visible" reporter:datatype="int"/>
5880                         <field reporter:label="Deleted" name="deleted" reporter:datatype="int"/>
5881                         <field reporter:label="Excluded" name="excluded" reporter:datatype="int"/>
5882                 </fields>
5883                 <links/>
5884         </class>
5885         <class id="asv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::survey" oils_persist:tablename="action.survey" reporter:label="Survey">
5886                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_id_seq">
5887                         <field reporter:label="Questions" name="questions" oils_persist:virtual="true" reporter:datatype="link"/>
5888                         <field reporter:label="Responses" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
5889                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
5890                         <field reporter:label="Survey End Date/Time" name="end_date" reporter:datatype="timestamp"/>
5891                         <field reporter:label="Survey ID" name="id" reporter:datatype="id"/>
5892                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
5893                         <field reporter:label="OPAC Survey?" name="opac" reporter:datatype="bool"/>
5894                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
5895                         <field reporter:label="Poll Style?" name="poll" reporter:datatype="bool"/>
5896                         <field reporter:label="Is Required?" name="required" reporter:datatype="bool"/>
5897                         <field reporter:label="Survey Start Date/Time" name="start_date" reporter:datatype="timestamp"/>
5898                         <field reporter:label="Display in User Summary" name="usr_summary" reporter:datatype="bool"/>
5899                 </fields>
5900                 <links>
5901                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5902                         <link field="responses" reltype="has_many" key="survey" map="" class="asvr"/>
5903                         <link field="questions" reltype="has_many" key="survey" map="" class="asvq"/>
5904                 </links>
5905         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5906             <actions>
5907                 <create permission="ADMIN_SURVEY" context_field="owner"/>
5908                 <retrieve/>
5909                 <update permission="ADMIN_SURVEY" context_field="owner"/>
5910                 <delete permission="ADMIN_SURVEY" context_field="owner"/>
5911             </actions>
5912         </permacrud>
5913         </class>
5914         <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">
5915                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_address_id_seq">
5916                         <field name="address_type"  reporter:datatype="text"/>
5917                         <field name="city"  reporter:datatype="text"/>
5918                         <field name="country"  reporter:datatype="text"/>
5919                         <field name="county"  reporter:datatype="text"/>
5920                         <field name="id" reporter:datatype="id" />
5921                         <field name="org_unit" reporter:datatype="org_unit"/>
5922                         <field name="post_code"  reporter:datatype="text"/>
5923                         <field name="state"  reporter:datatype="text"/>
5924                         <field name="street1"  reporter:datatype="text"/>
5925                         <field name="street2"  reporter:datatype="text"/>
5926                         <field name="valid" reporter:datatype="bool"/>
5927                         <field name="san" reporter:datatype="text" reporter:label="SAN"/>
5928                 </fields>
5929                 <links>
5930                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
5931                 </links>
5932         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5933             <actions>
5934                 <create permission="CREATE_ORG_ADDRESS" context_field="org_unit"/>
5935                 <retrieve/>
5936                 <update permission="UPDATE_ORG_ADDRESS" context_field="org_unit"/>
5937                 <delete permission="DELETE_ORG_ADDRESS" context_field="org_unit"/>
5938             </actions>
5939         </permacrud>
5940         </class>
5941         <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">
5942                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_query_id_seq">
5943                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5944                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5945                         <field name="query_text" reporter:datatype="text"/>
5946                 </fields>
5947         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5948             <actions>
5949                 <retrieve/>
5950             </actions>
5951         </permacrud>
5952         </class>
5953
5954         <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">
5955                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_id_seq">
5956                         <field name="id" reporter:datatype="id" reporter:selector="label"/>
5957                         <field name="owner" reporter:datatype="org_unit"/>
5958                         <field name="code" reporter:datatype="text"/>
5959                         <field name="label" reporter:datatype="text" oils_persist:i18n="true"/>
5960                         <field name="create_date" reporter:datatype="timestamp"/>
5961                         <field name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
5962                 </fields>
5963                 <links>
5964                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
5965                         <link field="entries" reltype="has_many" key="grp" map="" class="asfge"/>
5966                 </links>
5967         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5968             <actions>
5969                 <create permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5970                 <retrieve/>
5971                 <update permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5972                 <delete permission="ADMIN_SEARCH_FILTER_GROUP" context_field="owner"/>
5973             </actions>
5974         </permacrud>
5975         </class>
5976         <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">
5977                 <fields oils_persist:primary="id" oils_persist:sequence="actor.search_filter_group_entry_id_seq">
5978                         <field name="id" reporter:datatype="id"/>
5979                         <field name="grp" reporter:datatype="link"/>
5980                         <field name="pos" reporter:datatype="int"/>
5981                         <field name="query" reporter:datatype="link"/>
5982                 </fields>
5983                 <links>
5984                         <link field="grp" reltype="has_a" key="id" map="" class="asfg"/>
5985                         <link field="query" reltype="has_a" key="id" map="" class="asq"/>
5986                 </links>
5987         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
5988             <actions>
5989                 <create permission="ADMIN_SEARCH_FILTER_GROUP">
5990                     <context link="grp" field="owner"/>
5991                 </create>
5992                 <retrieve/>
5993                 <update permission="ADMIN_SEARCH_FILTER_GROUP">
5994                     <context link="grp" field="owner"/>
5995                 </update>
5996                 <delete permission="ADMIN_SEARCH_FILTER_GROUP">
5997                     <context link="grp" field="owner"/>
5998                 </delete>
5999             </actions>
6000         </permacrud>
6001         </class>
6002
6003         <!-- A note: Please update alhr and ahopl when updating ahr -->
6004         <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">
6005                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6006                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6007                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6008                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6009                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6010                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6011                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6012                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6013                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6014                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6015                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6016                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6017                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6018                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6019                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6020                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6021                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6022                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6023                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6024                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6025                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6026                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6027                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6028                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6029                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6030                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6031                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6032                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6033                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6034                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6035                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6036                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6037                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6038                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6039                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6040                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6041                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6042                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6043                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6044                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6045                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6046                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6047                 </fields>
6048                 <links>
6049                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6050                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6051                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6052                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6053                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6054                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6055                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6056                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6057                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6058                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6059                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6060                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6061                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6062                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6063                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6064                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6065                 </links>
6066                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6067                         <actions>
6068                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6069                         </actions>
6070                 </permacrud>
6071         </class>
6072         <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">
6073                 <oils_persist:source_definition><![CDATA[
6074                 SELECT
6075                         ahr.*,
6076                         COALESCE(acplo.position, acpl_ordered.fallback_position) AS
6077                                 copy_location_order_position,
6078                         CASE WHEN au.alias IS NOT NULL THEN
6079                                 au.alias
6080                         ELSE
6081                                 au.first_given_name
6082                         END AS usr_alias_or_first_given_name,
6083                         au.first_given_name AS usr_first_given_name,
6084                         au.second_given_name AS usr_second_given_name,
6085                         au.family_name AS usr_family_name,
6086                         au.prefix AS usr_prefix,
6087                         au.suffix AS usr_suffix,
6088                         au.alias AS usr_alias,
6089                         CASE WHEN au.alias IS NOT NULL THEN
6090                                 au.alias
6091                         ELSE
6092                                 REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6093                                         COALESCE(au.family_name, ''),
6094                                         COALESCE(au.suffix, ''),
6095                                         ', ',
6096                                         COALESCE(au.prefix, ''),
6097                                         COALESCE(au.first_given_name, ''),
6098                                         COALESCE(au.second_given_name, '')
6099                                 ], ' '), E'\\s+,', ',')
6100                         END AS usr_alias_or_display_name,
6101                         REGEXP_REPLACE(ARRAY_TO_STRING(ARRAY[
6102                                 COALESCE(au.family_name, ''),
6103                                 COALESCE(au.suffix, ''),
6104                                 ', ',
6105                                 COALESCE(au.prefix, ''),
6106                                 COALESCE(au.first_given_name, ''),
6107                                 COALESCE(au.second_given_name, '')
6108                         ], ' '), E'\\s+,', ',') AS usr_display_name,
6109                         TRIM(acnp.label || ' ' || acn.label || ' ' || acns.label)
6110                                 AS call_number_label,
6111                         siss.label AS issuance_label,
6112                         (ahr.usr <> ahr.requestor) AS is_staff_hold,
6113                         ahcm_1.copy_count AS potential_copies
6114                 FROM action.hold_request ahr
6115                 JOIN asset.copy acp ON (acp.id = ahr.current_copy)
6116                 JOIN asset.call_number acn ON (acp.call_number = acn.id)
6117                 JOIN asset.call_number_prefix acnp ON (acn.prefix = acnp.id)
6118                 JOIN asset.call_number_suffix acns ON (acn.suffix = acns.id)
6119                 JOIN actor.usr au ON (au.id = ahr.usr)
6120                 JOIN (
6121                         SELECT *, (ROW_NUMBER() OVER (ORDER BY name) + 1000000) AS fallback_position
6122                         FROM asset.copy_location
6123                 ) acpl_ordered ON (acpl_ordered.id = acp.location)
6124                 LEFT JOIN actor.usr_standing_penalty ausp 
6125                         ON (ahr.usr = ausp.usr AND (ausp.stop_date IS NULL OR ausp.stop_date > NOW()))
6126                 LEFT JOIN config.standing_penalty csp
6127                         ON (
6128                                 csp.id = ausp.standing_penalty AND 
6129                                 csp.block_list LIKE '%CAPTURE%' AND (
6130                                         (csp.org_depth IS NULL AND ahr.pickup_lib = ausp.org_unit) OR
6131                                         (csp.org_depth IS NOT NULL AND ahr.pickup_lib IN (
6132                                                 SELECT id FROM actor.org_unit_descendants(ausp.org_unit, csp.org_depth))
6133                                         )
6134                                 )
6135                         )
6136                 JOIN (
6137                         SELECT COUNT(target_copy) AS copy_count, hold
6138                         FROM action.hold_copy_map
6139                         GROUP BY 2
6140                 ) ahcm_1 ON (ahcm_1.hold = ahr.id)
6141                 LEFT JOIN serial.issuance siss
6142                         ON (ahr.hold_type = 'I' AND siss.id = ahr.target)
6143                 LEFT JOIN asset.copy_location_order acplo
6144                         ON (acp.location = acplo.location AND
6145                                 acp.circ_lib = acplo.org)
6146                 WHERE
6147                         ahr.capture_time IS NULL AND
6148                         ahr.cancel_time IS NULL AND
6149                         csp.id IS NULL AND
6150                         (ahr.expire_time is NULL OR ahr.expire_time > NOW()) AND
6151                         acp.status IN (0,7)
6152                 ]]></oils_persist:source_definition>
6153                 <fields oils_persist:primary="id">
6154                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6155                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6156                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6157                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6158                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6159                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6160                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6161                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6162                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6163                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6164                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6165                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6166                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6167                         <field reporter:label="Notifications SMS Number" name="sms_notify" reporter:datatype="text"/>
6168                         <field reporter:label="Notifications SMS Carrier" name="sms_carrier" reporter:datatype="link"/>
6169                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6170                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6171                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6172                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6173                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6174                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6175                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6176                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6177                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6178                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6179                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6180                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6181                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6182                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6183                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6184                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6185                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6186                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6187                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6188                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6189                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6190                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6191                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6192                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6193                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6194                         <field reporter:label="Copy Location Sort Order" name="copy_location_order_position" reporter:datatype="int" />
6195                         <field reporter:label="User First Given Name" name="usr_first_given_name" reporter:datatype="text" />
6196                         <field reporter:label="User Second Given Name" name="usr_second_given_name" reporter:datatype="text" />
6197                         <field reporter:label="User Family Name" name="usr_family_name" reporter:datatype="text" />
6198                         <field reporter:label="User Prefix" name="usr_prefix" reporter:datatype="text" />
6199                         <field reporter:label="User Suffix" name="usr_suffix" reporter:datatype="text" />
6200                         <field reporter:label="User Alias or First Given Name" name="usr_alias_or_first_given_name" reporter:datatype="text" />
6201                         <field reporter:label="User Display Name" name="usr_display_name" reporter:datatype="text" />
6202                         <field reporter:label="User Alias or Display Name" name="usr_alias_or_display_name" reporter:datatype="text" />
6203                         <field reporter:label="User Alias" name="usr_alias" reporter:datatype="text" />
6204                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text" />
6205                         <field reporter:label="Issuance Label" name="issuance_label" reporter:datatype="text" />
6206                         <field reporter:label="Is Staff Hold?" name="is_staff_hold" reporter:datatype="bool" />
6207                         <field reporter:label="Potential Copies" name="potential_copies" reporter:datatype="int" />
6208                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6209                 </fields>
6210                 <links>
6211                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6212                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6213                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6214                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6215                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6216                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6217                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6218                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6219                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6220                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6221                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6222                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6223                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6224                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6225                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6226                         <link field="sms_carrier" reltype="has_a" key="id" map="" class="csc"/>
6227                 </links>
6228                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6229                         <actions>
6230                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6231                         </actions>
6232                 </permacrud>
6233         </class>
6234         <class id="alhr" controller="open-ils.cstore" oils_obj:fieldmapper="action::last_hold_request" reporter:label="Last Captured Hold Request" oils_persist:readonly="true">
6235                 <oils_persist:source_definition>
6236                         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)
6237                 </oils_persist:source_definition>
6238                 <fields oils_persist:primary="id">
6239                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6240                         <field reporter:label="Transit" name="transit" oils_persist:virtual="true" />
6241                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6242                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6243                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6244                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6245                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6246                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6247                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6248                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6249                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6250                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6251                         <field reporter:label="Notifications Phone Number" name="phone_notify" reporter:datatype="text"/>
6252                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6253                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6254                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6255                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6256                         <field reporter:label="Requesting User" name="requestor" reporter:datatype="link"/>
6257                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6258                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6259                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6260                         <field reporter:label="Hold User" name="usr" reporter:datatype="link"/>
6261                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6262                         <field reporter:label="Notify Time" name="notify_time" oils_persist:virtual="true" reporter:datatype="timestamp"/>
6263                         <field reporter:label="Notify Count" name="notify_count" oils_persist:virtual="true" reporter:datatype="int" />
6264                         <field reporter:label="Notifications" name="notifications" oils_persist:virtual="true" reporter:datatype="link"/>
6265                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6266                         <field reporter:label="Eligible Copies" name="eligible_copies" oils_persist:virtual="true" reporter:datatype="link"/>
6267                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6268                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6269                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6270                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6271                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6272                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6273                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6274                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6275                         <field reporter:label="Notes" name="notes" reporter:datatype="link" oils_persist:virtual="true"/>
6276                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6277                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6278                 </fields>
6279                 <links>
6280                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6281                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6282                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6283                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6284                         <link field="requestor" reltype="has_a" key="id" map="" class="au"/>
6285                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6286                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6287                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6288                         <link field="transit" reltype="might_have" key="hold" map="" class="ahtc"/>
6289                         <link field="notifications" reltype="has_many" key="hold" map="" class="ahn"/>
6290                         <link field="eligible_copies" reltype="has_many" key="hold" map="target_copy" class="ahcm"/>
6291                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6292                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6293                         <link field="notes" reltype="has_many" key="hold" map="" class="ahrn"/>
6294                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6295                 </links>
6296         </class>
6297
6298         <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">
6299                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_note_id_seq">
6300                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6301                         <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
6302                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
6303                         <field reporter:label="Body" name="body" reporter:datatype="text"/>
6304                         <field reporter:label="Slip?" name="slip" reporter:datatype="bool"/>
6305                         <field reporter:label="Pub?" name="pub" reporter:datatype="bool"/>
6306                         <field reporter:label="Staff?" name="staff" reporter:datatype="bool"/>
6307                 </fields>
6308                 <links>
6309                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
6310                 </links>
6311                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6312                         <actions>
6313                                 <create permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></create>
6314                                 <retrieve permission="VIEW_USER"><context link="hold" field="request_lib"/></retrieve>
6315                                 <update permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></update>
6316                                 <delete permission="UPDATE_HOLD"><context link="hold" field="request_lib"/></delete>
6317                         </actions>
6318                 </permacrud>
6319         </class>
6320         <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">
6321                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6322                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6323                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6324                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6325                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6326                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6327                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6328                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6329                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6330                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6331                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6332                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6333                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6334                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6335                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6336                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6337                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6338                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6339                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6340                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6341                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6342                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6343                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6344                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6345                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6346                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6347                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6348                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6349                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6350                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6351                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6352                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6353                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6354                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6355                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6356                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6357                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6358                         <field reporter:label="Behind Desk" name="behind_desk" reporter:datatype="bool"/>
6359                 </fields>
6360                 <links>
6361                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6362                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6363                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6364                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6365                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6366                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6367                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6368                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6369                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6370                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6371                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6372                 </links>
6373                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6374                         <actions>
6375                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6376                         </actions>
6377                 </permacrud>
6378         </class>
6379         <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">
6380                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_id_seq">
6381                         <field reporter:label="Status" name="status" oils_persist:virtual="true" />
6382                         <field reporter:label="Capture Date/Time" name="capture_time" reporter:datatype="timestamp"/>
6383                         <field reporter:label="Currently Targeted Copy" name="current_copy" reporter:datatype="link"/>
6384                         <field reporter:label="Notify by Email?" name="email_notify" reporter:datatype="bool"/>
6385                         <field reporter:label="Hold Expire Date/Time" name="expire_time" reporter:datatype="timestamp"/>
6386                         <field reporter:label="Fulfilling Library" name="fulfillment_lib" reporter:datatype="org_unit"/>
6387                         <field reporter:label="Fulfilling Staff" name="fulfillment_staff" />
6388                         <field reporter:label="Fulfillment Date/Time" name="fulfillment_time" reporter:datatype="timestamp"/>
6389                         <field reporter:label="Hold Type" name="hold_type" reporter:datatype="text"/>
6390                         <field reporter:label="Holdable Formats (for M-type hold)" name="holdable_formats" reporter:datatype="text"/>
6391                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
6392                         <field reporter:label="Notify by Phone?" name="phone_notify" reporter:datatype="bool"/>
6393                         <field reporter:label="Notify by SMS?" name="sms_notify" reporter:datatype="bool"/>
6394                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
6395                         <field reporter:label="Last Targeting Date/Time" name="prev_check_time" reporter:datatype="timestamp"/>
6396                         <field reporter:label="Requesting Library" name="request_lib" reporter:datatype="org_unit"/>
6397                         <field reporter:label="Request Date/Time" name="request_time" reporter:datatype="timestamp"/>
6398                         <field reporter:label="Patron ZIP" name="usr_post_code" reporter:datatype="text"/>
6399                         <field reporter:label="Patron Home Library" name="usr_home_ou" reporter:datatype="link"/>
6400                         <field reporter:label="Patron Profile Group" name="usr_profile" reporter:datatype="link"/>
6401                         <field reporter:label="Patron Birth Year" name="usr_birth_year" reporter:datatype="int"/>
6402                         <field reporter:label="Staff Placed?" name="staff_placed" reporter:datatype="bool"/>
6403                         <field reporter:label="Item Selection Depth" name="selection_depth" />
6404                         <field reporter:label="Selection Locus" name="selection_ou" reporter:datatype="org_unit"/>
6405                         <field reporter:label="Target Object ID" name="target" reporter:datatype="link"/>
6406                         <field reporter:label="Hold Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
6407                         <field reporter:label="Bib Record link" name="bib_rec" oils_persist:virtual="true" reporter:datatype="link"/>
6408                         <field reporter:label="Currently Frozen" name="frozen" reporter:datatype="bool"/>
6409                         <field reporter:label="Activation Date" name="thaw_date" reporter:datatype="timestamp"/>
6410                         <field reporter:label="Shelf Time" name="shelf_time" reporter:datatype="timestamp"/>
6411                         <field reporter:label="Cancelation cause" name="cancel_cause" reporter:datatype="link" />
6412                         <field reporter:label="Cancelation note" name="cancel_note" reporter:datatype="text" />
6413                         <field reporter:label="Top of Queue" name="cut_in_line" reporter:datatype="bool" />
6414                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool" />
6415                         <field reporter:label="Shelf Expire Time" name="shelf_expire_time" reporter:datatype="timestamp"/>
6416                         <field reporter:label="Current Shelf Lib" name="current_shelf_lib" reporter:datatype="org_unit"/>
6417                 </fields>
6418                 <links>
6419                         <link field="fulfillment_lib" reltype="has_a" key="id" map="" class="aou"/>
6420                         <link field="fulfillment_staff" reltype="has_a" key="id" map="" class="au"/>
6421                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
6422                         <link field="selection_ou" reltype="has_a" key="id" map="" class="aou"/>
6423                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
6424                         <link field="request_lib" reltype="has_a" key="id" map="" class="aou"/>
6425                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
6426                         <link field="bib_rec" reltype="might_have" key="id" map="" class="rhrr"/>
6427                         <link field="cancel_cause" reltype="might_have" key="id" map="" class="ahrcc"/>
6428                         <link field="current_shelf_lib" reltype="has_a" key="id" map="" class="aou"/>
6429                         <link field="usr_profile" reltype="has_a" key="id" map="" class="pgt"/>
6430                 </links>
6431                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6432                         <actions>
6433                                 <retrieve permission="VIEW_HOLD" context_field="pickup_lib" />
6434                         </actions>
6435                 </permacrud>
6436         </class>
6437
6438         <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">
6439                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_id_seq">
6440                         <field reporter:label="Subordinate Organizational Units" name="children" oils_persist:virtual="true" reporter:datatype="org_unit"/>
6441                         <field reporter:label="Billing Address" name="billing_address" reporter:datatype="link"/>
6442                         <field reporter:label="Holds Receiving Address" name="holds_address" reporter:datatype="link"/>
6443                         <field reporter:label="Organizational Unit ID" name="id" reporter:datatype="org_unit" reporter:selector="shortname"/>
6444                         <field reporter:label="ILL Receiving Address" name="ill_address" reporter:datatype="link"/>
6445                         <field reporter:label="Mailing Address" name="mailing_address" reporter:datatype="link"/>
6446                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6447                         <field reporter:label="Organizational Unit Type" name="ou_type" reporter:datatype="link"/>
6448                         <field reporter:label="Parent Organizational Unit" name="parent_ou" reporter:datatype="link"/>
6449                         <field reporter:label="Short (Policy) Name" name="shortname" reporter:datatype="text" oils_obj:required="true" oils_obj:validate="^.+$"/>
6450                         <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
6451                         <field reporter:label="Phone Number" name="phone" reporter:datatype="text"/>
6452                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6453                         <field reporter:label="Fiscal Calendar" name="fiscal_calendar" reporter:datatype="link"/>
6454                         <field reporter:label="Users" name="users" oils_persist:virtual="true" reporter:datatype="link"/>
6455                         <field reporter:label="Closed Dates" name="closed_dates" oils_persist:virtual="true" reporter:datatype="link"/>
6456                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
6457                         <field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
6458                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
6459                         <field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
6460                         <field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
6461                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
6462                         <field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
6463                         <field reporter:label="Transit Copy Prev Destinations" name="atc_prev_dests" oils_persist:virtual="true" reporter:datatype="link"/>
6464                         <field reporter:label="Reservation Requests" name="resv_requests" oils_persist:virtual="true" reporter:datatype="link"/>
6465                         <field reporter:label="Reservation Pickups" name="resv_pickups" oils_persist:virtual="true" reporter:datatype="link"/>
6466                         <field reporter:label="Resource Types" name="rsrc_types" oils_persist:virtual="true" reporter:datatype="link"/>
6467                         <field reporter:label="Resources" name="resources" oils_persist:virtual="true" reporter:datatype="link"/>
6468                         <field reporter:label="Resource Attributes" name="rsrc_attrs" oils_persist:virtual="true" reporter:datatype="link"/>
6469                         <field reporter:label="Attribute Values" name="attr_vals" oils_persist:virtual="true" reporter:datatype="link"/>
6470                         <field reporter:label="Hours of Operation" name="hours_of_operation" oils_persist:virtual="true" reporter:datatype="link"/>
6471                 </fields>
6472                 <links>
6473                         <link field="billing_address" reltype="has_a" key="id" map="" class="aoa"/>
6474                         <link field="holds_address" reltype="has_a" key="id" map="" class="aoa"/>
6475                         <link field="ou_type" reltype="has_a" key="id" map="" class="aout"/>
6476                         <link field="mailing_address" reltype="has_a" key="id" map="" class="aoa"/>
6477                         <link field="parent_ou" reltype="has_a" key="id" map="" class="aou"/>
6478                         <link field="ill_address" reltype="has_a" key="id" map="" class="aoa"/>
6479                         <link field="fiscal_calendar" reltype="has_a" key="id" map="" class="acqfc"/>
6480                         <link field="users" reltype="has_many" key="home_ou" map="" class="au"/>
6481                         <link field="closed_dates" reltype="has_many" key="org_unit" map="" class="aoucd"/>
6482                         <link field="children" reltype="has_many" key="parent_ou" map="" class="aou"/>
6483                         <link field="circulations" reltype="has_many" key="circ_lib" map="" class="circ"/>
6484                         <link field="settings" reltype="has_many" key="org_unit" map="" class="aous"/>
6485                         <link field="addresses" reltype="has_many" key="org_unit" map="" class="aoa"/>
6486                         <link field="checkins" reltype="has_many" key="checkin_lib" map="" class="circ"/>
6487                         <link field="workstations" reltype="has_many" key="owning_lib" map="" class="aws"/>
6488                         <link field="fund_alloc_pcts" reltype="has_many" key="org" map="" class="acqfap"/>
6489                         <link field="copy_location_orders" reltype="has_many" key="org" map="" class="acplo"/>
6490                         <link field="atc_prev_dests" reltype="has_many" key="prev_dest" map="" class="atc"/>
6491                         <link field="resv_requests" reltype="has_many" key="request_lib" map="" class="bresv"/>
6492                         <link field="resv_pickups" reltype="has_many" key="pickup_lib" map="" class="bresv"/>
6493                         <link field="rsrc_types" reltype="has_many" key="owner" map="" class="brt"/>
6494                         <link field="resources" reltype="has_many" key="owner" map="" class="brsrc"/>
6495                         <link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
6496                         <link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
6497                         <link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
6498                 </links>
6499         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6500             <actions>
6501                 <create permission="CREATE_ORG_UNIT" context_field="parent_ou"/>
6502                 <retrieve />
6503                 <update permission="UPDATE_ORG_UNIT" context_field="id"/>
6504                 <delete permission="DELETE_ORG_UNIT" context_field="parent_ou"/>
6505             </actions>
6506         </permacrud>
6507         </class>
6508         <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">
6509                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
6510                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6511                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
6512                         <field reporter:label="Purpose" name="purpose" reporter:datatype="text"/>
6513                 </fields>
6514                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6515                         <actions>
6516                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6517                                 <retrieve/>
6518                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6519                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6520                         </actions>
6521                 </permacrud>
6522         </class>
6523         <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">
6524                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_node_id_seq">
6525                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
6526                         <field reporter:label="Tree" name="tree" reporter:datatype="link"/>
6527                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
6528                         <field reporter:label="Parent" name="parent_node" reporter:datatype="link"/>
6529                         <field reporter:label="Sibling Sort Order" name="sibling_order" reporter:datatype="int"/>
6530                         <field reporter:label="Children" name="children" reporter:datatype="link" oils_persist:virtual="true" />
6531                 </fields>
6532                 <links>
6533                         <link field="tree" reltype="has_a" key="id" map="" class="aouct"/>
6534                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
6535                         <link field="parent_node" reltype="has_a" key="id" map="" class="aouctn"/>
6536                         <link field="children" reltype="has_many" key="parent_node" map="" class="aouctn"/>
6537                 </links>
6538                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6539                         <actions>
6540                                 <create permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6541                                 <retrieve/>
6542                                 <update permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6543                                 <delete permission="ADMIN_ORG_UNIT_CUSTOM_TREE" global_required="true" />
6544                         </actions>
6545                 </permacrud>
6546         </class>
6547         <class id="ccnb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::call_number_bucket" oils_persist:tablename="container.call_number_bucket" reporter:label="Call Number Bucket">
6548                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_id_seq">
6549                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6550                         <field name="btype" reporter:datatype="text"/>
6551                         <field name="id" reporter:datatype="id" />
6552                         <field name="name"  reporter:datatype="text"/>
6553                         <field name="description" reporter:datatype="text"/>
6554                         <field name="owner" reporter:datatype="link"/>
6555                         <field name="pub" reporter:datatype="bool"/>
6556                         <field name="create_time" reporter:datatype="timestamp" />
6557                         <field name="owning_lib" reporter:datatype="org_unit" />
6558                 </fields>
6559                 <links>
6560                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6561                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6562                         <link field="items" reltype="has_many" key="bucket" map="" class="ccnbi"/>
6563                 </links>
6564                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6565                         <actions>
6566                                 <create permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6567                                 <retrieve permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6568                                 <update permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6569                                 <delete permission="CREATE_CALLNUMBER_BUCKET ADMIN_CALLNUMBER_BUCKET" context="owning_lib" owning_user="owner"/>
6570                         </actions>
6571                 </permacrud>
6572         </class>
6573         <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">
6574                 <fields oils_persist:primary="id" oils_persist:sequence="container.call_number_bucket_note_id_seq">
6575                         <field name="id" reporter:datatype="id" />
6576                         <field name="bucket" reporter:datatype="link"/>
6577                         <field name="note" reporter:datatype="text" />
6578                 </fields>
6579                 <links>
6580                         <link field="bucket" reltype="has_a" key="id" map="" class="ccnb"/>
6581                 </links>
6582         </class>
6583         <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">
6584                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_id_seq">
6585                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6586                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6587                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6588                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6589                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6590                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6591                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6592                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6593                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6594                 </fields>
6595                 <links>
6596                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6597                         <link field="sip_field" reltype="has_a" key="field" map="" class="ascsf"/>
6598                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="asce"/>
6599                 </links>
6600                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6601                         <actions>
6602                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
6603                         </actions>
6604                 </permacrud>
6605         </class>
6606         <class id="ac" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::card" oils_persist:tablename="actor.card" reporter:label="Library Card">
6607                 <fields oils_persist:primary="id" oils_persist:sequence="actor.card_id_seq">
6608                         <field reporter:label="IsActive?" name="active" reporter:datatype="bool"/>
6609                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
6610                         <field reporter:label="Card ID" name="id" reporter:datatype="id" />
6611                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6612                 </fields>
6613                 <links>
6614                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6615                 </links>
6616                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6617                         <actions>
6618                                 <retrieve permission="VIEW_USER">
6619                                         <context link="usr" field="home_ou" />
6620                                 </retrieve>
6621                         </actions>
6622                 </permacrud>
6623         </class>
6624     <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">
6625         <fields oils_persist:primary="field">
6626             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
6627             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
6628             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
6629         </fields>
6630         <links/>
6631         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6632             <actions>
6633                 <create permission="CREATE_PATRON_STAT_CAT" global_required="true"/>
6634                 <retrieve />
6635                 <update permission="UPDATE_PATRON_STAT_CAT" global_required="true"/>
6636                 <delete permission="DELETE_PATRON_STAT_CAT" global_required="true"/>
6637             </actions>
6638         </permacrud>
6639     </class>
6640         <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">
6641                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
6642                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
6643                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6644                         <field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
6645                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
6646                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
6647                         <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
6648                         <field reporter:label="User Summary" name="usr_summary" reporter:datatype="bool"/>
6649                         <field reporter:label="SIP Field" name="sip_field" reporter:datatype="link"/>
6650                         <field reporter:label="SIP Format" name="sip_format" reporter:datatype="text"/>
6651                         <field reporter:label="Checkout Archive" name="checkout_archive" reporter:datatype="bool"/>
6652                         <field reporter:label="Required" name="required" reporter:datatype="bool"/>
6653                         <field reporter:label="Free Text" name="allow_freetext" reporter:datatype="bool"/>
6654                 </fields>
6655                 <links>
6656                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6657                         <link field="sip_field" reltype="has_a" key="field" map="" class="actscsf"/>
6658                         <link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
6659                         <link field="default_entries" reltype="has_many" key="stat_cat" map="" class="actsced"/>
6660                 </links>
6661         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6662             <actions>
6663                 <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
6664                 <retrieve />
6665                 <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
6666                 <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
6667             </actions>
6668         </permacrud>
6669         </class>
6670         <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">
6671                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">
6672                         <field name="field" reporter:datatype="link"/>
6673                         <field name="id" reporter:datatype="id" />
6674                         <field name="source" reporter:datatype="link"/>
6675                         <field name="value"  reporter:datatype="text"/>
6676                 </fields>
6677                 <links>
6678                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
6679                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
6680                 </links>
6681         </class>
6682         <class id="cub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket" oils_persist:tablename="container.user_bucket" reporter:label="User Bucket">
6683                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_id_seq">
6684                         <field name="items" oils_persist:virtual="true" reporter:datatype="link"/>
6685                         <field name="btype" reporter:datatype="text"/>
6686                         <field name="id" reporter:datatype="id" />
6687                         <field name="name"  reporter:datatype="text"/>
6688                         <field name="description" reporter:datatype="text"/>
6689                         <field name="owner" reporter:datatype="link"/>
6690                         <field name="pub" reporter:datatype="bool"/>
6691                         <field name="create_time" reporter:datatype="timestamp" />
6692                         <field name="owning_lib" reporter:datatype="org_unit" />
6693                 </fields>
6694                 <links>
6695                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6696                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
6697                         <link field="items" reltype="has_many" key="bucket" map="" class="cubi"/>
6698                 </links>
6699                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6700                         <actions>
6701                                 <create permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6702                                 <retrieve permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6703                                 <update permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6704                                 <delete permission="CREATE_USER_BUCKET ADMIN_USER_BUCKET" context="owning_lib" owning_user="owner"/>
6705                         </actions>
6706                 </permacrud>
6707         </class>
6708         <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">
6709                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_note_id_seq">
6710                         <field name="id" reporter:datatype="id" />
6711                         <field name="bucket" reporter:datatype="link"/>
6712                         <field name="note" reporter:datatype="text" />
6713                 </fields>
6714                 <links>
6715                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6716                 </links>
6717         </class>
6718         <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">
6719                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
6720                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
6721                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
6722                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
6723                         <field reporter:label="Pyament ID" name="id" reporter:datatype="id" />
6724                         <field reporter:label="Payment Note" name="note"  reporter:datatype="text"/>
6725                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
6726                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
6727                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true"  reporter:datatype="text"/>
6728                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
6729                 </fields>
6730                 <links>
6731                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
6732                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
6733                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
6734                 </links>
6735         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6736             <actions>
6737                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6738                     <context link="xact" jump="usr" field="home_ou"/>
6739                 </retrieve>
6740                         </actions>
6741                 </permacrud>
6742         </class>
6743         <class id="afr" controller="open-ils.cstore" oils_obj:fieldmapper="authority::full_rec" oils_persist:tablename="authority.full_rec" reporter:label="Full Authority Record">
6744                 <fields oils_persist:primary="id" oils_persist:sequence="authority.full_rec_id_seq">
6745                         <field name="id" reporter:datatype="id" />
6746                         <field name="ind1" />
6747                         <field name="ind2" />
6748                         <field name="record" />
6749                         <field name="subfield" />
6750                         <field name="tag" />
6751                         <field name="value" />
6752                 </fields>
6753                 <links>
6754                         <link field="record" reltype="has_a" key="id" map="" class="are"/>
6755                 </links>
6756         </class>
6757         <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">
6758                 <fields oils_persist:primary="id" oils_persist:sequence="authority.authority_linking_id_seq">
6759                         <field name="id" reporter:label="ID" reporter:datatype="id" />
6760                         <field name="source" reporter:label="Source Record" reporter:datatype="link" />
6761                         <field name="target" reporter:label="Target Record" reporter:datatype="link" />
6762                         <field name="field" reporter:label="Authority Field" reporter:datatype="link" />
6763                 </fields>
6764                 <links>
6765                         <link field="source" reltype="has_a" key="id" map="" class="are"/>
6766                         <link field="target" reltype="has_a" key="id" map="" class="are"/>
6767                         <link field="field" reltype="has_a" key="id" map="" class="acsaf"/>
6768                 </links>
6769         </class>
6770         <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">
6771                 <fields oils_persist:primary="id" oils_persist:sequence="config.non_cataloged_type_id_seq">
6772                         <field reporter:label="Circulation Duration" name="circ_duration" reporter:datatype="interval"/>
6773                         <field reporter:label="Non-cat Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6774                         <field reporter:label="In House?" name="in_house" reporter:datatype="bool"/>
6775                         <field reporter:label="Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6776                         <field reporter:label="Owning Library" name="owning_lib"  reporter:datatype="org_unit"/>
6777                 </fields>
6778                 <links>
6779                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
6780                 </links>
6781         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6782             <actions>
6783                 <create permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6784                 <retrieve/>
6785                 <update permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6786                 <delete permission="CREATE_NON_CAT_TYPE" context_field="owning_lib"/>
6787             </actions>
6788         </permacrud>
6789
6790         </class>
6791         <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">
6792                 <fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_type_id_seq">
6793                         <field reporter:label="Subordinate Types" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
6794                         <field reporter:label="Can Have Users?" name="can_have_users" reporter:datatype="bool"/>
6795                         <field reporter:label="Can Have Volumes?" name="can_have_vols" reporter:datatype="bool"/>
6796                         <field reporter:label="Type Depth" name="depth" reporter:datatype="int" />
6797                         <field reporter:label="Type ID" name="id" reporter:selector="name" reporter:datatype="id"/>
6798                         <field reporter:label="Type Name" name="name"  reporter:datatype="text" oils_persist:i18n="true"/>
6799                         <field reporter:label="OPAC Label" name="opac_label"  reporter:datatype="text" oils_persist:i18n="true"/>
6800                         <field reporter:label="Parent Type" name="parent" reporter:datatype="link"/>
6801                         <field reporter:label="Org Units" name="org_units" oils_persist:virtual="true"  reporter:datatype="org_unit"/>
6802                 </fields>
6803                 <links>
6804                         <link field="parent" reltype="has_a" key="id" map="" class="aout"/>
6805                         <link field="children" reltype="has_many" key="parent" map="" class="aout"/>
6806                         <link field="org_units" reltype="has_many" key="ou_type" map="" class="aou"/>
6807                 </links>
6808         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6809             <actions>
6810                 <create permission="CREATE_ORG_TYPE" global_required="true"/>
6811                 <retrieve/>
6812                 <update permission="UPDATE_ORG_TYPE" global_required="true"/>
6813                 <delete permission="DELETE_ORG_TYPE" global_required="true"/>
6814             </actions>
6815         </permacrud>
6816         </class>
6817         <class id="bren" controller="open-ils.cstore" oils_obj:fieldmapper="biblio::record_note" oils_persist:tablename="biblio.record_note" reporter:label="Bib Record Note">
6818                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_note_id_seq">
6819                         <field name="create_date" reporter:datatype="timestamp"/>
6820                         <field name="creator" reporter:datatype="link"/>
6821                         <field name="edit_date" reporter:datatype="timestamp"/>
6822                         <field name="editor" reporter:datatype="link"/>
6823                         <field name="id" reporter:datatype="id" />
6824                         <field name="pub" reporter:datatype="bool"/>
6825                         <field name="record" reporter:datatype="link"/>
6826                         <field name="value"  reporter:datatype="text"/>
6827                 </fields>
6828                 <links>
6829                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
6830                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
6831                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
6832                 </links>
6833         </class>
6834         <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">
6835                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6836                         <field name="balance_owed" reporter:datatype="money" />
6837                         <field name="total_owed" reporter:datatype="money" />
6838                         <field name="total_paid" reporter:datatype="money" />
6839                         <field name="usr" reporter:datatype="link"/>
6840                 </fields>
6841                 <links>
6842                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6843                 </links>
6844         </class>
6845     <class id="mg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::grocery" oils_persist:tablename="money.grocery" reporter:label="Grocery Transaction">
6846                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6847                         <field reporter:label="Billing Location" name="billing_location" reporter:datatype="link"/>
6848                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6849                         <field reporter:label="Note" name="note"  reporter:datatype="text"/>
6850                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6851                         <field reporter:label="Transaction Finish Timestamp" name="xact_finish" reporter:datatype="timestamp" />
6852                         <field reporter:label="Transaction Start Timestamp" name="xact_start" reporter:datatype="timestamp" />
6853                         <field reporter:label="Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6854                         <field reporter:label="Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6855                         <field reporter:label="Billable Transaction link" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
6856                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6857                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6858                 </fields>
6859                 <links>
6860                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6861                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
6862                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6863                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6864                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
6865                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6866                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6867                 </links>
6868         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6869             <actions>
6870                 <retrieve permission="VIEW_USER_TRANSACTIONS" context_field="billing_location"/>
6871             </actions>
6872         </permacrud>
6873         </class>
6874         <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">
6875                 <fields oils_persist:primary="id" oils_persist:sequence="config.bib_source_id_seq">
6876                         <field name="id" reporter:selector="source" reporter:datatype="id"/>
6877                         <field name="quality" reporter:datatype="int" />
6878                         <field name="source" reporter:datatype="text"/>
6879                         <field name="transcendant" reporter:datatype="bool"/>
6880                         <field name="can_have_copies" reporter:datatype="bool"/>
6881                 </fields>
6882                 <links/>
6883         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6884             <actions>
6885                 <create permission="CREATE_BIB_SOURCE" global_required="true"/>
6886                 <retrieve/>
6887                 <update permission="UPDATE_BIB_SOURCE" global_required="true"/>
6888                 <delete permission="DELETE_BIB_SOURCE" global_required="true"/>
6889             </actions>
6890         </permacrud>
6891         </class>
6892         <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">
6893                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
6894                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
6895                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
6896                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
6897                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
6898                         <field reporter:label="Unrecovered Debt" name="unrecovered" reporter:datatype="bool"/>
6899                         <field reporter:label="Grocery Billing link" name="grocery" oils_persist:virtual="true" reporter:datatype="link"/>
6900                         <field reporter:label="Circulation Billing link" name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
6901                         <field reporter:label="Billing Line Items" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
6902                         <field reporter:label="Payment Line Items" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
6903                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="money"/>
6904                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="money"/>
6905                         <field reporter:label="Payment Summary" name="summary" oils_persist:virtual="true" reporter:datatype="link"/>
6906                 </fields>
6907                 <links>
6908                         <link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
6909                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
6910                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6911                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
6912                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
6913                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
6914                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
6915                         <link field="summary" reltype="might_have" key="id" map="" class="mbts"/>
6916                 </links>
6917                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6918                         <actions>
6919                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
6920                                         <context link="usr" field="home_ou" />
6921                                 </retrieve>
6922                         </actions>
6923                 </permacrud>
6924         </class>
6925         <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">
6926                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_id_seq">
6927                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
6928                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
6929                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6930                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
6931                         <field reporter:label="Default Entries" name="default_entries" oils_persist:virtual="true" reporter:datatype="link"/>
6932                 </fields>
6933                 <links>
6934                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6935                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6936                         <link field="default_entries" reltype="has_many" key="stat_cat_entry" map="" class="actsced"/>
6937                 </links>
6938         </class>
6939         <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">
6940                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_default_id_seq">
6941                         <field reporter:label="Default Entry ID" name="id" reporter:datatype="id" />
6942                         <field reporter:label="Default Entry Value" name="stat_cat_entry" reporter:datatype="link"/>
6943                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
6944                         <field reporter:label="Default for Owner" name="owner" reporter:datatype="link"/>
6945                 </fields>
6946                 <links>
6947                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
6948                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
6949                         <link field="stat_cat_entry" reltype="has_a" key="id" map="" class="actsce"/>
6950                 </links>
6951         </class>
6952         <class id="cubi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::user_bucket_item" oils_persist:tablename="container.user_bucket_item" reporter:label="User Bucket Item">
6953                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_id_seq">
6954                         <field name="bucket" reporter:datatype="link"/>
6955                         <field name="id" reporter:datatype="id" />
6956                         <field name="target_user" reporter:datatype="link"/>
6957                         <field name="create_time" reporter:datatype="timestamp" />
6958                         <field name="pos" reporter:datatype="int" />
6959                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
6960                 </fields>
6961                 <links>
6962                         <link field="target_user" reltype="has_a" key="id" map="" class="au"/>
6963                         <link field="bucket" reltype="has_a" key="id" map="" class="cub"/>
6964             <link field="notes" reltype="has_many" map="" key="item" class="cubin"/>
6965                 </links>
6966                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
6967                         <actions>
6968                                 <retrieve permission="ADMIN_USER_BUCKET">
6969                     <context link="bucket" owning_lib="owning_lib"/>
6970                 </retrieve>
6971             </actions>
6972         </permacrud>
6973         </class>
6974         <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">
6975                 <fields oils_persist:primary="id" oils_persist:sequence="container.user_bucket_item_note_id_seq">
6976                         <field name="id" reporter:datatype="id" />
6977                         <field name="item" reporter:datatype="link"/>
6978                         <field name="note" reporter:datatype="text" />
6979                 </fields>
6980                 <links>
6981                         <link field="item" reltype="has_a" key="id" map="" class="cubi"/>
6982                 </links>
6983         </class>
6984         <class id="mus" controller="open-ils.cstore" oils_obj:fieldmapper="money::user_summary" oils_persist:tablename="money.usr_summary" reporter:label="User Summary">
6985                 <fields oils_persist:primary="usr" oils_persist:sequence="">
6986                         <field name="balance_owed" reporter:datatype="money" />
6987                         <field name="total_owed" reporter:datatype="money" />
6988                         <field name="total_paid" reporter:datatype="money" />
6989                         <field name="usr" reporter:datatype="link"/>
6990                 </fields>
6991                 <links>
6992                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
6993                 </links>
6994         </class>
6995         <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">
6996                 <fields oils_persist:primary="code" oils_persist:sequence="">
6997                         <field reporter:label="LitF Code" name="code" reporter:datatype="text"/>
6998                         <field reporter:label="LitF Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
6999                         <field reporter:label="LitF Name" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7000                 </fields>
7001                 <links/>
7002         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7003             <actions>
7004                 <create permission="CREATE_MARC_CODE" global_required="true"/>
7005                 <retrieve/>
7006                 <update permission="UPDATE_MARC_CODE" global_required="true"/>
7007                 <delete permission="DELETE_MARC_CODE" global_required="true"/>
7008             </actions>
7009         </permacrud>
7010         </class>
7011         <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">
7012                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7013                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7014                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7015                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7016                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7017                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7018                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7019                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7020                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7021                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7022                 </fields>
7023                 <links>
7024                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7025                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7026                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7027                 </links>
7028         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7029             <actions>
7030                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7031                     <context link="xact" jump="usr" field="home_ou"/>
7032                 </retrieve>
7033                         </actions>
7034                 </permacrud>
7035         </class>
7036         <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">
7037                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7038                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7039                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7040                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7041                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7042                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7043                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7044                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="link"/>
7045                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7046                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7047                 </fields>
7048                 <links>
7049                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7050                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7051                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7052                 </links>
7053         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7054             <actions>
7055                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7056                     <context link="xact" jump="usr" field="home_ou"/>
7057                 </retrieve>
7058                         </actions>
7059                 </permacrud>
7060         </class>
7061         <class id="aoc" controller="open-ils.cstore" oils_obj:fieldmapper="action::open_circulation" oils_persist:tablename="action.open_circulation" reporter:label="Open Circulation">
7062                 <fields oils_persist:primary="id" oils_persist:sequence="">
7063                         <field name="checkin_lib" reporter:datatype="link"/>
7064                         <field name="checkin_staff" reporter:datatype="link"/>
7065                         <field name="checkin_time" reporter:datatype="timestamp"/>
7066                         <field name="circ_lib"  reporter:datatype="org_unit"/>
7067                         <field name="circ_staff" reporter:datatype="link"/>
7068                         <field name="desk_renewal" reporter:datatype="bool"/>
7069                         <field name="due_date" reporter:datatype="timestamp"/>
7070                         <field name="duration" reporter:datatype="interval"/>
7071                         <field name="duration_rule" reporter:datatype="link"/>
7072                         <field name="fine_interval" reporter:datatype="interval"/>
7073                         <field name="id" reporter:datatype="id" />
7074                         <field name="max_fine" reporter:datatype="money" />
7075                         <field name="max_fine_rule" reporter:datatype="link"/>
7076                         <field name="opac_renewal" reporter:datatype="bool"/>
7077                         <field name="phone_renewal" reporter:datatype="bool"/>
7078                         <field name="recurring_fine" reporter:datatype="money" />
7079                         <field name="recurring_fine_rule" reporter:datatype="link"/>
7080                         <field name="renewal_remaining" reporter:datatype="int" />
7081             <field name="grace_period" reporter:datatype="interval" />
7082                         <field name="stop_fines" reporter:datatype="text"/>
7083                         <field name="stop_fines_time" reporter:datatype="timestamp"/>
7084                         <field name="target_copy" reporter:datatype="link"/>
7085                         <field name="usr" reporter:datatype="link"/>
7086                         <field name="xact_finish" reporter:datatype="timestamp" />
7087                         <field name="xact_start" reporter:datatype="timestamp" />
7088                         <field name="circulation" oils_persist:virtual="true" reporter:datatype="link"/>
7089                 </fields>
7090                 <links>
7091                         <link field="circulation" reltype="might_have" key="id" map="" class="circ"/>
7092                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
7093                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
7094                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
7095                 </links>
7096         </class>
7097         <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">
7098                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.subject_field_entry_id_seq">
7099                         <field name="field" reporter:datatype="link"/>
7100                         <field name="id" reporter:datatype="id" />
7101                         <field name="source" reporter:datatype="link"/>
7102                         <field name="value" reporter:datatype="text"/>
7103                 </fields>
7104                 <links>
7105                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7106                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7107                 </links>
7108         </class>
7109         <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">
7110                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_recurring_fine_id_seq">
7111                         <field name="high" reporter:datatype="money" />
7112                         <field name="id" reporter:selector="name" reporter:datatype="id"/>
7113                         <field name="low" reporter:datatype="money" />
7114                         <field name="name" reporter:datatype="text"/>
7115                         <field name="normal" reporter:datatype="money" />
7116                         <field name="recurrence_interval" reporter:datatype="interval"/>
7117             <field name="grace_period" reporter:datatype="interval" />
7118                 </fields>
7119                 <links/>
7120         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7121             <actions>
7122                 <create permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7123                 <retrieve/>
7124                 <update permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7125                 <delete permission="ADMIN_RECURRING_FINE_RULE" global_required="true"/>
7126             </actions>
7127         </permacrud>
7128         </class>
7129         <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">
7130                 <fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
7131                         <field reporter:label="Accepting Staff Member" name="accepting_usr" reporter:datatype="link"/>
7132                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7133                         <field reporter:label="Amount Collected" name="amount_collected" reporter:datatype="money" />
7134                         <field reporter:label="Workstation link" name="cash_drawer" reporter:datatype="link"/>
7135                         <field reporter:label="Check Number" name="check_number" reporter:datatype="int" />
7136                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7137                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7138                         <field reporter:label="Payment Timestamp" name="payment_ts" reporter:datatype="timestamp"/>
7139                         <field reporter:label="Transaction link" name="xact" reporter:datatype="link"/>
7140                         <field reporter:label="Payment link" name="payment" oils_persist:virtual="true" reporter:datatype="link"/>
7141                         <field reporter:label="Payment Type" name="payment_type" oils_persist:virtual="true" reporter:datatype="text"/>
7142                 </fields>
7143                 <links>
7144                         <link field="payment" reltype="might_have" key="id" map="" class="mp"/>
7145                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7146                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7147                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7148                 </links>
7149         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7150             <actions>
7151                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7152                     <context link="xact" jump="usr" field="home_ou"/>
7153                 </retrieve>
7154                         </actions>
7155                 </permacrud>
7156         </class>
7157         <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">
7158                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_id_seq">
7159                         <field reporter:label="Age Hold Protection" name="age_protect" reporter:datatype="link"/>
7160                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7161                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
7162                         <field reporter:label="Call Number/Volume" name="call_number" reporter:datatype="link"/>
7163                         <field reporter:label="Circulation Type (MARC)" name="circ_as_type" reporter:datatype="text"/>
7164                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7165                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
7166                         <field reporter:label="Can Circulate" name="circulate" reporter:datatype="bool"/>
7167                         <field reporter:label="Copy Number on Volume" name="copy_number" reporter:datatype="text"/>
7168                         <field reporter:label="Creation Date/Time" name="create_date" reporter:datatype="timestamp"/>
7169                         <field reporter:label="Active Date/Time" name="active_date" reporter:datatype="timestamp"/>
7170                         <field reporter:label="Creating User" name="creator" reporter:datatype="link"/>
7171                         <field reporter:label="Is Deleted" name="deleted" reporter:datatype="bool"/>
7172                         <field reporter:label="Dummy ISBN" name="dummy_isbn" reporter:datatype="text"/>
7173                         <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
7174                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money" />
7175                         <field reporter:label="Precat Dummy Author" name="dummy_author" reporter:datatype="text"/>
7176                         <field reporter:label="Precat Dummy Title" name="dummy_title" reporter:datatype="text"/>
7177                         <field reporter:label="Last Edit Date/Time" name="edit_date" reporter:datatype="timestamp"/>
7178                         <field reporter:label="Last Editing User" name="editor" reporter:datatype="link"/>
7179                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7180                         <field reporter:label="Is Holdable" name="holdable" reporter:datatype="bool" />
7181                         <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
7182                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7183                         <field reporter:label="Shelving Location" name="location" reporter:datatype="link"/>
7184                         <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool" />
7185                         <field reporter:label="Price" name="price" reporter:datatype="money" />
7186                         <field reporter:label="Is Reference" name="ref" reporter:datatype="bool"/>
7187                         <field reporter:label="Copy Status" name="status" reporter:datatype="link"/>
7188                         <field reporter:label="Copy Status Changed Time" name="status_changed_time" reporter:datatype="timestamp"/>
7189                         <field reporter:label="Is Mint Condition" name="mint_condition" reporter:datatype="bool"/>
7190                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7191                         <field reporter:label="Cost" name="cost" reporter:datatype="money"/>
7192                         <field reporter:label="Copy Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link"/>
7193                         <field reporter:label="Stat-Cat entry maps" name="stat_cat_entry_copy_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7194                         <field reporter:label="Circulations" name="circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7195                         <field reporter:label="Aged (patronless) Circulations" name="aged_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7196                         <field reporter:label="Combined Aged and Active Circulations" name="all_circulations" oils_persist:virtual="true" reporter:datatype="link"/>
7197                         <field reporter:label="Total Circulations" name="total_circ_count" oils_persist:virtual="true" reporter:datatype="link"/>
7198                         <field reporter:label="Last Circulation Date" name="last_circ" oils_persist:virtual="true" reporter:datatype="link"/>
7199                         <field reporter:label="Holds" name="holds" oils_persist:virtual="true" reporter:datatype="link"/>
7200                         <field reporter:label="Statistical Category Entries" name="stat_cat_entries" oils_persist:virtual="true" reporter:datatype="link"/>
7201                         <field reporter:label="Monograph Parts" name="parts" oils_persist:virtual="true" reporter:datatype="link"/>
7202                         <field reporter:label="Peer Record Maps" name="peer_record_maps" oils_persist:virtual="true" reporter:datatype="link"/>
7203                         <field reporter:label="Peer Records" name="peer_records" oils_persist:virtual="true" reporter:datatype="link"/>
7204                         <field reporter:label="Last Captured Hold" name="last_captured_hold" oils_persist:virtual="true" reporter:datatype="link"/>
7205                         <field reporter:label="Has Holds" name="holds_count" oils_persist:virtual="true" reporter:datatype="link"/>
7206                         <field reporter:label="Copy Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
7207                 </fields>
7208                 <links>
7209                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7210                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
7211                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7212                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7213                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7214                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7215                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7216                         <link field="holds" reltype="has_many" key="target_copy" map="hold" class="ahcm"/>
7217                         <link field="stat_cat_entry_copy_maps" reltype="has_many" key="owning_copy" map="" class="ascecm"/>
7218                         <link field="notes" reltype="has_many" key="owning_copy" map="" class="acpn"/>
7219                         <link field="stat_cat_entries" reltype="has_many" key="owning_copy" map="stat_cat_entry" class="ascecm"/>
7220                         <link field="circulations" reltype="has_many" key="target_copy" map="" class="circ"/>
7221                         <link field="aged_circulations" reltype="has_many" key="target_copy" map="" class="acirc"/>
7222                         <link field="all_circulations" reltype="has_many" key="target_copy" map="" class="combcirc"/>
7223                         <link field="total_circ_count" reltype="might_have" key="id" map="" class="erfcc"/>
7224                         <link field="last_circ" reltype="might_have" key="id" map="" class="rlc"/>
7225                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7226                         <link field="parts" reltype="has_many" key="target_copy" map="part" class="acpm"/>
7227                         <link field="peer_record_maps" reltype="has_many" key="target_copy" map="" class="bpbcm"/>
7228                         <link field="peer_records" reltype="has_many" key="target_copy" map="peer_record" class="bpbcm"/>
7229                         <link field="last_captured_hold" reltype="has_a" key="current_copy" map="" class="alhr"/>
7230                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7231                         <link field="holds_count" reltype="might_have" key="id" map="" class="hasholdscount"/>
7232                         <link field="tags" reltype="has_many" key="copy" map="" class="acptcm"/>
7233                 </links>
7234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7235             <actions>
7236                 <create permission="CREATE_COPY">
7237                     <context link="call_number" field="owning_lib"/>
7238                 </create>
7239                 <retrieve/>
7240                 <update permission="UPDATE_COPY">
7241                     <context link="call_number" field="owning_lib"/>
7242                 </update>
7243                 <delete permission="DELETE_COPY">
7244                     <context link="call_number" field="owning_lib"/>
7245                 </delete>
7246             </actions>
7247         </permacrud>
7248         </class>
7249
7250         <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">
7251                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
7252                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
7253                         <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="org_unit"/>
7254                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
7255                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
7256                         <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
7257                         <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
7258                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
7259                         <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="org_unit"/>
7260                         <field reporter:label="Status" name="status" reporter:datatype="link"/>
7261                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
7262                         <field reporter:label="Loan Duration" name="loan_duration" reporter:datatype="int"/>
7263                         <field reporter:label="Fine Level" name="fine_level" reporter:datatype="int"/>
7264                         <field reporter:label="Age Protect" name="age_protect" reporter:datatype="link"/>
7265                         <field reporter:label="Circulate?" name="circulate" reporter:datatype="bool"/>
7266                         <field reporter:label="Deposit?" name="deposit" reporter:datatype="bool"/>
7267                         <field reporter:label="Reference?" name="ref" reporter:datatype="bool"/>
7268                         <field reporter:label="Holdable?" name="holdable" reporter:datatype="bool"/>
7269                         <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
7270                         <field reporter:label="Price" name="price" reporter:datatype="money"/>
7271                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link"/>
7272                         <field reporter:label="Circ As Type" name="circ_as_type" reporter:datatype="link"/>
7273                         <field reporter:label="Alert Message" name="alert_message" reporter:datatype="text"/>
7274                         <field reporter:label="OPAC Visible?" name="opac_visible" reporter:datatype="bool"/>
7275                         <field reporter:label="Floating Group" name="floating" reporter:datatype="link"/>
7276                         <field reporter:label="Mint Condition?" name="mint_condition" reporter:datatype="bool"/>
7277                 </fields>
7278                 <links>
7279                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7280                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
7281                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
7282                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7283                         <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
7284                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
7285                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
7286                         <link field="floating" reltype="has_a" key="id" map="" class="cfg"/>
7287                         <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
7288                         <link field="circ_as_type" reltype="has_a" key="code" map="" class="citm"/>
7289                 </links>
7290                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7291                         <actions>
7292                                 <create permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7293                                 <retrieve />
7294                                 <update permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7295                                 <delete permission="ADMIN_ASSET_COPY_TEMPLATE" global_required="true"/>
7296                         </actions>
7297                 </permacrud>
7298         </class>
7299
7300         <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">
7301                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_age_hold_protect_id_seq">
7302                         <field reporter:label="Item Age" name="age" reporter:datatype="interval"/>
7303                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7304                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7305                         <field reporter:label="Allowed Proximity" name="prox" reporter:datatype="int" />
7306                 </fields>
7307                 <links/>
7308         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7309             <actions>
7310                 <create permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7311                 <retrieve/>
7312                 <update permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7313                 <delete permission="ADMIN_AGE_PROTECT_RULE" global_required="true"/>
7314             </actions>
7315         </permacrud>
7316         </class>
7317         <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">
7318                 <fields oils_persist:primary="id" oils_persist:sequence="config.rule_max_fine_id_seq">
7319                         <field reporter:label="Max Fine Amount" name="amount" reporter:datatype="money" />
7320                         <field reporter:label="Rule ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7321                         <field reporter:label="Rule Name" name="name" reporter:datatype="text"/>
7322                         <field reporter:label="Is Percent" name="is_percent" reporter:datatype="bool"/>
7323                 </fields>
7324                 <links/>
7325         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7326             <actions>
7327                 <create permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7328                 <retrieve/>
7329                 <update permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7330                 <delete permission="ADMIN_MAX_FINE_RULE" global_required="true"/>
7331             </actions>
7332         </permacrud>
7333         </class>
7334         <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">
7335                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_tree_id_seq">
7336                         <field reporter:label="Child Groups" name="children" oils_persist:virtual="true" reporter:datatype="link"/>
7337                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7338                         <field reporter:label="Group ID" name="id" reporter:selector="name" reporter:datatype="id"/>
7339                         <field reporter:label="Group Name" name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7340                         <field reporter:label="Parent Group" name="parent" reporter:datatype="link"/>
7341                         <field reporter:label="User Expiration Interval" name="perm_interval" reporter:datatype="interval"/>
7342                         <field reporter:label="Required Permission" name="application_perm" reporter:datatype="text"/>
7343                         <field reporter:label="Is User Group" name="usergroup" reporter:datatype="bool"/>
7344                         <field reporter:label="Hold Priority" name="hold_priority" reporter:datatype="int"/>
7345                 </fields>
7346                 <links>
7347                         <link field="parent" reltype="has_a" key="id" map="" class="pgt"/>
7348                         <link field="children" reltype="has_many" key="parent" map="" class="pgt"/>
7349                 </links>
7350         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7351             <actions>
7352                 <create permission="CREATE_PERM" global_required="true"/>
7353                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7354                 <update permission="UPDATE_PERM" global_required="true"/>
7355                 <delete permission="DELETE_PERM" global_required="true"/>
7356             </actions>
7357         </permacrud>
7358         </class>
7359         <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">
7360                 <fields oils_persist:primary="id" oils_persist:sequence="action.survey_answer_id_seq">
7361                         <field reporter:label="Responses using this Answer" name="responses" oils_persist:virtual="true" reporter:datatype="link"/>
7362                         <field reporter:label="Answer Text" name="answer" reporter:datatype="text"/>
7363                         <field reporter:label="Answer ID" name="id" reporter:datatype="id" />
7364                         <field reporter:label="Question" name="question" reporter:datatype="link"/>
7365                 </fields>
7366                 <links>
7367                         <link field="question" reltype="has_a" key="id" map="" class="asvq"/>
7368                         <link field="responses" reltype="has_many" key="answer" map="" class="asvr"/>
7369                 </links>
7370         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7371             <actions>
7372                 <create permission="ADMIN_SURVEY">
7373                     <context link="question" jump="survey" field="owner"/>
7374                 </create>
7375                 <retrieve/>
7376                 <update permission="ADMIN_SURVEY">
7377                     <context link="question" jump="survey" field="owner"/>
7378                 </update>
7379                 <delete permission="ADMIN_SURVEY">
7380                     <context link="question" jump="survey" field="owner"/>
7381                 </delete>
7382             </actions>
7383         </permacrud>
7384         </class>
7385         <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">
7386                 <fields oils_persist:primary="id" oils_persist:sequence="action.non_cataloged_circulation_id_seq">
7387                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
7388                         <field reporter:label="Circulation Date/Time" name="circ_time" reporter:datatype="timestamp"/>
7389                         <field reporter:label="Non-cat Circulation ID" name="id" reporter:datatype="id" />
7390                         <field reporter:label="Non-cat Item Type" name="item_type" reporter:datatype="link"/>
7391                         <field reporter:label="Patron" name="patron" reporter:datatype="link"/>
7392                         <field reporter:label="Circulating Staff" name="staff" reporter:datatype="link"/>
7393                         <field reporter:label="Virtual Due Date/Time" name="duedate" reporter:datatype="timestamp" oils_persist:virtual="true"/>
7394                 </fields>
7395                 <links>
7396                         <link field="item_type" reltype="has_a" key="id" map="" class="cnct"/>
7397                         <link field="staff" reltype="has_a" key="id" map="" class="au"/>
7398                         <link field="patron" reltype="has_a" key="id" map="" class="au"/>
7399                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7400                 </links>
7401                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7402                         <actions>
7403                                 <retrieve permission="VIEW_CIRCULATIONS" context_field="circ_lib" />
7404                         </actions>
7405                 </permacrud>
7406         </class>
7407         <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">
7408                 <fields oils_persist:primary="usr" oils_persist:sequence="">
7409                         <field name="balance_owed" reporter:datatype="money" />
7410                         <field name="total_owed" reporter:datatype="money" />
7411                         <field name="total_paid" reporter:datatype="money" />
7412                         <field name="usr" reporter:datatype="link"/>
7413                 </fields>
7414                 <links>
7415                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7416                 </links>
7417         </class>
7418         <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">
7419                 <fields oils_persist:primary="id" oils_persist:sequence="action.unfulfilled_hold_list_id_seq">
7420                         <field reporter:label="Non-fulfilling Library" name="circ_lib"  reporter:datatype="org_unit"/>
7421                         <field reporter:label="Non-fulfilling Copy" name="current_copy" reporter:datatype="link"/>
7422                         <field reporter:label="Retargeting Date/Time" name="fail_time" reporter:datatype="timestamp"/>
7423                         <field reporter:label="Hold" name="hold" reporter:datatype="link"/>
7424                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
7425                 </fields>
7426                 <links>
7427                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7428                         <link field="current_copy" reltype="has_a" key="id" map="" class="acp"/>
7429                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
7430                 </links>
7431         </class>
7432         <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">
7433                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.identifier_field_entry_id_seq">
7434                         <field name="field" reporter:datatype="link"/>
7435                         <field name="id" reporter:datatype="id" />
7436                         <field name="source" reporter:datatype="link"/>
7437                         <field name="value" reporter:datatype="text"/>
7438                 </fields>
7439                 <links>
7440                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7441                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7442                 </links>
7443         </class>
7444         <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">
7445                 <fields oils_persist:primary="id" oils_persist:sequence="metabib.title_field_entry_id_seq">
7446                         <field name="field" reporter:datatype="link"/>
7447                         <field name="id" reporter:datatype="id" />
7448                         <field name="source" reporter:datatype="link"/>
7449                         <field name="value" reporter:datatype="text"/>
7450                 </fields>
7451                 <links>
7452                         <link field="source" reltype="has_a" key="id" map="" class="bre"/>
7453                         <link field="field" reltype="has_a" key="id" map="" class="cmf"/>
7454                 </links>
7455         </class>
7456         <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">
7457                 <fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_entry_usr_map_id_seq">
7458                         <field reporter:label="Entry ID" name="id" reporter:datatype="id" />
7459                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
7460                         <field reporter:label="Entry Text" name="stat_cat_entry" reporter:datatype="text"/>
7461                         <field reporter:label="User" name="target_usr" reporter:datatype="link"/>
7462                 </fields>
7463                 <links>
7464                         <link field="target_usr" reltype="has_a" key="id" map="" class="au"/>
7465                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
7466                 </links>
7467         </class>
7468         <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">
7469                 <fields oils_persist:primary="id" oils_persist:sequence="permission.grp_perm_map_id_seq">
7470                         <field name="depth" reporter:datatype="int" />
7471                         <field name="grantable" reporter:datatype="bool"/>
7472                         <field name="grp" reporter:datatype="link"/>
7473                         <field name="id" reporter:datatype="id" />
7474                         <field name="perm" reporter:datatype="link"/>
7475                 </fields>
7476                 <links>
7477                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7478                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7479                 </links>
7480         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7481             <actions>
7482                 <create permission="ASSIGN_GROUP_PERM" global_required="true"/>
7483                 <retrieve permission="ASSIGN_GROUP_PERM UPDATE_GROUP_PERM REMOVE_GROUP_PERM" global_required="true"/>
7484                 <update permission="UPDATE_GROUP_PERM" global_required="true"/>
7485                 <delete permission="REMOVE_GROUP_PERM" global_required="true"/>
7486             </actions>
7487         </permacrud>
7488         </class>
7489         <class id="ccb" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::copy_bucket" oils_persist:tablename="container.copy_bucket" reporter:label="Copy Bucket">
7490                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_id_seq">
7491                         <field name="items" oils_persist:virtual="true" />
7492                         <field name="btype" reporter:datatype="text"/>
7493                         <field name="id" reporter:datatype="id" />
7494                         <field name="name" reporter:datatype="text"/>
7495                         <field name="description" reporter:datatype="text"/>
7496                         <field name="owner" reporter:datatype="link"/>
7497                         <field name="pub" reporter:datatype="bool"/>
7498                         <field name="create_time" reporter:datatype="timestamp" />
7499                         <field name="owning_lib" reporter:datatype="org_unit" />
7500                 </fields>
7501                 <links>
7502                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
7503                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
7504                         <link field="items" reltype="has_many" key="bucket" map="" class="ccbi"/>
7505                 </links>
7506                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7507                         <actions>
7508                                 <create permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7509                                 <retrieve permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7510                                 <update permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7511                                 <delete permission="CREATE_COPY_BUCKET ADMIN_COPY_BUCKET" context="owning_lib" owning_user="owner"/>
7512                         </actions>
7513                 </permacrud>
7514         </class>
7515         <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">
7516                 <fields oils_persist:primary="id" oils_persist:sequence="container.copy_bucket_note_id_seq">
7517                         <field name="id" reporter:datatype="id" />
7518                         <field name="bucket" reporter:datatype="link"/>
7519                         <field name="note" reporter:datatype="text" />
7520                 </fields>
7521                 <links>
7522                         <link field="bucket" reltype="has_a" key="id" map="" class="ccb"/>
7523                 </links>
7524         </class>
7525         <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">
7526                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_work_ou_map_id_seq">
7527                         <field reporter:label="User/Working Location Map ID" name="id" reporter:datatype="int" />
7528                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
7529                         <field reporter:label="Working Location" name="work_ou" reporter:datatype="link"/>
7530                 </fields>
7531                 <links>
7532                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7533                         <link field="work_ou" reltype="has_a" key="id" map="" class="aou"/>
7534                 </links>
7535         </class>
7536         <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">
7537                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_perm_map_id_seq">
7538                         <field name="depth" reporter:datatype="int"/>
7539                         <field name="grantable" reporter:datatype="bool"/>
7540                         <field name="id" reporter:datatype="id" />
7541                         <field name="perm" reporter:datatype="link"/>
7542                         <field name="usr" reporter:datatype="link"/>
7543                 </fields>
7544                 <links>
7545                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7546                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7547                 </links>
7548         </class>
7549         <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">
7550                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_object_perm_map_id_seq">
7551                         <field name="object_id" reporter:datatype="text"/>
7552                         <field name="grantable" reporter:datatype="bool"/>
7553                         <field name="id" reporter:datatype="id" />
7554                         <field name="perm" reporter:datatype="link"/>
7555                         <field name="usr" reporter:datatype="link"/>
7556                         <field name="object_type" reporter:datatype="text"/>
7557                 </fields>
7558                 <links>
7559                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7560                         <link field="perm" reltype="has_a" key="id" map="" class="ppl"/>
7561                 </links>
7562         </class>
7563         <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">
7564                 <fields oils_persist:primary="id" oils_persist:sequence="">
7565                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7566                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7567                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7568                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7569                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7570                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7571                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7572                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7573                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7574                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7575                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7576                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7577                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7578                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7579                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7580                 </fields>
7581                 <links>
7582                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7583                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7584                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7585                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7586                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7587                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7588                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7589                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7590                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7591                 </links>
7592         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7593             <actions>
7594                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7595                     <context link="xact" jump="usr" field="home_ou"/>
7596                 </retrieve>
7597                         </actions>
7598                 </permacrud>
7599         </class>
7600         <class id="mbp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::bnm_payment" oils_persist:tablename="money.bnm_payment_view" reporter:core="true" reporter:label="Payments: Brick-and-mortar">
7601                 <fields oils_persist:primary="id" oils_persist:sequence="">
7602                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7603                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7604                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7605                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7606                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7607                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7608                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7609                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7610                         <field reporter:label="Cash Payment Detail" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7611                         <field reporter:label="Credit Card Payment Detail" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7612                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7613                         <field reporter:label="Check Payment Detail" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7614                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7615                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7616                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7617                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7618                 </fields>
7619                 <links>
7620                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7621                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7622                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7623                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7624                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7625                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7626                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7627                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7628                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7629                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7630                 </links>
7631                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7632                         <actions>
7633                                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7634                                         <context link="xact" jump="usr" field="home_ou"/>
7635                                 </retrieve>
7636                         </actions>
7637                 </permacrud>
7638         </class>
7639         <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">
7640                 <fields oils_persist:primary="id" oils_persist:sequence="">
7641                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7642                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7643                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7644                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7645                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7646                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7647                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7648                         <field reporter:label="Work Payment Detail" name="work_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7649                         <field reporter:label="Forgive Payment Detail" name="forgive_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7650                         <field reporter:label="Goods Payment Detail" name="goods_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7651                         <field reporter:label="Credit Payment Detail" name="credit_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7652                         <field reporter:label="Account Adjustment Detail" name="account_adjustment" oils_persist:virtual="true" reporter:datatype="link"/>
7653                 </fields>
7654                 <links>
7655                         <link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
7656                         <link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
7657                         <link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
7658                         <link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
7659                         <link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
7660                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7661                 </links>
7662         </class>
7663         <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">
7664                 <fields oils_persist:primary="id" oils_persist:sequence="">
7665                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7666                         <field reporter:label="Payment ID" name="id" reporter:datatype="id" />
7667                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7668                         <field reporter:label="Payment Date/Time" name="payment_ts" reporter:datatype="timestamp"/>
7669                         <field reporter:label="Payment Type" name="payment_type" reporter:datatype="text"/>
7670                         <field reporter:label="Billable Transaction" name="xact" reporter:datatype="link"/>
7671                         <field reporter:label="Accepting User" name="accepting_usr" reporter:datatype="link"/>
7672                         <field reporter:label="Cash Drawer" name="cash_drawer" reporter:datatype="link"/>
7673                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7674                         <field reporter:label="Cash Payment" name="cash_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7675                         <field reporter:label="Credit Card Payment" name="credit_card_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7676                         <field reporter:label="Check Payment" name="check_payment" oils_persist:virtual="true" reporter:datatype="link"/>
7677                 </fields>
7678                 <links>
7679                         <link field="cash_payment" reltype="might_have" key="id" map="" class="mcp"/>
7680                         <link field="credit_card_payment" reltype="might_have" key="id" map="" class="mccp"/>
7681                         <link field="check_payment" reltype="might_have" key="id" map="" class="mckp"/>
7682                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7683                         <link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
7684                         <link field="cash_drawer" reltype="has_a" key="id" map="" class="aws"/>
7685                 </links>
7686         </class>
7687         <class id="cbrebi" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="container::biblio_record_entry_bucket_item" oils_persist:tablename="container.biblio_record_entry_bucket_item" reporter:label="Biblio Record Entry Bucket Item">
7688                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
7689                         <field name="bucket" reporter:datatype="link"/>
7690                         <field name="id" reporter:datatype="id" />
7691                         <field name="target_biblio_record_entry" reporter:datatype="link"/>
7692                         <field name="create_time" reporter:datatype="timestamp" />
7693                         <field name="pos" reporter:datatype="int" />
7694                         <field name="notes" oils_persist:virtual="true" reporter:datatype="link" />
7695                 </fields>
7696                 <links>
7697                         <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre"/>
7698                         <link field="bucket" reltype="has_a" key="id" map="" class="cbreb"/>
7699             <link field="notes" reltype="has_many" map="" key="item" class="cbrebin"/>
7700                 </links>
7701                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7702                         <actions>
7703                                 <retrieve permission="ADMIN_COPY_BUCKET">
7704                     <context link="bucket" owning_lib="owning_lib"/>
7705                 </retrieve>
7706             </actions>
7707         </permacrud>
7708         </class>
7709         <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">
7710                 <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_note_id_seq">
7711                         <field name="id" reporter:datatype="id" />
7712                         <field name="item" reporter:datatype="link"/>
7713                         <field name="note" reporter:datatype="text" />
7714                 </fields>
7715                 <links>
7716                         <link field="item" reltype="has_a" key="id" map="" class="cbrebi"/>
7717                 </links>
7718         </class>
7719         <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">
7720                 <fields oils_persist:primary="id" oils_persist:sequence="asset.stat_cat_entry_id_seq">
7721                         <field reporter:label="Entry ID" name="id" reporter:datatype="int" />
7722                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
7723                         <field reporter:label="Stat Cat" name="stat_cat" reporter:datatype="link"/>
7724                         <field reporter:label="Value" name="value" reporter:datatype="text" oils_persist:i18n="true"/>
7725                 </fields>
7726                 <links>
7727                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
7728                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7729                 </links>
7730                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7731                         <actions>
7732                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
7733                         </actions>
7734                 </permacrud>
7735         </class>
7736     <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">
7737         <fields oils_persist:primary="field">
7738             <field reporter:label="Field Identifier" name="field" reporter:datatype="text" reporter:selector="name"/>
7739             <field reporter:label="Field Name" name="name" reporter:datatype="text"/>
7740             <field reporter:label="Exclusive?" name="one_only" reporter:datatype="bool"/>
7741         </fields>
7742         <links/>
7743         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7744             <actions>
7745                 <create permission="CREATE_COPY_STAT_CAT" global_required="true"/>
7746                 <retrieve />
7747                 <update permission="UPDATE_COPY_STAT_CAT" global_required="true"/>
7748                 <delete permission="DELETE_COPY_STAT_CAT" global_required="true"/>
7749             </actions>
7750         </permacrud>
7751     </class>
7752         <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">
7753                 <fields oils_persist:primary="id" oils_persist:sequence="action.hold_request_cancel_cause_id_seq">
7754                         <field reporter:label="Cause ID" name="id" reporter:datatype="id" />
7755                         <field reporter:label="Cause Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7756                 </fields>
7757                 <links/>
7758         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7759             <actions>
7760                 <create permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7761                 <retrieve/>
7762                 <update permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7763                 <delete permission="ADMIN_HOLD_CANCEL_CAUSE" global_required="true"/>
7764             </actions>
7765         </permacrud>
7766         </class>
7767
7768
7769         <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">
7770                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7771                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7772                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7773                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7774                         <field reporter:label="Reservation requiring Transit" name="reservation" reporter:datatype="link"/>
7775                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7776                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7777                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7778                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7779                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7780                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7781                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7782                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7783                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7784                 </fields>
7785                 <links>
7786                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7787                         <link field="target_copy" reltype="has_a" key="id" map="" class="brsrc"/>
7788                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7789                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7790                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7791                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7792                         <link field="reservation" reltype="has_a" key="id" map="" class="bresv"/>
7793                 </links>
7794         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7795             <actions>
7796                 <create permission="TRANSIT_COPY">
7797                     <context link="target_copy" field="owner"/>
7798                 </create>
7799                 <retrieve/>
7800                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7801                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7802             </actions>
7803         </permacrud>
7804         </class>
7805         <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">
7806                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
7807                         <field reporter:label="Copy Status at Transit" name="copy_status" reporter:datatype="link"/>
7808                         <field reporter:label="Destination Library" name="dest" reporter:datatype="org_unit"/>
7809                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
7810                         <field reporter:label="Hold requiring Transit" name="hold" reporter:datatype="link"/>
7811                         <field reporter:label="Transit ID" name="id" reporter:datatype="id" />
7812                         <field reporter:label="Is Persistent?" name="persistant_transfer" reporter:datatype="bool"/>
7813                         <field reporter:label="Previous Stop" name="prev_hop" reporter:datatype="link"/>
7814                         <field reporter:label="Sending Library" name="source" reporter:datatype="org_unit"/>
7815                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
7816                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
7817                         <field reporter:label="Base Transit" name="transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
7818                         <field reporter:label="Prev Destination Library" name="prev_dest" reporter:datatype="org_unit"/>
7819                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
7820                 </fields>
7821                 <links>
7822                         <link field="transit_copy" reltype="might_have" key="id" map="" class="atc"/>
7823                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
7824                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
7825                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
7826                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
7827                         <link field="prev_dest" reltype="has_a" key="id" map="" class="aou"/>
7828                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
7829                 </links>
7830         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7831             <actions>
7832                 <create permission="TRANSIT_COPY" context_field="owner">
7833                     <context link="target_copy" field="circ_lib"/>
7834                 </create>
7835                 <retrieve/>
7836                 <update permission="UPDATE_TRANSIT" context_field="dest source"/>
7837                 <delete permission="DELETE_TRANSIT" context_field="dest source"/>
7838             </actions>
7839         </permacrud>
7840         </class>
7841         <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">
7842                 <fields oils_persist:primary="id" oils_persist:sequence="money.billing_id_seq">
7843                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
7844                         <field reporter:label="Billing Timestamp" name="billing_ts" reporter:datatype="timestamp"/>
7845                         <field reporter:label="Legacy Billing Type" name="billing_type" reporter:datatype="text"/>
7846                         <field reporter:label="Billing ID" name="id" reporter:datatype="id" />
7847                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
7848                         <field reporter:label="Void Timestamp" name="void_time" reporter:datatype="timestamp"/>
7849                         <field reporter:label="Voided?" name="voided" reporter:datatype="bool"/>
7850                         <field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
7851                         <field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
7852                         <field reporter:label="Type" name="btype" reporter:datatype="link"/>
7853                         <field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
7854                 </fields>
7855                 <links>
7856                         <link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
7857                         <link field="voider" reltype="has_a" key="id" map="" class="au"/>
7858                         <link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
7859                         <link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
7860                 </links>
7861         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7862             <actions>
7863                 <retrieve permission="VIEW_USER_TRANSACTIONS">
7864                     <context link="xact" jump="usr" field="home_ou"/>
7865                 </retrieve>
7866                         </actions>
7867                 </permacrud>
7868         </class>
7869         <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">
7870                 <fields oils_persist:primary="id" oils_persist:sequence="permission.usr_grp_map_id_seq">
7871                         <field name="grp" />
7872                         <field name="id" reporter:datatype="id" />
7873                         <field name="usr" />
7874                 </fields>
7875                 <links>
7876                         <link field="grp" reltype="has_a" key="id" map="" class="pgt"/>
7877                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
7878                 </links>
7879         </class>
7880         <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">
7881                 <fields oils_persist:primary="id" oils_persist:sequence="config.i18n_core_id_seq">
7882                         <field name="id" reporter:datatype="id" />
7883                         <field name="fq_field" reporter:datatype="text"/>
7884                         <field name="identity_value" reporter:datatype="text"/>
7885                         <field name="translation" reporter:datatype="text"/>
7886                         <field name="string" reporter:datatype="text"/>
7887                 </fields>
7888                 <links>
7889                         <link field="translation" reltype="has_a" key="code" map="" class="i18n_l"/>
7890                 </links>
7891         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7892             <actions>
7893                 <create permission="CREATE_TRANSLATION" global_required="true"/>
7894                 <retrieve permission="CREATE_TRANSLATION UPDATE_TRANSLATION DELETE_TRANSLATION" global_required="true"/>
7895                 <update permission="UPDATE_TRANSLATION" global_required="true"/>
7896                 <delete permission="DELETE_TRANSLATION" global_required="true"/>
7897             </actions>
7898         </permacrud>
7899         </class>
7900         <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">
7901                 <fields oils_persist:primary="id" oils_persist:sequence="config.idl_field_doc_id_seq">
7902                         <field name="id" reporter:datatype="id" />
7903                         <field name="fm_class" reporter:datatype="text"/>
7904                         <field name="field" reporter:datatype="text"/>
7905                         <field name="owner" reporter:datatype="org_unit"/>
7906                         <field name="string" reporter:datatype="text" oils_persist:i18n="true"/>
7907                 </fields>
7908                 <links>
7909                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7910                 </links>
7911         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7912             <actions>
7913                 <create   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7914                 <retrieve/>
7915                 <update   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7916                 <delete   permission="ADMIN_FIELD_DOC" context_field="owner"/>
7917             </actions>
7918         </permacrud>
7919         </class>
7920         <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">
7921                 <fields oils_persist:primary="code">
7922                         <field name="code" reporter:datatype="id" />
7923                         <field name="marc_code" reporter:datatype="text"/>
7924                         <field name="name" reporter:datatype="text" oils_persist:i18n="true"/>
7925                         <field name="description" reporter:datatype="text" oils_persist:i18n="true"/>
7926                         <field name="rtl" reporter:datatype="bool"/>
7927                 </fields>
7928                 <links/>
7929         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7930             <actions>
7931                 <create permission="CREATE_LOCALE" global_required="true"/>
7932                 <retrieve/>
7933                 <update permission="UPDATE_LOCALE" global_required="true"/>
7934                 <delete permission="DELETE_LOCALE" global_required="true"/>
7935             </actions>
7936         </permacrud>
7937         </class>
7938         <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">
7939                 <fields oils_persist:primary="id" oils_persist:sequence="config.billing_type_id_seq">
7940                         <field name="id" reporter:datatype="id" reporter:label="ID" reporter:selector="name"/>
7941                         <field name="name" reporter:datatype="text" reporter:label="Name" oils_persist:i18n="true"/>
7942                         <field name="owner" reporter:datatype="org_unit" reporter:label="Org Unit" />
7943             <field name="default_price" reporter:datatype="money" reporter:label="Default Price"/>
7944                 </fields>
7945                 <links>
7946                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
7947                 </links>
7948         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7949             <actions>
7950                 <create permission="CREATE_BILLING_TYPE" context_field="owner"/>
7951                 <retrieve permission="VIEW_BILLING_TYPE CREATE_BILLING_TYPE UPDATE_BILLING_TYPE DELETE_BILLING_TYPE" context_field="owner"/>
7952                 <update permission="UPDATE_BILLING_TYPE" context_field="owner"/>
7953                 <delete permission="DELETE_BILLING_TYPE" context_field="owner"/>
7954             </actions>
7955         </permacrud>
7956         </class>
7957
7958         <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">
7959                 <fields oils_persist:primary="id">
7960                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7961                         <field reporter:label="Type Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
7962                 </fields>
7963                 <links/>
7964         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
7965             <actions>
7966                 <create permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7967                 <retrieve/>
7968                 <update permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7969                 <delete permission="ADMIN_USER_REQUEST_TYPE" global_required="true"/>
7970             </actions>
7971         </permacrud>
7972         </class>
7973
7974         <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">
7975                 <fields oils_persist:primary="id" oils_persist:sequence="acq.user_request_id_seq">
7976                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
7977                         <field reporter:label="User" name="usr" reporter:datatype="link" />
7978                         <field reporter:label="Request Type" name="request_type" oils_obj:required="true" reporter:datatype="link" />
7979                         <field reporter:label="Place Hold" name="hold" reporter:datatype="bool" />
7980                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="link" />
7981                         <field reporter:label="Holdable Formats" name="holdable_formats" reporter:datatype="text" />
7982                         <field reporter:label="Phone Notify" name="phone_notify" reporter:datatype="text" />
7983                         <field reporter:label="Email Notify" name="email_notify" reporter:datatype="bool" />
7984                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
7985                         <field reporter:label="Bib Record" name="eg_bib" reporter:datatype="link" />
7986                         <field reporter:label="Request Date/Time" name="request_date" reporter:datatype="timestamp" />
7987                         <field reporter:label="Need Before Date/Time" name="need_before" reporter:datatype="timestamp" />
7988                         <field reporter:label="Max Acceptable Fee" name="max_fee" reporter:datatype="text" />
7989                         <field reporter:label="ISxN" name="isxn" reporter:datatype="text" />
7990                         <field reporter:label="Title" name="title" reporter:datatype="text" />
7991                         <field reporter:label="Volume" name="volume" reporter:datatype="text" />
7992                         <field reporter:label="Author" name="author" reporter:datatype="text" />
7993                         <field reporter:label="Article Title" name="article_title" reporter:datatype="text" />
7994                         <field reporter:label="Article Pages" name="article_pages" reporter:datatype="text" />
7995                         <field reporter:label="Publisher" name="publisher" reporter:datatype="text" />
7996                         <field reporter:label="Publication Location" name="location" reporter:datatype="text" />
7997                         <field reporter:label="Publication Date" name="pubdate" reporter:datatype="text" />
7998                         <field reporter:label="Mentioned In" name="mentioned" reporter:datatype="text" />
7999                         <field reporter:label="Other Info" name="other_info" reporter:datatype="text" />
8000                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8001                 </fields>
8002                 <links>
8003                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
8004                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
8005                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8006                         <link field="eg_bib" reltype="has_a" key="id" map="" class="bre"/>
8007                         <link field="request_type" reltype="has_a" key="id" map="" class="aurt"/>
8008                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8009                 </links>
8010         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8011             <actions>
8012                 <create permission="user_request.create">
8013                     <context link="usr" field="home_ou"/>
8014                                 </create>
8015                 <retrieve permission="user_request.view">
8016                     <context link="usr" field="home_ou"/>
8017                                 </retrieve>
8018                 <update permission="user_request.update">
8019                     <context link="usr" field="home_ou"/>
8020                                 </update>
8021                 <delete permission="user_request.delete">
8022                     <context link="usr" field="home_ou"/>
8023                                 </delete>
8024             </actions>
8025         </permacrud>
8026         </class>
8027
8028         <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">
8029                 <fields oils_persist:primary="code">
8030                         <field reporter:label="Currency Code" name="code" reporter:datatype="text" reporter:selector='label'/>
8031                         <field reporter:label="Currency Label" name="label" reporter:datatype="text" oils_persist:i18n="true" />
8032                 </fields>
8033                 <links/>
8034         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8035             <actions>
8036                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8037                 <retrieve/>
8038                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8039                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8040             </actions>
8041         </permacrud>
8042         </class>
8043
8044         <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">
8045                 <fields oils_persist:primary="id" oils_persist:sequence="acq.exchange_rate_id_seq">
8046                         <field reporter:label="Exchange Rate ID" name="id" reporter:datatype="id" />
8047                         <field reporter:label="From Currency" name="from_currency" reporter:datatype="link" />
8048                         <field reporter:label="To Currency" name="to_currency" reporter:datatype="link" />
8049                         <field reporter:label="Ratio" name="ratio" />
8050                 </fields>
8051                 <links>
8052                         <link field="from_currency" reltype="has_a" key="code" map="" class="acqct"/>
8053                         <link field="to_currency" reltype="has_a" key="code" map="" class="acqct"/>
8054                 </links>
8055                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8056                         <actions>
8057                                 <create permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8058                                 <retrieve/>
8059                                 <update permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8060                                 <delete permission="ADMIN_CURRENCY_TYPE" global_required="true"/>
8061                         </actions>
8062                 </permacrud>
8063         </class>
8064
8065         <class id="acqpro" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::provider" oils_persist:tablename="acq.provider" reporter:label="Provider">
8066                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_id_seq">
8067                         <field reporter:label="Provider ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8068                         <field reporter:label="Provider Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8069                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8070                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8071                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8072                         <field reporter:label="Holdings Tag" name="holding_tag" reporter:datatype="text" />
8073                         <field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link" />
8074                         <field reporter:label="SAN" name="san" reporter:datatype="text" />
8075                         <field reporter:label="EDI Default" name="edi_default" reporter:datatype="link" />
8076                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8077                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8078                         <field reporter:label="URL" name="url" reporter:datatype="text" />
8079                         <field reporter:label="Email" name="email" reporter:datatype="text" />
8080                         <field reporter:label="Phone" name="phone" reporter:datatype="text" />
8081                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text" />
8082                         <field reporter:label="Default Claim Policy" name="default_claim_policy" reporter:datatype="link" />
8083                         <field reporter:label="Default # Copies" name="default_copy_count" reporter:datatype="int" />
8084                         <field reporter:label="Notes" name="provider_notes" oils_persist:virtual="true" reporter:datatype="link" />
8085                 </fields>
8086                 <links>
8087                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8088                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8089             <link field="addresses" reltype="has_many" map="" key="provider" class="acqpa"/>
8090             <link field="edi_default" reltype="has_a" map="" key="id" class="acqedi"/>
8091                         <link field="default_claim_policy" reltype="has_a" map="" key="id" class="acqclp"/>
8092                         <link field="provider_notes" reltype="has_many" map="" key="provider" class="acqpron"/>
8093                 </links>
8094         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8095             <actions>
8096                 <create   permission="ADMIN_PROVIDER" context_field="owner"/>
8097                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER" context_field="owner"/>
8098                 <update   permission="ADMIN_PROVIDER" context_field="owner"/>
8099                 <delete   permission="ADMIN_PROVIDER" context_field="owner"/>
8100             </actions>
8101         </permacrud>
8102         </class>
8103
8104         <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">
8105                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_note_id_seq">
8106                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8107                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8108                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8109                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8110                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8111                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8112                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
8113                 </fields>
8114                 <links>
8115                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8116                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8117                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8118                 </links>
8119         </class>
8120
8121         <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">
8122                 <fields oils_persist:primary="code">
8123                         <field reporter:label="Code" name="code" reporter:datatype="id" reporter:selector="name"/>
8124                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8125                 </fields>
8126                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8127             <actions>
8128                 <create permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8129                 <retrieve/>
8130                 <update permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8131                 <delete permission="ADMIN_INVOICE_PAYMENT_METHOD" global_required="true"/>
8132             </actions>
8133                 </permacrud>
8134         </class>
8135
8136         <class id="acqinv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::invoice" oils_persist:tablename="acq.invoice" reporter:label="Invoice">
8137                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_id_seq">
8138                         <field reporter:label="Internal Invoice ID" name="id" reporter:datatype="id"/>
8139                         <field reporter:label="Receiver" name="receiver" reporter:datatype="org_unit" />
8140                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8141                         <field reporter:label="Shipper" name="shipper" reporter:datatype="link"/>
8142                         <field reporter:label="Invoice Date" name="recv_date" reporter:datatype="timestamp" />
8143                         <field reporter:label="Receive Method" name="recv_method" reporter:datatype="link" />
8144                         <field reporter:label="Invoice Type" name="inv_type" reporter:datatype="text" />
8145                         <field reporter:label="Vendor Invoice ID" name="inv_ident" reporter:datatype="text" />
8146                         <field reporter:label="Payment Auth" name="payment_auth" reporter:datatype="text" />
8147                         <field reporter:label="Payment Method" name="payment_method" reporter:datatype="link" />
8148                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8149                         <field reporter:label="Complete" name="complete" reporter:datatype="bool" />
8150                         <field reporter:label="Invoice Entries" name="entries" reporter:datatype="link" oils_persist:virtual="true"/>
8151                         <field reporter:label="Invoice Items" name="items" reporter:datatype="link" oils_persist:virtual="true"/>
8152                 </fields>
8153                 <links>
8154                         <link field="receiver" reltype="has_a" key="id" map="" class="aou"/>
8155                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8156                         <link field="shipper" reltype="has_a" key="id" map="" class="acqpro"/>
8157                         <link field="recv_method" reltype="has_a" key="code" map="" class="acqim"/>
8158                         <link field="payment_method" reltype="has_a" key="code" map="" class="acqipm"/>
8159                         <link field="entries" reltype="has_many" key="invoice" map="" class="acqie"/>
8160                         <link field="items" reltype="has_many" key="invoice" map="" class="acqii"/>
8161                 </links>
8162         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8163             <actions>
8164                 <create   permission="CREATE_INVOICE" context_field="receiver"/>
8165                 <retrieve permission="CREATE_INVOICE VIEW_INVOICE" context_field="receiver"/>
8166                 <update   permission="CREATE_INVOICE" context_field="receiver"/>
8167                 <delete   permission="CREATE_INVOICE" context_field="receiver"/>
8168             </actions>
8169         </permacrud>
8170         </class>
8171
8172         <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">
8173                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_entry_id_seq">
8174                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8175                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8176                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8177                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link"/>
8178                         <field reporter:label="Invoice Item Count" name="inv_item_count" reporter:datatype="int" />
8179                         <field reporter:label="Physical Item Count" name="phys_item_count" reporter:datatype="int" />
8180                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8181                         <field reporter:label="Billed Cost per Item" name="billed_per_item" reporter:datatype="bool" />
8182                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8183                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8184                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8185                 </fields>
8186                 <links>
8187                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8188                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8189                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
8190                 </links>
8191         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8192             <actions>
8193                 <create   permission="ADMIN_INVOICE">
8194                                         <context link="invoice" field="receiver"/>
8195                                 </create>
8196                 <retrieve permission="ADMIN_INVOICE">
8197                                         <context link="invoice" field="receiver"/>
8198                                 </retrieve>
8199                 <update   permission="ADMIN_INVOICE">
8200                                         <context link="invoice" field="receiver"/>
8201                                 </update>
8202                                 <delete   permission="ADMIN_INVOICE">
8203                                         <context link="invoice" field="receiver"/>
8204                                 </delete>
8205             </actions>
8206         </permacrud>
8207         </class>
8208
8209         <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">
8210                 <fields oils_persist:primary="id" oils_persist:sequence="acq.invoice_item_id_seq">
8211                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8212                         <field reporter:label="Invoice" name="invoice" reporter:datatype="link" />
8213                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
8214                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
8215                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link" />
8216                         <field reporter:label="Title or Item Name" name="title" reporter:datatype="text" />
8217                         <field reporter:label="Author" name="author" reporter:datatype="text" />
8218                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8219                         <field reporter:label="Cost Billed" name="cost_billed" reporter:datatype="money" />
8220                         <field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
8221                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8222                         <field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
8223                         <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
8224                         <field reporter:label="Target" name="target" reporter:datatype="int" />
8225                 </fields>
8226                 <links>
8227                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
8228                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8229                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
8230                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
8231                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8232                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
8233                 </links>
8234         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8235             <actions>
8236                 <create   permission="ADMIN_INVOICE">
8237                                         <context link="invoice" field="receiver"/>
8238                                 </create>
8239                 <retrieve permission="ADMIN_INVOICE">
8240                                         <context link="invoice" field="receiver"/>
8241                                 </retrieve>
8242                 <update   permission="ADMIN_INVOICE">
8243                                         <context link="invoice" field="receiver"/>
8244                                 </update>
8245                                 <delete   permission="ADMIN_INVOICE">
8246                                         <context link="invoice" field="receiver"/>
8247                                 </delete>
8248             </actions>
8249         </permacrud>
8250         </class>
8251
8252         <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">
8253                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_address_id_seq">
8254                         <field reporter:label="Address Type" name="address_type"  reporter:datatype="text"/>
8255                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
8256                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
8257                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
8258                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8259                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8260                         <field reporter:label="Post Code" name="post_code"  reporter:datatype="text"/>
8261                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
8262                         <field reporter:label="Street 1" name="street1"  reporter:datatype="text"/>
8263                         <field reporter:label="Street 2" name="street2"  reporter:datatype="text"/>
8264                         <field reporter:label="Is Valid?" name="valid" reporter:datatype="bool"/>
8265                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
8266                 </fields>
8267                 <links>
8268                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8269                 </links>
8270         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8271             <actions>
8272                 <create permission="ADMIN_PROVIDER">
8273                     <context link="provider" field="owner"/>
8274                 </create>
8275                 <retrieve permission="ADMIN_PROVIDER">
8276                     <context link="provider" field="owner"/>
8277                 </retrieve>
8278                 <update permission="ADMIN_PROVIDER">
8279                     <context link="provider" field="owner"/>
8280                 </update>
8281                 <delete permission="ADMIN_PROVIDER">
8282                     <context link="provider" field="owner"/>
8283                 </delete>
8284             </actions>
8285         </permacrud>
8286         </class>
8287
8288         <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">
8289                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_id_seq">
8290                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
8291                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8292                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8293                         <field reporter:label="Role" name="role" reporter:datatype="text"/>
8294                         <field reporter:label="Email" name="email" reporter:datatype="text"/>
8295                         <field reporter:label="Phone" name="phone" reporter:datatype="text"/>
8296         </fields>
8297                 <links>
8298                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8299                 </links>
8300         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8301             <actions>
8302                 <create permission="ADMIN_PROVIDER">
8303                     <context link="provider" field="owner"/>
8304                 </create>
8305                 <retrieve permission="ADMIN_PROVIDER">
8306                     <context link="provider" field="owner"/>
8307                 </retrieve>
8308                 <update permission="ADMIN_PROVIDER">
8309                     <context link="provider" field="owner"/>
8310                 </update>
8311                 <delete permission="ADMIN_PROVIDER">
8312                     <context link="provider" field="owner"/>
8313                 </delete>
8314             </actions>
8315         </permacrud>
8316     </class>
8317         <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">
8318                 <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_contact_address_id_seq">
8319                         <field reporter:label="Type" name="address_type"  reporter:datatype="text"/>
8320                         <field reporter:label="City" name="city"  reporter:datatype="text"/>
8321                         <field reporter:label="Country" name="country"  reporter:datatype="text"/>
8322                         <field reporter:label="County" name="county"  reporter:datatype="text"/>
8323                         <field reporter:label="Address ID" name="id" reporter:datatype="id" />
8324                         <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
8325                         <field reporter:label="State" name="state"  reporter:datatype="text"/>
8326                         <field reporter:label="Street (1)" name="street1"  reporter:datatype="text"/>
8327                         <field reporter:label="Street (2)" name="street2"  reporter:datatype="text"/>
8328                         <field reporter:label="Contact" name="contact" reporter:datatype="link"/>
8329                         <field reporter:label="Valid Address?" name="valid" reporter:datatype="bool"/>
8330                         <field reporter:label="Fax Phone" name="fax_phone" reporter:datatype="text"/>
8331                 </fields>
8332                 <links>
8333                         <link field="contact" reltype="has_a" key="id" map="" class="acqpc"/>
8334                 </links>
8335         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8336             <actions>
8337                 <create permission="ADMIN_PROVIDER">
8338                     <context link="contact" jump='provider' field="owner"/>
8339                 </create>
8340                 <retrieve permission="ADMIN_PROVIDER">
8341                     <context link="contact" jump='provider' field="owner"/>
8342                 </retrieve>
8343                 <update permission="ADMIN_PROVIDER">
8344                     <context link="contact" jump='provider' field="owner"/>
8345                 </update>
8346                 <delete permission="ADMIN_PROVIDER">
8347                     <context link="contact" jump='provider' field="owner"/>
8348                 </delete>
8349             </actions>
8350         </permacrud>
8351         </class>
8352
8353         <class id="acqftr" controller="open-ils.cstore" oils_obj:fieldmapper="acq::fund_transfer" oils_persist:tablename="acq.fund_transfer" reporter:label="Fund Transfer">
8354                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_transfer_id_seq">
8355                         <field reporter:label="Fund Transfer ID" name="id" reporter:datatype="id"/>
8356                         <field reporter:label="Source Fund" name="src_fund" reporter:datatype="link"/>
8357                         <field reporter:label="Source Amount" name="src_amount" reporter:datatype="money"/>
8358                         <field reporter:label="Destination Fund" name="dest_fund" reporter:datatype="link"/>
8359                         <field reporter:label="Destination Amount" name="dest_amount" reporter:datatype="money"/>
8360                         <field reporter:label="Transfer Time" name="transfer_time" reporter:datatype="timestamp"/>
8361                         <field reporter:label="Transfer User" name="transfer_user" reporter:datatype="link"/>
8362                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8363                         <field reporter:label="Funding Source Credit ID" name="funding_source_credit" reporter:datatype="link"/>
8364                 </fields>
8365                 <links>
8366                         <link field="src_fund" reltype="has_a" key="id" map="" class="acqf"/>
8367                         <link field="dest_fund" reltype="has_a" key="id" map="" class="acqf"/>
8368                         <link field="transfer_user" reltype="has_a" key="id" map="" class="au"/>
8369                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
8370                 </links>
8371         </class>
8372
8373         <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">
8374                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_calendar_id_seq">
8375                         <field reporter:label="Fiscal Calendar ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8376                         <field reporter:label="Fiscal Calendar Name" name="name" reporter:datatype="text"/>
8377                         <field reporter:label="Years" name="years" oils_persist:virtual="true" reporter:datatype="link"/>
8378                 </fields>
8379                 <links>
8380             <link field="years" reltype="has_many" map="" key="calendar" class="acqfy"/>
8381                 </links>
8382                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8383                         <actions>
8384                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8385                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8386                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8387                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8388                         </actions>
8389                 </permacrud>
8390         </class>
8391
8392         <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">
8393                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fiscal_year_id_seq">
8394                         <field reporter:label="Fiscal Year ID" name="id" reporter:datatype="id" reporter:selector='year'/>
8395                         <field reporter:label="Calendar" name="calendar" reporter:datatype="link"/>
8396                         <field reporter:label="Fiscal Year" name="year" reporter:datatype="int"/>
8397                         <field reporter:label="Year Begin" name="year_begin" reporter:datatype="timestamp"/>
8398                         <field reporter:label="Year End" name="year_end" reporter:datatype="timestamp"/>
8399                 </fields>
8400                 <links>
8401                         <link field="calendar" reltype="has_a" key="id" map="" class="acqfc"/>
8402                 </links>
8403                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8404                         <actions>
8405                                 <create permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8406                                 <retrieve permission="STAFF_LOGIN" global_required="true"/>
8407                                 <update permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8408                                 <delete permission="ADMIN_ACQ_FISCAL_YEAR" global_required="true"/>
8409                         </actions>
8410                 </permacrud>
8411         </class>
8412
8413         <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">
8414                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_id_seq">
8415                         <field reporter:label="Funding Source ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8416                         <field reporter:label="Funding Source Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8417                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" />
8418                         <field reporter:label="Currency" name="currency_type" oils_persist:primitive="string" reporter:datatype="link" />
8419                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8420                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8421                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8422                         <field reporter:label="Credits" name="credits" oils_persist:virtual="true" reporter:datatype="link"/>
8423                         <field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
8424                 </fields>
8425                 <links>
8426                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8427                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
8428             <link field="allocations" reltype="has_many" map="" key="funding_source" class="acqfa"/>
8429             <link field="credits" reltype="has_many" key="funding_source" map="" class="acqfscred"/>
8430                         <link field="fund_alloc_pcts" reltype="has_many" key="funding_source" map="" class="acqfap"/>
8431                 </links>
8432         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8433             <actions>
8434                 <create   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8435                 <retrieve permission="ADMIN_FUNDING_SOURCE MANAGE_FUNDING_SOURCE VIEW_FUNDING_SOURCE" context_field="owner"/>
8436                 <update   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8437                 <delete   permission="ADMIN_FUNDING_SOURCE" context_field="owner"/>
8438             </actions>
8439         </permacrud>
8440         </class>
8441
8442         <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">
8443                 <fields oils_persist:primary="id" oils_persist:sequence="acq.funding_source_credit_id_seq">
8444                         <field reporter:label="Credit ID" name="id" reporter:datatype="id" />
8445                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link" />
8446                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8447                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8448                         <field reporter:label="Deadline Date" name="deadline_date" reporter:datatype="timestamp" />
8449                         <field reporter:label="Effective Date" name="effective_date" reporter:datatype="timestamp" />
8450                 </fields>
8451                 <links>
8452                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8453                 </links>
8454                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8455                         <actions>
8456                                 <create permission="ADMIN_FUNDING_SOURCE">
8457                     <context link="funding_source" field="owner"/>
8458                 </create>
8459                                 <retrieve permission="ADMIN_FUNDING_SOURCE">
8460                     <context link="funding_source" field="owner"/>
8461                 </retrieve>
8462                                 <update permission="ADMIN_FUNDING_SOURCE">
8463                     <context link="funding_source" field="owner"/>
8464                 </update>
8465                                 <delete permission="ADMIN_FUNDING_SOURCE">
8466                     <context link="funding_source" field="owner"/>
8467                 </delete>
8468                         </actions>
8469                 </permacrud>
8470         </class>
8471
8472         <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">
8473                 <fields oils_persist:primary="id">
8474                         <field reporter:label="Ordered Fund Src ID" name="id" reporter:datatype="id"/>
8475                         <field reporter:label="Sort Priority" name="sort_priority" reporter:datatype="int"/>
8476                         <field reporter:label="Sort Date" name="sort_date" reporter:datatype="timestamp"/>
8477                         <field reporter:label="Funding Source ID" name="funding_source" reporter:datatype="link"/>
8478                         <field reporter:label="Amount" name="amount" reporter:datatype="money"/>
8479                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
8480                 </fields>
8481                 <links>
8482                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8483                 </links>
8484         </class>
8485
8486         <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">
8487                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_debit_id_seq">
8488                         <field reporter:label="Debit ID" name="id" reporter:datatype="id" />
8489                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8490                         <field reporter:label="Origin Amount" name="origin_amount" reporter:datatype="money" />
8491                         <field reporter:label="Origin Currency" name="origin_currency_type" reporter:datatype="link" />
8492                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8493                         <field reporter:label="Encumbrance" name="encumbrance" reporter:datatype="bool" />
8494                         <field reporter:label="Debit Type" name="debit_type" reporter:datatype="text" />
8495                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8496                         <field reporter:label="Invoice Entry" name="invoice_entry" reporter:datatype="link" />
8497                 </fields>
8498                 <links>
8499                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8500                         <link field="origin_currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8501                         <link field="invoice_entry" reltype="has_a" key="id" map="" class="acqie"/>
8502                 </links>
8503                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8504                         <actions>
8505                                 <create permission="ADMIN_ACQ_FUND">
8506                     <context link="fund" field="org"/>
8507                 </create>
8508                                 <retrieve permission="ADMIN_ACQ_FUND">
8509                     <context link="fund" field="org"/>
8510                 </retrieve>
8511                                 <update permission="ADMIN_ACQ_FUND">
8512                     <context link="fund" field="org"/>
8513                 </update>
8514                                 <delete permission="ADMIN_ACQ_FUND">
8515                     <context link="fund" field="org"/>
8516                 </delete>
8517                         </actions>
8518                 </permacrud>
8519         </class>
8520
8521         <class id="acqf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::fund" oils_persist:tablename="acq.fund" reporter:label="Fund">
8522                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8523                         <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8524                         <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8525                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8526                         <field reporter:label="Year" name="year" reporter:datatype="int" />
8527                         <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8528                         <field reporter:label="Code" name="code" reporter:datatype="text" />
8529                         <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8530                         <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8531                         <field reporter:label="Active" name="active" reporter:datatype="bool" />
8532                         <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8533                         <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8534                         <field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
8535                         <field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
8536                         <field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
8537                         <field reporter:label="Tags" name="tags" oils_persist:virtual="true" reporter:datatype="link"/>
8538                         <field reporter:label="Allocation Total" name="allocation_total" oils_persist:virtual="true" reporter:datatype="link"/>
8539                         <field reporter:label="Debit Total" name="debit_total" oils_persist:virtual="true" reporter:datatype="link"/>
8540                         <field reporter:label="Encumbrance Total" name="encumbrance_total" oils_persist:virtual="true" reporter:datatype="link"/>
8541                         <field reporter:label="Spent Total" name="spent_total" oils_persist:virtual="true" reporter:datatype="link"/>
8542                         <field reporter:label="Combined Balance" name="combined_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8543                         <field reporter:label="Spent Balance" name="spent_balance" oils_persist:virtual="true" reporter:datatype="link"/>
8544                 </fields>
8545                 <links>
8546                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8547                         <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8548             <link field="allocations" reltype="has_many" key="fund" map="" class="acqfa"/>
8549             <link field="debits" reltype="has_many" key="fund" map="" class="acqfdeb"/>
8550             <link field="tags" reltype="has_many" key="fund" map="" class="acqftm"/>
8551             <link field="allocation_total" reltype="might_have" key="fund" map="" class="acqfat"/>
8552             <link field="debit_total" reltype="might_have" key="fund" map="" class="acqfdt"/>
8553             <link field="encumbrance_total" reltype="might_have" key="fund" map="" class="acqfet"/>
8554             <link field="spent_total" reltype="might_have" key="fund" map="" class="acqfst"/>
8555             <link field="combined_balance" reltype="might_have" key="fund" map="" class="acqfcb"/>
8556             <link field="spent_balance" reltype="might_have" key="fund" map="" class="acqfsb"/>
8557                 </links>
8558         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1" ignore_object_perms="true">
8559             <actions>
8560                 <create permission="ADMIN_ACQ_FUND" context_field="org"/>
8561                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8562                 <update permission="ADMIN_ACQ_FUND" context_field="org"/>
8563                 <delete permission="ADMIN_ACQ_FUND" context_field="org"/>
8564             </actions>
8565         </permacrud>
8566         </class>
8567
8568         <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">
8569                 <fields oils_persist:primary="fund">
8570                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8571                         <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8572                 </fields>
8573                 <links>
8574                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8575                 </links>
8576         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8577             <actions>
8578                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8579                                         <context link="fund" field="org" />
8580                 </retrieve>
8581             </actions>
8582         </permacrud>
8583         </class>
8584
8585         <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">
8586                 <fields oils_persist:primary="fund">
8587                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8588                         <field reporter:label="Total Debit Amount" name="amount" reporter:datatype="money" />
8589                 </fields>
8590                 <links>
8591                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8592                 </links>
8593         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8594             <actions>
8595                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8596                                         <context link="fund" field="org" />
8597                 </retrieve>
8598             </actions>
8599         </permacrud>
8600         </class>
8601
8602         <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">
8603                 <fields oils_persist:primary="fund">
8604                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8605                         <field reporter:label="Total Encumbrance Amount" name="amount" reporter:datatype="money" />
8606                 </fields>
8607                 <links>
8608                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8609                 </links>
8610         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8611             <actions>
8612                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8613                                         <context link="fund" field="org" />
8614                 </retrieve>
8615             </actions>
8616         </permacrud>
8617         </class>
8618
8619         <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">
8620                 <fields oils_persist:primary="fund">
8621                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8622                         <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8623                 </fields>
8624                 <links>
8625                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8626                 </links>
8627         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8628             <actions>
8629                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8630                                         <context link="fund" field="org" />
8631                 </retrieve>
8632             </actions>
8633         </permacrud>
8634         </class>
8635
8636         <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">
8637                 <fields oils_persist:primary="fund">
8638                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8639                         <field reporter:label="Balance after Spent and Encumbered" name="amount" reporter:datatype="money" />
8640                 </fields>
8641                 <links>
8642                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8643                 </links>
8644         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8645             <actions>
8646                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8647                                         <context link="fund" field="org" />
8648                 </retrieve>
8649             </actions>
8650         </permacrud>
8651         </class>
8652
8653    <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">
8654         <fields oils_persist:primary="fund">
8655             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8656             <field reporter:label="Total Allocation Amount" name="amount" reporter:datatype="money" />
8657         </fields>
8658         <links>
8659             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8660         </links>
8661     </class>
8662
8663    <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">
8664         <fields oils_persist:primary="fund">
8665             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8666             <field reporter:label="Total Encumbered Amount" name="amount" reporter:datatype="money" />
8667         </fields>
8668         <links>
8669             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8670         </links>
8671     </class>
8672
8673    <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">
8674         <fields oils_persist:primary="fund">
8675             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8676             <field reporter:label="Total Spent Amount" name="amount" reporter:datatype="money" />
8677         </fields>
8678         <links>
8679             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8680         </links>
8681     </class>
8682
8683    <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">
8684         <fields oils_persist:primary="fund">
8685             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8686             <field reporter:label="Total Spent Balance" name="amount" reporter:datatype="money" />
8687         </fields>
8688         <links>
8689             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8690         </links>
8691     </class>
8692
8693    <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">
8694         <fields oils_persist:primary="fund">
8695             <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8696             <field reporter:label="Total Combined Balance" name="amount" reporter:datatype="money" />
8697         </fields>
8698         <links>
8699             <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8700         </links>
8701     </class>
8702
8703         <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">
8704                 <fields oils_persist:primary="funding_source">
8705                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8706                         <field reporter:label="Total Credits to Funding Source" name="amount" reporter:datatype="money" />
8707                 </fields>
8708                 <links>
8709                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8710                 </links>
8711         </class>
8712
8713         <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">
8714                 <fields oils_persist:primary="funding_source">
8715                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8716                         <field reporter:label="Total Allocated from Funding Source" name="amount" reporter:datatype="money" />
8717                 </fields>
8718                 <links>
8719                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8720                 </links>
8721         </class>
8722
8723         <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">
8724                 <fields oils_persist:primary="funding_source">
8725                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8726                         <field reporter:label="Balance Remaining" name="amount" reporter:datatype="money" />
8727                 </fields>
8728                 <links>
8729                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8730                 </links>
8731         </class>
8732
8733         <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">
8734                 <fields oils_persist:primary="fund">
8735                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link" />
8736                         <field reporter:label="Balance after Spent" name="amount" reporter:datatype="money" />
8737                 </fields>
8738                 <links>
8739                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8740                 </links>
8741         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8742             <actions>
8743                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
8744                                         <context link="fund" field="org" />
8745                 </retrieve>
8746             </actions>
8747         </permacrud>
8748     </class>
8749     <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">
8750         <oils_persist:source_definition><![CDATA[
8751             SELECT
8752                 acqf.*,
8753                 COALESCE(acqfat.amount, 0.00) AS allocated_total,
8754                 COALESCE(acqfst.amount, 0.00) AS spent_total,
8755                 COALESCE(acqfet.amount, 0.00) AS encumbrance_total,
8756                 COALESCE(acqfcb.amount, 0.00) AS combined_balance
8757             FROM
8758                 acq.fund acqf
8759                 LEFT JOIN acq.fund_allocation_total acqfat ON (acqfat.fund = acqf.id)
8760                 LEFT JOIN acq.fund_spent_total acqfst ON (acqfst.fund = acqf.id)
8761                 LEFT JOIN acq.fund_encumbrance_total acqfet ON (acqfet.fund = acqf.id)
8762                 LEFT JOIN acq.fund_combined_balance acqfcb ON (acqfcb.fund = acqf.id)
8763         ]]></oils_persist:source_definition>
8764         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_id_seq">
8765             <field reporter:label="Fund ID" name="id" reporter:datatype="id" reporter:selector='code'/>
8766             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8767             <field reporter:label="Name" name="name" reporter:datatype="text" />
8768             <field reporter:label="Year" name="year" reporter:datatype="int" />
8769             <field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
8770             <field reporter:label="Code" name="code" reporter:datatype="text" />
8771             <field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
8772             <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
8773             <field reporter:label="Active" name="active" reporter:datatype="bool" />
8774             <field reporter:label="Balance Warning Percent" name="balance_warning_percent" reporter:datatype="int" />
8775             <field reporter:label="Balance Stop Percent" name="balance_stop_percent" reporter:datatype="int" />
8776
8777             <!-- non fund-native fields -->
8778             <field reporter:label="Total Allocated" name="allocated_total" reporter:datatype="money"/>
8779             <field reporter:label="Total Spent" name="spent_total" reporter:datatype="money"/>
8780             <field reporter:label="Total Encumbered" name="encumbrance_total" reporter:datatype="money"/>
8781             <field reporter:label="Remaining Balance" name="combined_balance" reporter:datatype="money"/>
8782         </fields>
8783         <links>
8784             <link field="id" reltype="has_a" key="id" map="" class="acqf"/>
8785             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8786             <link field="currency_type" reltype="has_a" key="code" map="" class="acqct"/>
8787         </links>
8788         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8789             <actions>
8790                 <retrieve permission="ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="org"/>
8791             </actions>
8792         </permacrud>
8793         </class>
8794         <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">
8795                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_id_seq">
8796                         <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8797                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
8798                         <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8799                         <field reporter:label="Amount" name="amount" reporter:datatype="money" />
8800                         <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8801                         <field reporter:label="Note" name="note" reporter:datatype="text" />
8802                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8803                 </fields>
8804                 <links>
8805                         <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8806                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
8807                         <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8808                 </links>
8809                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8810                         <actions>
8811                                 <create permission="ADMIN_ACQ_FUND">
8812                     <context link="fund" field="org"/>
8813                 </create>
8814                                 <retrieve permission="ADMIN_ACQ_FUND">
8815                     <context link="fund" field="org"/>
8816                 </retrieve>
8817                                 <update permission="ADMIN_ACQ_FUND">
8818                     <context link="fund" field="org"/>
8819                 </update>
8820                                 <delete permission="ADMIN_ACQ_FUND">
8821                     <context link="fund" field="org"/>
8822                 </delete>
8823                         </actions>
8824                 </permacrud>
8825         </class>
8826
8827     <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">
8828         <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_allocation_percent_id_seq">
8829             <field reporter:label="Allocation ID" name="id" reporter:datatype="id" />
8830             <field reporter:label="Funding Source" name="funding_source" reporter:datatype="link" />
8831             <field reporter:label="Org Unit" name="org" reporter:datatype="org_unit" />
8832             <field reporter:label="Fund Code" name="fund_code" reporter:datatype="text" />
8833             <field reporter:label="Percent" name="percent" reporter:datatype="float" />
8834             <field reporter:label="Allocating User" name="allocator" reporter:datatype="link" />
8835             <field reporter:label="Note" name="note" reporter:datatype="text" />
8836             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp" />
8837         </fields>
8838         <links>
8839             <link field="allocator" reltype="has_a" key="id" map="" class="au"/>
8840             <link field="org" reltype="has_a" key="id" map="" class="aou"/>
8841             <link field="funding_source" reltype="has_a" key="id" map="" class="acqfs"/>
8842         </links>
8843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8844                         <actions>
8845                                 <create permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8846                                 <retrieve permission="VIEW_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8847                                 <update permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8848                                 <delete permission="ADMIN_ACQ_FUND_ALLOCATION_PERCENT" global_required="true"/>
8849                         </actions>
8850                 </permacrud>
8851     </class>
8852
8853         <class id="acqpl" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::picklist" oils_persist:tablename="acq.picklist" reporter:label="Selection List">
8854                 <fields oils_persist:primary="id" oils_persist:sequence="acq.picklist_id_seq">
8855                         <field reporter:label="Selection List ID" name="id" reporter:datatype="id" reporter:selector='name' />
8856                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8857                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit" />
8858                         <field reporter:label="Name" name="name" reporter:datatype="text" oils_persist:i18n="true" />
8859                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8860                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8861                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link" />
8862                         <field reporter:label="Entry Count" name="entry_count" oils_persist:virtual="true"/>
8863                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8864                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8865                 </fields>
8866                 <links>
8867                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8868                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8869                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8870                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8871                         <link field="entries" reltype="has_many" key="picklist" map="" class="jub"/>
8872                 </links>
8873                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8874                         <actions>
8875                                 <retrieve permission="CREATE_PICKLIST VIEW_PICKLIST" context_field="org_unit"/>
8876                         </actions>
8877                 </permacrud>
8878         </class>
8879
8880         <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">
8881                 <fields oils_persist:primary="id" oils_persist:sequence="acq.cancel_reason_id_seq">
8882                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector='label'/>
8883                         <field reporter:label="Using Library" name="org_unit" reporter:datatype="org_unit"/>
8884                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
8885                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true"/>
8886                         <field reporter:label="Keep Debits?" name="keep_debits" reporter:datatype="bool"/>
8887                 </fields>
8888                 <links>
8889                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
8890                 </links>
8891                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8892                         <actions>
8893                                 <create permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8894                                 <retrieve permission="STAFF_LOGIN" context_field="org_unit"/>
8895                                 <update permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8896                                 <delete permission="ADMIN_ACQ_CANCEL_CAUSE" context_field="org_unit"/>
8897                         </actions>
8898                 </permacrud>
8899         </class>
8900
8901         <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">
8902                 <fields oils_persist:primary="id" oils_persist:sequence="acq.purchase_order_id_seq">
8903                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="id" reporter:selector='name'/>
8904                         <field reporter:label="Owner" name="owner" reporter:datatype="link" />
8905                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8906                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8907                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
8908                         <field reporter:label="State" name="state" reporter:datatype="text" />
8909                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="org_unit" />
8910                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8911                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8912                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp" />
8913                         <field reporter:label="Name" name="name" reporter:datatype="text" />
8914                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
8915                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8916                         <field reporter:label="Line Items" name="lineitems" oils_persist:virtual="true" reporter:datatype="link" />
8917                         <field reporter:label="Notes" name="notes" oils_persist:virtual="true" reporter:datatype="link" />
8918                         <field reporter:label="Line Item Count" name="lineitem_count" oils_persist:virtual="true" reporter:datatype="int" />
8919                         <field reporter:label="Amount Encumbered" name="amount_encumbered" oils_persist:virtual="true" reporter:datatype="float" />
8920                         <field reporter:label="Amount Spent" name="amount_spent" oils_persist:virtual="true" reporter:datatype="float" />
8921                         <field reporter:label="Amount Estimated" name="amount_estimated" oils_persist:virtual="true" reporter:datatype="float" />
8922                         <field reporter:label="PO Items" name="po_items" oils_persist:virtual="true" reporter:datatype="link" />
8923                 </fields>
8924                 <links>
8925                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8926                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8927                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8928                         <link field="default_fund" reltype="has_a" key="id" map="" class="acqf"/>
8929                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8930                         <link field="lineitems" reltype="has_many" key="purchase_order" map="" class="jub"/>
8931                         <link field="po_items" reltype="has_many" key="purchase_order" map="" class="acqpoi"/>
8932                         <link field="notes" reltype="has_many" key="purchase_order" map="" class="acqpon"/>
8933                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8934                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8935                 </links>
8936                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8937                         <actions>
8938                                 <create permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8939                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8940                                 <update permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8941                                 <delete permission="CREATE_PURCHASE_ORDER" context_field="ordering_agency"/>
8942                         </actions>
8943                 </permacrud>
8944         </class>
8945
8946         <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">
8947                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_purchase_order_pkey_seq">
8948                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
8949                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
8950                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
8951                         <field reporter:label="Purchase Order ID" name="id" reporter:datatype="link"/>
8952                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
8953                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
8954                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
8955                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
8956                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
8957                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
8958                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
8959                         <field reporter:label="State" name="state" reporter:datatype="text"/>
8960                         <field reporter:label="Order Date" name="order_date" reporter:datatype="timestamp"/>
8961                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
8962                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
8963                         <field reporter:label="Prepayment Required" name="prepayment_required" reporter:datatype="bool" />
8964                 </fields>
8965                 <links>
8966                         <link field="id" reltype="has_a" key="id" map="" class="acqpo"/>
8967                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
8968                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8969                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8970                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
8971                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
8972                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
8973                 </links>
8974                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8975             <actions>
8976                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER" context_field="ordering_agency"/>
8977             </actions>
8978                 </permacrud>
8979         </class>
8980
8981         <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">
8982                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_note_id_seq">
8983                         <field reporter:label="PO Note ID" name="id" reporter:datatype="id" />
8984                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
8985                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
8986                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
8987                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
8988                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
8989                         <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
8990                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
8991                 </fields>
8992                 <links>
8993                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
8994                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
8995                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
8996                 </links>
8997                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
8998             <actions>
8999                 <create permission="CREATE_PURCHASE_ORDER">
9000                     <context link="purchase_order" field="ordering_agency"/>
9001                 </create>
9002                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9003                     <context link="purchase_order" field="ordering_agency"/>
9004                 </retrieve>
9005                 <update permission="CREATE_PURCHASE_ORDER">
9006                     <context link="purchase_order" field="ordering_agency"/>
9007                 </update>
9008                 <delete permission="CREATE_PURCHASE_ORDER">
9009                     <context link="purchase_order" field="ordering_agency"/>
9010                 </delete>
9011             </actions>
9012                 </permacrud>
9013         </class>
9014
9015         <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">
9016                 <fields oils_persist:primary="id" oils_persist:sequence="acq.po_item_id_seq">
9017                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9018                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9019                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9020                         <field reporter:label="Invoice Item Type" name="inv_item_type" reporter:datatype="link"/>
9021                         <field reporter:label="Title" name="title" reporter:datatype="text"/>
9022                         <field reporter:label="Author" name="author" reporter:datatype="text"/>
9023                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9024                         <field reporter:label="Estimated Cost" name="estimated_cost" reporter:datatype="money"/>
9025                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9026                         <field reporter:label="Target" name="target" reporter:datatype="int" />
9027                 </fields>
9028                 <links>
9029                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9030                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9031                         <link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
9032                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9033                 </links>
9034                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9035             <actions>
9036                 <create permission="CREATE_PURCHASE_ORDER">
9037                     <context link="purchase_order" field="ordering_agency"/>
9038                 </create>
9039                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9040                     <context link="purchase_order" field="ordering_agency"/>
9041                 </retrieve>
9042                 <update permission="CREATE_PURCHASE_ORDER">
9043                     <context link="purchase_order" field="ordering_agency"/>
9044                 </update>
9045                 <delete permission="CREATE_PURCHASE_ORDER">
9046                     <context link="purchase_order" field="ordering_agency"/>
9047                 </delete>
9048             </actions>
9049                 </permacrud>
9050         </class>
9051
9052         <class id="jub" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem" oils_persist:tablename="acq.lineitem" reporter:label="Line Item">
9053                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_id_seq">
9054                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="id" />
9055                         <field reporter:label="Selecting User" name="selector" reporter:datatype="link" />
9056                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link" />
9057                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link" />
9058                         <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9059                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9060                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9061                         <field reporter:label="MARC" name="marc" reporter:datatype="text" />
9062                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link" />
9063                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text" />
9064                         <field reporter:label="Expected Receive Date" name="expected_recv_time" reporter:datatype="timestamp" />
9065                         <field reporter:label="State" name="state" reporter:datatype="text" />
9066                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9067                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9068                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link" />
9069                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9070                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9071                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9072                         <field reporter:label="Item Count" name="item_count" oils_persist:virtual="true" reporter:datatype="int" />
9073                         <field reporter:label="Descriptive Attributes" name="attributes" oils_persist:virtual="true" reporter:datatype="link" />
9074                         <field reporter:label="Line Item Details" name="lineitem_details" oils_persist:virtual="true" reporter:datatype="link" />
9075                         <field reporter:label="Line Item Notes" name="lineitem_notes" oils_persist:virtual="true" reporter:datatype="link" />
9076                         <field reporter:label="Distribution Formulas" name="distribution_formulas" oils_persist:virtual="true" reporter:datatype="link" />
9077                         <field reporter:label="Invoice Entries" name="invoice_entries" oils_persist:virtual="true" reporter:datatype="link" />
9078                         <field reporter:label="Order Summary" name="order_summary" oils_persist:virtual="true" reporter:datatype="link" />
9079                 </fields>
9080                 <links>
9081                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9082                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9083                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9084                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9085                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9086                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9087                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9088                         <link field="attributes" reltype="has_many" key="lineitem" map="" class="acqlia"/>
9089                         <link field="lineitem_details" reltype="has_many" key="lineitem" map="" class="acqlid"/>
9090                         <link field="lineitem_notes" reltype="has_many" key="lineitem" map="" class="acqlin"/>
9091                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9092                         <link field="distribution_formulas" reltype="has_many" key="lineitem" map="" class="acqdfa"/>
9093                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9094                         <link field="invoice_entries" reltype="has_many" key="lineitem" map="" class="acqie"/>
9095                         <link field="order_summary" reltype="might_have" key="lineitem" map="" class="acqlisum"/>
9096                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9097                 </links>
9098                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9099                         <actions>
9100                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER CREATE_PICKLIST VIEW_PICKLIST">
9101                                         <context link="purchase_order" field="ordering_agency"/>
9102                                         <context link="picklist" field="org_unit"/>
9103                                 </retrieve>
9104                         </actions>
9105                 </permacrud>
9106         </class>
9107
9108         <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">
9109                 <fields oils_persist:primary="audit_id" oils_persist:sequence="acq.acq_lineitem_pkey_seq">
9110                         <field reporter:label="Audit ID" name="audit_id" reporter:datatype="id"/>
9111                         <field reporter:label="Audit Time" name="audit_time" reporter:datatype="timestamp"/>
9112                         <field reporter:label="Audit Action" name="audit_action" reporter:datatype="text"/>
9113                         <field reporter:label="Lineitem ID" name="id" reporter:datatype="link"/>
9114                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9115                         <field reporter:label="Editor" name="editor" reporter:datatype="link"/>
9116                         <field reporter:label="Selector" name="selector" reporter:datatype="link"/>
9117                         <field reporter:label="Provider" name="provider" reporter:datatype="link"/>
9118                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
9119                         <field reporter:label="Selection List" name="picklist" reporter:datatype="link"/>
9120                         <field reporter:label="Expected Receive Time" name="expected_recv_time" reporter:datatype="timestamp"/>
9121                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9122                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp"/>
9123                         <field reporter:label="MARC" name="marc" reporter:datatype="text"/>
9124                         <field reporter:label="Evergreen Bib ID" name="eg_bib_id" reporter:datatype="link"/>
9125                         <field reporter:label="Source Label" name="source_label" reporter:datatype="text"/>
9126                         <field reporter:label="State" name="state" reporter:datatype="text"/>
9127                         <field reporter:label="Claim Policy" name="claim_policy" reporter:datatype="link"/>
9128                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link"/>
9129                         <field reporter:label="Estimated Unit Price" name="estimated_unit_price" reporter:datatype="money" />
9130                         <field reporter:label="Queued Vandelay Record" name="queued_record" reporter:datatype="link" />
9131                 </fields>
9132                 <links>
9133                         <link field="id" reltype="has_a" key="id" map="" class="jub"/>
9134                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9135                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9136                         <link field="selector" reltype="has_a" key="id" map="" class="au"/>
9137                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9138                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9139                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl"/>
9140                         <link field="eg_bib_id" reltype="has_a" key="id" map="" class="bre"/>
9141                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9142                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
9143                         <link field="queued_record" reltype="has_a" key="id" map="" class="vqbr"/>
9144                 </links>
9145                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9146                         <actions>
9147                                 <retrieve permission="CREATE_PURCHASE_ORDER VIEW_PURCHASE_ORDER">
9148                                         <context link="purchase_order" field="ordering_agency"/>
9149                                         <context link="picklist" field="org_unit"/>
9150                                 </retrieve>
9151                         </actions>
9152                 </permacrud>
9153         </class>
9154
9155         <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">
9156                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
9157                         <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
9158                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9159                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9160                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
9161                 </fields>
9162                 <links>
9163                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9164                 </links>
9165                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9166                         <actions>
9167                                 <create permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9168                                 <retrieve permission="STAFF_LOGIN" context_field="owning_lib"/>
9169                                 <update permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9170                                 <delete permission="ADMIN_ACQ_LINEITEM_ALERT_TEXT" context_field="owning_lib"/>
9171                         </actions>
9172                 </permacrud>
9173         </class>
9174
9175         <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">
9176                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
9177                         <field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
9178                         <field reporter:label="Line Item" name="lineitem" reporter:datatype="link" />
9179                         <field reporter:label="Creator" name="creator" reporter:datatype="link" />
9180                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
9181                         <field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
9182                         <field reporter:label="Editor" name="editor" reporter:datatype="link" />
9183                         <field reporter:label="Note Value" name="value" reporter:datatype="text" />
9184                         <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
9185                         <field reporter:label="Vendor Public" name="vendor_public" reporter:datatype="bool" />
9186                 </fields>
9187                 <links>
9188                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9189                         <link field="editor" reltype="has_a" key="id" map="" class="au"/>
9190                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9191                         <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
9192                 </links>
9193         </class>
9194
9195         <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">
9196                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_id_seq">
9197                         <field reporter:label="Attribute Value ID" name="id" reporter:datatype="id" />
9198                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link" />
9199                         <field reporter:label="Type" name="attr_type" reporter:datatype="text" />
9200                         <field reporter:label="Name" name="attr_name" reporter:datatype="text" />
9201                         <field reporter:label="Value" name="attr_value" reporter:datatype="text" />
9202                         <field reporter:label="Definition" name="definition" reporter:datatype="text" />
9203                         <field reporter:label="Order Identifier" name="order_ident" reporter:datatype="bool" />
9204                 </fields>
9205                 <links>
9206                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9207                         <link field="definition" reltype="has_a" key="id" map="" class="acqliad"/>
9208                 </links>
9209         </class>
9210
9211         <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">
9212                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_detail_id_seq">
9213                         <field reporter:label="Item Detail ID" name="id" reporter:datatype="id" />
9214                         <field reporter:label="PO Line Item" name="lineitem" reporter:datatype="link" />
9215                         <field reporter:label="Evergreen Copy ID" name="eg_copy_id" reporter:datatype="link" />
9216                         <field reporter:label="Barcode" name="barcode" reporter:datatype="text" />
9217                         <field reporter:label="Call Number Label" name="cn_label" reporter:datatype="text" />
9218                         <field reporter:label="Actual Receive Date" name="recv_time" reporter:datatype="timestamp" />
9219                         <field reporter:label="Receiving User" name="receiver" reporter:datatype="link" />
9220                         <field reporter:label="Fund" name="fund" reporter:datatype="link" />
9221                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link" />
9222                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
9223                         <field reporter:label="Copy Location" name="location" reporter:datatype="link" />
9224                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="link" />
9225                         <field reporter:label="Note" name="note" reporter:datatype="text" />
9226                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text" />
9227                         <field reporter:label="Cancel Reason" name="cancel_reason" reporter:datatype="link" />
9228                         <field reporter:label="Claims" name="claims" reporter:datatype="link" oils_persist:virtual="true" />
9229                 </fields>
9230                 <links>
9231                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9232                         <link field="eg_copy_id" reltype="has_a" key="id" map="" class="acp"/>
9233                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9234                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9235                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9236                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9237                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9238                         <link field="cancel_reason" reltype="has_a" key="id" map="" class="acqcr"/>
9239                         <link field="claims" reltype="has_many" key="lineitem_detail" map="" class="acqcl"/>
9240                         <link field="receiver" reltype="has_a" key="id" map="" class="au"/>
9241                 </links>
9242         </class>
9243
9244         <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">
9245                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9246                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9247                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9248                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9249                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9250                 </fields>
9251                 <links/>
9252                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9253                         <actions>
9254                                 <retrieve />
9255                         </actions>
9256                 </permacrud>
9257         </class>
9258
9259         <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">
9260                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9261                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9262                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9263                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9264                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9265                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9266             <field reporter:label="Remove" name="remove" reporter:datatype="text" />
9267                 </fields>
9268                 <links/>
9269         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9270             <actions>
9271                 <create permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9272                 <retrieve />
9273                 <update permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9274                 <delete permission="ADMIN_LINEITEM_MARC_ATTR_DEF" global_required="true"/>
9275             </actions>
9276         </permacrud>
9277         </class>
9278
9279         <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">
9280                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9281                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9282                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9283                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9284                         <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9285                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9286                 </fields>
9287                 <links/>
9288         </class>
9289         <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">
9290                 <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9291                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9292                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9293                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9294                         <field reporter:label="User" name="usr" reporter:datatype="link" />
9295                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9296                 </fields>
9297                 <links>
9298                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
9299                 </links>
9300         </class>
9301
9302         <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">
9303             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9304                 <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9305                 <field reporter:label="Code" name="code" reporter:datatype="text" />
9306                 <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9307                 <field reporter:label="XPath" name="xpath" reporter:datatype="text" />
9308                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9309                 <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9310         <field reporter:label="Remove" name="remove" reporter:datatype="text" />
9311
9312             </fields>
9313             <links>
9314                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9315             </links>
9316             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9317                 <actions>
9318                     <create permission="ADMIN_PROVIDER">
9319                         <context link="provider" field="owner"/>
9320                     </create>
9321                     <retrieve permission="ADMIN_PROVIDER">
9322                         <context link="provider" field="owner"/>
9323                     </retrieve>
9324                     <update permission="ADMIN_PROVIDER">
9325                         <context link="provider" field="owner"/>
9326                     </update>
9327                     <delete permission="ADMIN_PROVIDER">
9328                         <context link="provider" field="owner"/>
9329                     </delete>
9330                 </actions>
9331             </permacrud>
9332         </class>
9333         
9334         <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">
9335             <fields oils_persist:primary="id" oils_persist:sequence="acq.provider_holding_subfield_map_id_seq">
9336                 <field reporter:label="ID" name="id" reporter:datatype="id" />
9337                 <field reporter:label="Provider" name="provider" reporter:datatype="link" />
9338                 <field reporter:label="Name" name="name" reporter:datatype="text" />
9339                 <field reporter:label="Subfield" name="subfield" reporter:datatype="text" />
9340             </fields>
9341             <links>
9342                 <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9343             </links>
9344             <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9345                 <actions>
9346                     <create permission="ADMIN_PROVIDER">
9347                         <context link="provider" field="owner"/>
9348                     </create>
9349                     <retrieve permission="ADMIN_PROVIDER">
9350                         <context link="provider" field="owner"/>
9351                     </retrieve>
9352                     <update permission="ADMIN_PROVIDER">
9353                         <context link="provider" field="owner"/>
9354                     </update>
9355                     <delete permission="ADMIN_PROVIDER">
9356                         <context link="provider" field="owner"/>
9357                     </delete>
9358                 </actions>
9359             </permacrud>
9360         </class>
9361         
9362         <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">
9363             <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_attr_definition_id_seq">
9364                         <field reporter:label="Definition ID" name="id" reporter:datatype="id" />
9365                         <field reporter:label="Code" name="code" reporter:datatype="text" />
9366                         <field reporter:label="Description" name="description" reporter:datatype="text" oils_persist:i18n="true" />
9367                         <field reporter:label="Is Identifier?" name="ident" reporter:datatype="bool"/>
9368                 </fields>
9369                 <links/>
9370         </class>
9371
9372         <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">
9373                 <fields oils_persist:primary="id" oils_persist:sequence="config.remote_account_id_seq"><!-- edi_account inherits from config.remote_account, hence the seq -->
9374                         <field name="id"            reporter:datatype="id"        reporter:label="EDI Account ID" reporter:selector="label"/>
9375                         <field name="label"         reporter:datatype="text"      reporter:label="Label"/>
9376                         <field name="host"          reporter:datatype="text"      reporter:label="Host"/>
9377                         <field name="username"      reporter:datatype="text"      reporter:label="Username"/>
9378                         <field name="password"      reporter:datatype="text"      reporter:label="Password"/>
9379                         <field name="account"       reporter:datatype="text"      reporter:label="Account"/>
9380                         <field name="path"          reporter:datatype="text"      reporter:label="Path"/>
9381                         <field name="owner"         reporter:datatype="link"      reporter:label="Owner"/>
9382                         <field name="last_activity" reporter:datatype="timestamp" reporter:label="Last Activity"/>
9383                         <field name="provider"      reporter:datatype="link"      reporter:label="Provider"/>
9384                         <field name="in_dir"        reporter:datatype="text"      reporter:label="Incoming Directory"/>
9385                         <field name="vendacct"      reporter:datatype="text"      reporter:label="Vendor Account Number"/>
9386                         <field name="vendcode"      reporter:datatype="text"      reporter:label="Vendor Assigned Code"/>
9387                         <field name="attr_set"      reporter:datatype="link"      reporter:label="EDI Attribute Set"/>
9388                         <field name="use_attrs"     reporter:datatype="bool"      reporter:label="Use EDI Attributes"/>
9389                 </fields>
9390                 <links>
9391                         <link field="provider" reltype="has_a" key="id" map="" class="acqpro"/>
9392                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9393                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
9394                 </links>
9395         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9396             <actions>
9397                 <create permission="ADMIN_PROVIDER">
9398                     <context link="provider" field="owner"/>
9399                 </create>
9400                 <retrieve permission="ADMIN_PROVIDER">
9401                     <context link="provider" field="owner"/>
9402                 </retrieve>
9403                 <update permission="ADMIN_PROVIDER">
9404                     <context link="provider" field="owner"/>
9405                 </update>
9406                 <delete permission="ADMIN_PROVIDER">
9407                     <context link="provider" field="owner"/>
9408                 </delete>
9409             </actions>
9410         </permacrud>
9411         </class>
9412
9413         <class id="aea" controller="open-ils.cstore open-ils.pcrud" 
9414                 oils_obj:fieldmapper="acq::edi_attr" 
9415                 oils_persist:tablename="acq.edi_attr" reporter:label="EDI Attribute">
9416                 <fields oils_persist:primary="key">
9417                         <field name="key"   reporter:datatype="text" reporter:label="Key" reporter:selector="label"/>
9418                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
9419                 </fields>
9420         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9421             <actions>
9422                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9423                 <retrieve/>
9424                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9425                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9426             </actions>
9427         </permacrud>
9428         </class>
9429         <class id="aeas" controller="open-ils.cstore open-ils.pcrud" 
9430                 oils_obj:fieldmapper="acq::edi_attr_set" 
9431                 oils_persist:tablename="acq.edi_attr_set" reporter:label="EDI Attribute Set">
9432                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_id_seq">
9433                         <field name="id"    reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
9434                         <field name="label" reporter:datatype="text" reporter:label="Label"/>
9435                         <field name="attr_maps" reporter:datatype="link" oils_persist:virtual="true" reporter:label="Mapped EDI Attributes"/>
9436                 </fields>
9437                 <links>
9438                         <link field="attr_maps" reltype="has_many" key="attr_set" map="" class="aeasm"/>
9439                 </links>
9440         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9441             <actions>
9442                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9443                 <retrieve/>
9444                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9445                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9446             </actions>
9447         </permacrud>
9448         </class>
9449         <class id="aeasm" controller="open-ils.cstore open-ils.pcrud" 
9450                 oils_obj:fieldmapper="acq::edi_attr_set_map" 
9451                 oils_persist:tablename="acq.edi_attr_set_map" reporter:label="EDI Attribute Set Map">
9452                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_attr_set_map_id_seq">
9453                         <field name="id"       reporter:datatype="id"   reporter:label="ID" reporter:selector="label"/>
9454                         <field name="attr_set" reporter:datatype="link" reporter:label="Attribute Set"/>
9455                         <field name="attr"     reporter:datatype="link" reporter:label="Attribute"/>
9456                 </fields>
9457                 <links>
9458                         <link field="attr_set" reltype="has_a" key="id" map="" class="aeas"/>
9459                         <link field="attr" reltype="has_a" key="id" map="" class="aea"/>
9460                 </links>
9461         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9462             <actions>
9463                 <create permission="ADMIN_PROVIDER" global_required="true"/>
9464                 <retrieve/>
9465                 <update permission="ADMIN_PROVIDER" global_required="true"/>
9466                 <delete permission="ADMIN_PROVIDER" global_required="true"/>
9467             </actions>
9468         </permacrud>
9469         </class>
9470
9471
9472         <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">
9473                 <fields oils_persist:primary="id" oils_persist:sequence="acq.edi_message_id_seq">
9474                         <field name="id"               reporter:datatype="id"        reporter:label="EDI Message ID"/>
9475                         <field name="account"          reporter:datatype="link"      reporter:label="EDI Account"/>
9476                         <field name="remote_file"      reporter:datatype="text"      reporter:label="Filename"/>
9477                         <field name="create_time"      reporter:datatype="timestamp" reporter:label="Time Created"/>
9478                         <field name="translate_time"   reporter:datatype="timestamp" reporter:label="Time Translated"/>
9479                         <field name="process_time"     reporter:datatype="timestamp" reporter:label="Time Processed"/>
9480                         <field name="error_time"       reporter:datatype="timestamp" reporter:label="Time of Error"/>
9481                         <field name="status"           reporter:datatype="text"      reporter:label="Status"/>
9482                         <field name="edi"              reporter:datatype="text"      reporter:label="EDI Message Body"/>
9483                         <field name="jedi"             reporter:datatype="text"      reporter:label="JEDI Message Body"/>
9484                         <field name="error"            reporter:datatype="text"      reporter:label="Error"/>
9485                         <field name="purchase_order"   reporter:datatype="link"      reporter:label="Purchase Order"/>
9486                         <field name="message_type"     reporter:datatype="text"      reporter:label="Message Type"/>
9487                 </fields>
9488                 <links>
9489                         <link field="account" reltype="has_a" key="id" map="" class="acqedi"/>
9490                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
9491                 </links>
9492         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9493             <actions>
9494                 <retrieve permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9495                     <context link="account" jump="provider" field="owner"/>
9496                 </retrieve>
9497                 <update   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9498                     <context link="account" jump="provider" field="owner"/>
9499                 </update>
9500                 <delete   permission="ADMIN_PROVIDER MANAGE_PROVIDER VIEW_PROVIDER">
9501                     <context link="account" jump="provider" field="owner"/>
9502                 </delete>
9503             </actions>
9504         </permacrud>
9505         </class>
9506
9507
9508         <class id="rof" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::output_folder" oils_persist:tablename="reporter.output_folder" reporter:label="Output Folder">
9509                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.output_folder_id_seq">
9510                         <field name="id" reporter:datatype="id" />
9511                         <field name="parent" reporter:datatype="link"/>
9512                         <field name="owner" reporter:datatype="link"/>
9513                         <field name="create_time" reporter:datatype="timestamp"/>
9514                         <field name="name" reporter:datatype="text"/>
9515                         <field name="shared" reporter:datatype="bool"/>
9516                         <field name="share_with" reporter:datatype="link"/>
9517                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9518                         <field name="outputs" oils_persist:virtual="true" reporter:datatype="link"/>
9519                 </fields>
9520                 <links>
9521                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9522                         <link field="parent" reltype="has_a" key="id" map="" class="rof"/>
9523                         <link field="children" reltype="has_many" key="parent" map="" class="rof"/>
9524                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9525                         <link field="outputs" reltype="has_many" key="folder" map="" class="rs"/>
9526                 </links>
9527         </class>
9528         <class id="rtf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::template_folder" oils_persist:tablename="reporter.template_folder" reporter:label="Template Folder">
9529                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_folder_id_seq">
9530                         <field name="id" reporter:datatype="id" />
9531                         <field name="parent" reporter:datatype="link"/>
9532                         <field name="owner" reporter:datatype="link"/>
9533                         <field name="create_time" reporter:datatype="timestamp"/>
9534                         <field name="name" reporter:datatype="text"/>
9535                         <field name="shared" reporter:datatype="bool"/>
9536                         <field name="share_with" reporter:datatype="link"/>
9537                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9538                         <field name="templates" oils_persist:virtual="true" reporter:datatype="link"/>
9539                 </fields>
9540                 <links>
9541                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9542                         <link field="parent" reltype="has_a" key="id" map="" class="rtf"/>
9543                         <link field="children" reltype="has_many" key="parent" map="" class="rtf"/>
9544                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9545                         <link field="templates" reltype="has_many" key="folder" map="" class="rt"/>
9546                 </links>
9547         </class>
9548         <class id="rrf" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report_folder" oils_persist:tablename="reporter.report_folder" reporter:label="Report Folder">
9549                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_folder_id_seq">
9550                         <field name="id" reporter:datatype="id" />
9551                         <field name="parent" reporter:datatype="link"/>
9552                         <field name="owner" reporter:datatype="link"/>
9553                         <field name="create_time" reporter:datatype="timestamp"/>
9554                         <field name="name" reporter:datatype="text"/>
9555                         <field name="shared" reporter:datatype="bool"/>
9556                         <field name="share_with" reporter:datatype="link"/>
9557                         <field name="children" oils_persist:virtual="true" reporter:datatype="link"/>
9558                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9559                 </fields>
9560                 <links>
9561                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9562                         <link field="parent" reltype="has_a" key="id" map="" class="rrf"/>
9563                         <link field="children" reltype="has_many" key="parent" map="" class="rrf"/>
9564                         <link field="share_with" reltype="has_a" key="id" map="" class="aou"/>
9565                         <link field="reports" reltype="has_many" key="folder" map="" class="rr"/>
9566                 </links>
9567         </class>
9568         <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">
9569                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.template_id_seq">
9570                         <field name="id" reporter:datatype="id" />
9571                         <field name="owner" reporter:datatype="link"/>
9572                         <field name="create_time" reporter:datatype="timestamp"/>
9573                         <field name="name" reporter:datatype="text"/>
9574                         <field name="data" reporter:datatype="text"/>
9575                         <field name="folder" reporter:datatype="link"/>
9576                         <field name="description" reporter:datatype="text"/>
9577                         <field name="reports" oils_persist:virtual="true" reporter:datatype="link"/>
9578                 </fields>
9579                 <links>
9580                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9581                         <link field="folder" reltype="has_a" key="id" map="" class="rtf"/>
9582                         <link field="reports" reltype="has_many" key="template" map="" class="rr"/>
9583                 </links>
9584         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9585             <actions>
9586                 <create   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9587                 <retrieve permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9588                 <update   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9589                 <delete   permission="RUN_REPORTS" owning_user="owner" global_required="true"/>
9590             </actions>
9591         </permacrud>
9592         </class>
9593         <class id="rr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::report" oils_persist:tablename="reporter.report" reporter:label="Report">
9594                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.report_id_seq">
9595                         <field name="id" reporter:datatype="id" />
9596                         <field name="owner" reporter:datatype="link"/>
9597                         <field name="create_time" reporter:datatype="timestamp"/>
9598                         <field name="template" reporter:datatype="link"/>
9599                         <field name="data" reporter:datatype="text"/>
9600                         <field name="folder" reporter:datatype="link"/>
9601                         <field name="recur" reporter:datatype="bool"/>
9602                         <field name="recurrence" reporter:datatype="interval"/>
9603                         <field name="name" reporter:datatype="text"/>
9604                         <field name="description" reporter:datatype="text"/>
9605                         <field name="runs" oils_persist:virtual="true" reporter:datatype="link"/>
9606                 </fields>
9607                 <links>
9608                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
9609                         <link field="template" reltype="has_a" key="id" map="" class="rt"/>
9610                         <link field="folder" reltype="has_a" key="id" map="" class="rrf"/>
9611                         <link field="runs" reltype="has_many" key="report" map="" class="rs"/>
9612                 </links>
9613         </class>
9614         <class id="rs" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::schedule" oils_persist:tablename="reporter.schedule" reporter:label="Schedule">
9615                 <fields oils_persist:primary="id" oils_persist:sequence="reporter.schedule_id_seq">
9616                         <field name="id" reporter:datatype="id" />
9617                         <field name="runner" reporter:datatype="link"/>
9618                         <field name="start_time" reporter:datatype="timestamp"/>
9619                         <field name="complete_time" reporter:datatype="timestamp"/>
9620                         <field name="run_time" reporter:datatype="timestamp"/>
9621                         <field name="email" reporter:datatype="text"/>
9622                         <field name="excel_format" reporter:datatype="bool"/>
9623                         <field name="csv_format" reporter:datatype="bool"/>
9624                         <field name="html_format" reporter:datatype="bool"/>
9625                         <field name="error_code" reporter:datatype="int"/>
9626                         <field name="error_text" reporter:datatype="text"/>
9627                         <field name="report" reporter:datatype="link"/>
9628                         <field name="folder" reporter:datatype="link"/>
9629                         <field name="chart_pie" reporter:datatype="bool"/>
9630                         <field name="chart_bar" reporter:datatype="bool"/>
9631                         <field name="chart_line" reporter:datatype="bool"/>
9632                 </fields>
9633                 <links>
9634                         <link field="runner" reltype="has_a" key="id" map="" class="au"/>
9635                         <link field="report" reltype="has_a" key="id" map="" class="rr"/>
9636                         <link field="folder" reltype="has_a" key="id" map="" class="rof"/>
9637                 </links>
9638         </class>
9639         <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">
9640                 <fields oils_persist:primary="id">
9641                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9642                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9643                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9644                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9645                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9646                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9647                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9648                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9649                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9650                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9651                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9652                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9653                 </fields>
9654                 <links>
9655                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9656                 </links>
9657                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9658                         <actions>
9659                                 <retrieve />
9660                         </actions>
9661                 </permacrud>
9662         </class>
9663         <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">
9664                 <fields oils_persist:primary="id">
9665                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9666                         <field reporter:label="Fingerprint" name="fingerprint" reporter:datatype="text"/>
9667                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9668                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9669                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9670                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9671                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9672                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9673                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9674                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9675                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9676                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9677                 </fields>
9678                 <links>
9679                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9680                 </links>
9681         </class>
9682         <class id="rsr" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::simple_record" oils_persist:tablename="reporter.simple_record" reporter:label="Simple Record">
9683                 <fields oils_persist:primary="id">
9684                         <field reporter:label="Record ID" name="id" reporter:datatype="id" />
9685                         <field reporter:label="Metarecord" name="metarecord" reporter:datatype="link"/>
9686                         <field reporter:label="Fingerprint" name="fingerprint" />
9687                         <field reporter:label="Overall Record Quality" name="quality" reporter:datatype="int"/>
9688                         <field reporter:label="TCN Source" name="tcn_source" reporter:datatype="text"/>
9689                         <field reporter:label="TCN Value" name="tcn_value" reporter:datatype="text"/>
9690                         <field reporter:label="Title Proper (normalized)" name="title" reporter:datatype="text"/>
9691                         <field reporter:label="Uniform Title (normalized)" name="uniform_title" reporter:datatype="text"/>
9692                         <field reporter:label="Author (normalized)" name="author" reporter:datatype="text"/>
9693                         <field reporter:label="Publisher (normalized)" name="publisher" reporter:datatype="text"/>
9694                         <field reporter:label="Publication Year (normalized)" name="pubdate" reporter:datatype="int"/>
9695                         <field reporter:label="Series Title (normalized)" name="series_title" reporter:datatype="text"/>
9696                         <field reporter:label="Series Statement (normalized)" name="series_statement" reporter:datatype="text"/>
9697                         <field reporter:label="Summary (normalized)" name="summary" reporter:datatype="text"/>
9698                         <field reporter:label="ISBN" name="isbn" reporter:datatype="text"/>
9699                         <field reporter:label="ISSN" name="issn" reporter:datatype="text"/>
9700                         <field reporter:label="Topic Subjects (normalized)" name="topic_subject" reporter:datatype="text"/>
9701                         <field reporter:label="Geographic Subjects (normalized)" name="geographic_subject" reporter:datatype="text"/>
9702                         <field reporter:label="Genres (normalized)" name="genre" reporter:datatype="text"/>
9703                         <field reporter:label="Personal Name Subjects (normalized)" name="name_subject" reporter:datatype="text"/>
9704                         <field reporter:label="Corporate Name Subjects (normalized)" name="corporate_subject" reporter:datatype="text"/>
9705                         <field reporter:label="External URI List (normalized)" name="external_uri" reporter:datatype="text"/>
9706                         <field reporter:label="Full Bibliographic record" name="biblio_record" oils_persist:virtual="true" reporter:datatype="link"/>
9707                 </fields>
9708                 <links>
9709                         <link field="metarecord" reltype="has_a" key="id" map="" class="mmr"/>
9710                         <link field="biblio_record" reltype="might_have" key="id" map="" class="bre"/>
9711                 </links>
9712         </class>
9713         <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">
9714                 <fields oils_persist:primary="id">
9715                         <field reporter:label="User ID" name="id" reporter:datatype="id" />
9716                         <field reporter:label="Date of Birth" name="dob" reporter:datatype="timestamp"/>
9717                         <field reporter:label="General Demographic Division" name="general_division" reporter:datatype="text"/>
9718                 </fields>
9719                 <links>
9720                         <link field="id" reltype="might_have" key="id" map="" class="au"/>
9721                 </links>
9722         </class>
9723         <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">
9724                 <fields oils_persist:primary="id">
9725                         <field reporter:label="Circulation ID" name="id" reporter:datatype="id" />
9726                         <field reporter:label="Circulation Type" name="type" reporter:datatype="text"/>
9727                 </fields>
9728                 <links>
9729                         <link field="id" reltype="might_have" key="id" map="" class="circ"/>
9730                 </links>
9731         </class>
9732         <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">
9733                 <fields oils_persist:primary="id">
9734                         <field reporter:label="Hold ID" name="id" reporter:datatype="id" />
9735                         <field reporter:label="Hold Target" name="target" reporter:datatype="int" />
9736                         <field reporter:label="Hold Request Type" name="hold_type" reporter:datatype="text"/>
9737                         <field reporter:label="Target Bib Record" name="bib_record" reporter:datatype="link"/>
9738                 </fields>
9739                 <links>
9740                         <link field="id" reltype="might_have" key="id" map="" class="ahr"/>
9741                         <link field="bib_record" reltype="has_a" key="id" map="" class="bre"/>
9742                 </links>
9743         </class>
9744         <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">
9745                 <fields oils_persist:primary="xact">
9746                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9747                         <field reporter:label="Unvoided Billing Amount" name="unvoided" reporter:datatype="int" />
9748                         <field reporter:label="Voided Billing Amount" name="voided" reporter:datatype="money"/>
9749                         <field reporter:label="Total Billing Amount" name="total" reporter:datatype="money"/>
9750                 </fields>
9751                 <links>
9752                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9753                 </links>
9754         </class>
9755         <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">
9756                 <fields oils_persist:primary="xact">
9757                         <field reporter:label="Transaction ID" name="xact" reporter:datatype="int" />
9758                         <field reporter:label="Unvoided Paid Amount" name="unvoided" reporter:datatype="int" />
9759                         <field reporter:label="Voided (Returned) Paid Amount" name="voided" reporter:datatype="money"/>
9760                         <field reporter:label="Total Paid Amount" name="total" reporter:datatype="money"/>
9761                 </fields>
9762                 <links>
9763                         <link field="xact" reltype="might_have" key="id" map="" class="mbt"/>
9764                 </links>
9765         </class>
9766         <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)">
9767                 <fields oils_persist:primary="id">
9768                         <field reporter:label="Bib ID" name="id" reporter:datatype="id" />
9769                         <field reporter:label="Update Time" name="holding_update" reporter:datatype="timestamp" />
9770                         <field reporter:label="Update Type" name="update_type" reporter:datatype="text" />
9771                 </fields>
9772                 <links>
9773                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
9774                 </links>
9775         </class>
9776         <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">
9777                 <fields oils_persist:primary="id">
9778                         <field reporter:label="Copy ID" name="id" reporter:datatype="int" />
9779                         <field reporter:label="Total Circulation Count" name="circ_count" reporter:datatype="int" />
9780                 </fields>
9781                 <links>
9782                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
9783                 </links>
9784         </class>
9785         <class id="erccpo" controller="open-ils.reporter-store" oils_obj:fieldmapper="extend_reporter::copy_count_per_org" oils_persist:tablename="extend_reporter.copy_count_per_org" reporter:label="Library Holdings Count with Deleted">
9786                 <fields oils_persist:primary="bibid">
9787                         <field reporter:label="Bib Record" name="bibid" reporter:datatype="id" />
9788                         <field reporter:label="Circulation Library" name="circ_lib" reporter:datatype="link" />
9789                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link" />
9790                         <field reporter:label="Last Edit Date" name="last_edit_time" reporter:datatype="timestamp" />
9791                         <field reporter:label="Has Only Deleted Copies 0/1" name="has_only_deleted_copies" reporter:datatype="int" />
9792                         <field reporter:label="Total deleted copies" name="deleted_count" reporter:datatype="int" />
9793                         <field reporter:label="Total visible copies" name="visible_count" reporter:datatype="int" />
9794                         <field reporter:label="Total copies attached" name="total_count" reporter:datatype="int" />
9795                 </fields>
9796                 <links>
9797                         <link field="bibid" reltype="has_a" key="id" map="" class="bre"/>
9798                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
9799                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9800                 </links>
9801         </class>
9802         <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">
9803                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_id_seq">
9804                         <field reporter:label="Formula ID" name="id" reporter:datatype="id" reporter:selector="name" />
9805                         <field reporter:label="Formula Owner" name="owner" reporter:datatype="org_unit"/>
9806                         <field reporter:label="Formula Name" name="name" reporter:datatype="text"/>
9807                         <field reporter:label="Skip Count" name="skip_count" reporter:datatype="int"/>
9808                         <field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
9809                         <field reporter:label="Use Count" name="use_count" oils_persist:virtual="true" reporter:datatype="int"/>
9810                 </fields>
9811                 <links>
9812                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
9813                         <link field="entries" reltype="has_many" key="formula" map="" class="acqdfe"/>
9814                 </links>
9815                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9816                         <actions>
9817                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9818                                 <retrieve permission="CREATE_PURCHASE_ORDER ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9819                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9820                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA" context_field="owner"/>
9821                         </actions>
9822                 </permacrud>
9823         </class>
9824         <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">
9825                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_entry_id_seq">
9826                         <field reporter:label="Entry ID" name="id" reporter:datatype="id"/>
9827                         <field reporter:label="Formula ID" name="formula" reporter:datatype="link"/>
9828                         <field reporter:label="Position" name="position" reporter:datatype="int"/>
9829                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
9830                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
9831                         <field reporter:label="Location" name="location" reporter:datatype="link"/>
9832                         <field reporter:label="Fund" name="fund" reporter:datatype="link"/>
9833                         <field reporter:label="Circulation Modifier" name="circ_modifier" reporter:datatype="link"/>
9834                         <field reporter:label="Collection Code" name="collection_code" reporter:datatype="text"/>
9835                 </fields>
9836                 <links>
9837                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9838                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
9839                         <link field="location" reltype="has_a" key="id" map="" class="acpl"/>
9840                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
9841                         <link field="circ_modifier" reltype="has_a" key="code" map="" class="ccm"/>
9842                 </links>
9843                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9844                         <actions>
9845                                 <create permission="ADMIN_ACQ_DISTRIB_FORMULA">
9846                                         <context link="formula" field="owner"/>
9847                                 </create>
9848                                 <retrieve permission="ADMIN_ACQ_DISTRIB_FORMULA">
9849                                         <context link="formula" field="owner"/>
9850                                 </retrieve>
9851                                 <update permission="ADMIN_ACQ_DISTRIB_FORMULA">
9852                                         <context link="formula" field="owner"/>
9853                                 </update>
9854                                 <delete permission="ADMIN_ACQ_DISTRIB_FORMULA">
9855                                         <context link="formula" field="owner"/>
9856                                 </delete>
9857                         </actions>
9858                 </permacrud>
9859         </class>
9860
9861         <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">
9862                 <fields oils_persist:primary="id" oils_persist:sequence="acq.distribution_formula_application_id_seq">
9863                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
9864                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9865                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
9866                         <field reporter:label="Distribution Formula" name="formula" reporter:datatype="link"/>
9867                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
9868                 </fields>
9869                 <links>
9870                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9871                         <link field="formula" reltype="has_a" key="id" map="" class="acqdf"/>
9872                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
9873                 </links>
9874                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9875                         <actions>
9876                                 <create permission="CREATE_PURCHASE_ORDER">
9877                                         <context link="formula" field="owner"/>
9878                 </create>
9879                                 <retrieve permission="CREATE_PURCHASE_ORDER">
9880                                         <context link="formula" field="owner"/>
9881                 </retrieve>
9882                                 <update permission="CREATE_PURCHASE_ORDER">
9883                                         <context link="formula" field="owner"/>
9884                 </update>
9885                                 <delete permission="CREATE_PURCHASE_ORDER">
9886                                         <context link="formula" field="owner"/>
9887                 </delete>
9888                         </actions>
9889                 </permacrud>
9890         </class>
9891
9892         <class id="acqda" controller="open-ils.cstore" oils_obj:fieldmapper="acq::debit_attribution" oils_persist:tablename="acq.debit_attribution" reporter:label="Debit Attribution">
9893                 <fields oils_persist:primary="id">
9894                         <field reporter:label="Debit Attribution ID" name="id" reporter:datatype="id"/>
9895                         <field reporter:label="Fund Debit" name="fund_debit" reporter:datatype="link"/>
9896                         <field reporter:label="Debit Amount" name="debit_amount" reporter:datatype="money"/>
9897                         <field reporter:label="Funding Source Credit" name="funding_source_credit" reporter:datatype="link"/>
9898                         <field reporter:label="Credit Amount" name="credit_amount" reporter:datatype="money"/>
9899                 </fields>
9900                 <links>
9901                         <link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
9902                         <link field="funding_source_credit" reltype="has_a" key="id" map="" class="acqfscred"/>
9903                 </links>
9904         </class>
9905
9906         <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">
9907                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_type_id_seq">
9908                         <field reporter:label="Claim Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9909                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9910                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9911                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9912                 </fields>
9913                 <links>
9914                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9915                 </links>
9916                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9917                         <actions>
9918                                 <create permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9919                                 <retrieve permission="ADMIN_ACQ_CLAIM_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9920                                 <update permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9921                                 <delete permission="ADMIN_ACQ_CLAIM_TYPE" context_field="org_unit"/>
9922                         </actions>
9923                 </permacrud>
9924         </class>
9925
9926         <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">
9927                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_type_id_seq">
9928                         <field reporter:label="Claim Event Type ID" name="id" reporter:datatype="id" reporter:selector="code" />
9929                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
9930                         <field reporter:label="Code" name="code" reporter:datatype="text"/>
9931                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
9932                         <field reporter:label="Library Initiated" name="library_initiated" reporter:datatype="bool"/>
9933                 </fields>
9934                 <links>
9935                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
9936                 </links>
9937                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
9938                         <actions>
9939                                 <create permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9940                                 <retrieve permission="ADMIN_ACQ_CLAIM_EVENT_TYPE ADMIN_ACQ_CLAIM VIEW_CLAIM MANAGE_CLAIM" context_field="org_unit"/>
9941                                 <update permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9942                                 <delete permission="ADMIN_ACQ_CLAIM_EVENT_TYPE" context_field="org_unit"/>
9943                         </actions>
9944                 </permacrud>
9945         </class>
9946
9947         <class id="acqcl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim" oils_persist:tablename="acq.claim" reporter:label="Claim">
9948                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_id_seq">
9949                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9950                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9951                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
9952                 </fields>
9953                 <links>
9954                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9955                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
9956                 </links>
9957         </class>
9958
9959         <class id="acqcle" controller="open-ils.cstore" oils_obj:fieldmapper="acq::claim_event" oils_persist:tablename="acq.claim_event" reporter:label="Claim Event">
9960                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_event_id_seq">
9961                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9962                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9963                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9964                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9965                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9966                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9967                 </fields>
9968                 <links>
9969                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9970                         <link field="claim" reltype="has_a" key="id" map="" class="acqcl"/>
9971                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
9972                 </links>
9973         </class>
9974
9975         <class id="acqscl" controller="open-ils.cstore" oils_obj:fieldmapper="acq::serial_claim" oils_persist:tablename="acq.serial_claim" reporter:label="Serial Claim">
9976                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_id_seq">
9977                         <field reporter:label="Claim ID" name="id" reporter:datatype="id"/>
9978                         <field reporter:label="Claim Type" name="type" reporter:datatype="link"/>
9979                         <field reporter:label="Serial Item" name="item" reporter:datatype="link"/>
9980                 </fields>
9981                 <links>
9982                         <link field="type" reltype="has_a" key="id" map="" class="acqclt"/>
9983                         <link field="item" reltype="has_a" key="id" map="" class="sitem"/>
9984                 </links>
9985         </class>
9986
9987         <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">
9988                 <fields oils_persist:primary="id" oils_persist:sequence="acq.serial_claim_event_id_seq">
9989                         <field reporter:label="Claim Event ID" name="id" reporter:datatype="id"/>
9990                         <field reporter:label="Claim Event Type" name="type" reporter:datatype="link"/>
9991                         <field reporter:label="Claim ID" name="claim" reporter:datatype="link"/>
9992                         <field reporter:label="Event Date" name="event_date" reporter:datatype="timestamp"/>
9993                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
9994                         <field reporter:label="Note" name="note" reporter:datatype="text"/>
9995                 </fields>
9996                 <links>
9997                         <link field="type" reltype="has_a" key="id" map="" class="acqclet"/>
9998                         <link field="claim" reltype="has_a" key="id" map="" class="acqscl"/>
9999                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10000                 </links>
10001         </class>
10002
10003         <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">
10004                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_id_seq">
10005                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name"/>
10006                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="org_unit"/>
10007                         <field reporter:label="Claim Policy Name" name="name" reporter:datatype="text"/>
10008                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10009                 </fields>
10010                 <links>
10011                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
10012                 </links>
10013                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10014             <actions>
10015                 <create   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10016                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER" context_field="org_unit"/>
10017                 <update   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10018                 <delete   permission="ADMIN_CLAIM_POLICY" context_field="org_unit"/>
10019             </actions>
10020                 </permacrud>
10021         </class>
10022
10023         <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">
10024                 <fields oils_persist:primary="id" oils_persist:sequence="acq.claim_policy_action_id_seq">
10025                         <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="action"/>
10026                         <field reporter:label="Claim Policy ID" name="claim_policy" reporter:datatype="link"/>
10027                         <field reporter:label="Action Interval" name="action_interval" reporter:datatype="interval"/>
10028                         <field reporter:label="Action (Event Type)" name="action" reporter:datatype="link"/>
10029                 </fields>
10030                 <links>
10031                         <link field="claim_policy" reltype="has_a" key="id" map="" class="acqclp"/>
10032                         <link field="action" reltype="has_a" key="id" map="" class="acqclet"/>
10033                 </links>
10034                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10035                         <actions>
10036                                 <create permission="ADMIN_CLAIM_POLICY">
10037                                         <context link="claim_policy" field="org_unit"/>
10038                 </create>
10039                                 <retrieve permission="ADMIN_CLAIM_POLICY VIEW_PROVIDER">
10040                                         <context link="claim_policy" field="org_unit"/>
10041                 </retrieve>
10042                                 <update permission="ADMIN_CLAIM_POLICY">
10043                                         <context link="claim_policy" field="org_unit"/>
10044                 </update>
10045                                 <delete permission="ADMIN_CLAIM_POLICY">
10046                                         <context link="claim_policy" field="org_unit"/>
10047                 </delete>
10048                         </actions>
10049                 </permacrud>
10050         </class>
10051
10052     <class id="stgu" controller="open-ils.cstore" oils_obj:fieldmapper="staging::user_stage" oils_persist:tablename="staging.user_stage" reporter:label="User Stage">
10053         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.user_stage_row_id_seq">
10054             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10055             <field reporter:label="Create Date" name="row_date" reporter:datatype="timestamp"/>
10056             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10057             <field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="text"/>
10058             <field reporter:label="Email Address" name="email" reporter:datatype="text"/>
10059             <field reporter:label="Password" name="passwd" reporter:datatype="text"/>
10060             <field reporter:label="Primary Identification Type" name="ident_type" reporter:datatype="int"/>
10061             <field reporter:label="First Name" name="first_given_name" reporter:datatype="text"/>
10062             <field reporter:label="Middle Name" name="second_given_name" reporter:datatype="text"/>
10063             <field reporter:label="Last Name" name="family_name" reporter:datatype="text"/>
10064             <field reporter:label="Daytime Phone" name="day_phone" reporter:datatype="text"/>
10065             <field reporter:label="Evening Phone" name="evening_phone" reporter:datatype="text"/>
10066             <field reporter:label="Home Library" name="home_ou" reporter:datatype="int"/>
10067             <field reporter:label="Date of Birth" name="dob" reporter:datatype="text"/>
10068             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10069             <field reporter:label="Requesting User" name="requesting_usr" reporter:datatype="link"/>
10070         </fields>
10071         <links>
10072             <link field="requesting_usr" reltype="has_a" key="id" map="" class="au"/>
10073         </links>
10074     </class>
10075
10076     <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">
10077         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.card_stage_row_id_seq">
10078             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10079             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10080             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10081             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
10082             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10083         </fields>
10084     </class>
10085
10086     <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">
10087         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10088             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10089             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10090             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10091             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10092             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10093             <field reporter:label="City" name="city" reporter:datatype="text"/>
10094             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10095             <field reporter:label="State" name="state" reporter:datatype="text"/>
10096             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10097             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10098             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10099         </fields>
10100     </class>
10101
10102     <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">
10103         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.mailing_address_stage_row_id_seq">
10104             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10105             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10106             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10107             <field reporter:label="Street (1)" name="street1" reporter:datatype="text"/>
10108             <field reporter:label="Street (2)" name="street2" reporter:datatype="text"/>
10109             <field reporter:label="City" name="city" reporter:datatype="text"/>
10110             <field reporter:label="County" name="county"  reporter:datatype="text"/>
10111             <field reporter:label="State" name="state" reporter:datatype="text"/>
10112             <field reporter:label="Country" name="country" reporter:datatype="text"/>
10113             <field reporter:label="Postal Code" name="post_code" reporter:datatype="text"/>
10114             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10115         </fields>
10116     </class>
10117
10118     <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">
10119         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.statcat_stage_row_id_seq">
10120             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10121             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10122             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10123             <field reporter:label="Stat Cat ID" name="statcat" reporter:datatype="text"/>
10124             <field reporter:label="Stat Cat Value" name="value" reporter:datatype="text"/>
10125             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10126         </fields>
10127     </class>
10128
10129     <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">
10130         <fields oils_persist:primary="row_id" oils_persist:sequence="staging.setting_stage_row_id_seq">
10131             <field reporter:label="Row ID" name="row_id" reporter:datatype="id"/>
10132             <field reporter:label="Row Date" name="row_date" reporter:datatype="timestamp"/>
10133             <field reporter:label="User Name" name="usrname" reporter:datatype="text"/>
10134             <field reporter:label="User Setting Code" name="setting" reporter:datatype="text"/>
10135             <field reporter:label="User Setting Value" name="value" reporter:datatype="text"/>
10136             <field reporter:label="Complete" name="complete" reporter:datatype="bool"/>
10137         </fields>
10138     </class>
10139
10140         <class id="afsg" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_group" oils_persist:tablename="action.fieldset_group" reporter:label="Fieldset Group">
10141                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_group_id_seq">
10142                         <field reporter:label="Fieldset Group ID" name="id" reporter:datatype="id"/>
10143                         <field reporter:label="Fieldset Group Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10144                         <field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp"/>
10145                         <field reporter:label="Complete Time" name="complete_time" reporter:datatype="timestamp"/>
10146                         <field reporter:label="Container ID" name="container" reporter:datatype="int" oils_obj:required="true"/> <!-- not an fkey because could be on multiple tables -->
10147                         <field reporter:label="Container Type" name="container_type" reporter:datatype="text" oils_obj:required="true"/>
10148                         <field reporter:label="Rollback Group" name="rollback_group" reporter:datatype="link"/>
10149                         <field reporter:label="Rollback Time" name="rollback_time" reporter:datatype="timestamp"/>
10150                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
10151                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
10152                 </fields>
10153                 <links>
10154                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10155                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10156                         <link field="rollback_group" reltype="has_a" key="id" map="" class="afsg"/>
10157                 </links>
10158                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10159                         <actions>
10160                                 <create permission="CREATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10161                                 <retrieve permission="RETRIEVE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10162                                 <update permission="UPDATE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10163                                 <delete permission="DELETE_FIELDSET_GROUP ADMIN_FIELDSET_GROUP" context_field="owning_lib" owning_user="creator"/>
10164                         </actions>
10165                 </permacrud>
10166         </class>
10167
10168         <class id="afs" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset" oils_persist:tablename="action.fieldset" reporter:label="Fieldset">
10169                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_id_seq">
10170                         <field reporter:label="Fieldset ID" name="id" reporter:datatype="id"/>
10171                         <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
10172                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="link"/>
10173                         <field reporter:label="Status" name="status" reporter:datatype="text"/>
10174                         <field reporter:label="Creation Time" name="creation_time" reporter:datatype="timestamp"/>
10175                         <field reporter:label="Scheduled Time" name="scheduled_time" reporter:datatype="timestamp"/>
10176                         <field reporter:label="Applied Time" name="applied_time" reporter:datatype="timestamp"/>
10177                         <field reporter:label="Class Name" name="classname" reporter:datatype="text"/>
10178                         <field reporter:label="Fieldset Name" name="name" reporter:datatype="text"/>
10179                         <field reporter:label="Stored Query" name="stored_query" reporter:datatype="link"/>
10180                         <field reporter:label="Primary Key Value" name="pkey_value" reporter:datatype="text"/>
10181                         <field reporter:label="Fieldset Group" name="fieldset_group" reporter:datatype="link"/>
10182                         <field reporter:label="Error Message" name="error_msg" reporter:datatype="text"/>
10183                 </fields>
10184                 <links>
10185                         <link field="owner" reltype="has_a" key="id" map="" class="au"/>
10186                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10187                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10188                         <link field="fieldset_group" reltype="has_a" key="id" map="" class="afsg"/>
10189                 </links>
10190                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10191                         <actions>
10192                                 <create permission="CREATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10193                                 <retrieve permission="RETRIEVE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10194                                 <update permission="UPDATE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10195                                 <delete permission="DELETE_FIELDSET ADMIN_FIELDSET" context_field="owning_lib" owning_user="owner"/>
10196                         </actions>
10197                 </permacrud>
10198         </class>
10199
10200         <class id="afscv" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::fieldset_col_val" oils_persist:tablename="action.fieldset_col_val" reporter:label="Fieldset Column Value">
10201                 <fields oils_persist:primary="id" oils_persist:sequence="action.fieldset_col_val_id_seq">
10202                         <field reporter:label="Column Value ID" name="id" reporter:datatype="id"/>
10203                         <field reporter:label="Fieldset ID" name="fieldset" reporter:datatype="link"/>
10204                         <field reporter:label="Column Name" name="col" reporter:datatype="text"/>
10205                         <field reporter:label="Column Value" name="val" reporter:datatype="text"/>
10206                 </fields>
10207                 <links>
10208                         <link field="fieldset" reltype="has_a" key="id" map="" class="afs"/>
10209                 </links>
10210                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1"> <!-- NOTE: foreign context does not support owning_user today -->
10211                         <actions>
10212                                 <create permission="CREATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10213                     <context link="fieldset" field="owning_lib"/>
10214                 </create>
10215                                 <retrieve permission="RETRIEVE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10216                     <context link="fieldset" field="owning_lib"/>
10217                 </retrieve>
10218                                 <update permission="UPDATE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10219                     <context link="fieldset" field="owning_lib"/>
10220                 </update>
10221                                 <delete permission="DELETE_FIELDSET_ENTRY ADMIN_FIELDSET_ENTRY">
10222                     <context link="fieldset" field="owning_lib"/>
10223                 </delete>
10224                         </actions>
10225                 </permacrud>
10226         </class>
10227
10228     <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">
10229         <fields>
10230             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10231             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10232             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10233         </fields>
10234                 <links>
10235                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10236                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10237                 </links>
10238     </class>
10239
10240     <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">
10241         <fields>
10242             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10243             <field reporter:label="Min Loop" name="min" reporter:datatype="int"/>
10244         </fields>
10245                 <links>
10246                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10247                 </links>
10248     </class>
10249
10250     <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">
10251         <fields>
10252             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10253             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10254             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10255         </fields>
10256                 <links>
10257                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10258                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10259                 </links>
10260     </class>
10261
10262     <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">
10263         <fields>
10264             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10265             <field reporter:label="Max Loop" name="max" reporter:datatype="int"/>
10266         </fields>
10267                 <links>
10268                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10269                 </links>
10270     </class>
10271
10272     <class id="aufhol" controller="open-ils.cstore" oils_obj:fieldmapper="action::unfulfilled_hold_outermost_loop" oils_persist:readonly="true">
10273                 <oils_persist:source_definition>
10274
10275             SELECT  DISTINCT l.*
10276               FROM  action.unfulfilled_hold_loops l
10277                     JOIN action.unfulfilled_hold_max_loop m USING (hold)
10278               WHERE l.count = m.max
10279
10280                 </oils_persist:source_definition>
10281         <fields>
10282             <field reporter:label="Hold ID" name="hold" reporter:datatype="link"/>
10283             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="link"/>
10284             <field reporter:label="Loop Count" name="count" reporter:datatype="int"/>
10285         </fields>
10286                 <links>
10287                         <link field="hold" reltype="has_a" key="id" map="" class="ahr"/>
10288                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
10289                 </links>
10290     </class>
10291
10292         <class id="qsq" controller="open-ils.cstore" oils_obj:fieldmapper="query::stored_query" oils_persist:tablename="query.stored_query" reporter:label="Stored Query">
10293                 <fields oils_persist:primary="id" oils_persist:sequence="query.stored_query_id_seq">
10294                         <field reporter:label="Query ID" name="id" reporter:datatype="id"/>
10295                         <field reporter:label="Query type" name="type" reporter:datatype="text"/>
10296                         <field reporter:label="Use ALL" name="use_all" reporter:datatype="bool"/>
10297                         <field reporter:label="Use DISTINCT" name="use_distinct" reporter:datatype="bool"/>
10298                         <field reporter:label="FROM Clause" name="from_clause" reporter:datatype="link"/>
10299                         <field reporter:label="WHERE Clause" name="where_clause" reporter:datatype="link"/>
10300                         <field reporter:label="HAVING Clause" name="having_clause" reporter:datatype="link"/>
10301                         <field reporter:label="LIMIT count" name="limit_count" reporter:datatype="link"/>
10302                         <field reporter:label="OFFSET count" name="offset_count" reporter:datatype="link"/>
10303                 </fields>
10304                 <links>
10305                         <link field="from_clause" reltype="has_a" key="id" map="" class="qfr"/>
10306                         <link field="having_clause" reltype="has_a" key="id" map="" class="qxp"/>
10307                         <link field="where_clause" reltype="has_a" key="id" map="" class="qxp"/>
10308                         <link field="limit_count" reltype="has_a" key="id" map="" class="qxp"/>
10309                         <link field="offset_count" reltype="has_a" key="id" map="" class="qxp"/>
10310                 </links>
10311         </class>
10312
10313         <class id="qseq" controller="open-ils.cstore" oils_obj:fieldmapper="query::query_sequence" oils_persist:tablename="query.query_sequence" reporter:label="Query Sequence">
10314                 <fields oils_persist:primary="id" oils_persist:sequence="query.query_sequence_id_seq">
10315                         <field reporter:label="Query Seq ID" name="id" reporter:datatype="id"/>
10316                         <field reporter:label="Parent Query" name="parent_query" reporter:datatype="link"/>
10317                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10318                         <field reporter:label="Child Query" name="child_query" reporter:datatype="link"/>
10319                 </fields>
10320                 <links>
10321                         <link field="parent_query" reltype="has_a" key="id" map="" class="qsq"/>
10322                         <link field="child_query" reltype="has_a" key="id" map="" class="qsq"/>
10323                 </links>
10324         </class>
10325
10326         <class id="qdt" controller="open-ils.cstore" oils_obj:fieldmapper="query::datatype" oils_persist:tablename="query.datatype" reporter:label="Datatype">
10327                 <fields oils_persist:primary="id" oils_persist:sequence="query.datatype_id_seq">
10328                         <field reporter:label="Datatype ID" name="id" reporter:datatype="id"/>
10329                         <field reporter:label="Datatype Name" name="datatype_name" reporter:datatype="text"/>
10330                         <field reporter:label="Is Numeric" name="is_numeric" reporter:datatype="bool"/>
10331                         <field reporter:label="Is Composite" name="is_composite" reporter:datatype="bool"/>
10332                 </fields>
10333                 <links>
10334                 </links>
10335         </class>
10336
10337         <class id="qsf" controller="open-ils.cstore" oils_obj:fieldmapper="query::subfield" oils_persist:tablename="query.subfield" reporter:label="Subfield">
10338                 <fields oils_persist:primary="id" oils_persist:sequence="query.subfield_id_seq">
10339                         <field reporter:label="Subfield ID" name="id" reporter:datatype="id"/>
10340                         <field reporter:label="Composite Type" name="composite_type" reporter:datatype="link"/>
10341                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10342                         <field reporter:label="Subfield Type" name="subfield_type" reporter:datatype="link"/>
10343                 </fields>
10344                 <links>
10345                         <link field="composite_type" reltype="has_a" key="id" map="" class="qdt"/>
10346                         <link field="subfield_type" reltype="has_a" key="id" map="" class="qdt"/>
10347                 </links>
10348         </class>
10349         
10350         <class id="qfs" controller="open-ils.cstore" oils_obj:fieldmapper="query::function_sig" oils_persist:tablename="query.function_sig" reporter:label="Function Signature">
10351                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_sig_id_seq">
10352                         <field reporter:label="Function Signature ID" name="id" reporter:datatype="id"/>
10353                         <field reporter:label="Function Name" name="function_name" reporter:datatype="text"/>
10354                         <field reporter:label="Return Type" name="return_type" reporter:datatype="link"/>
10355                         <field reporter:label="Is Aggregate" name="is_aggregate" reporter:datatype="bool"/>
10356                 </fields>
10357                 <links>
10358                         <link field="return_type" reltype="has_a" key="id" map="" class="qdt"/>
10359                 </links>
10360         </class>
10361         
10362         <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">
10363                 <fields oils_persist:primary="id" oils_persist:sequence="query.function_param_def_id_seq">
10364                         <field reporter:label="Function Param Def ID" name="id" reporter:datatype="id"/>
10365                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10366                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10367                         <field reporter:label="Datatype" name="datatype" reporter:datatype="link"/>
10368                 </fields>
10369                 <links>
10370                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10371                         <link field="datatype" reltype="has_a" key="id" map="" class="qdt"/>
10372                 </links>
10373         </class>
10374
10375         <class id="qbv" controller="open-ils.cstore" oils_obj:fieldmapper="query::bind_variable" oils_persist:tablename="query.bind_variable" reporter:label="Bind Variable">
10376                 <fields oils_persist:primary="name">
10377                         <field reporter:label="Name" name="name" reporter:datatype="id"/>
10378                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_persist:i18n="true"/>
10379                         <field reporter:label="Type" name="type" reporter:datatype="text"/>
10380                         <field reporter:label="Description" name="description" reporter:datatype="text"/>
10381                         <field reporter:label="Default Value" name="default_value" reporter:datatype="text"/>
10382                         <field reporter:label="Actual Value" name="actual_value" oils_persist:virtual="true" reporter:datatype="text"/>
10383                 </fields>
10384                 <links>
10385                 </links>
10386         </class>
10387
10388         <class id="qxp" controller="open-ils.cstore" oils_obj:fieldmapper="query::expression" oils_persist:tablename="query.expression" reporter:label="Expression">
10389                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10390                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10391                         <field reporter:label="Expression Type" name="type" reporter:datatype="text"/>
10392                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10393                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10394                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10395                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10396                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10397                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10398                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10399                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10400                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10401                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10402                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10403                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10404                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10405                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
10406                 </fields>
10407                 <links>
10408                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10409                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10410                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10411                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10412                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10413                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10414                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
10415                 </links>
10416         </class>
10417
10418         <class id="qcb" controller="open-ils.cstore" oils_obj:fieldmapper="query::case_branch" oils_persist:tablename="query.case_branch" reporter:label="Case Branch">
10419                 <fields oils_persist:primary="id" oils_persist:sequence="query.case_branch_id_seq">
10420                         <field reporter:label="Case Branch ID" name="id" reporter:datatype="id"/>
10421                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10422                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10423                         <field reporter:label="Condition" name="condition" reporter:datatype="link"/>
10424                         <field reporter:label="Result" name="result" reporter:datatype="link"/>
10425                 </fields>
10426                 <links>
10427                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10428                         <link field="condition" reltype="has_a" key="id" map="" class="qxp"/>
10429                         <link field="result" reltype="has_a" key="id" map="" class="qxp"/>
10430                 </links>
10431         </class>
10432
10433         <class id="qfr" controller="open-ils.cstore" oils_obj:fieldmapper="query::from_relation" oils_persist:tablename="query.from_relation" reporter:label="From Relation">
10434                 <fields oils_persist:primary="id" oils_persist:sequence="query.from_relation_id_seq">
10435                         <field reporter:label="From Relation ID" name="id" reporter:datatype="id"/>
10436                         <field reporter:label="From Relation Type" name="type" reporter:datatype="text"/>
10437                         <field reporter:label="Table Name" name="table_name" reporter:datatype="text"/>
10438                         <field reporter:label="Class Name" name="class_name" reporter:datatype="text"/>
10439                         <field reporter:label="Subquery ID" name="subquery" reporter:datatype="link"/>
10440                         <field reporter:label="Function Call ID" name="function_call" reporter:datatype="link"/>
10441                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10442                         <field reporter:label="Parent Relation ID" name="parent_relation" reporter:datatype="link"/>
10443                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10444                         <field reporter:label="Join Type" name="join_type" reporter:datatype="text"/>
10445                         <field reporter:label="On Clause ID" name="on_clause" reporter:datatype="link"/>
10446                 </fields>
10447                 <links>
10448                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10449                         <link field="function_call" reltype="has_a" key="id" map="" class="qxp"/>
10450                         <link field="parent_relation" reltype="has_a" key="id" map="" class="qfr"/>
10451                         <link field="on_clause" reltype="has_a" key="id" map="" class="qxp"/>
10452                 </links>
10453         </class>
10454
10455         <class id="qrc" controller="open-ils.cstore" oils_obj:fieldmapper="query::record_column" oils_persist:tablename="query.record_column" reporter:label="Record Column">
10456                 <fields oils_persist:primary="id" oils_persist:sequence="query.record_column_id_seq">
10457                         <field reporter:label="Record Column ID" name="id" reporter:datatype="id"/>
10458                         <field reporter:label="From Relation ID" name="from_relation" reporter:datatype="link"/>
10459                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10460                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10461                         <field reporter:label="Column Type" name="column_type" reporter:datatype="link"/>
10462                 </fields>
10463                 <links>
10464                         <link field="from_relation" reltype="has_a" key="id" map="" class="qfr"/>
10465                         <link field="column_type" reltype="has_a" key="id" map="" class="qdt"/>
10466                 </links>
10467         </class>
10468
10469         <class id="qsi" controller="open-ils.cstore" oils_obj:fieldmapper="query::select_item" oils_persist:tablename="query.select_item" reporter:label="Select Item">
10470                 <fields oils_persist:primary="id" oils_persist:sequence="query.select_item_id_seq">
10471                         <field reporter:label="Select Item ID" name="id" reporter:datatype="id"/>
10472                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
10473                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10474                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
10475                         <field reporter:label="Column Alias" name="column_alias" reporter:datatype="text"/>
10476                         <field reporter:label="Is Grouped By" name="grouped_by" reporter:datatype="bool"/>
10477                 </fields>
10478                 <links>
10479                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10480                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
10481                 </links>
10482         </class>
10483
10484         <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">
10485                 <fields oils_persist:primary="id" oils_persist:sequence="query.order_by_item_id_seq">
10486                         <field reporter:label="Order By Item ID" name="id" reporter:datatype="id"/>
10487                         <field reporter:label="Stored Query ID" name="stored_query" reporter:datatype="link"/>
10488                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10489                         <field reporter:label="Expression" name="expression" reporter:datatype="link"/>
10490                 </fields>
10491                 <links>
10492                         <link field="stored_query" reltype="has_a" key="id" map="" class="qsq"/>
10493                         <link field="expression" reltype="has_a" key="id" map="" class="qxp"/>
10494                 </links>
10495         </class>
10496
10497         <class id="xbet" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbet" oils_persist:tablename="query.expr_xbet" reporter:label="Between Expression">
10498                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10499                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10500                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10501                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10502                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10503                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10504                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10505                 </fields>
10506                 <links>
10507                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10508                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10509                 </links>
10510         </class>
10511
10512         <class id="xbind" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbind" oils_persist:tablename="query.expr_xbind" reporter:label="Bind Variable Expression">
10513                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10514                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10515                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10516                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10517                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10518                         <field reporter:label="Bind Variable" name="bind_variable" reporter:datatype="link"/>
10519                 </fields>
10520                 <links>
10521                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10522                         <link field="bind_variable" reltype="has_a" key="name" map="" class="qbv"/>
10523                 </links>
10524         </class>
10525
10526         <class id="xbool" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xbool" oils_persist:tablename="query.expr_xbool" reporter:label="Boolean Expression">
10527                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10528                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10529                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10530                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10531                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10532                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10533                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10534                 </fields>
10535                 <links>
10536                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10537                 </links>
10538         </class>
10539
10540         <class id="xcase" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcase" oils_persist:tablename="query.expr_xcase" reporter:label="Case Expression">
10541                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10542                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10543                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10544                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10545                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10546                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10547                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10548                 </fields>
10549                 <links>
10550                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10551                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10552                 </links>
10553         </class>
10554
10555         <class id="xcast" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcast" oils_persist:tablename="query.expr_xcast" reporter:label="Cast Expression">
10556                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10557                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10558                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10559                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10560                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10561                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10562                         <field reporter:label="Cast Type" name="cast_type" reporter:datatype="link"/>
10563                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10564                 </fields>
10565                 <links>
10566                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10567                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10568                         <link field="cast_type" reltype="has_a" key="id" map="" class="qdt"/>
10569                 </links>
10570         </class>
10571
10572         <class id="xcol" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xcol" oils_persist:tablename="query.expr_xcol" reporter:label="Column Expression">
10573                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10574                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10575                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10576                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10577                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10578                         <field reporter:label="Table Alias" name="table_alias" reporter:datatype="text"/>
10579                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10580                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10581                 </fields>
10582                 <links>
10583                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10584                 </links>
10585         </class>
10586
10587         <class id="xex" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xex" oils_persist:tablename="query.expr_xex" reporter:label="Exists Expression">
10588                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10589                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10590                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10591                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10592                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10593                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10594                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10595                 </fields>
10596                 <links>
10597                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10598                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10599                 </links>
10600         </class>
10601
10602         <class id="xfunc" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xfunc" oils_persist:tablename="query.expr_xfunc" reporter:label="Function Expression">
10603                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10604                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10605                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10606                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10607                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10608                         <field reporter:label="Column Name" name="column_name" reporter:datatype="text"/>
10609                         <field reporter:label="Function ID" name="function_id" reporter:datatype="link"/>
10610                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10611                 </fields>
10612                 <links>
10613                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10614                         <link field="function_id" reltype="has_a" key="id" map="" class="qfs"/>
10615                 </links>
10616         </class>
10617
10618         <class id="xin" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xin" oils_persist:tablename="query.expr_xin" reporter:label="In Expression">
10619                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10620                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10621                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10622                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10623                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10624                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10625                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10626                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10627                 </fields>
10628                 <links>
10629                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10630                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10631                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10632                 </links>
10633         </class>
10634
10635         <class id="xisnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xisnull" oils_persist:tablename="query.expr_xisnull" reporter:label="IS NULL Expression">
10636                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10637                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10638                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10639                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10640                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10641                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10642                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10643                 </fields>
10644                 <links>
10645                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10646                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10647                 </links>
10648         </class>
10649
10650         <class id="xnull" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnull" oils_persist:tablename="query.expr_xnull" reporter:label="Null Expression">
10651                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10652                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10653                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10654                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10655                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10656                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10657                 </fields>
10658                 <links>
10659                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10660                 </links>
10661         </class>
10662
10663         <class id="xnum" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xnum" oils_persist:tablename="query.expr_xnum" reporter:label="Number Expression">
10664                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10665                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10666                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10667                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10668                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10669                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10670                 </fields>
10671                 <links>
10672                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10673                 </links>
10674         </class>
10675
10676         <class id="xop" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xop" oils_persist:tablename="query.expr_xop" reporter:label="Operator Expression">
10677                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10678                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10679                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10680                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10681                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10682                         <field reporter:label="Left Operand" name="left_operand" reporter:datatype="link"/>
10683                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10684                         <field reporter:label="Right Operand" name="right_operand" reporter:datatype="link"/>
10685                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10686                 </fields>
10687                 <links>
10688                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10689                         <link field="left_operand" reltype="has_a" key="id" map="" class="qxp"/>
10690                         <link field="right_operand" reltype="has_a" key="id" map="" class="qxp"/>
10691                 </links>
10692         </class>
10693
10694         <class id="xser" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xser" oils_persist:tablename="query.expr_xser" reporter:label="Operator Expression">
10695                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10696                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10697                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10698                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10699                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10700                         <field reporter:label="Operator" name="operator" reporter:datatype="text"/>
10701                         <field reporter:label="Negate?" name="negate" reporter:datatype="bool"/>
10702                 </fields>
10703                 <links>
10704                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10705                 </links>
10706         </class>
10707
10708         <class id="xstr" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xstr" oils_persist:tablename="query.expr_xstr" reporter:label="String Expression">
10709                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10710                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10711                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10712                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10713                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10714                         <field reporter:label="Literal" name="literal" reporter:datatype="text"/>
10715                 </fields>
10716                 <links>
10717                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10718                 </links>
10719         </class>
10720
10721         <class id="xsubq" controller="open-ils.cstore" oils_obj:fieldmapper="query::expr_xsubq" oils_persist:tablename="query.expr_xsubq" reporter:label="Subquery Expression">
10722                 <fields oils_persist:primary="id" oils_persist:sequence="query.expression_id_seq">
10723                         <field reporter:label="Expression ID" name="id" reporter:datatype="id"/>
10724                         <field reporter:label="Is Parenthesized" name="parenthesize" reporter:datatype="bool"/>
10725                         <field reporter:label="Parent Expression" name="parent_expr" reporter:datatype="link"/>
10726                         <field reporter:label="Sequence Number" name="seq_no" reporter:datatype="int"/>
10727                         <field reporter:label="Subquery" name="subquery" reporter:datatype="link"/>
10728                 </fields>
10729                 <links>
10730                         <link field="parent_expr" reltype="has_a" key="id" map="" class="qxp"/>
10731                         <link field="subquery" reltype="has_a" key="id" map="" class="qsq"/>
10732                 </links>
10733         </class>
10734
10735         <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">
10736                 <fields oils_persist:primary="id">
10737                         <field reporter:label="Temp ID" name="id" reporter:datatype="id"/>
10738                         <field reporter:label="Type" name="ptype" reporter:datatype="link"/>
10739                         <field reporter:label="Subfield" name="subfield" reporter:datatype="link"/>
10740                         <field reporter:label="Value" name="value" reporter:datatype="link"/>
10741                         <field reporter:label="Record" name="record" reporter:datatype="link"/>
10742                 </fields>
10743                 <links>
10744                         <link field="ptype" reltype="has_a" key="id" map="" class="cmpctm"/>
10745                         <link field="subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10746                         <link field="value" reltype="has_a" key="id" map="" class="cmpcvm"/>
10747                         <link field="record" reltype="has_a" key="id" map="" class="bre"/>
10748                 </links>
10749         </class>
10750
10751         <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">
10752                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_ff_pos_map_id_seq">
10753                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10754                         <field reporter:label="Fixed Field" name="fixed_field" reporter:datatype="text"/>
10755                         <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10756                         <field reporter:label="Record Type" name="rec_type" reporter:datatype="text"/>
10757                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10758                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10759                         <field reporter:label="Default Value" name="default_val" reporter:datatype="text"/>
10760                 </fields>
10761                 <links/>
10762                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10763                         <actions>
10764                                 <retrieve/>
10765                         </actions>
10766                 </permacrud>
10767         </class>
10768
10769         <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">
10770                 <fields oils_persist:primary="ptype_key">
10771                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="id"/>
10772                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10773                 </fields>
10774                 <links/>
10775                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10776                         <actions>
10777                                 <retrieve/>
10778                         </actions>
10779                 </permacrud>
10780         </class>
10781
10782         <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">
10783                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_subfield_map_id_seq">
10784                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10785                         <field reporter:label="Type Key" name="ptype_key" reporter:datatype="link"/>
10786                         <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10787                         <field reporter:label="Start Postion" name="start_pos" reporter:datatype="int"/>
10788                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
10789                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10790                 </fields>
10791                 <links>
10792                         <link field="ptype_key" reltype="has_a" key="id" map="" class="cmpctm"/>
10793                 </links>
10794                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10795                         <actions>
10796                                 <retrieve/>
10797                         </actions>
10798                 </permacrud>
10799         </class>
10800
10801         <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">
10802                 <fields oils_persist:primary="id" oils_persist:sequence="config.marc21_physical_characteristic_value_map_id_seq">
10803                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
10804                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
10805                         <field reporter:label="Subfield" name="ptype_subfield" reporter:datatype="link"/>
10806                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
10807                 </fields>
10808                 <links>
10809                         <link field="ptype_subfield" reltype="has_a" key="id" map="" class="cmpcsm"/>
10810                 </links>
10811                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10812                         <actions>
10813                                 <retrieve/>
10814                         </actions>
10815                 </permacrud>
10816         </class>
10817
10818     <class
10819         id="uvs"
10820         controller="open-ils.cstore open-ils.pcrud"
10821         oils_obj:fieldmapper="url_verify::session"
10822         oils_persist:tablename="url_verify.session"
10823         reporter:label="URL Verification Session"
10824     >
10825         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.session_id_seq">
10826             <field reporter:label="Session ID" name="id" reporter:datatype="id"/>
10827             <field reporter:label="Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
10828                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" oils_obj:required="true"/>
10829             <field reporter:label="Creator" name="creator" reporter:datatype="link" oils_obj:required="true"/>
10830             <field reporter:label="Record Container" name="container" reporter:datatype="link" oils_obj:required="true"/>
10831             <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
10832             <field reporter:label="Search Constraints" name="search" reporter:datatype="text" oils_obj:required="true"/>
10833             <field reporter:label="URL Selectors" name="selectors" reporter:datatype="link" oils_persist:virtual="true"/>
10834             <field reporter:label="Verification Attempts" name="attempts" reporter:datatype="link" oils_persist:virtual="true"/>
10835         </fields>
10836
10837         <links>
10838             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
10839             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
10840             <link field="container" reltype="has_a" key="id" map="" class="cbreb"/>
10841             <link field="selectors" reltype="has_many" key="session" map="" class="uvus"/>
10842             <link field="attempts" reltype="has_many" key="session" map="" class="uvva"/>
10843         </links>
10844
10845         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10846             <actions>
10847                 <retrieve permission="URL_VERIFY" context_field="owning_lib"/>
10848             </actions>
10849         </permacrud>
10850
10851     </class>
10852
10853     <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">
10854         <oils_persist:source_definition>
10855             SELECT
10856                 cbrebi.id AS id,  -- so we can have a pkey in our view
10857                 uvs.id AS session,
10858                 uvs.owning_lib,
10859                 cbrebi.target_biblio_record_entry
10860             FROM url_verify.session uvs
10861             JOIN container.biblio_record_entry_bucket cbreb
10862                 ON (uvs.container = cbreb.id)
10863             JOIN container.biblio_record_entry_bucket_item cbrebi
10864                 ON (cbrebi.bucket = cbreb.id)
10865         </oils_persist:source_definition>
10866         <fields oils_persist:primary="id" oils_persist:sequence="container.biblio_record_entry_bucket_item_id_seq">
10867             <field reporter:label="Bucket Item ID" name="id" reporter:datatype="id" />
10868             <field reporter:label="Session" name="session" reporter:datatype="link" />
10869             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit" />
10870             <field reporter:label="Target Biblio Record Entry" name="target_biblio_record_entry" reporter:datatype="link" />
10871         </fields>
10872         <links>
10873             <link field="target_biblio_record_entry" reltype="has_a" key="id" map="" class="bre" />
10874             <link field="session" reltype="has_a" key="id" map="" class="uvs" />
10875             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou" />
10876         </links>
10877         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10878             <actions>
10879                 <retrieve permission="URL_VERIFY" context_field="owning_lib" />
10880             </actions>
10881         </permacrud>
10882     </class>
10883
10884     <class
10885         id="uvus"
10886         controller="open-ils.cstore open-ils.pcrud"
10887         oils_obj:fieldmapper="url_verify::url_selector"
10888         oils_persist:tablename="url_verify.url_selector"
10889         reporter:label="URL Verification URL Selector"
10890     >
10891         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_selector_id_seq">
10892             <field reporter:label="URL Selector ID" name="id" reporter:datatype="id"/>
10893             <field reporter:label="XPath" name="xpath" reporter:datatype="text" oils_obj:required="true"/>
10894                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10895             <field reporter:label="URLs" name="urls" reporter:datatype="link" oils_persist:virtual="true"/>
10896         </fields>
10897
10898         <links>
10899             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10900             <link field="urls" reltype="has_many" key="id" map="" class="uvu"/>
10901         </links>
10902
10903         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10904             <actions>
10905                 <create permission="URL_VERIFY">
10906                     <context link="session" field="owning_lib"/>
10907                 </create>
10908                 <retrieve permission="URL_VERIFY">
10909                     <context link="session" field="owning_lib"/>
10910                 </retrieve>
10911                 <update permission="URL_VERIFY">
10912                     <context link="session" field="owning_lib"/>
10913                 </update>
10914                 <delete permission="URL_VERIFY">
10915                     <context link="session" field="owning_lib"/>
10916                 </delete>
10917             </actions>
10918         </permacrud>
10919
10920     </class>
10921
10922     <class
10923         id="uvu"
10924         controller="open-ils.cstore open-ils.pcrud"
10925         oils_obj:fieldmapper="url_verify::url"
10926         oils_persist:tablename="url_verify.url"
10927         reporter:label="URL Verification URL"
10928     >
10929         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_id_seq">
10930             <field reporter:label="URL ID" name="id" reporter:datatype="id"/>
10931                         <field reporter:label="Redirected From" name="redirect_from" reporter:datatype="link"/>
10932                         <field reporter:label="Container Item" name="item" reporter:datatype="link" oils_obj:required="true"/>
10933                         <field reporter:label="Session" name="session" reporter:datatype="link" oils_obj:required="true"/>
10934                         <field reporter:label="URL Selector" name="url_selector" reporter:datatype="link"/>
10935             <field reporter:label="Tag" name="tag" reporter:datatype="text"/>
10936             <field reporter:label="Subfield" name="subfield" reporter:datatype="text"/>
10937             <field reporter:label="Ordinal Position" name="ord" reporter:datatype="int"/>
10938             <field reporter:label="URL" name="full_url" reporter:datatype="text"/>
10939             <field reporter:label="Scheme" name="scheme" reporter:datatype="text"/>
10940             <field reporter:label="Host" name="host" reporter:datatype="text"/>
10941             <field reporter:label="Domain" name="domain" reporter:datatype="text"/>
10942             <field reporter:label="TLD" name="tld" reporter:datatype="text"/>
10943             <field reporter:label="Path" name="path" reporter:datatype="text"/>
10944             <field reporter:label="Page" name="page" reporter:datatype="text"/>
10945             <field reporter:label="Query" name="query" reporter:datatype="text"/>
10946             <field reporter:label="Fragment" name="fragment" reporter:datatype="text"/>
10947             <field reporter:label="Verifications" name="verifications" reporter:datatype="link" oils_persist:virtual="true" />
10948         </fields>
10949
10950         <links>
10951             <link field="redirect_from" reltype="has_a" key="id" map="" class="uvu"/>
10952             <link field="item" reltype="has_a" key="id" map="" class="uvsbrem" />
10953             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10954             <link field="url_selector" reltype="has_a" key="id" map="" class="uvus"/>
10955             <link field="verifications" reltype="has_many" key="url" map="" class="uvuv"/>
10956         </links>
10957
10958         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10959             <actions>
10960                 <create permission="URL_VERIFY">
10961                     <context link="session" field="owning_lib"/>
10962                 </create>
10963                 <retrieve permission="URL_VERIFY">
10964                     <context link="session" field="owning_lib"/>
10965                 </retrieve>
10966                 <update permission="URL_VERIFY">
10967                     <context link="session" field="owning_lib"/>
10968                 </update>
10969                 <delete permission="URL_VERIFY">
10970                     <context link="session" field="owning_lib"/>
10971                 </delete>
10972             </actions>
10973         </permacrud>
10974
10975     </class>
10976
10977     <class
10978         id="uvva"
10979         controller="open-ils.cstore open-ils.pcrud"
10980         oils_obj:fieldmapper="url_verify::verification_attempt"
10981         oils_persist:tablename="url_verify.verification_attempt"
10982         reporter:label="URL Verification Attempt"
10983     >
10984         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.verification_attempt_id_seq">
10985             <field reporter:label="Attempt ID" name="id" reporter:datatype="id"/>
10986                         <field reporter:label="User" name="usr" reporter:datatype="link"/>
10987                         <field reporter:label="Session" name="session" reporter:datatype="link"/>
10988             <field reporter:label="Start Time" name="start_time" reporter:datatype="timestamp"/>
10989             <field reporter:label="Finish Time" name="finish_time" reporter:datatype="timestamp"/>
10990         </fields>
10991
10992         <links>
10993             <link field="session" reltype="has_a" key="id" map="" class="uvs"/>
10994             <link field="usr" reltype="has_a" key="id" map="" class="au"/>
10995         </links>
10996
10997         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
10998             <actions>
10999                 <create permission="URL_VERIFY">
11000                     <context link="session" field="owning_lib"/>
11001                 </create>
11002                 <retrieve permission="URL_VERIFY">
11003                     <context link="session" field="owning_lib"/>
11004                 </retrieve>
11005                 <update permission="URL_VERIFY">
11006                     <context link="session" field="owning_lib"/>
11007                 </update>
11008                 <delete permission="URL_VERIFY">
11009                     <context link="session" field="owning_lib"/>
11010                 </delete>
11011             </actions>
11012         </permacrud>
11013
11014     </class>
11015
11016     <class
11017         id="uvuv"
11018         controller="open-ils.cstore open-ils.pcrud"
11019         oils_obj:fieldmapper="url_verify::url_verification"
11020         oils_persist:tablename="url_verify.url_verification"
11021         reporter:label="URL Verification"
11022     >
11023         <fields oils_persist:primary="id" oils_persist:sequence="url_verify.url_verification_id_seq">
11024             <field reporter:label="Verification ID" name="id" reporter:datatype="id"/>
11025                         <field reporter:label="URL" name="url" reporter:datatype="link"/>
11026                         <field reporter:label="Attempt" name="attempt" reporter:datatype="link"/>
11027             <field reporter:label="Request Time" name="req_time" reporter:datatype="timestamp"/>
11028             <field reporter:label="Result Time" name="res_time" reporter:datatype="timestamp"/>
11029             <field reporter:label="Result Code" name="res_code" reporter:datatype="int"/>
11030             <field reporter:label="Result Text" name="res_text" reporter:datatype="text"/>
11031                         <field reporter:label="Redirected To" name="redirect_to" reporter:datatype="link"/>
11032         </fields>
11033
11034         <links>
11035             <link field="url" reltype="has_a" key="id" map="" class="uvu"/>
11036             <link field="attempt" reltype="has_a" key="id" map="" class="uvva"/>
11037             <link field="redirect_to" reltype="has_a" key="id" map="" class="uvu"/>
11038         </links>
11039
11040         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11041             <actions>
11042                 <create permission="URL_VERIFY">
11043                     <context link="attempt" jump="session" field="owning_lib"/>
11044                 </create>
11045                 <retrieve permission="URL_VERIFY">
11046                     <context link="attempt" jump="session" field="owning_lib"/>
11047                 </retrieve>
11048                 <update permission="URL_VERIFY">
11049                     <context link="attempt" jump="session" field="owning_lib"/>
11050                 </update>
11051                 <delete permission="URL_VERIFY">
11052                     <context link="attempt" jump="session" field="owning_lib"/>
11053                 </delete>
11054             </actions>
11055         </permacrud>
11056
11057     </class>
11058
11059         <class
11060                 id="cfdi"
11061                 controller="open-ils.cstore open-ils.pcrud"
11062                 oils_obj:fieldmapper="config::filter_dialog_interface"
11063                 oils_persist:tablename="config.filter_dialog_interface"
11064                 reporter:label="FilterDialog Interface">
11065                 <fields oils_persist:primary="key" oils_persist:sequence="config.filter_dialog_interface_pkey">
11066                         <field reporter:label="Interface Key" name="key" reporter:datatype="text" />
11067                         <field reporter:label="Description" name="description" reporter:datatype="text" />
11068                 </fields>
11069                 <links>
11070                         <link field="filter_sets" reltype="has_many" key="interface" map="" class="cfdfs"/>
11071                 </links>
11072                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11073                         <actions>
11074                                 <retrieve />
11075                         </actions>
11076                 </permacrud>
11077         </class>
11078
11079         <class
11080                 id="cfdfs"
11081                 controller="open-ils.cstore open-ils.pcrud"
11082                 oils_obj:fieldmapper="config::filter_dialog_filter_set"
11083                 oils_persist:tablename="config.filter_dialog_filter_set"
11084                 reporter:label="FilterDialog Filter Set">
11085                 <fields oils_persist:primary="id" oils_persist:sequence="config.filter_dialog_filter_set_id_seq">
11086                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
11087                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
11088                         <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11089                         <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11090                         <field reporter:label="Interface" name="interface" reporter:datatype="link"/>
11091                         <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
11092                         <field reporter:label="Filters" name="filters" reporter:datatype="text"/>
11093                 </fields>
11094                 <links>
11095                         <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11096                         <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11097                         <link field="interface" reltype="has_a" key="key" map="" class="cfdi"/>
11098                 </links>
11099                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11100                         <actions>
11101                                 <create permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11102                                 <retrieve permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11103                                 <update permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11104                                 <delete permission="SAVED_FILTER_DIALOG_FILTERS" context_field="owning_lib"/>
11105                         </actions>
11106                 </permacrud>
11107
11108         </class>
11109
11110         <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">
11111                 <fields oils_persist:primary="code">
11112                         <field reporter:label="Code" name="code" reporter:datatype="id"/>
11113                         <field reporter:label="Type Value" name="type_val" reporter:datatype="text"/>
11114                         <field reporter:label="BLvl Value" name="blvl_val" reporter:datatype="text"/>
11115                 </fields>
11116                 <links/>
11117                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11118                         <actions>
11119                                 <retrieve/>
11120                         </actions>
11121                 </permacrud>
11122         </class>
11123
11124         <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">
11125                 <oils_persist:source_definition>
11126
11127             SELECT  b.id,
11128                     MAX(dcp.edit_date) AS last_delete_date
11129              FROM   biblio.record_entry b
11130                     JOIN asset.call_number cn ON (cn.record = b.id)
11131                     JOIN asset.copy dcp ON (cn.id = dcp.call_number)
11132              WHERE  NOT b.deleted
11133              GROUP BY b.id
11134              HAVING SUM( CASE WHEN NOT dcp.deleted THEN 1 ELSE 0 END) = 0 
11135
11136                 </oils_persist:source_definition>
11137                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11138                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11139                         <field reporter:label="Delete Date/Time" name="last_delete_date" reporter:datatype="timestamp"/>
11140                 </fields>
11141                 <links>
11142                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11143                 </links>
11144                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11145                         <actions>
11146                                 <retrieve/>
11147                         </actions>
11148                 </permacrud>
11149         </class>
11150
11151         <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">
11152                 <oils_persist:source_definition>
11153
11154             -- -- 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.
11155             -- -- 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
11156             -- -- may not.
11157             -- SELECT
11158             --     bre.id AS bib_id,
11159             --     COALESCE( z.copy_count, 0 ) AS copy_count,
11160             --     COALESCE( z.hold_count, 0 ) AS hold_count,
11161             --     COALESCE( z.copy_hold_ratio, 0 ) AS hold_copy_ratio
11162             -- FROM (
11163                 SELECT
11164                     y.bre AS id,
11165                     COALESCE( x.copy_count, 0 ) AS copy_count,
11166                     y.hold_count AS hold_count,
11167                     (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
11168                 FROM (
11169                         SELECT
11170                             (SELECT bib_record FROM reporter.hold_request_record r WHERE r.id = h.id LIMIT 1) AS bre,
11171                             COUNT(*) AS hold_count
11172                         FROM action.hold_request h
11173                         WHERE
11174                             cancel_time IS NULL
11175                             AND fulfillment_time IS NULL
11176                             -- AND NOT frozen  -- a frozen hold is still a desired hold, eh?
11177                         GROUP BY 1
11178                     )y LEFT JOIN (
11179                         SELECT 
11180                             (SELECT id
11181                                 FROM biblio.record_entry 
11182                                 WHERE id = (SELECT record FROM asset.call_number WHERE id = call_number and deleted is false)
11183                             ) AS bre, 
11184                             COUNT(*) AS copy_count
11185                         FROM asset.copy
11186                             JOIN asset.copy_location loc ON (copy.location = loc.id AND loc.holdable)
11187                         WHERE copy.holdable 
11188                             AND NOT copy.deleted 
11189                             AND copy.status IN ( SELECT id FROM config.copy_status WHERE holdable ) 
11190                         GROUP BY 1
11191                     )x ON x.bre = y.bre
11192                 -- )z RIGHT JOIN (
11193                 --     SELECT id
11194                 --     FROM biblio.record_entry
11195                 --     WHERE NOT deleted
11196                 -- )bre ON (z.bib_id = bre.id)
11197                 
11198
11199                 </oils_persist:source_definition>
11200                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11201                         <field reporter:label="Record ID" name="id" reporter:datatype="id"/>
11202                         <field reporter:label="Holdable Copy Count" name="copy_count" reporter:datatype="int"/>
11203                         <field reporter:label="Active Holds" name="hold_count" reporter:datatype="int"/>
11204                         <field reporter:label="Hold/Copy Ratio" name="hold_copy_ratio" reporter:datatype="float"/>
11205                 </fields>
11206                 <links>
11207                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11208                 </links>
11209                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11210                         <actions>
11211                                 <retrieve/>
11212                         </actions>
11213                 </permacrud>
11214         </class>
11215
11216         <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">
11217                 <oils_persist:source_definition>
11218             SELECT *,
11219                 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,
11220                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE holds_everywhere::FLOAT/copy_count_everywhere END AS everywhere_ratio
11221             FROM
11222                 (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
11223                     FROM
11224                         action.hold_request ahr
11225                         JOIN reporter.hold_request_record rhrr USING (id)
11226                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11227                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id AND ahr.pickup_lib = ac.circ_lib)
11228                     WHERE
11229                         ahr.cancel_time IS NULL
11230                         AND ahr.fulfillment_time IS NULL
11231                     GROUP BY bib_record, pickup_lib
11232                 )x
11233                 JOIN
11234                 (SELECT bib_record as id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11235                     FROM
11236                         action.hold_request ahr
11237                         JOIN reporter.hold_request_record rhrr USING (id)
11238                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11239                     WHERE
11240                         ahr.cancel_time IS NULL
11241                         AND ahr.fulfillment_time IS NULL
11242                     GROUP BY bib_record
11243                 )y
11244                 USING (id)
11245                 </oils_persist:source_definition>
11246                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11247                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
11248                         <field reporter:label="Pickup Library" name="pickup_lib" reporter:datatype="org_unit"/>
11249                         <field reporter:label="Active Holds at Pickup Library" name="holds_at_pickup_library" reporter:datatype="int"/>
11250                         <field reporter:label="Holdable Copy Count at Pickup Library" name="copy_count_at_pickup_library" reporter:datatype="int"/>
11251                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
11252                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
11253                         <field reporter:label="Hold/Copy Ratio at Pickup Library" name="pickup_library_ratio" reporter:datatype="float"/>
11254                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
11255                 </fields>
11256                 <links>
11257                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11258                         <link field="pickup_lib" reltype="has_a" key="id" map="" class="aou"/>
11259                 </links>
11260                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11261                         <actions>
11262                                 <retrieve/>
11263                         </actions>
11264                 </permacrud>
11265         </class>
11266
11267         <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) ">
11268                 <oils_persist:source_definition>
11269             WITH counts_at_ou AS (
11270                 SELECT  rhrr.bib_record AS id,
11271                         aou.id AS pickup_lib_or_desc,
11272                         COUNT(DISTINCT ahr.id) AS holds_at_or_below,
11273                         COALESCE(COUNT(DISTINCT ac.id),0) AS copy_count_at_or_below
11274                   FROM  actor.org_unit aou
11275                         JOIN actor.org_unit_type aout ON (aou.ou_type = aout.id),
11276                         action.hold_request ahr
11277                         JOIN reporter.hold_request_record rhrr USING (id)
11278                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11279                         LEFT JOIN asset.copy ac ON (ahcm.target_copy = ac.id)
11280                   WHERE ahr.cancel_time IS NULL AND ahr.fulfillment_time IS NULL
11281                         AND ac.circ_lib IN (SELECT id FROM actor.org_unit_descendants(aou.id))
11282                         AND (actor.org_unit_ancestor_at_depth(ahr.pickup_lib,aout.depth)).id = (actor.org_unit_ancestor_at_depth(ac.circ_lib,aout.depth)).id
11283                   GROUP BY 1, 2
11284             )
11285             SELECT x.id, x.pickup_lib_or_desc, x.holds_at_or_below, x.copy_count_at_or_below,
11286                    y.holds_everywhere, y.copy_count_everywhere,
11287                 CASE WHEN copy_count_at_or_below = 0 THEN 'Infinity'::FLOAT ELSE x.holds_at_or_below::FLOAT/x.copy_count_at_or_below END AS hold_copy_ratio_at_or_below_ou,
11288                 CASE WHEN copy_count_everywhere = 0 THEN 'Infinity'::FLOAT ELSE y.holds_everywhere::FLOAT/y.copy_count_everywhere END AS everywhere_ratio
11289             FROM counts_at_ou x
11290                 JOIN (SELECT bib_record AS id, count(DISTINCT ahr.id) AS holds_everywhere, COALESCE(count(DISTINCT target_copy),0) as copy_count_everywhere
11291                     FROM
11292                         action.hold_request ahr
11293                         JOIN reporter.hold_request_record rhrr USING (id)
11294                         LEFT JOIN action.hold_copy_map ahcm ON (ahr.id = ahcm.hold)
11295                     WHERE
11296                         ahr.cancel_time IS NULL
11297                         AND ahr.fulfillment_time IS NULL
11298                     GROUP BY bib_record
11299                 )y
11300                 USING (id)
11301                 </oils_persist:source_definition>
11302                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11303                         <field reporter:label="Record ID" name="id" reporter:datatype="link"/>
11304                         <field reporter:label="Pickup Library" name="pickup_lib_or_desc" reporter:datatype="org_unit"/>
11305                         <field reporter:label="Active Holds at Pickup Library and its Descendants" name="holds_at_or_below" reporter:datatype="int"/>
11306                         <field reporter:label="Holdable Copy Count at Pickup Library and its Descendants" name="copy_count_at_or_below" reporter:datatype="int"/>
11307                         <field reporter:label="Active Holds Everywhere" name="holds_everywhere" reporter:datatype="int"/>
11308                         <field reporter:label="Holdable Copy Count Everywhere" name="copy_count_everywhere" reporter:datatype="int"/>
11309                         <field reporter:label="Hold/Copy Ratio at Pickup Library and its Descendants" name="hold_copy_ratio_at_or_below_ou" reporter:datatype="float"/>
11310                         <field reporter:label="Hold/Copy Ratio Everywhere" name="everywhere_ratio" reporter:datatype="float"/>
11311                 </fields>
11312                 <links>
11313                         <link field="id" reltype="has_a" key="id" map="" class="bre"/>
11314                         <link field="pickup_lib_or_desc" reltype="has_a" key="id" map="" class="aou"/>
11315                 </links>
11316                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11317                         <actions>
11318                                 <retrieve/>
11319                         </actions>
11320                 </permacrud>
11321         </class>
11322
11323         <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">
11324                 <oils_persist:source_definition>
11325             SELECT
11326                 ac.id,
11327                 COALESCE(MAX(actac.xact_start), ac.create_date) AS last_circ_or_create,
11328                 MAX(actac.xact_start) AS last_circ
11329             FROM asset.copy ac
11330                  LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
11331             GROUP BY ac.id
11332
11333             -- Alternate version, say if you have migrated last checkout information in extend_reporter.legacy_circ_timestamp:
11334             --SELECT
11335             --    ac.id,
11336             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts, ac.create_date) AS last_circ_or_create,
11337             --    GREATEST(MAX(actac.xact_start), erlct.last_cko_ts) AS last_circ
11338             --FROM asset.copy ac
11339             --     LEFT JOIN action.all_circulation actac ON ac.id = actac.target_copy
11340             --     LEFT JOIN extend_reporter.legacy_circ_timestamp erlct ON ac.id = erlct.id
11341             --GROUP BY ac.id, ac.create_date, erlct.last_cko_ts
11342                 </oils_persist:source_definition>
11343                 <fields oils_persist:primary="id" oils_persist:sequence="biblio.record_entry">
11344                         <field reporter:label="Copy ID" name="id" reporter:datatype="link"/>
11345                         <field reporter:label="Last Circulation or Creation Date" name="last_circ_or_create" reporter:datatype="timestamp"/>
11346                         <field reporter:label="Last Circulation Date" name="last_circ" reporter:datatype="timestamp"/>
11347                 </fields>
11348                 <links>
11349                         <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11350                 </links>
11351                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11352                         <actions>
11353                                 <retrieve/>
11354                         </actions>
11355                 </permacrud>
11356         </class>
11357
11358         <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">
11359                 <fields oils_persist:primary="id">
11360                         <field reporter:label="Text Search Config" reporter:selector="name" reporter:datatype="text" name="id"/>
11361                         <field reporter:label="Text Search Config Name" reporter:datatype="text" name="name"/>
11362                 </fields>
11363                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11364                         <actions>
11365                                 <retrieve/>
11366                         </actions>
11367                 </permacrud>
11368         </class>
11369
11370         <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">
11371                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_class_ts_map_id_seq">
11372                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
11373                         <field reporter:label="Metabib Class" reporter:datatype="text" name="field_class"/>
11374                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
11375                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
11376                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
11377                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
11378                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
11379                         <field reporter:label="Always Apply?" reporter:datatype="bool" name="always"/>
11380                 </fields>
11381                 <links>
11382                         <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
11383                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
11384                 </links>
11385                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11386                         <actions>
11387                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11388                                 <retrieve/>
11389                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11390                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11391                         </actions>
11392                 </permacrud>
11393         </class>
11394
11395         <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">
11396                 <fields oils_persist:primary="id" oils_persist:sequence="config.metabib_field_ts_map_id_seq">
11397                         <field reporter:label="Map ID" reporter:datatype="id" name="id"/>
11398                         <field reporter:label="Metabib Field" reporter:datatype="text" name="metabib_field"/>
11399                         <field reporter:label="Text Search Config" reporter:datatype="text" name="ts_config"/>
11400                         <field reporter:label="Active?" reporter:datatype="bool" name="active"/>
11401                         <field reporter:label="Index Weight" reporter:datatype="text" name="index_weight"/>
11402                         <field reporter:label="Index Language" reporter:datatype="text" name="index_lang"/>
11403                         <field reporter:label="Search Language" reporter:datatype="text" name="search_lang"/>
11404                 </fields>
11405                 <links>
11406                         <link field="metabib_field" reltype="has_a" key="id" map="" class="cmf"/>
11407                         <link field="ts_config" reltype="has_a" key="id" map="" class="ctcl"/>
11408                 </links>
11409                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11410                         <actions>
11411                                 <create permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11412                                 <retrieve/>
11413                                 <update permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11414                                 <delete permission="ADMIN_INDEX_NORMALIZER" global_required="true"/>
11415                         </actions>
11416                 </permacrud>
11417         </class>
11418
11419
11420         <!-- ********************************************************************************************************************* -->
11421         <!-- What follows is a set of example extensions that are useful for PINES.  Comment out or remove if you don't want them. -->
11422         <!-- ********************************************************************************************************************* -->
11423         <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">
11424                 <fields oils_persist:primary="id">
11425                         <field reporter:label="Circulation" name="id" reporter:datatype="id" />
11426                         <field reporter:label="Library Circulation Location Short (Policy) Name" name="circ_lib" reporter:datatype="text"/>
11427                         <field reporter:label="Library Circulation Location Link" name="circ_lib_id" reporter:datatype="org_unit"/>
11428                         <field reporter:label="Circulation Date/Time" name="xact_start" reporter:datatype="timestamp"/>
11429                         <field reporter:label="Circulation Type" name="circ_type" reporter:datatype="text"/>
11430                         <field reporter:label="Copy Link" name="copy_id" reporter:datatype="link"/>
11431                         <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11432                         <field reporter:label="Owning Library Short (Policy) Name" name="owning_lib_name" reporter:datatype="text"/>
11433                         <field reporter:label="Item Language" name="language" reporter:datatype="text"/>
11434                         <field reporter:label="Literary Form" name="lit_form" reporter:datatype="text"/>
11435                         <field reporter:label="MARC Form" name="item_form" reporter:datatype="text"/>
11436                         <field reporter:label="MARC Type" name="item_type" reporter:datatype="text"/>
11437                         <field reporter:label="Shelving Location" name="shelving_location" reporter:datatype="text"/>
11438                         <field reporter:label="Patron Profile Group" name="profile_group" reporter:datatype="text"/>
11439                         <field reporter:label="Patron Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
11440                         <field reporter:label="Call Number Link" name="call_number" reporter:datatype="link"/>
11441                         <field reporter:label="Call Number Label" name="call_number_label" reporter:datatype="text"/>
11442                         <field reporter:label="Call Number Dewey/Prefix" name="dewey" reporter:datatype="text"/>
11443                         <field reporter:label="Patron Link" name="patron_id" reporter:datatype="link"/>
11444                         <field reporter:label="Patron Home Library Link" name="patron_home_lib" reporter:datatype="link"/>
11445                         <field reporter:label="Patron Home Library Short (Policy) Name" name="patron_home_lib_shortname" reporter:datatype="text"/>
11446                         <field reporter:label="Patron County" name="patron_county" reporter:datatype="text"/>
11447                         <field reporter:label="Patron City" name="patron_city" reporter:datatype="text"/>
11448                         <field reporter:label="Patron ZIP Code" name="patron_zip" reporter:datatype="text"/>
11449                         <field reporter:label="Legacy CAT1 Link" name="stat_cat_1" reporter:datatype="link"/>
11450                         <field reporter:label="Legacy CAT2 Link" name="stat_cat_2" reporter:datatype="link"/>
11451                         <field reporter:label="Dewey Range - Tens" name="dewey_range_tens" reporter:datatype="text"/>
11452                         <field reporter:label="Dewey Range - Hundreds" name="dewey_range_hundreds" reporter:datatype="text"/>
11453                         <field reporter:label="Dewey Block - Tens" name="dewey_block_tens" reporter:datatype="text"/>
11454                         <field reporter:label="Dewey Block - Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11455                         <field reporter:label="Legacy CAT1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11456                         <field reporter:label="Legacy CAT2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11457                 </fields>
11458                 <links>
11459                         <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11460                         <link field="copy_id" reltype="has_a" key="id" map="" class="acp"/>
11461                         <link field="patron_id" reltype="has_a" key="id" map="" class="au"/>
11462                         <link field="circ_lib_id" reltype="has_a" key="id" map="" class="aou"/>
11463                         <link field="call_number" reltype="has_a" key="id" map="" class="acn"/>
11464                         <link field="patron_home_lib" reltype="has_a" key="id" map="" class="aou"/>
11465                         <link field="stat_cat_1" reltype="has_a" key="id" map="" class="rsce1"/>
11466                         <link field="stat_cat_2" reltype="has_a" key="id" map="" class="rsce2"/>
11467                 </links>
11468         </class>
11469
11470         <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">
11471                 <fields oils_persist:primary="id">
11472                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
11473                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
11474                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11475                 </fields>
11476                 <links>
11477                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11478                 </links>
11479         </class>
11480
11481         <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">
11482                 <fields oils_persist:primary="id">
11483                         <field reporter:label="Entry ID" name="id" reporter:selector="value" reporter:datatype="id" />
11484                         <field reporter:label="Entry Owner" name="owner" reporter:datatype="link"/>
11485                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
11486                 </fields>
11487                 <links>
11488                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11489                 </links>
11490         </class>
11491
11492         <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">
11493                 <fields oils_persist:primary="id">
11494                         <field reporter:label="Transaction ID" name="id" reporter:datatype="id" />
11495
11496                         <field reporter:label="Billing Location Short (Policy) Name" name="billing_location_shortname" reporter:datatype="text"/>
11497                         <field reporter:label="Billing Location Name" name="billing_location_name" reporter:datatype="text"/>
11498                         <field reporter:label="Billing Location Link" name="billing_location" reporter:datatype="org_unit"/>
11499
11500                         <field reporter:label="User Home Library Short (Policy) Name" name="usr_home_ou_shortname" reporter:datatype="text"/>
11501                         <field reporter:label="User Home Library Name" name="usr_home_ou_name" reporter:datatype="text"/>
11502                         <field reporter:label="User Home Library Link" name="usr_home_ou" reporter:datatype="org_unit"/>
11503
11504                         <field reporter:label="User Barcode" name="barcode" reporter:datatype="text"/>
11505                         <field reporter:label="User Link" name="usr" reporter:datatype="link"/>
11506
11507                         <field reporter:label="Transaction Start Date/Time" name="xact_start" reporter:datatype="timestamp"/>
11508                         <field reporter:label="Transaction End Date/Time" name="xact_finish" reporter:datatype="timestamp"/>
11509                         <field reporter:label="Transaction Type" name="xact_type" reporter:datatype="text"/>
11510
11511                         <field reporter:label="Total Paid" name="total_paid" reporter:datatype="money"/>
11512                         <field reporter:label="Total Billed" name="total_owed" reporter:datatype="money"/>
11513
11514                         <field reporter:label="Last Payment Date/Time" name="last_payment_ts" reporter:datatype="timestamp"/>
11515                         <field reporter:label="Last Payment Note" name="last_payment_note" reporter:datatype="text"/>
11516                         <field reporter:label="Last Payment Type" name="last_payment_type" reporter:datatype="text"/>
11517
11518                         <field reporter:label="Last Billing Date/Time" name="last_billing_ts" reporter:datatype="timestamp"/>
11519                         <field reporter:label="Last Billing Note" name="last_billing_note" reporter:datatype="text"/>
11520                         <field reporter:label="Last Billing Type" name="last_billing_type" reporter:datatype="text"/>
11521
11522                         <field reporter:label="User Age Demographic" name="demographic_general_division" reporter:datatype="text"/>
11523                         <field reporter:label="User County" name="patron_county" reporter:datatype="text"/>
11524                         <field reporter:label="User City" name="patron_city" reporter:datatype="text"/>
11525                         <field reporter:label="User ZIP Code" name="patron_zip" reporter:datatype="text"/>
11526
11527                         <field reporter:label="Balance Owed" name="balance_owed" reporter:datatype="money"/>
11528                         <field reporter:label="User Profile Group" name="profile_group" reporter:datatype="text"/>
11529
11530                 </fields>
11531                 <links>
11532                         <link field="id" reltype="has_a" key="id" map="" class="mbt"/>
11533                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11534                         <link field="billing_location" reltype="has_a" key="id" map="" class="aou"/>
11535                         <link field="usr_home_ou" reltype="has_a" key="id" map="" class="aou"/>
11536                 </links>
11537         </class>
11538
11539         <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">
11540                 <oils_persist:source_definition>
11541
11542             SELECT
11543                 po.ordering_agency AS ordering_agency,
11544                 po.id AS purchase_order,
11545                 li.id AS lineitem,
11546                 lid.id AS lineitem_detail,
11547                 cpa.id AS claim_policy_action
11548             FROM
11549                 acq.lineitem_detail lid
11550                 JOIN acq.lineitem li ON (li.id = lid.lineitem)
11551                 JOIN acq.purchase_order po ON (po.id = li.purchase_order)
11552                 JOIN acq.claim_policy cp ON (li.claim_policy = cp.id)
11553                 JOIN acq.claim_policy_action cpa ON (
11554                     cpa.claim_policy = cp.id
11555
11556                     -- we only care about claim policy actions whose claim
11557                     -- interval we'd reached or exceeded
11558                     AND (NOW() - cpa.action_interval) &gt; po.order_date
11559
11560                     -- filter out all claim policy actions where claim events
11561                     -- have occurred on or after the action's action_interval
11562                     AND NOT EXISTS (
11563                         SELECT 1
11564                         FROM
11565                             acq.claim_event evt
11566                             JOIN acq.claim claim ON (
11567                                 claim.id = evt.claim
11568                                 AND claim.lineitem_detail = lid.id
11569                             )
11570                         WHERE
11571                             evt.event_date &gt;= (po.order_date + cpa.action_interval)
11572                     )
11573                 )
11574             WHERE
11575                 lid.cancel_reason IS NULL
11576                 AND li.cancel_reason IS NULL -- belt/suspenders
11577                 AND po.cancel_reason IS NULL -- belt/suspenders
11578                 AND lid.recv_time IS NULL
11579                 AND po.state = 'on-order'
11580             ORDER BY 1, 2, 3, 4, 5
11581
11582                 </oils_persist:source_definition>
11583                 <fields>
11584                         <field reporter:label="Ordering Agency" name="ordering_agency" reporter:datatype="link"/>
11585                         <field reporter:label="Purchase Order" name="purchase_order" reporter:datatype="link"/>
11586                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11587                         <field reporter:label="Lineitem Detail" name="lineitem_detail" reporter:datatype="link"/>
11588                         <field reporter:label="Claim Policy Action" name="claim_policy_action" reporter:datatype="link"/>
11589                 </fields>
11590                 <links>
11591                         <link field="ordering_agency" reltype="has_a" key="id" map="" class="aou"/>
11592                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo"/>
11593                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11594                         <link field="lineitem_detail" reltype="has_a" key="id" map="" class="acqlid"/>
11595                         <link field="claim_policy_action" reltype="has_a" key="id" map="" class="acqclpa"/>
11596                 </links>
11597         </class>
11598         <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">
11599                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11600                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11601                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11602                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11603                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11604                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11605                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11606                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11607                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11608                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11609                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11610                 </fields>
11611                 <links>
11612                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11613                 </links>
11614     </class>
11615         <class id="acqlisumi" controller="open-ils.cstore" oils_obj:fieldmapper="acq::lineitem_summary_invoiceable" oils_persist:readonly="true" reporter:label="Invoiceable Lineitem Summary">
11616                 <oils_persist:source_definition>
11617             SELECT * FROM acq.lineitem_summary 
11618                                 WHERE item_count > (invoice_count + cancel_count)
11619         </oils_persist:source_definition>
11620                 <fields oils_persist:primary="lineitem" oils_persist:sequence="acq.lineitem_id_seq">
11621                         <field reporter:label="Lineitem" name="lineitem" reporter:datatype="link"/>
11622                         <field reporter:label="Item Count" name="item_count" reporter:datatype="int"/>
11623                         <field reporter:label="Receive Count" name="recv_count" reporter:datatype="int"/>
11624                         <field reporter:label="Cancel Count" name="cancel_count" reporter:datatype="int"/>
11625                         <field reporter:label="Delay Count" name="delay_count" reporter:datatype="int"/>
11626                         <field reporter:label="Invoice Count" name="invoice_count" reporter:datatype="int"/>
11627                         <field reporter:label="Claim Count" name="claim_count" reporter:datatype="int"/>
11628                         <field reporter:label="Estimated Amount" name="estimated_amount" reporter:datatype="money"/>
11629                         <field reporter:label="Encumbrance Amount" name="encumbrance_amount" reporter:datatype="money"/>
11630                         <field reporter:label="Paid Amount" name="paid_amount" reporter:datatype="money"/>
11631                 </fields>
11632                 <links>
11633                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
11634                 </links>
11635     </class>
11636         <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">
11637                 <oils_persist:source_definition>
11638
11639                         SELECT  t.*
11640                           FROM  action.transit_copy t
11641                                 JOIN actor.org_unit AS s ON (t.source = s.id)
11642                                 JOIN actor.org_unit AS d ON (t.dest = d.id)
11643                           WHERE s.parent_ou &lt;&gt; d.parent_ou
11644
11645                 </oils_persist:source_definition>
11646                 <fields oils_persist:primary="id" oils_persist:sequence="action.transit_copy_id_seq">
11647                         <field reporter:label="Pretransit Copy Status" name="copy_status" reporter:datatype="link"/>
11648                         <field reporter:label="Destination" name="dest" reporter:datatype="link"/>
11649                         <field reporter:label="Receive Date/Time" name="dest_recv_time" reporter:datatype="timestamp"/>
11650                         <field reporter:label="Transit ID" name="id" reporter:datatype="id"/>
11651                         <field reporter:label="Is Persistent? (unused)" name="persistant_transfer" reporter:datatype="bool"/>
11652                         <field reporter:label="Previous Hop (unused)" name="prev_hop" reporter:datatype="link"/>
11653                         <field reporter:label="Source" name="source" reporter:datatype="link"/>
11654                         <field reporter:label="Send Date/Time" name="source_send_time" reporter:datatype="timestamp"/>
11655                         <field reporter:label="Transited Copy" name="target_copy" reporter:datatype="link"/>
11656                         <field reporter:label="Hold Transit" name="hold_transit_copy" oils_persist:virtual="true" reporter:datatype="link"/>
11657                         <field reporter:label="Cancel Date/Time" name="cancel_time" reporter:datatype="timestamp"/>
11658                 </fields>
11659                 <links>
11660                         <link field="hold_transit_copy" reltype="might_have" key="id" map="" class="ahtc"/>
11661                         <link field="source" reltype="has_a" key="id" map="" class="aou"/>
11662                         <link field="copy_status" reltype="has_a" key="id" map="" class="ccs"/>
11663                         <link field="dest" reltype="has_a" key="id" map="" class="aou"/>
11664                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11665                         <link field="prev_hop" reltype="has_a" key="id" map="" class="atc"/>
11666                 </links>
11667         </class>
11668
11669     <class id="circbyyr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="action::circ_counts_by_year" oils_persist:readonly="true">
11670                 <oils_persist:source_definition>
11671
11672         SELECT copy, SUM(count) AS count, year, is_renewal FROM (
11673                 SELECT
11674                         cp.id as copy,
11675                         COUNT(circ.id),
11676                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11677                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11678                 FROM
11679                         asset.copy cp
11680                                 JOIN action.circulation circ ON (cp.id = circ.target_copy)
11681                 GROUP BY 1, 3, 4
11682                 UNION ALL
11683                 SELECT
11684                         cp.id as copy,
11685                         COUNT(circ.id),
11686                         EXTRACT(YEAR FROM circ.xact_start) AS year,
11687                         (phone_renewal OR desk_renewal OR opac_renewal) as is_renewal
11688                 FROM
11689                         asset.copy cp
11690                                 JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
11691                 GROUP BY 1, 3, 4
11692                 UNION ALL
11693                 SELECT
11694                         id as copy,
11695                         circ_count,
11696                         -1 AS year,
11697                         false as is_renewal
11698                 FROM
11699                         extend_reporter.legacy_circ_count
11700         )x GROUP BY 1, 3, 4
11701
11702                 </oils_persist:source_definition>
11703         <fields>
11704             <field reporter:label="Copy ID" name="copy" reporter:datatype="link"/>
11705             <field reporter:label="Count" name="count" reporter:datatype="int"/>
11706             <field reporter:label="Year" name="year" reporter:datatype="int"/>
11707             <field reporter:label="Renewal" name="is_renewal" reporter:datatype="bool"/>
11708         </fields>
11709                 <links>
11710                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
11711                 </links>
11712                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11713                         <actions>
11714                                 <retrieve/>
11715                         </actions>
11716                 </permacrud>
11717     </class>
11718
11719         <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">
11720                 <fields oils_persist:primary="id" oils_persist:sequence="money.billable_xact_id_seq">
11721                         <field reporter:label="Check In Library" name="checkin_lib" reporter:datatype="org_unit"/>
11722                         <field reporter:label="Check In Staff" name="checkin_staff" reporter:datatype="link"/>
11723                         <field reporter:label="Check In Date/Time" name="checkin_time" reporter:datatype="timestamp"/>
11724                         <field reporter:label="Circulating Library" name="circ_lib"  reporter:datatype="org_unit"/>
11725                         <field reporter:label="Circulating Staff" name="circ_staff" reporter:datatype="link"/>
11726                         <field reporter:label="Desk Renewal" name="desk_renewal" reporter:datatype="bool"/>
11727                         <field reporter:label="Due Date/Time" name="due_date" reporter:datatype="timestamp"/>
11728                         <field reporter:label="Circulation Duration" name="duration" reporter:datatype="interval"/>
11729                         <field reporter:label="Circ Duration Rule" name="duration_rule" reporter:datatype="link"/>
11730                         <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
11731                         <field reporter:label="Circ ID" name="id" reporter:datatype="id" />
11732                         <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money" />
11733                         <field reporter:label="Max Fine Rule" name="max_fine_rule" reporter:datatype="link"/>
11734                         <field reporter:label="OPAC Renewal" name="opac_renewal" reporter:datatype="bool"/>
11735                         <field reporter:label="Phone Renewal" name="phone_renewal" reporter:datatype="bool"/>
11736                         <field reporter:label="Recurring Fine Amount" name="recurring_fine" reporter:datatype="money" />
11737                         <field reporter:label="Recurring Fine Rule" name="recurring_fine_rule" reporter:datatype="link"/>
11738                         <field reporter:label="Remaining Renewals" name="renewal_remaining" reporter:datatype="int" />
11739                         <field reporter:label="Fine Stop Reason" name="stop_fines" reporter:datatype="text"/>
11740                         <field reporter:label="Fine Stop Date/Time" name="stop_fines_time" reporter:datatype="timestamp"/>
11741                         <field reporter:label="Circulating Item" name="target_copy" reporter:datatype="link"/>
11742                         <field reporter:label="Patron" name="usr" reporter:datatype="link"/>
11743                         <field reporter:label="Transaction Finish Date/Time" name="xact_finish" reporter:datatype="timestamp" />
11744                         <field reporter:label="Checkout Date/Time" name="xact_start" reporter:datatype="timestamp" />
11745                         <field reporter:label="Transaction Billings" name="billings" oils_persist:virtual="true" reporter:datatype="link"/>
11746                         <field reporter:label="Transaction Payments" name="payments" oils_persist:virtual="true" reporter:datatype="link"/>
11747                         <field reporter:label="Base Transaction" name="billable_transaction" oils_persist:virtual="true" reporter:datatype="link"/>
11748                         <field reporter:label="Circulation Type" name="circ_type" oils_persist:virtual="true" reporter:datatype="link"/>
11749                         <field reporter:label="Billing Totals" name="billing_total" oils_persist:virtual="true" reporter:datatype="link"/>
11750                         <field reporter:label="Payment Totals" name="payment_total" oils_persist:virtual="true" reporter:datatype="link"/>
11751                 </fields>
11752                 <links>
11753                         <link field="billable_transaction" reltype="might_have" key="id" map="" class="mbt"/>
11754                         <link field="circ_staff" reltype="has_a" key="id" map="" class="au"/>
11755                         <link field="checkin_lib" reltype="has_a" key="id" map="" class="aou"/>
11756                         <link field="target_copy" reltype="has_a" key="id" map="" class="acp"/>
11757                         <link field="checkin_staff" reltype="has_a" key="id" map="" class="au"/>
11758                         <link field="usr" reltype="has_a" key="id" map="" class="au"/>
11759                         <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11760                         <link field="payments" reltype="has_many" key="xact" map="" class="mp"/>
11761                         <link field="billings" reltype="has_many" key="xact" map="" class="mb"/>
11762                         <link field="duration_rule" reltype="has_a" key="name" map="" class="crcd"/>
11763                         <link field="max_fine_rule" reltype="has_a" key="name" map="" class="crmf"/>
11764                         <link field="recurring_fine_rule" reltype="has_a" key="name" map="" class="crrf"/>
11765                         <link field="circ_type" reltype="might_have" key="id" map="" class="rcirct"/>
11766                         <link field="billing_total" reltype="might_have" key="xact" map="" class="rxbt"/>
11767                         <link field="payment_total" reltype="might_have" key="xact" map="" class="rxpt"/>
11768                 </links>
11769         </class>
11770
11771     <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">
11772         <fields oils_persist:primary="id">
11773             <field reporter:label="Title" name="title" reporter:datatype="text"/>
11774             <field reporter:label="Author" name="author" reporter:datatype="text"/>
11775             <field reporter:label="Pubdate" name="pubdate" reporter:datatype="text"/>
11776             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
11777             <field reporter:label="Price" name="price" reporter:datatype="money"/>
11778             <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
11779             <field reporter:label="Callnumber Label" name="call_number_label" reporter:datatype="text"/>
11780             <field reporter:label="Dewy Tens" name="dewey_block_tens" reporter:datatype="text"/>
11781             <field reporter:label="Dewy Hundreds" name="dewey_block_hundreds" reporter:datatype="text"/>
11782             <field reporter:label="Use Count" name="use_count" reporter:datatype="int"/>
11783             <field reporter:label="Circ Modifier" name="circ_modifier" reporter:datatype="text"/>
11784             <field reporter:label="Shelving Location Name" name="shelving_location" reporter:datatype="text"/>
11785             <field reporter:label="Legacy Stat Cat 1" name="stat_cat_1" reporter:datatype="link"/>
11786             <field reporter:label="Legacy Stat Cat 2" name="stat_cat_2" reporter:datatype="link"/>
11787             <field reporter:label="Legacy Stat Cat 1 Value" name="stat_cat_1_value" reporter:datatype="text"/>
11788             <field reporter:label="Legacy Stat Cat 2 Value" name="stat_cat_2_value" reporter:datatype="text"/>
11789             <field reporter:label="Edit Date" name="edit_date" reporter:datatype="timestamp"/>
11790             <field reporter:label="Create Date" name="create_date" reporter:datatype="timestamp"/>
11791             <field reporter:label="Owning Lib Name" name="owning_lib_name" reporter:datatype="text"/>
11792             <field reporter:label="Circ Lib Name" name="circ_lib_name" reporter:datatype="text"/>
11793             <field reporter:label="Owning Lib" name="owning_lib" reporter:datatype="link"/>
11794             <field reporter:label="Circ Lib" name="circ_lib" reporter:datatype="link"/>
11795             <field reporter:label="Creator" name="creator" reporter:datatype="link"/>
11796             <field reporter:label="Age Protection" name="age_protect" reporter:datatype="link"/>
11797             <field reporter:label="OPAC Visible" name="opac_visible" reporter:datatype="bool"/>
11798             <field reporter:label="Reference" name="ref" reporter:datatype="bool"/>
11799             <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="text"/>
11800             <field reporter:label="Deleted" name="deleted" reporter:datatype="bool"/>
11801             <field reporter:label="TCN" name="tcn_value" reporter:datatype="text"/>
11802             <field reporter:label="Status" name="status" reporter:datatype="link"/>
11803             <field reporter:label="Stop Fines Reason" name="stop_fines" reporter:datatype="text"/>
11804             <field reporter:label="Due Date" name="due_date" reporter:datatype="timestamp"/>
11805             <field reporter:label="Patron Barcode" name="patron_barcode" reporter:datatype="text"/>
11806             <field reporter:label="Patron Name" name="patron_name" reporter:datatype="text"/>
11807         </fields>
11808         <links>
11809             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11810             <link field="id" reltype="has_a" key="id" map="" class="acp"/>
11811             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11812             <link field="creator" reltype="has_a" key="id" map="" class="au"/>
11813             <link field="age_protect" reltype="has_a" key="id" map="" class="crahp"/>
11814             <link field="status" reltype="has_a" key="id" map="" class="ccs"/>
11815             <link field="stat_cat_1" reltype="might_have" key="id" map="" class="rsce1"/>
11816             <link field="stat_cat_2" reltype="might_have" key="id" map="" class="rsce2"/>
11817         </links>
11818     </class>
11819
11820     <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">
11821         <fields oils_persist:primary="id">
11822             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11823             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11824             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11825             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11826         </fields>
11827         <links>
11828             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11829             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11830         </links>
11831     </class>
11832
11833     <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">
11834         <fields oils_persist:primary="owning_lib">
11835             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11836             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11837             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11838         </fields>
11839         <links>
11840             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11841         </links>
11842     </class>
11843
11844     <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">
11845         <fields oils_persist:primary="id">
11846             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11847             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11848             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11849             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11850             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11851         </fields>
11852         <links>
11853             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11854             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11855             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11856         </links>
11857     </class>
11858
11859     <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">
11860         <fields oils_persist:primary="circ_lib">
11861             <field reporter:label="Circulating Library" name="circ_lib" reporter:datatype="org_unit"/>
11862             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11863             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11864             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11865         </fields>
11866         <links>
11867             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11868             <link field="circ_lib" reltype="has_a" key="id" map="" class="aou"/>
11869         </links>
11870     </class>
11871
11872     <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">
11873         <fields oils_persist:primary="id">
11874             <field reporter:label="Circulation ID" name="id" reporter:datatype="link"/>
11875             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11876             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11877             <field reporter:label="Billing Type" name="billing_type" reporter:datatype="text"/>
11878             <field reporter:label="Total Billed" name="billed" reporter:datatype="money"/>
11879         </fields>
11880         <links>
11881             <link field="id" reltype="has_a" key="id" map="" class="circ"/>
11882             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11883             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11884         </links>
11885     </class>
11886
11887     <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">
11888         <fields oils_persist:primary="home_ou">
11889             <field reporter:label="User Home Library" name="home_ou" reporter:datatype="org_unit"/>
11890             <field reporter:label="Owning Library" name="owning_lib" reporter:datatype="org_unit"/>
11891             <field reporter:label="Billing Types" name="billing_types" reporter:datatype="text"/>
11892             <field reporter:label="Balance" name="balance" reporter:datatype="money"/>
11893         </fields>
11894         <links>
11895             <link field="owning_lib" reltype="has_a" key="id" map="" class="aou"/>
11896             <link field="home_ou" reltype="has_a" key="id" map="" class="aou"/>
11897         </links>
11898     </class>
11899         <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">
11900                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_id_seq">
11901                         <field reporter:label="Fund Tag ID" name="id" reporter:datatype="id"/>
11902                         <field reporter:label="Fund Tag Owner" name="owner" reporter:datatype="org_unit"/>
11903                         <field reporter:label="Fund Tag Name" name="name" reporter:datatype="text"/>
11904                         <field reporter:label="Map Entries" name="map_entries" oils_persist:virtual="true" reporter:datatype="link"/>
11905                 </fields>
11906                 <links>
11907                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
11908                         <link field="map_entries" reltype="has_many" key="fund" map="" class="acqftm"/>
11909                 </links>
11910                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11911                         <actions>
11912                                 <create permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11913                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND" context_field="owner"/>
11914                                 <update permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11915                         <delete permission="ADMIN_ACQ_FUND_TAG" context_field="owner"/>
11916                         </actions>
11917                 </permacrud>
11918         </class>
11919         <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">
11920                 <fields oils_persist:primary="id" oils_persist:sequence="acq.fund_tag_map_id_seq">
11921                         <field reporter:label="Map Entry ID" name="id" reporter:datatype="id"/>
11922                         <field reporter:label="Fund ID" name="fund" reporter:datatype="link"/>
11923                         <field reporter:label="Tag ID" name="tag" reporter:datatype="link"/>
11924                 </fields>
11925                 <links>
11926                         <link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
11927                         <link field="tag" reltype="has_a" key="id" map="" class="acqft"/>
11928                         </links>
11929                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
11930                 <actions>
11931                                 <create permission="ADMIN_ACQ_FUND_TAG">
11932                                         <context link="tag" field="owner"/>
11933                                 </create>
11934                                 <retrieve permission="ADMIN_ACQ_FUND_TAG ADMIN_ACQ_FUND VIEW_FUND MANAGE_FUND">
11935                                         <context link="tag" field="owner"/>
11936                                 </retrieve>
11937                                 <update permission="ADMIN_ACQ_FUND_TAG">
11938                                         <context link="tag" field="owner"/>
11939                                 </update>
11940                                 <delete permission="ADMIN_ACQ_FUND_TAG">
11941                                         <context link="tag" field="owner"/>
11942                                 </delete>
11943                         </actions>
11944                 </permacrud>
11945         </class>
11946         <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">
11947                 <oils_persist:source_definition><![CDATA[
11948                 SELECT
11949                         poi.purchase_order AS purchase_order,
11950                         ii.invoice AS invoice,
11951                         NULL AS lineitem,
11952                         poi.id AS po_item,
11953                         NULL AS picklist
11954                 FROM
11955                         acq.po_item poi
11956                         JOIN acq.invoice_item ii ON (ii.po_item = poi.id)
11957                 UNION SELECT
11958                         jub.purchase_order AS purchase_order,
11959                         ie.invoice AS invoice,
11960                         jub.id AS lineitem,
11961                         NULL AS po_item,
11962                         jub.picklist AS picklist
11963                 FROM
11964                         acq.lineitem jub
11965                         JOIN acq.invoice_entry ie ON (ie.lineitem = jub.id)
11966                 UNION SELECT
11967                         ii.purchase_order AS purchase_order,
11968                         ii.invoice AS invoice,
11969                         NULL AS lineitem,
11970                         NULL AS po_item,
11971                         NULL AS picklist
11972                 FROM
11973                         acq.invoice_item ii
11974                 WHERE ii.po_item IS NULL
11975                 UNION SELECT
11976                         ie.purchase_order AS purchase_order,
11977                         ie.invoice AS invoice,
11978                         NULL AS lineitem,
11979                         NULL AS po_item,
11980                         NULL AS picklist
11981                 FROM
11982                         acq.invoice_entry ie
11983                 WHERE ie.lineitem IS NULL
11984                 UNION SELECT
11985                         NULL AS purchase_order,
11986                         NULL AS invoice,
11987                         jub.id AS lineitem,
11988                         NULL AS po_item,
11989                         jub.picklist AS picklist
11990                 FROM
11991                         acq.lineitem jub
11992                 WHERE jub.purchase_order IS NULL
11993                 ]]></oils_persist:source_definition>
11994                 <fields>
11995                         <field reporter:label="Purchase Order ID" name="purchase_order" reporter:datatype="link"/>
11996                         <field reporter:label="Lineitem ID" name="lineitem" reporter:datatype="link"/>
11997                         <field reporter:label="Invoice ID" name="invoice" reporter:datatype="link"/>
11998                         <field reporter:label="Purchase Order Item ID" name="po_item" reporter:datatype="link"/>
11999                         <field reporter:label="Picklist ID" name="picklist" reporter:datatype="link"/>
12000                 </fields>
12001                 <links>
12002                         <link field="purchase_order" reltype="has_a" key="id" map="" class="acqpo" />
12003                         <link field="lineitem" reltype="has_a" key="id" map="" class="jub" />
12004                         <link field="invoice" reltype="has_a" key="id" map="" class="acqinv" />
12005                         <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi" />
12006                         <link field="picklist" reltype="has_a" key="id" map="" class="acqpl" />
12007                 </links>
12008         </class>
12009         <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">
12010                 <fields oils_persist:primary="id" oils_persist:sequence="config.barcode_completion_id_seq">
12011                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12012                         <field reporter:label="Active" name="active" reporter:datatype="bool"/>
12013                         <field reporter:label="Owner" name="org_unit" reporter:datatype="org_unit"/>
12014                         <field reporter:label="Prefix" name="prefix" reporter:datatype="text"/>
12015                         <field reporter:label="Suffix" name="suffix" reporter:datatype="text"/>
12016                         <field reporter:label="Length" name="length" reporter:datatype="int"/>
12017                         <field reporter:label="Padding" name="padding" reporter:datatype="text"/>
12018                         <field reporter:label="Padding At End" name="padding_end" reporter:datatype="bool"/>
12019                         <field reporter:label="Applies to Items" name="asset" reporter:datatype="bool"/>
12020                         <field reporter:label="Applies to Users" name="actor" reporter:datatype="bool"/>
12021                 </fields>
12022                 <links>
12023                         <link field="org_unit" reltype="has_a" key="id" map="" class="aou"/>
12024                 </links>
12025                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12026                         <actions>
12027                                 <create permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12028                                 <retrieve/>
12029                                 <update permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12030                                 <delete permission="UPDATE_ORG_UNIT_SETTING_ALL" context_field="org_unit"/>
12031                         </actions>
12032                 </permacrud>
12033         </class>
12034
12035         <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">
12036                 <fields oils_persist:primary="id" oils_persist:sequence="config.org_unit_setting_type_log_id_seq">
12037                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12038                         <field name="date_applied" reporter:datatype="timestamp"/>
12039                         <field name="org" reporter:datatype="org_unit"/>
12040                         <field name="original_value" reporter:datatype="text"/>
12041                         <field name="new_value" reporter:datatype="text"/>
12042                         <field name="field_name" reporter:datatype="link"/>
12043                 </fields>
12044                 <links>
12045                         <link field="field_name" reltype="has_a" key="name" map="" class="coust"/>
12046                         <link field="org" reltype="has_a" key="id" map="" class="aou"/>
12047                 </links>
12048                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12049                         <actions>
12050                                 <create permission="ADMIN_ORG_UNIT_SETTING_TYPE" context_field="org"/>
12051                                 <retrieve permission="STAFF_LOGIN" context_field="org"/>
12052                                 <update permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12053                                 <delete permission="ADMIN_ORG_UNIT_SETTING_TYPE_LOG" context_field="org"/>
12054                         </actions>
12055                 </permacrud>
12056         </class>
12057         <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">
12058                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12059                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12060                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12061                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12062                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12063                 </fields>
12064                 <links>
12065                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12066                         <link field="stat_cat" reltype="has_a" key="id" map="" class="actsc"/>
12067                 </links>
12068         </class>
12069         <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">
12070                 <fields oils_persist:primary="id" oils_persist:sequence="action.archive_actor_stat_cat_id_seq">
12071                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12072                         <field reporter:label="Circ" name="xact" reporter:datatype="link"/>
12073                         <field reporter:label="Statistical Category" name="stat_cat" reporter:datatype="link"/>
12074                         <field reporter:label="Entry Value" name="value" reporter:datatype="text"/>
12075                 </fields>
12076                 <links>
12077                         <link field="xact" reltype="has_a" key="id" map="" class="combcirc"/>
12078                         <link field="stat_cat" reltype="has_a" key="id" map="" class="asc"/>
12079                 </links>
12080         </class>
12081         <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">
12082                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_id_seq">
12083                         <field reporter:label="ID" name="id" reporter:selector="name" reporter:datatype="id"/>
12084                         <field reporter:label="Name" name="name" reporter:datatype="text"/>
12085                         <field reporter:label="Manual" name="manual" reporter:datatype="bool"/>
12086                         <field reporter:label="Group Members" name="members" oils_persist:virtual="true" reporter:datatype="link"/>
12087                 </fields>
12088                 <links>
12089                         <link field="members" reltype="has_many" key="floating_group" class="cfgm"/>
12090                 </links>
12091                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12092                         <actions>
12093                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12094                                 <retrieve/>
12095                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12096                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12097                         </actions>
12098                 </permacrud>
12099         </class>
12100         <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">
12101                 <fields oils_persist:primary="id" oils_persist:sequence="config.floating_group_member_id_seq">
12102                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12103                         <field reporter:label="Floating Group" name="floating_group" reporter:datatype="link"/>
12104                         <field reporter:label="Org Unit" name="org_unit" reporter:datatype="link"/>
12105                         <field reporter:label="Stop Depth" name="stop_depth" reporter:datatype="int"/>
12106                         <field reporter:label="Max Depth" name="max_depth" reporter:datatype="int"/>
12107                         <field reporter:label="Exclude" name="exclude" reporter:datatype="bool"/>
12108                 </fields>
12109                 <links>
12110                         <link field="floating_group" reltype="has_a" key="id" class="cfg"/>
12111                         <link field="org_unit" reltype="has_a" key="id" class="aou"/>
12112                 </links>
12113                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12114                         <actions>
12115                                 <create permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12116                                 <retrieve/>
12117                                 <update permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12118                                 <delete permission="ADMIN_FLOAT_GROUPS" global_required="true"/>
12119                         </actions>
12120                 </permacrud>
12121         </class>
12122         <class id="cctt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_tag_type" oils_persist:tablename="config.copy_tag_type" reporter:label="Copy Tag Types" oils_persist:field_safe="true">
12123                 <fields oils_persist:primary="code">
12124                         <field reporter:label="Code" name="code" reporter:selector="label" reporter:datatype="id" oils_obj:required="true"/>
12125                         <field reporter:label="Label" name="label" reporter:datatype="text" oils_obj:required="true"/>
12126                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12127                 </fields>
12128                 <links>
12129                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12130                 </links>
12131                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12132                         <actions>
12133                                 <create permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12134                                 <retrieve/>
12135                                 <update permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12136                                 <delete permission="ADMIN_COPY_TAG_TYPES" context_field="owner"/>
12137                         </actions>
12138                 </permacrud>
12139         </class>
12140         <class id="acpt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag" oils_persist:tablename="asset.copy_tag" reporter:label="Copy Tags" oils_persist:field_safe="true">
12141                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_id_seq">
12142                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12143                         <field reporter:label="Copy Tag Type" name="tag_type" reporter:datatype="link"/>
12144                         <field reporter:label="Label" name="label" reporter:datatype="text"/>
12145                         <field reporter:label="Value" name="value" reporter:datatype="text"/>
12146                         <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
12147                         <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
12148                         <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
12149                 </fields>
12150                 <links>
12151                         <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
12152                         <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
12153                 </links>
12154                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12155                         <actions>
12156                                 <create permission="ADMIN_COPY_TAG" context_field="owner"/>
12157                                 <retrieve/>
12158                                 <update permission="ADMIN_COPY_TAG" context_field="owner"/>
12159                                 <delete permission="ADMIN_COPY_TAG" context_field="owner"/>
12160                         </actions>
12161                 </permacrud>
12162         </class>
12163         <class id="acptcm" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_tag_copy_map" oils_persist:tablename="asset.copy_tag_copy_map" reporter:label="Copy Tag Copy Map" oils_persist:field_safe="true">
12164                 <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_tag_copy_map_id_seq">
12165                         <field reporter:label="ID" name="id" reporter:datatype="id"/>
12166                         <field reporter:label="Copy" name="copy" reporter:datatype="link"/>
12167                         <field reporter:label="Tag" name="tag" reporter:datatype="link"/>
12168                 </fields>
12169                 <links>
12170                         <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
12171                         <link field="tag" reltype="has_a" key="id" map="" class="acpt"/>
12172                 </links>
12173                 <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12174                         <actions>
12175                                 <create permission="UPDATE_COPY">
12176                     <context link="copy" field="circ_lib"/>
12177                 </create>
12178                                 <retrieve/>
12179                                 <update permission="UPDATE_COPY">
12180                     <context link="copy" field="circ_lib"/>
12181                 </update>
12182                                 <delete permission="UPDATE_COPY">
12183                     <context link="copy" field="circ_lib"/>
12184                 </delete>
12185                         </actions>
12186                 </permacrud>
12187         </class>
12188         <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">
12189         <oils_persist:source_definition>
12190         SELECT ahcm.target_copy AS id,count(*) AS count
12191          FROM
12192          action.hold_request ahr,
12193          action.hold_copy_map ahcm
12194          WHERE
12195          ahr.cancel_time IS NULL AND
12196          ahr.fulfillment_time IS NULL AND
12197          ahr.capture_time IS NULL AND
12198          ahr.id = ahcm.hold
12199          GROUP BY ahcm.target_copy
12200         </oils_persist:source_definition>
12201         <fields oils_persist:primary="id">
12202             <field reporter:label="Copy ID" name="id" reporter:datatype="id"/>
12203             <field reporter:label="Holds Count" name="count" reporter:datatype="text"/>
12204         </fields>
12205         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
12206             <actions>
12207                <retrieve/>
12208             </actions>
12209         </permacrud>
12210         </class>
12211
12212         <!-- ********************************************************************************************************************* -->
12213
12214 </IDL>
12215
12216 <!--
12217     vim:noet:ts=4:sw=4:
12218 -->