This commit is contained in:
@@ -235,12 +235,12 @@ export default {
|
||||
});
|
||||
break;
|
||||
|
||||
case socktype.SubscriptionServer:
|
||||
vm.$router.push({
|
||||
name: "subscription-server-edit",
|
||||
params: { recordid: tid.id }
|
||||
});
|
||||
break;
|
||||
case socktype.SubscriptionServer:
|
||||
vm.$router.push({
|
||||
name: "subscription-server-edit",
|
||||
params: { recordid: tid.id }
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
|
||||
@@ -168,8 +168,8 @@
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
sockType: { type: Number, default: null },
|
||||
sockId: { type: Number, default: null },
|
||||
ayaType: { type: Number, default: null },
|
||||
ayaId: { type: Number, default: null },
|
||||
readonly: Boolean
|
||||
},
|
||||
data() {
|
||||
@@ -217,8 +217,8 @@ export default {
|
||||
fileData.push({ name: f.name, lastModified: f.lastModified });
|
||||
}
|
||||
const at = {
|
||||
sockId: vm.sockId,
|
||||
sockType: vm.sockType,
|
||||
sockId: vm.ayaId,
|
||||
sockType: vm.ayaType,
|
||||
files: vm.uploadFiles,
|
||||
fileData: JSON.stringify(fileData), //note this is required for an array or it will come to the server as a string [object,object]
|
||||
notes: vm.notes ? vm.notes : ""
|
||||
@@ -259,7 +259,7 @@ export default {
|
||||
const vm = this;
|
||||
try {
|
||||
const res = await window.$gz.api.get(
|
||||
"attachment/list?socktype=" + vm.sockType + "&ayaid=" + vm.sockId
|
||||
"attachment/list?socktype=" + vm.ayaType + "&sockid=" + vm.ayaId
|
||||
);
|
||||
if (res.error) {
|
||||
window.$gz.errorHandler.handleFormError(res.error);
|
||||
|
||||
@@ -598,26 +598,26 @@ function generateMenu(vm) {
|
||||
}
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "WorkOrderList",
|
||||
icon: "$sockiTools",
|
||||
key: FORM_KEY + ":WorkOrderList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "WorkOrderList",
|
||||
// icon: "$sockiTools",
|
||||
// key: FORM_KEY + ":WorkOrderList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "QuoteList",
|
||||
icon: "$sockiPencilAlt",
|
||||
key: FORM_KEY + ":QuoteList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "QuoteList",
|
||||
// icon: "$sockiPencilAlt",
|
||||
// key: FORM_KEY + ":QuoteList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "PMList",
|
||||
icon: "$sockiBusinessTime",
|
||||
key: FORM_KEY + ":PMList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "PMList",
|
||||
// icon: "$sockiBusinessTime",
|
||||
// key: FORM_KEY + ":PMList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
|
||||
@@ -666,26 +666,26 @@ function generateMenu(vm) {
|
||||
}
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "WorkOrderList",
|
||||
icon: "$sockiTools",
|
||||
key: FORM_KEY + ":WorkOrderList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "WorkOrderList",
|
||||
// icon: "$sockiTools",
|
||||
// key: FORM_KEY + ":WorkOrderList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "QuoteList",
|
||||
icon: "$sockiPencilAlt",
|
||||
key: FORM_KEY + ":QuoteList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "QuoteList",
|
||||
// icon: "$sockiPencilAlt",
|
||||
// key: FORM_KEY + ":QuoteList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "PMList",
|
||||
icon: "$sockiBusinessTime",
|
||||
key: FORM_KEY + ":PMList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "PMList",
|
||||
// icon: "$sockiBusinessTime",
|
||||
// key: FORM_KEY + ":PMList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
|
||||
@@ -99,16 +99,51 @@
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
<gz-date-time-picker
|
||||
ref="subscriptionExpire"
|
||||
v-model="obj.subscriptionExpire"
|
||||
:label="$sock.t('SubServerSubExpire')"
|
||||
:rules="[form().required(this, 'subscriptionExpire')]"
|
||||
:readonly="formState.readOnly"
|
||||
:error-messages="form().serverErrors(this, 'subscriptionExpire')"
|
||||
data-cy="subscriptionExpire"
|
||||
@input="fieldValueChanged('subscriptionExpire')"
|
||||
></gz-date-time-picker>
|
||||
<v-row>
|
||||
<v-col cols="1">
|
||||
<v-menu offset-y>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn icon v-bind="attrs" v-on="on">
|
||||
<v-icon small>$sockiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item @click="subExpireAddOneWeek">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiCopy</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One week</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="subExpireAddOneMonth">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiClone</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One month</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="subExpireAddOneYear">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$sockiMapMarker</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>One year</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
<v-col cols="11">
|
||||
<gz-date-time-picker
|
||||
ref="subscriptionExpire"
|
||||
v-model="obj.subscriptionExpire"
|
||||
:label="$sock.t('SubServerSubExpire')"
|
||||
:rules="[form().required(this, 'subscriptionExpire')]"
|
||||
:readonly="formState.readOnly"
|
||||
:error-messages="
|
||||
form().serverErrors(this, 'subscriptionExpire')
|
||||
"
|
||||
data-cy="subscriptionExpire"
|
||||
@input="fieldValueChanged('subscriptionExpire')"
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" sm="6" lg="4" xl="3">
|
||||
@@ -265,7 +300,7 @@ export default {
|
||||
concurrency: 0,
|
||||
name: null,
|
||||
active: true,
|
||||
customerId: 0,
|
||||
customerId: null,
|
||||
notes: null,
|
||||
created: window.$gz.locale.nowUTC8601String(),
|
||||
dataCenter: null,
|
||||
@@ -997,6 +1032,35 @@ export default {
|
||||
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||
},
|
||||
methods: {
|
||||
subExpireAddOneWeek: function() {
|
||||
// // eslint-disable-next-line
|
||||
// debugger;
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.subscriptionExpire = window.$gz.locale.addDurationToUTC8601String(
|
||||
now,
|
||||
{
|
||||
days: 7
|
||||
}
|
||||
);
|
||||
},
|
||||
subExpireAddOneMonth: function() {
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.subscriptionExpire = window.$gz.locale.addDurationToUTC8601String(
|
||||
now,
|
||||
{
|
||||
months: 1
|
||||
}
|
||||
);
|
||||
},
|
||||
subExpireAddOneYear: function() {
|
||||
const now = window.$gz.locale.nowUTC8601String(this.timeZoneName);
|
||||
this.obj.subscriptionExpire = window.$gz.locale.addDurationToUTC8601String(
|
||||
now,
|
||||
{
|
||||
years: 1
|
||||
}
|
||||
);
|
||||
},
|
||||
canSave: function() {
|
||||
return this.formState.valid && this.formState.dirty;
|
||||
},
|
||||
@@ -1303,26 +1367,26 @@ function generateMenu(vm) {
|
||||
}
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "WorkOrderList",
|
||||
icon: "$sockiTools",
|
||||
key: FORM_KEY + ":WorkOrderList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "WorkOrderList",
|
||||
// icon: "$sockiTools",
|
||||
// key: FORM_KEY + ":WorkOrderList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "QuoteList",
|
||||
icon: "$sockiPencilAlt",
|
||||
key: FORM_KEY + ":QuoteList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "QuoteList",
|
||||
// icon: "$sockiPencilAlt",
|
||||
// key: FORM_KEY + ":QuoteList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "PMList",
|
||||
icon: "$sockiBusinessTime",
|
||||
key: FORM_KEY + ":PMList",
|
||||
vm: vm
|
||||
});
|
||||
// menuOptions.menuItems.push({
|
||||
// title: "PMList",
|
||||
// icon: "$sockiBusinessTime",
|
||||
// key: FORM_KEY + ":PMList",
|
||||
// vm: vm
|
||||
// });
|
||||
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
|
||||
@@ -597,7 +597,7 @@ namespace Sockeye.Api.Controllers
|
||||
await ct.Database.OpenConnectionAsync();
|
||||
cmd.CommandText = $@"select afileattachment.id, afileattachment.xmin as concurrency, displayfilename,contenttype,lastmodified, afileattachment.notes, size, auser.name as attachedbyuser from afileattachment
|
||||
left join auser on (afileattachment.attachedByUserId=auser.id)
|
||||
where attachtosockType={(int)sockType} and attachtoobjectid={sockId}
|
||||
where attachtoatype={(int)sockType} and attachtoobjectid={sockId}
|
||||
order by displayfilename";
|
||||
|
||||
using (var dr = await cmd.ExecuteReaderAsync())
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace Sockeye.DataList
|
||||
FieldKey = "object",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "afileattachment.AttachToObjectid",
|
||||
SqlValueColumnName = $"AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtosockType,{translationId})",
|
||||
SqlATypeColumnName = "afileattachment.attachtosockType",
|
||||
SqlValueColumnName = $"AYGETNAME(afileattachment.AttachToObjectid, afileattachment.attachtoatype,{translationId})",
|
||||
SqlATypeColumnName = "afileattachment.attachtoatype",
|
||||
Translate = true
|
||||
});
|
||||
|
||||
|
||||
@@ -51,6 +51,19 @@ namespace Sockeye.Biz
|
||||
case SockType.Review:
|
||||
return await ct.Review.AnyAsync(z => z.Id == id);
|
||||
|
||||
case SockType.License:
|
||||
return await ct.License.AnyAsync(z => z.Id == id);
|
||||
case SockType.TrialLicenseRequest:
|
||||
return await ct.TrialLicenseRequest.AnyAsync(z => z.Id == id);
|
||||
case SockType.SubscriptionServer:
|
||||
return await ct.SubscriptionServer.AnyAsync(z => z.Id == id);
|
||||
case SockType.Purchase:
|
||||
return await ct.Purchase.AnyAsync(z => z.Id == id);
|
||||
case SockType.Product:
|
||||
return await ct.Product.AnyAsync(z => z.Id == id);
|
||||
case SockType.GZCase:
|
||||
return await ct.GZCase.AnyAsync(z => z.Id == id);
|
||||
|
||||
|
||||
case SockType.CustomerNotifySubscription:
|
||||
return await ct.CustomerNotifySubscription.AnyAsync(z => z.Id == id);
|
||||
|
||||
@@ -429,7 +429,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE afileattachment (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, "
|
||||
+ "attachtoobjectid BIGINT NOT NULL, attachtosockType INTEGER NOT NULL, attachedbyuserid BIGINT NOT NULL REFERENCES auser (id), "
|
||||
+ "attachtoobjectid BIGINT NOT NULL, attachtoatype INTEGER NOT NULL, attachedbyuserid BIGINT NOT NULL REFERENCES auser (id), "
|
||||
+ "storedfilename TEXT NOT NULL, displayfilename TEXT NOT NULL, contenttype TEXT, lastmodified TIMESTAMPTZ NOT NULL, notes TEXT, exists BOOL NOT NULL, size BIGINT NOT NULL)");
|
||||
|
||||
//index required for ops that need to check if file already in db (delete, count refs etc)
|
||||
@@ -438,7 +438,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
||||
|
||||
//index for the common issue of checking if an object has an attachment and retrieving them
|
||||
//note always query (where clause) in this same order for best performance
|
||||
await ExecQueryAsync("CREATE INDEX idx_afileattachment_attachtoobjectid_attachtosockType ON afileattachment (attachtoobjectid, attachtosockType );");
|
||||
await ExecQueryAsync("CREATE INDEX idx_afileattachment_attachtoobjectid_attachtoaType ON afileattachment (attachtoobjectid, attachtoaType );");
|
||||
|
||||
await ExecQueryAsync("CREATE TABLE aopsjob (gid uuid PRIMARY KEY, name TEXT NOT NULL, created TIMESTAMPTZ NOT NULL, exclusive BOOL NOT NULL, "
|
||||
+ "startafter TIMESTAMPTZ NOT NULL, jobtype INTEGER NOT NULL, subtype INTEGER, objectid BIGINT, sockType INTEGER, jobstatus INTEGER NOT NULL, jobinfo TEXT)");
|
||||
|
||||
Reference in New Issue
Block a user