This commit is contained in:
@@ -31,7 +31,6 @@ todo: biz rule like validatecansave and validatecandelete but validatecanFetch f
|
||||
currently doing: MEMO -
|
||||
|
||||
|
||||
Read needs to set viewed flag on GET
|
||||
READ menu items
|
||||
Reply, Forward
|
||||
compose - must filter OUT outside users, currently they show, new picklist I guess with extra criteria?
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<!-- cansave: {{ canSave() }}<br />
|
||||
selectedUser: {{ selectedUser }}<br />
|
||||
selectedUsers: {{ selectedUsers }}<br /> -->
|
||||
|
||||
<!-- <pre class="text-body-1">{{ obj.notes }}</pre> -->
|
||||
<template v-if="!composing">
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-col cols="12" class="mb-16">
|
||||
<p>
|
||||
<span class="text-h6">{{ $ay.t("MemoSent") }}<br /></span
|
||||
>{{ $ay.dt(obj.sent) }}
|
||||
@@ -26,9 +26,9 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="text-h6">{{ $ay.t("MemoMessage") }}<br /></span
|
||||
>{{ obj.notes }}
|
||||
<span class="text-h6">{{ $ay.t("MemoMessage") }}<br /></span>
|
||||
</p>
|
||||
<div style="white-space: pre-wrap;">{{ obj.notes }}</div>
|
||||
</v-col>
|
||||
|
||||
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
||||
@@ -67,7 +67,7 @@
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-col cols="12" v-if="!replyMode">
|
||||
<gz-pick-list
|
||||
:allowNoSelection="false"
|
||||
:canClear="false"
|
||||
@@ -93,7 +93,12 @@
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" v-if="replyMode">
|
||||
<p>
|
||||
<span class="text-caption">{{ $ay.t("MemoToID") }}<br /></span
|
||||
>{{ obj.fromName }}
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<v-text-field
|
||||
v-model="obj.name"
|
||||
@@ -289,6 +294,7 @@ export default {
|
||||
rights: window.$gz.role.defaultRightsObject(),
|
||||
ayaType: window.$gz.type.Memo,
|
||||
composing: false,
|
||||
replyMode: false,
|
||||
pickListSelectedUserId: null,
|
||||
items: [],
|
||||
toUsers: []
|
||||
@@ -336,6 +342,10 @@ export default {
|
||||
},
|
||||
updateSave: function() {
|
||||
let hasSelection = this.toUsers.length > 0;
|
||||
console.log("UpdateSaveCalled: ", {
|
||||
formstate: this.formState,
|
||||
hasSelection: hasSelection
|
||||
});
|
||||
//enable / disable save button
|
||||
if (
|
||||
this.formState.dirty &&
|
||||
@@ -512,6 +522,33 @@ export default {
|
||||
});
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
}
|
||||
},
|
||||
replyForward(forward) {
|
||||
let vm = this;
|
||||
if (!forward) {
|
||||
//REPLY MODE
|
||||
vm.obj.toId = vm.obj.fromId;
|
||||
vm.replyMode = true;
|
||||
vm.toUsers.push({ id: vm.obj.fromId });
|
||||
}
|
||||
let header = `${vm.$ay.t("MemoSent")} ${vm.$ay.dt(
|
||||
vm.obj.sent
|
||||
)}\n${vm.$ay.t("MemoFromID")} ${vm.obj.fromName}\n${vm.$ay.t(
|
||||
"MemoSubject"
|
||||
)} ${vm.obj.name}\n`;
|
||||
|
||||
vm.obj.name = `${vm.$ay.t("MemoRe")} ${vm.obj.name}`;
|
||||
vm.obj.notes = `\n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n${header}\n\n${vm.obj.notes}`;
|
||||
vm.obj.id = 0;
|
||||
vm.composing = true;
|
||||
generateMenu(vm);
|
||||
window.$gz.form.setFormState({
|
||||
vm: vm,
|
||||
dirty: true,
|
||||
valid: true,
|
||||
loading: false
|
||||
});
|
||||
vm.updateSave();
|
||||
}
|
||||
|
||||
//end methods
|
||||
@@ -570,6 +607,12 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "reply":
|
||||
m.vm.replyForward(false);
|
||||
break;
|
||||
case "forward":
|
||||
m.vm.replyForward(true);
|
||||
break;
|
||||
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
@@ -647,16 +690,7 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
if (vm.rights.change) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "MemoForward",
|
||||
icon: "$ayiShare",
|
||||
key: FORM_KEY + ":forward",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
if (vm.rights.change) {
|
||||
if (vm.rights.change && !vm.composing) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "MemoReply",
|
||||
icon: "$ayiReply",
|
||||
@@ -664,7 +698,14 @@ function generateMenu(vm) {
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
if (vm.rights.change && !vm.composing) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "MemoForward",
|
||||
icon: "$ayiShare",
|
||||
key: FORM_KEY + ":forward",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
@@ -695,6 +736,7 @@ async function fetchTranslatedText(vm) {
|
||||
"MemoSent",
|
||||
"MemoForward",
|
||||
"MemoReply",
|
||||
"MemoRe",
|
||||
"MemoCustom1",
|
||||
"MemoCustom2",
|
||||
"MemoCustom3",
|
||||
@@ -712,5 +754,23 @@ async function fetchTranslatedText(vm) {
|
||||
"MemoCustom15",
|
||||
"MemoCustom16"
|
||||
]);
|
||||
}
|
||||
} /*
|
||||
|
||||
/// <summary>
|
||||
/// Generate a new memo as a Reply or Forward based on this fetched read only memo
|
||||
/// </summary>
|
||||
/// <param name="bForward">If true, this is a forward reply to don't set the toID just yet</param>
|
||||
/// <returns>A memo object with fields filled in ready for typing reply/forward text</returns>
|
||||
public Memo ReplyForward(bool bForward)
|
||||
{
|
||||
Memo m=Memo.NewItem();
|
||||
if(!bForward)
|
||||
m.ToID=this.FromID;
|
||||
|
||||
m.Subject=LocalizedTextTable.GetLocalizedTextDirect("Memo.Label.Re")+ " " + this.Subject;
|
||||
m.Message="\r\n\r\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r\n" + this.Header + "\r\n\r\n" + this.Message;
|
||||
|
||||
return m;
|
||||
}
|
||||
*/
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user