case 4173
This commit is contained in:
@@ -419,8 +419,52 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-tab-item>
|
</v-tab-item>
|
||||||
</v-tabs-items>
|
</v-tabs-items>
|
||||||
</v-tabs>
|
</v-tabs> </v-form
|
||||||
</v-form>
|
><v-dialog v-model="emailDialog">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title>
|
||||||
|
{{ $ay.t("SendEmail") }}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row dense class="mt-2">
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
ref="subject"
|
||||||
|
v-model="subject"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoSubject')"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-textarea
|
||||||
|
ref="message"
|
||||||
|
v-model="message"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoMessage')"
|
||||||
|
required
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-btn color="blue darken-1" text @click="emailDialog = false">{{
|
||||||
|
$ay.t("Close")
|
||||||
|
}}</v-btn>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="blue darken-1"
|
||||||
|
text
|
||||||
|
:disabled="
|
||||||
|
subject == null || message == null || obj.emailAddress == null
|
||||||
|
"
|
||||||
|
@click="sendEmail()"
|
||||||
|
>{{ $ay.t("OK") }}</v-btn
|
||||||
|
>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
<v-overlay :value="!formState.ready || formState.loading">
|
<v-overlay :value="!formState.ready || formState.loading">
|
||||||
<v-progress-circular indeterminate :size="64" />
|
<v-progress-circular indeterminate :size="64" />
|
||||||
@@ -490,7 +534,10 @@ export default {
|
|||||||
serverError: {}
|
serverError: {}
|
||||||
},
|
},
|
||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
ayaType: window.$gz.type.User
|
ayaType: window.$gz.type.User,
|
||||||
|
emailDialog: false,
|
||||||
|
subject: null,
|
||||||
|
message: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -586,6 +633,37 @@ export default {
|
|||||||
window.$gz.eventBus.$off("menu-click", clickHandler);
|
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async sendEmail() {
|
||||||
|
if (
|
||||||
|
this.obj.id == 0 ||
|
||||||
|
this.subject == null ||
|
||||||
|
this.message == null ||
|
||||||
|
window.$gz.util.stringIsNullOrEmpty(this.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(this);
|
||||||
|
try {
|
||||||
|
const res = await window.$gz.api.upsert("notify/direct-smtp", {
|
||||||
|
ObjectId: this.obj.id,
|
||||||
|
aType: this.ayaType,
|
||||||
|
toAddress: this.obj.emailAddress,
|
||||||
|
subject: this.subject,
|
||||||
|
textBody: this.message
|
||||||
|
});
|
||||||
|
if (res.error) {
|
||||||
|
this.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(this);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: this,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, this);
|
||||||
|
}
|
||||||
|
this.emailDialog = false;
|
||||||
|
},
|
||||||
goHelp() {
|
goHelp() {
|
||||||
window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank");
|
window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank");
|
||||||
},
|
},
|
||||||
@@ -924,6 +1002,9 @@ async function clickHandler(menuItem) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "sendemail":
|
||||||
|
m.vm.emailDialog = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -1043,6 +1124,19 @@ function generateMenu(vm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.rights.change &&
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
!window.$gz.util.stringIsNullOrEmpty(vm.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "SendEmail",
|
||||||
|
icon: "$ayiAt",
|
||||||
|
key: FORM_KEY + ":sendemail",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
@@ -1109,7 +1203,8 @@ async function fetchTranslatedText() {
|
|||||||
"AuthTwoFactorDisabled",
|
"AuthTwoFactorDisabled",
|
||||||
"WorkOrderItemScheduledUserList",
|
"WorkOrderItemScheduledUserList",
|
||||||
"WorkOrderItemLaborList",
|
"WorkOrderItemLaborList",
|
||||||
"AllowLogin"
|
"AllowLogin",
|
||||||
|
"SendEmail"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -672,6 +672,51 @@
|
|||||||
</v-tabs-items>
|
</v-tabs-items>
|
||||||
</v-tabs>
|
</v-tabs>
|
||||||
</v-form>
|
</v-form>
|
||||||
|
<v-dialog v-model="emailDialog">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title>
|
||||||
|
{{ $ay.t("SendEmail") }}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row dense class="mt-2">
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
ref="subject"
|
||||||
|
v-model="subject"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoSubject')"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-textarea
|
||||||
|
ref="message"
|
||||||
|
v-model="message"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoMessage')"
|
||||||
|
required
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-btn color="blue darken-1" text @click="emailDialog = false">{{
|
||||||
|
$ay.t("Close")
|
||||||
|
}}</v-btn>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="blue darken-1"
|
||||||
|
text
|
||||||
|
:disabled="
|
||||||
|
subject == null || message == null || obj.emailAddress == null
|
||||||
|
"
|
||||||
|
@click="sendEmail()"
|
||||||
|
>{{ $ay.t("OK") }}</v-btn
|
||||||
|
>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
<v-overlay :value="!formState.ready || formState.loading">
|
<v-overlay :value="!formState.ready || formState.loading">
|
||||||
<v-progress-circular indeterminate :size="64" />
|
<v-progress-circular indeterminate :size="64" />
|
||||||
@@ -742,7 +787,10 @@ export default {
|
|||||||
availableRoles: [],
|
availableRoles: [],
|
||||||
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||||
languageName: window.$gz.locale.getResolvedLanguage(),
|
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||||
hour12: window.$gz.locale.getHour12()
|
hour12: window.$gz.locale.getHour12(),
|
||||||
|
emailDialog: false,
|
||||||
|
subject: null,
|
||||||
|
message: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -846,6 +894,37 @@ export default {
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
|
async sendEmail() {
|
||||||
|
if (
|
||||||
|
this.obj.id == 0 ||
|
||||||
|
this.subject == null ||
|
||||||
|
this.message == null ||
|
||||||
|
window.$gz.util.stringIsNullOrEmpty(this.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(this);
|
||||||
|
try {
|
||||||
|
const res = await window.$gz.api.upsert("notify/direct-smtp", {
|
||||||
|
ObjectId: this.obj.id,
|
||||||
|
aType: this.ayaType,
|
||||||
|
toAddress: this.obj.emailAddress,
|
||||||
|
subject: this.subject,
|
||||||
|
textBody: this.message
|
||||||
|
});
|
||||||
|
if (res.error) {
|
||||||
|
this.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(this);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: this,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, this);
|
||||||
|
}
|
||||||
|
this.emailDialog = false;
|
||||||
|
},
|
||||||
canSave: function() {
|
canSave: function() {
|
||||||
return this.formState.valid && this.formState.dirty;
|
return this.formState.valid && this.formState.dirty;
|
||||||
},
|
},
|
||||||
@@ -1254,6 +1333,9 @@ async function clickHandler(menuItem) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "sendemail":
|
||||||
|
m.vm.emailDialog = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -1352,6 +1434,19 @@ function generateMenu(vm) {
|
|||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.rights.change &&
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
!window.$gz.util.stringIsNullOrEmpty(vm.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "SendEmail",
|
||||||
|
icon: "$ayiAt",
|
||||||
|
key: FORM_KEY + ":sendemail",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
}
|
}
|
||||||
@@ -1425,7 +1520,8 @@ async function fetchTranslatedText() {
|
|||||||
"UserPageAddress",
|
"UserPageAddress",
|
||||||
"Contact",
|
"Contact",
|
||||||
"LastLogin",
|
"LastLogin",
|
||||||
"CustomerList"
|
"CustomerList",
|
||||||
|
"SendEmail"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -411,6 +411,51 @@
|
|||||||
</v-tabs-items>
|
</v-tabs-items>
|
||||||
</v-tabs>
|
</v-tabs>
|
||||||
</v-form>
|
</v-form>
|
||||||
|
<v-dialog v-model="emailDialog">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title>
|
||||||
|
{{ $ay.t("SendEmail") }}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row dense class="mt-2">
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
ref="subject"
|
||||||
|
v-model="subject"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoSubject')"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-textarea
|
||||||
|
ref="message"
|
||||||
|
v-model="message"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoMessage')"
|
||||||
|
required
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-btn color="blue darken-1" text @click="emailDialog = false">{{
|
||||||
|
$ay.t("Close")
|
||||||
|
}}</v-btn>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="blue darken-1"
|
||||||
|
text
|
||||||
|
:disabled="
|
||||||
|
subject == null || message == null || obj.emailAddress == null
|
||||||
|
"
|
||||||
|
@click="sendEmail()"
|
||||||
|
>{{ $ay.t("OK") }}</v-btn
|
||||||
|
>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
<v-overlay :value="!formState.ready || formState.loading">
|
<v-overlay :value="!formState.ready || formState.loading">
|
||||||
<v-progress-circular indeterminate :size="64" />
|
<v-progress-circular indeterminate :size="64" />
|
||||||
@@ -479,7 +524,10 @@ export default {
|
|||||||
serverError: {}
|
serverError: {}
|
||||||
},
|
},
|
||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
ayaType: window.$gz.type.User
|
ayaType: window.$gz.type.User,
|
||||||
|
emailDialog: false,
|
||||||
|
subject: null,
|
||||||
|
message: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -588,6 +636,37 @@ export default {
|
|||||||
window.$gz.eventBus.$off("menu-click", clickHandler);
|
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async sendEmail() {
|
||||||
|
if (
|
||||||
|
this.obj.id == 0 ||
|
||||||
|
this.subject == null ||
|
||||||
|
this.message == null ||
|
||||||
|
window.$gz.util.stringIsNullOrEmpty(this.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(this);
|
||||||
|
try {
|
||||||
|
const res = await window.$gz.api.upsert("notify/direct-smtp", {
|
||||||
|
ObjectId: this.obj.id,
|
||||||
|
aType: this.ayaType,
|
||||||
|
toAddress: this.obj.emailAddress,
|
||||||
|
subject: this.subject,
|
||||||
|
textBody: this.message
|
||||||
|
});
|
||||||
|
if (res.error) {
|
||||||
|
this.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(this);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: this,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, this);
|
||||||
|
}
|
||||||
|
this.emailDialog = false;
|
||||||
|
},
|
||||||
goHelp() {
|
goHelp() {
|
||||||
window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank");
|
window.open(window.$gz.api.helpUrl() + "ay-start-localization", "_blank");
|
||||||
},
|
},
|
||||||
@@ -898,6 +977,9 @@ async function clickHandler(menuItem) {
|
|||||||
case "disable2fa":
|
case "disable2fa":
|
||||||
m.vm.disableTfa();
|
m.vm.disableTfa();
|
||||||
break;
|
break;
|
||||||
|
case "sendemail":
|
||||||
|
m.vm.emailDialog = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -998,6 +1080,20 @@ function generateMenu(vm) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.rights.change &&
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
!window.$gz.util.stringIsNullOrEmpty(vm.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "SendEmail",
|
||||||
|
icon: "$ayiAt",
|
||||||
|
key: FORM_KEY + ":sendemail",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
}
|
}
|
||||||
@@ -1062,7 +1158,8 @@ async function fetchTranslatedText() {
|
|||||||
"SendPasswordResetCode",
|
"SendPasswordResetCode",
|
||||||
"AuthDisableTwoFactor",
|
"AuthDisableTwoFactor",
|
||||||
"AuthTwoFactorDisabled",
|
"AuthTwoFactorDisabled",
|
||||||
"AllowLogin"
|
"AllowLogin",
|
||||||
|
"SendEmail"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -602,6 +602,51 @@
|
|||||||
</v-tabs-items>
|
</v-tabs-items>
|
||||||
</v-tabs>
|
</v-tabs>
|
||||||
</v-form>
|
</v-form>
|
||||||
|
<v-dialog v-model="emailDialog">
|
||||||
|
<v-card>
|
||||||
|
<v-card-title>
|
||||||
|
{{ $ay.t("SendEmail") }}
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row dense class="mt-2">
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-text-field
|
||||||
|
ref="subject"
|
||||||
|
v-model="subject"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoSubject')"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="12">
|
||||||
|
<v-textarea
|
||||||
|
ref="message"
|
||||||
|
v-model="message"
|
||||||
|
dense
|
||||||
|
:label="$ay.t('MemoMessage')"
|
||||||
|
required
|
||||||
|
auto-grow
|
||||||
|
></v-textarea>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-btn color="blue darken-1" text @click="emailDialog = false">{{
|
||||||
|
$ay.t("Close")
|
||||||
|
}}</v-btn>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn
|
||||||
|
color="blue darken-1"
|
||||||
|
text
|
||||||
|
:disabled="
|
||||||
|
subject == null || message == null || obj.emailAddress == null
|
||||||
|
"
|
||||||
|
@click="sendEmail()"
|
||||||
|
>{{ $ay.t("OK") }}</v-btn
|
||||||
|
>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
<v-overlay :value="!formState.ready || formState.loading">
|
<v-overlay :value="!formState.ready || formState.loading">
|
||||||
<v-progress-circular indeterminate :size="64" />
|
<v-progress-circular indeterminate :size="64" />
|
||||||
@@ -661,7 +706,10 @@ export default {
|
|||||||
serverError: {}
|
serverError: {}
|
||||||
},
|
},
|
||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
ayaType: window.$gz.type.Vendor
|
ayaType: window.$gz.type.Vendor,
|
||||||
|
emailDialog: false,
|
||||||
|
subject: null,
|
||||||
|
message: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -753,6 +801,37 @@ export default {
|
|||||||
window.$gz.eventBus.$off("menu-click", clickHandler);
|
window.$gz.eventBus.$off("menu-click", clickHandler);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async sendEmail() {
|
||||||
|
if (
|
||||||
|
this.obj.id == 0 ||
|
||||||
|
this.subject == null ||
|
||||||
|
this.message == null ||
|
||||||
|
window.$gz.util.stringIsNullOrEmpty(this.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(this);
|
||||||
|
try {
|
||||||
|
const res = await window.$gz.api.upsert("notify/direct-smtp", {
|
||||||
|
ObjectId: this.obj.id,
|
||||||
|
aType: this.ayaType,
|
||||||
|
toAddress: this.obj.emailAddress,
|
||||||
|
subject: this.subject,
|
||||||
|
textBody: this.message
|
||||||
|
});
|
||||||
|
if (res.error) {
|
||||||
|
this.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(this);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
window.$gz.form.setFormState({
|
||||||
|
vm: this,
|
||||||
|
loading: false
|
||||||
|
});
|
||||||
|
window.$gz.errorHandler.handleFormError(error, this);
|
||||||
|
}
|
||||||
|
this.emailDialog = false;
|
||||||
|
},
|
||||||
canSave: function() {
|
canSave: function() {
|
||||||
return this.formState.valid && this.formState.dirty;
|
return this.formState.valid && this.formState.dirty;
|
||||||
},
|
},
|
||||||
@@ -1046,6 +1125,9 @@ async function clickHandler(menuItem) {
|
|||||||
addressPostal: m.vm.obj.addressPostal
|
addressPostal: m.vm.obj.addressPostal
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case "sendemail":
|
||||||
|
m.vm.emailDialog = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
"notify-warning",
|
"notify-warning",
|
||||||
@@ -1139,6 +1221,19 @@ function generateMenu(vm) {
|
|||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
vm.rights.change &&
|
||||||
|
vm.$route.params.recordid != 0 &&
|
||||||
|
!window.$gz.util.stringIsNullOrEmpty(vm.obj.emailAddress)
|
||||||
|
) {
|
||||||
|
menuOptions.menuItems.push({
|
||||||
|
title: "SendEmail",
|
||||||
|
icon: "$ayiAt",
|
||||||
|
key: FORM_KEY + ":sendemail",
|
||||||
|
vm: vm
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
@@ -1206,7 +1301,8 @@ async function fetchTranslatedText() {
|
|||||||
"VendorCustom13",
|
"VendorCustom13",
|
||||||
"VendorCustom14",
|
"VendorCustom14",
|
||||||
"VendorCustom15",
|
"VendorCustom15",
|
||||||
"VendorCustom16"
|
"VendorCustom16",
|
||||||
|
"SendEmail"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user