Bug 32030: Add Notes field to erm_eholdings_packages table
authorPedro Amorim <pjamorim91@gmail.com>
Tue, 18 Oct 2022 19:18:19 +0000 (19:18 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 8 Nov 2022 12:44:26 +0000 (09:44 -0300)
- Added API specs for new field 'notes' for erm_holdings_package;
- Added new field 'notes' in DB schema for erm;
- Added new field 'notes' in Vue.js frontend

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
api/v1/swagger/definitions/erm_eholdings_package.yaml
api/v1/swagger/paths/erm_eholdings_packages.yaml
installer/data/mysql/atomicupdate/erm.pl
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesFormAdd.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesList.vue
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalPackagesShow.vue

index 190e751..3289718 100644 (file)
@@ -38,6 +38,11 @@ properties:
     type:
       - string
       - "null"
+  notes:
+    description: notes about the package
+    type:
+      - string
+      - "null"
   created_on:
     description: date of creation
     type:
index 7064e4a..fd0d58d 100644 (file)
         name: content_type
         required: false
         type: string
+      - description: Case insensitive search on package notes
+        in: query
+        name: notes
+        required: false
+        type: string
       - description: Case insensitive search on package creation date
         in: query
         name: created_on
index df7d09f..7b781d1 100755 (executable)
@@ -197,6 +197,7 @@ return {
                     `provider` ENUM('ebsco') DEFAULT NULL COMMENT 'External provider',
                     `package_type` VARCHAR(80) DEFAULT NULL COMMENT 'type of the package',
                     `content_type` VARCHAR(80) DEFAULT NULL COMMENT 'type of the package',
+                    `notes` mediumtext DEFAULT NULL COMMENT 'notes about this package',
                     `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date of creation of the package',
                     CONSTRAINT `erm_packages_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
                     PRIMARY KEY(`package_id`)
index 8128681..5d78453 100644 (file)
@@ -2908,6 +2908,7 @@ CREATE TABLE `erm_eholdings_packages` (
     `provider` ENUM('ebsco') DEFAULT NULL COMMENT 'External provider',
     `package_type` VARCHAR(80) DEFAULT NULL COMMENT 'type of the package',
     `content_type` VARCHAR(80) DEFAULT NULL COMMENT 'type of the package',
+    `notes` mediumtext DEFAULT NULL COMMENT 'notes about this package',
     `created_on` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date of creation of the package',
     CONSTRAINT `erm_eholdings_packages_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
     PRIMARY KEY(`package_id`)
index 82b7393..433c3e1 100644 (file)
                                 :options="av_package_content_types"
                             />
                         </li>
+                        <li>
+                            <label for="package_notes">{{
+                                $t("Notes")
+                            }}:</label>
+                            <textarea
+                                id="package_notes"
+                                v-model="erm_package.notes"
+                            />
+                        </li>
 
                         <EHoldingsPackageAgreements
                             :package_agreements="erm_package.package_agreements"
@@ -108,6 +117,7 @@ export default {
                 external_id: '',
                 package_type: '',
                 content_type: '',
+                notes: '',
                 created_on: null,
                 resources: null,
                 package_agreements: [],
index 7771471..3994134 100644 (file)
@@ -151,6 +151,15 @@ export default {
                         }
                     },
                     {
+                        title: __("Notes"),
+                        data: "notes",
+                        searchable: true,
+                        orderable: true,
+                        render: function (data, type, row, meta) {
+                            return row.notes;
+                        }
+                    },
+                    {
                         title: __("Actions"),
                         data: function (row, type, val, meta) {
                             return '<div class="actions"></div>'
index 8e6f92f..45e1ec0 100644 (file)
                             )
                         }}</span>
                     </li>
+                    <li>
+                        <label>{{ $t("Notes") }}:</label>
+                        <span>{{ erm_package.notes }}</span>
+                    </li>
                     <li v-if="erm_package.created_on">
                         <label>{{ $t("Created on") }}:</label>
                         <span>{{ format_date(erm_package.created_on) }}</span>