Baseline IDL stuff for alerts
authorMike Rylander <mrylander@gmail.com>
Wed, 4 Nov 2015 14:52:22 +0000 (09:52 -0500)
committerMike Rylander <mrylander@gmail.com>
Thu, 31 Aug 2017 16:18:34 +0000 (12:18 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.copy_alerts.sql

index 7764758..7c36709 100644 (file)
@@ -7025,6 +7025,109 @@ SELECT  usr,
         </permacrud>
        </class>
 
+       <class id="ccat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="config::copy_alert_type" oils_persist:tablename="config.copy_alert_type" reporter:label="Copy Alert Type" oils_persist:restrict_primary="100">
+               <fields oils_persist:primary="id" oils_persist:sequence="config.copy_alert_type_id_seq">
+                       <field reporter:label="Id" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Scope Org Unit" name="scope_org"  reporter:datatype="org_unit"/>
+                       <field reporter:label="Active" name="active" reporter:datatype="bool" />
+                       <field reporter:label="Name" name="name" reporter:datatype="text" />
+                       <field reporter:label="State" name="state" reporter:datatype="text"/>
+                       <field reporter:label="Event" name="event" reporter:datatype="text" />
+                       <field reporter:label="During Renewal" name="in_renew" reporter:datatype="bool" />
+                       <field reporter:label="Allow At Copy Circ Lib" name="at_circ" reporter:datatype="bool"/>
+                       <field reporter:label="Allow At Copy Owning Lib" name="at_owning" reporter:datatype="bool"/>
+                       <field reporter:label="Invert allowed locations" name="invert_location" reporter:datatype="bool"/>
+                       <field reporter:label="Next Statuses" name="next_status" reporter:datatype="text"/>
+               </fields>
+               <links>
+                       <link field="scope_org" reltype="has_a" key="id" map="" class="aou"/>
+               </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="ADMIN_COPY_ALERT_TYPE CREATE_COPY_ALERT_TYPE" context_field="scope_org"/>
+                <retrieve/>
+                <update permission="ADMIN_COPY_ALERT_TYPE UPDATE_COPY_ALERT_TYPE" context_field="scope_org"/>
+                <delete permission="ADMIN_COPY_ALERT_TYPE DELETE_COPY_ALERT_TYPE" context_field="scope_org"/>
+            </actions>
+        </permacrud>
+       </class>
+
+       <class id="acas" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::copy_alert_suppress" oils_persist:tablename="actor.copy_alert_suppress" reporter:label="Copy Alert Suppression">
+               <fields oils_persist:primary="id" oils_persist:sequence="actor.copy_alert_suppress_id_seq">
+                       <field reporter:label="Id" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Org Unit" name="org"  reporter:datatype="org_unit"/>
+                       <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
+               </fields>
+               <links>
+                       <link field="org" reltype="has_a" key="id" map="" class="aou"/>
+                       <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
+               </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="ADMIN_COPY_ALERT_SUPPRESS CREATE_COPY_ALERT_SUPPRESS" context_field="org"/>
+                <retrieve/>
+                <update permission="ADMIN_COPY_ALERT_SUPPRESS UPDATE_COPY_ALERT_SUPPRESS" context_field="org"/>
+                <delete permission="ADMIN_COPY_ALERT_SUPPRESS DELETE_COPY_ALERT_SUPPRESS" context_field="org"/>
+            </actions>
+        </permacrud>
+       </class>
+
+       <class id="aca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::copy_alert" oils_persist:tablename="asset.copy_alert" reporter:label="Copy Alert">
+               <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_alert_id_seq">
+                       <field reporter:label="Id" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
+                       <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
+                       <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
+                       <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
+                       <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
+                       <field reporter:label="Note" name="note" reporter:datatype="text"/>
+                       <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
+                       <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
+                       <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
+                       <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
+                       <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
+               </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT" global_required="true"/>
+                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT" global_required="true"/>
+                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT" global_required="true"/>
+                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT" global_required="true"/>
+            </actions>
+        </permacrud>
+       </class>
+
+       <class id="aaca" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::active_copy_alert" oils_persist:tablename="asset.active_copy_alert" reporter:label="Active Copy Alert" oils_persist:readonly="true">
+               <fields oils_persist:primary="id">
+                       <field reporter:label="Id" name="id" reporter:datatype="id"/>
+                       <field reporter:label="Alert Type" name="alert_type" reporter:datatype="link" />
+                       <field reporter:label="Copy" name="copy"  reporter:datatype="link"/>
+                       <field reporter:label="Temporary" name="temp" reporter:datatype="bool" />
+                       <field reporter:label="Create Date/Time" name="create_time" reporter:datatype="timestamp" />
+                       <field reporter:label="Creator" name="create_staff" reporter:datatype="link"/>
+                       <field reporter:label="Note" name="note" reporter:datatype="text"/>
+                       <field reporter:label="Acknowledge Date/Time" name="ack_time" reporter:datatype="timestamp" />
+                       <field reporter:label="Acknowledger" name="ack_staff" reporter:datatype="link"/>
+               </fields>
+               <links>
+                       <link field="alert_type" reltype="has_a" key="id" map="" class="ccat"/>
+                       <link field="copy" reltype="has_a" key="id" map="" class="acp"/>
+                       <link field="create_staff" reltype="has_a" key="id" map="" class="au"/>
+                       <link field="ack_staff" reltype="has_a" key="id" map="" class="au"/>
+               </links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT" global_required="true"/>
+                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT" global_required="true"/>
+                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT" global_required="true"/>
+                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT" global_required="true"/>
+            </actions>
+        </permacrud>
+       </class>
+
        <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">
                <fields oils_persist:primary="id" oils_persist:sequence="asset.copy_template_id_seq">
                        <field reporter:label="ID" name="id" reporter:datatype="id" reporter:selector="name" />
index bf2cce6..bb67c0c 100644 (file)
@@ -37,7 +37,7 @@ END;
 $$ LANGUAGE PLPGSQL;
 
 CREATE TYPE config.copy_alert_type_state AS ENUM (
-       'NORMAL',
+    'NORMAL',
     'LOST',
     'MISSING',
     'DAMAGED',
@@ -61,7 +61,7 @@ CREATE TABLE config.copy_alert_type (
     in_renew    bool,
     invert_location bool    not null default false,
     at_circ     bool,
-    at_owing    bool,
+    at_owning   bool,
     next_status int[]
 );
 SELECT SETVAL('config.copy_alert_type_id_seq'::TEXT, 100);