e.stop();
break;
+ case 'kronolithEventSaveAsNew':
+ this.saveEvent(true);
+ elt.disable();
+ e.stop();
+ break;
+
case 'kronolithTaskSave':
this.saveTask();
elt.disable();
this.updateCalendarDropDown('kronolithEventTarget');
this.toggleAllDay(false);
this.openTab($('kronolithEventForm').down('.tabset a.kronolithTabLink'));
- $('kronolithEventForm').enable();
this.disableAlarmMethods();
$('kronolithEventForm').reset();
if (Kronolith.conf.maps.driver) {
$('kronolithEventMapLink').hide();
}
$('kronolithEventSave').show();
+ $('kronolithEventSaveAsNew').show();
$('kronolithEventDelete').show();
$('kronolithEventForm').down('.kronolithFormActions .kronolithSeparator').show();
if (id) {
$('kronolithEventEndDate').setValue(d.toString(Kronolith.conf.date_format));
$('kronolithEventEndTime').setValue(d.toString(Kronolith.conf.time_format));
$('kronolithEventLinkExport').up('span').hide();
+ $('kronolithEventSaveAsNew').hide();
RedBox.showHtml($('kronolithEventDialog').show());
}
},
/**
* Submits the event edit form to create or update an event.
*/
- saveEvent: function()
+ saveEvent: function(asnew)
{
if (this.wrongFormat.size()) {
this.showNotifications([{ type: 'horde.warning', message: Kronolith.text.fix_form_values }]);
.merge({
view: this.view,
view_start: start,
- view_end: end
+ view_end: end,
+ as_new: !!asnew
}),
function(r) {
if (r.response.events && eventid) {
if (!ev.pe) {
$('kronolithEventSave').hide();
- $('kronolithEventForm').disable();
kronolithETagAc.disable();
$('kronolithEventTabTags').select('label').each(function(e) {e.hide()});
} else {
if (!ev.pd) {
$('kronolithEventDelete').hide();
}
- if (!ev.pe && !ev.pd) {
- $('kronolithEventForm').down('.kronolithFormActions .kronolithSeparator').hide();
- }
this.setTitle(ev.t);
RedBox.showHtml($('kronolithEventDialog').show());
<div class="kronolithFormActions">
<input id="kronolithEventSave" type="button" value="<?php echo _("Save") ?>" class="button ok" />
+ <input id="kronolithEventSaveAsNew" type="button" value="<?php echo _("Save As New") ?>" class="button ok" />
<input id="kronolithEventDelete" type="button" value="<?php echo _("Delete") ?>" class="button ko" />
<span class="kronolithSeparator"><?php echo _("or") ?></span> <a class="kronolithFormCancel"><?php echo _("Cancel") ?></a>
</div>