mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Calendar: Quick add improvements
- Set slot attribute to make sure dialog adopts the preference checkbox too - Make sure template winds up alone in the dialog (remove default content)
This commit is contained in:
parent
67dba61ef6
commit
db44e0b754
@ -2085,7 +2085,9 @@ export class CalendarApp extends EgwApp
|
|||||||
* Open a smaller dialog/popup to add a new entry
|
* Open a smaller dialog/popup to add a new entry
|
||||||
*
|
*
|
||||||
* This is opened inside a dialog widget, not a popup. This causes issues
|
* This is opened inside a dialog widget, not a popup. This causes issues
|
||||||
* with the submission, handling of the response, and cleanup.
|
* with the submission, handling of the response, and cleanup. We're doing this because the server sets a lot
|
||||||
|
* of default values, but this could probably also be done more cleanly by getting the values via AJAX and passing
|
||||||
|
* them into the dialog
|
||||||
*
|
*
|
||||||
* @param {Object} options Array of values for new
|
* @param {Object} options Array of values for new
|
||||||
* @param {et2_calendar_event} event Placeholder showing where new event goes
|
* @param {et2_calendar_event} event Placeholder showing where new event goes
|
||||||
@ -2107,7 +2109,7 @@ export class CalendarApp extends EgwApp
|
|||||||
this.quick_add = options;
|
this.quick_add = options;
|
||||||
|
|
||||||
// Open dialog to use as target
|
// Open dialog to use as target
|
||||||
let add_dialog = Et2Dialog.show_dialog(null, '', ' ', null, [], Et2Dialog.PLAIN_MESSAGE, this.egw);
|
let add_dialog = Et2Dialog.show_dialog(null, '', 'Add new event', null, [], Et2Dialog.PLAIN_MESSAGE, this.egw);
|
||||||
add_dialog.id = "quick_add";
|
add_dialog.id = "quick_add";
|
||||||
// Position by the event
|
// Position by the event
|
||||||
if(event)
|
if(event)
|
||||||
@ -2138,8 +2140,15 @@ export class CalendarApp extends EgwApp
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Insert the content
|
// Insert the content into the correct place
|
||||||
add_dialog._overlayContentNode._contentNode.insertAdjacentHTML("beforeend", content.html);
|
add_dialog._overlayContentNode._contentNode.remove();
|
||||||
|
add_dialog._overlayContentNode.insertAdjacentHTML("beforeend", content.html);
|
||||||
|
let template = add_dialog._overlayContentNode.querySelector("[id='calendar-add']");
|
||||||
|
if(template)
|
||||||
|
{
|
||||||
|
template.slot = "content";
|
||||||
|
template.addEventListener("load", add_dialog._adoptTemplateButtons);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
).sendRequest();
|
).sendRequest();
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ add alarm calendar en Add alarm
|
|||||||
add appointments via shortened dialog or complete edit window calendar en Add appointments via shortened dialog or complete edit window
|
add appointments via shortened dialog or complete edit window calendar en Add appointments via shortened dialog or complete edit window
|
||||||
add current view as favorite calendar en Add current view as favorite
|
add current view as favorite calendar en Add current view as favorite
|
||||||
add new alarm calendar en Add new alarm
|
add new alarm calendar en Add new alarm
|
||||||
|
add new event calendar en Add new event
|
||||||
add new participants or resource calendar en Add new participants or resource
|
add new participants or resource calendar en Add new participants or resource
|
||||||
add timesheet entry calendar en Add timesheet entry
|
add timesheet entry calendar en Add timesheet entry
|
||||||
added calendar en Added
|
added calendar en Added
|
||||||
|
@ -17,23 +17,28 @@
|
|||||||
<textbox id="title" size="75" maxlength="255" tabindex="1" class="et2_fullWidth" span="4" blur="Title" needed="true"/>
|
<textbox id="title" size="75" maxlength="255" tabindex="1" class="et2_fullWidth" span="4" blur="Title" needed="true"/>
|
||||||
</row>
|
</row>
|
||||||
<row class="dialogHeader2" height="28">
|
<row class="dialogHeader2" height="28">
|
||||||
<description for="start" value="Start" width="88"/>
|
<description for="start" value="Start" width="88"/>
|
||||||
<date-time id="start" needed="1" class="required" onchange="app.calendar.edit_start_change"/>
|
<date-time id="start" needed="1" class="required" onchange="app.calendar.edit_start_change"/>
|
||||||
<description for="duration" value="Duration" id="calendar_edit_duration" />
|
<description for="duration" value="Duration" id="calendar_edit_duration"/>
|
||||||
<menulist>
|
<menulist>
|
||||||
<menupopup statustext="Duration of the meeting" class="et2_fullWidth" id="duration" no_lang="1" onchange="app.calendar.set_enddate_visibility" options="Use end date,,,,,,,false"/>
|
<menupopup statustext="Duration of the meeting" class="et2_fullWidth" id="duration" no_lang="1"
|
||||||
</menulist>
|
onchange="app.calendar.set_enddate_visibility" options="Use end date,,,,,,,false"/>
|
||||||
<date-time id="end" onchange="app.calendar.edit_update_participant"/>
|
</menulist>
|
||||||
</row>
|
<date-time id="end" onchange="app.calendar.edit_update_participant"/>
|
||||||
</rows>
|
</row>
|
||||||
</grid>
|
</rows>
|
||||||
<hbox class="dialogFooterToolbar">
|
</grid>
|
||||||
<button statustext="saves the changes made" label="Save" id="button[save]" image="save" background_image="1" onclick="return app.calendar.add_dialog_save(ev, widget); "/>
|
<hbox slot="buttons">
|
||||||
<button statustext="Full edit dialog" label="Edit" id="button[edit]" image="edit" background_image="1" onclick="return app.calendar.add_dialog_edit(ev, widget);"/>
|
<button statustext="saves the changes made" label="Save" id="button[save]" image="save" background_image="1"
|
||||||
<button statustext="Close the window" label="Cancel" id="button[cancel]"
|
onclick="return app.calendar.add_dialog_save(ev, widget); "/>
|
||||||
|
<button statustext="Full edit dialog" label="Edit" id="button[edit]" image="edit" background_image="1"
|
||||||
|
onclick="return app.calendar.add_dialog_edit(ev, widget);"/>
|
||||||
|
<button statustext="Close the window" label="Cancel" id="button[cancel]"
|
||||||
onclick="document.querySelector('et2-dialog#quick_add').close()" image="cancel"
|
onclick="document.querySelector('et2-dialog#quick_add').close()" image="cancel"
|
||||||
background_image="1"/>
|
background_image="1"/>
|
||||||
<checkbox label="Always use full edit dialog" id="new_event_dialog" statustext="Always use the full edit dialog, not this little dialog" onchange="egw.set_preference('calendar',widget.id,widget.get_value() ? 'edit' : 'add');"/>
|
<checkbox label="Always use full edit dialog" id="new_event_dialog"
|
||||||
</hbox>
|
statustext="Always use the full edit dialog, not this little dialog"
|
||||||
</template>
|
onchange="egw.set_preference('calendar',widget.id,widget.get_value() ? 'edit' : 'add');"/>
|
||||||
|
</hbox>
|
||||||
|
</template>
|
||||||
</overlay>
|
</overlay>
|
||||||
|
Loading…
Reference in New Issue
Block a user