This commit is contained in:
@@ -31,7 +31,6 @@ todo: biz rule like validatecansave and validatecandelete but validatecanFetch f
|
|||||||
currently doing: MEMO -
|
currently doing: MEMO -
|
||||||
|
|
||||||
|
|
||||||
Read needs to set viewed flag on GET
|
|
||||||
READ menu items
|
READ menu items
|
||||||
Reply, Forward
|
Reply, Forward
|
||||||
compose - must filter OUT outside users, currently they show, new picklist I guess with extra criteria?
|
compose - must filter OUT outside users, currently they show, new picklist I guess with extra criteria?
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<!-- cansave: {{ canSave() }}<br />
|
<!-- cansave: {{ canSave() }}<br />
|
||||||
selectedUser: {{ selectedUser }}<br />
|
selectedUser: {{ selectedUser }}<br />
|
||||||
selectedUsers: {{ selectedUsers }}<br /> -->
|
selectedUsers: {{ selectedUsers }}<br /> -->
|
||||||
|
<!-- <pre class="text-body-1">{{ obj.notes }}</pre> -->
|
||||||
<template v-if="!composing">
|
<template v-if="!composing">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12" class="mb-16">
|
||||||
<p>
|
<p>
|
||||||
<span class="text-h6">{{ $ay.t("MemoSent") }}<br /></span
|
<span class="text-h6">{{ $ay.t("MemoSent") }}<br /></span
|
||||||
>{{ $ay.dt(obj.sent) }}
|
>{{ $ay.dt(obj.sent) }}
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<span class="text-h6">{{ $ay.t("MemoMessage") }}<br /></span
|
<span class="text-h6">{{ $ay.t("MemoMessage") }}<br /></span>
|
||||||
>{{ obj.notes }}
|
|
||||||
</p>
|
</p>
|
||||||
|
<div style="white-space: pre-wrap;">{{ obj.notes }}</div>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
<v-col v-if="form().showMe(this, 'Tags')" cols="12">
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col cols="12">
|
<v-col cols="12" v-if="!replyMode">
|
||||||
<gz-pick-list
|
<gz-pick-list
|
||||||
:allowNoSelection="false"
|
:allowNoSelection="false"
|
||||||
:canClear="false"
|
:canClear="false"
|
||||||
@@ -93,7 +93,12 @@
|
|||||||
</v-chip>
|
</v-chip>
|
||||||
</template>
|
</template>
|
||||||
</v-col>
|
</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-col cols="12">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.name"
|
v-model="obj.name"
|
||||||
@@ -289,6 +294,7 @@ export default {
|
|||||||
rights: window.$gz.role.defaultRightsObject(),
|
rights: window.$gz.role.defaultRightsObject(),
|
||||||
ayaType: window.$gz.type.Memo,
|
ayaType: window.$gz.type.Memo,
|
||||||
composing: false,
|
composing: false,
|
||||||
|
replyMode: false,
|
||||||
pickListSelectedUserId: null,
|
pickListSelectedUserId: null,
|
||||||
items: [],
|
items: [],
|
||||||
toUsers: []
|
toUsers: []
|
||||||
@@ -336,6 +342,10 @@ export default {
|
|||||||
},
|
},
|
||||||
updateSave: function() {
|
updateSave: function() {
|
||||||
let hasSelection = this.toUsers.length > 0;
|
let hasSelection = this.toUsers.length > 0;
|
||||||
|
console.log("UpdateSaveCalled: ", {
|
||||||
|
formstate: this.formState,
|
||||||
|
hasSelection: hasSelection
|
||||||
|
});
|
||||||
//enable / disable save button
|
//enable / disable save button
|
||||||
if (
|
if (
|
||||||
this.formState.dirty &&
|
this.formState.dirty &&
|
||||||
@@ -512,6 +522,33 @@ export default {
|
|||||||
});
|
});
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
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
|
//end methods
|
||||||
@@ -570,6 +607,12 @@ async function clickHandler(menuItem) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "reply":
|
||||||
|
m.vm.replyForward(false);
|
||||||
|
break;
|
||||||
|
case "forward":
|
||||||
|
m.vm.replyForward(true);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
window.$gz.eventBus.$emit(
|
window.$gz.eventBus.$emit(
|
||||||
@@ -647,16 +690,7 @@ function generateMenu(vm) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.rights.change) {
|
if (vm.rights.change && !vm.composing) {
|
||||||
menuOptions.menuItems.push({
|
|
||||||
title: "MemoForward",
|
|
||||||
icon: "$ayiShare",
|
|
||||||
key: FORM_KEY + ":forward",
|
|
||||||
vm: vm
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vm.rights.change) {
|
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "MemoReply",
|
title: "MemoReply",
|
||||||
icon: "$ayiReply",
|
icon: "$ayiReply",
|
||||||
@@ -664,7 +698,14 @@ function generateMenu(vm) {
|
|||||||
vm: 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 });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
|
|
||||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||||
@@ -695,6 +736,7 @@ async function fetchTranslatedText(vm) {
|
|||||||
"MemoSent",
|
"MemoSent",
|
||||||
"MemoForward",
|
"MemoForward",
|
||||||
"MemoReply",
|
"MemoReply",
|
||||||
|
"MemoRe",
|
||||||
"MemoCustom1",
|
"MemoCustom1",
|
||||||
"MemoCustom2",
|
"MemoCustom2",
|
||||||
"MemoCustom3",
|
"MemoCustom3",
|
||||||
@@ -712,5 +754,23 @@ async function fetchTranslatedText(vm) {
|
|||||||
"MemoCustom15",
|
"MemoCustom15",
|
||||||
"MemoCustom16"
|
"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>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user