From e59e2c142e4b10d10d4bc31c2ca9c5d481cd367f Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 24 Dec 2022 20:24:52 +0000 Subject: [PATCH] --- client/src/api/open-object-handler.js | 7 +++++++ client/src/components/pick-list.vue | 12 ++++++------ server/util/AySchema.cs | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/client/src/api/open-object-handler.js b/client/src/api/open-object-handler.js index facd4cd..54598ce 100644 --- a/client/src/api/open-object-handler.js +++ b/client/src/api/open-object-handler.js @@ -221,6 +221,13 @@ export default { }); break; + case socktype.Vendor: + vm.$router.push({ + name: "vendor-edit", + params: { recordid: tid.id } + }); + break; + default: window.$gz.eventBus.$emit( "notify-warning", diff --git a/client/src/components/pick-list.vue b/client/src/components/pick-list.vue index 9a76987..0e1bc05 100644 --- a/client/src/components/pick-list.vue +++ b/client/src/components/pick-list.vue @@ -50,7 +50,7 @@ export default { errorMessages: { type: Array, default: null }, readonly: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, - sockType: { + ayaType: { type: Number, default: 0 }, @@ -94,7 +94,7 @@ export default { }; }, watch: { - sockType(val, oldVal) { + ayaType(val, oldVal) { if (val != oldVal && oldVal != null) { //change of type so clear out the list this.searchResults = []; @@ -166,7 +166,7 @@ export default { idToOpen = this.lastSelection.id; } window.$gz.eventBus.$emit("openobject", { - type: this.sockType, + type: this.ayaType, id: idToOpen }); }, @@ -201,7 +201,7 @@ export default { window.$gz.form.addNoSelectionItem(this.searchResults, true); } else { const pickListParams = { - sockType: this.sockType, + sockType: this.ayaType, preselectedIds: [this.value] }; if (this.variant != null) { @@ -265,7 +265,7 @@ export default { //default params for when called on init if (!pickListParams) { pickListParams = { - sockType: this.sockType + ayaType: this.ayaType }; if (this.value != null) { pickListParams["preselectedIds"] = [this.value]; @@ -370,7 +370,7 @@ export default { } //build parameter - const pickListParams = { sockType: vm.sockType }; + const pickListParams = { ayaType: vm.ayaType }; if (!emptyQuery) { let query = queryTerms[0]; if (queryTerms[1] != "[?]") { diff --git a/server/util/AySchema.cs b/server/util/AySchema.cs index 58de281..602e75e 100644 --- a/server/util/AySchema.cs +++ b/server/util/AySchema.cs @@ -305,7 +305,7 @@ namespace Sockeye.Util CREATE OR REPLACE PROCEDURE public.aydosearchindex( wordlist TEXT[], ayobjectid BIGINT, - socktype INTEGER, + stype INTEGER, cleanfirst boolean) LANGUAGE 'plpgsql' @@ -317,12 +317,12 @@ BEGIN RAISE EXCEPTION 'Bad object id --> %', ayobjectid; END IF; - IF socktype=0 THEN - RAISE EXCEPTION 'Bad object type --> %', socktype; + IF stype=0 THEN + RAISE EXCEPTION 'Bad object type --> %', stype; END IF; IF cleanfirst=true THEN - delete from asearchkey where objectid=ayobjectid and sockType=socktype; + delete from asearchkey where objectid=ayobjectid and sockType=stype; END IF; FOREACH s IN ARRAY wordlist @@ -330,9 +330,9 @@ BEGIN SELECT id INTO wordid FROM asearchdictionary WHERE word = s; IF wordid IS NULL THEN insert into asearchdictionary (word) values(s) on conflict (word) do update set word=excluded.word returning id into wordid; - insert into asearchkey (wordid,objectid,sockType) values(wordid,ayobjectid,socktype); + insert into asearchkey (wordid,objectid,sockType) values(wordid,ayobjectid,stype); ELSE - insert into asearchkey (wordid,objectid,sockType) values(wordid,ayobjectid,socktype); + insert into asearchkey (wordid,objectid,sockType) values(wordid,ayobjectid,stype); END IF; END LOOP; END; @@ -342,14 +342,14 @@ $BODY$; //Original Name fetcher function, superseded by later updates await ExecQueryAsync(@" -CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID BIGINT, IN AYATYPE INTEGER,TRANSLATIONID integer) RETURNS TEXT AS $BODY$ +CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID BIGINT, IN stype INTEGER,TRANSLATIONID integer) RETURNS TEXT AS $BODY$ DECLARE aytable TEXT DEFAULT ''; aynamecolumn TEXT DEFAULT 'name'; aytkey TEXT DEFAULT 'no'; returnstr TEXT DEFAULT ''; BEGIN - case socktype + case stype when 0 then aytkey= 'NoType'; when 1 then aytkey= 'Global'; when 2 then return 'FormUserOptions'; @@ -666,14 +666,14 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); //UPDATED NAME FETCHER FOR INTEGRATION await ExecQueryAsync(@" -CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID BIGINT, IN AYATYPE INTEGER,TRANSLATIONID integer) RETURNS TEXT AS $BODY$ +CREATE OR REPLACE FUNCTION PUBLIC.AYGETNAME(IN AYOBJECTID BIGINT, IN stype INTEGER,TRANSLATIONID integer) RETURNS TEXT AS $BODY$ DECLARE aytable TEXT DEFAULT ''; aynamecolumn TEXT DEFAULT 'name'; aytkey TEXT DEFAULT 'no'; returnstr TEXT DEFAULT ''; BEGIN - case socktype + case stype when 0 then aytkey= 'NoType'; when 1 then aytkey= 'Global'; when 2 then return 'FormUserOptions';