LP#1721036: Add url to item tags (DB, IDL, and OPAC link)
authorRemington Steed <rjs7@calvin.edu>
Wed, 24 Apr 2019 18:01:39 +0000 (14:01 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Sun, 1 Sep 2019 13:48:28 +0000 (09:48 -0400)
This commit adds a new field to the asset.copy_tag database table, adds
it to the IDL, and includes it as a link in the OPAC when present.

Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/040.schema.asset.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql [new file with mode: 0644]
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index 0a14cb5..544488e 100644 (file)
@@ -12706,6 +12706,7 @@ SELECT  usr,
                        <field reporter:label="Staff Note" name="staff_note" reporter:datatype="text"/>
                        <field reporter:label="Is OPAC Visible?" name="pub" reporter:datatype="bool"/>
                        <field reporter:label="Owner" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
+                       <field reporter:label="URL" name="url" reporter:datatype="text"/>
                </fields>
                <links>
                        <link field="tag_type" reltype="has_a" key="code" map="" class="cctt"/>
index 9beed1d..198632a 100644 (file)
@@ -967,7 +967,8 @@ CREATE TABLE asset.copy_tag (
     index_vector    tsvector NOT NULL,
     staff_note      TEXT,
     pub             BOOLEAN DEFAULT TRUE,
-    owner           INTEGER NOT NULL REFERENCES actor.org_unit (id)
+    owner           INTEGER NOT NULL REFERENCES actor.org_unit (id),
+    url             TEXT
 );
 
 CREATE INDEX asset_copy_tag_label_idx
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.asset.copy_tag.url.sql
new file mode 100644 (file)
index 0000000..b7b26ce
--- /dev/null
@@ -0,0 +1,8 @@
+BEGIN;
+
+--INSERT INTO config.upgrade_log (version, applied_to) VALUES ('XXXX', :eg_version);
+
+ALTER TABLE asset.copy_tag
+          ADD COLUMN url TEXT;
+
+COMMIT;
index 1e0456c..1c7a2de 100644 (file)
@@ -236,7 +236,15 @@ END; # FOREACH bib
                 <tr class="copy_tag_row">
                     <td>&nbsp;</td>
                     <td class="copy_tag" colspan="4">
-                        <span class="copy_tag_value">[% tag.value | html %]</span>
+                        <span class="copy_tag_value">
+                            [% IF tag.url %]
+                            <a href="[% tag.url | html %]">
+                            [% END %]
+                                [% tag.value | html %]
+                            [% IF tag.url %]
+                            </a>
+                            [% END %]
+                        </span>
                     </td>
                 <tr>
             [% END %]