- add Duplicate Event in Calendar

This commit is contained in:
Paolo Arena
2019-10-30 18:55:16 +01:00
parent eea814fb43
commit 2c62c27e64
3 changed files with 13 additions and 1 deletions

View File

@@ -492,6 +492,17 @@ export default class CEventsCalendar extends Vue {
tools.CancelEvent(this, eventparam)
}
public duplicateEvent(eventparam) {
GlobalStore.actions.DuplicateRec({ table: tools.TABEVENTS, id: eventparam._id }).then((rec) => {
rec.dateTimeStart = new Date()
rec.dateTimeEnd = new Date()
CalendarStore.state.eventlist.push(rec)
this.editEvent(rec)
})
// tools.ActionRecTable(this, lists.MenuAction.DUPLICATE_RECTABLE, tools.TABEVENTS, eventparam._id, eventparam, 'db.duplicatedrecord')
}
public findEventIndex(eventparam) {
for (let i = 0; i < CalendarStore.state.eventlist.length; ++i) {
if (eventparam) {

View File

@@ -10,6 +10,8 @@
<q-toolbar-title>
{{ $t('cal.event') }}
</q-toolbar-title>
<q-btn v-if="editable" flat round color="white" icon="fas fa-copy" v-close-popup
@click="duplicateEvent(myevent)"></q-btn>
<q-btn v-if="editable" flat round color="white" icon="delete" v-close-popup
@click="deleteEvent(myevent)"></q-btn>
<q-btn v-if="editable" flat round color="white" icon="edit" v-close-popup

View File

@@ -338,7 +338,6 @@ export default class CGridTableRec extends Vue {
}
}
public ActionAfterYes(action, item, data) {
if (action === lists.MenuAction.DELETE_RECTABLE) {
if (this.serverData.length > 0)