From 2356c6e0ddc80565b144e822f2e21c211022462c Mon Sep 17 00:00:00 2001
From: nathan
Date: Mon, 9 Dec 2024 14:56:34 -0700
Subject: [PATCH] Change deprecated et2_dialog for Et2Dialog webcomponent
---
addressbook/templates/default/edit.xet | 2 +-
addressbook/templates/mobile/edit.xet | 2 +-
admin/inc/class.admin_mail.inc.php | 2 +-
admin/templates/default/customfield_edit.xet | 2 +-
admin/templates/default/customtranslation.xet | 2 +-
admin/templates/default/mailaccount.xet | 6 ++---
admin/templates/default/token.edit.xet | 2 +-
admin/templates/mobile/mailaccount.xet | 6 ++---
.../et2_extension_nextmatch_actions.js | 8 +++---
calendar/templates/default/edit.xet | 6 ++---
calendar/templates/default/meeting.xet | 2 +-
calendar/templates/mobile/edit.xet | 6 ++---
filemanager/templates/default/admin.xet | 2 +-
filemanager/templates/default/file.xet | 2 +-
filemanager/templates/mobile/file.xet | 2 +-
home/js/Et2PortletList.ts | 6 ++---
home/js/app.ts | 5 ++--
infolog/templates/default/edit.xet | 2 +-
infolog/templates/mobile/edit.xet | 2 +-
mail/js/app.js | 25 ++++++++++---------
mail/templates/default/acl.xet | 2 +-
mail/templates/mobile/acl.xet | 2 +-
notifications/js/notificationajaxpopup.js | 5 ++--
pixelegg/js/fw_mobile.js | 3 ++-
preferences/templates/default/password.xet | 2 +-
preferences/templates/mobile/password.xet | 2 +-
resources/templates/default/edit.xet | 2 +-
resources/templates/mobile/edit.xet | 2 +-
timesheet/templates/default/edit.xet | 2 +-
timesheet/templates/default/editstatus.xet | 2 +-
timesheet/templates/mobile/edit.xet | 2 +-
timesheet/templates/mobile/view.xet | 2 +-
32 files changed, 62 insertions(+), 58 deletions(-)
diff --git a/addressbook/templates/default/edit.xet b/addressbook/templates/default/edit.xet
index bdb587ef39..8a5a0380a7 100644
--- a/addressbook/templates/default/edit.xet
+++ b/addressbook/templates/default/edit.xet
@@ -423,7 +423,7 @@
-
+
diff --git a/addressbook/templates/mobile/edit.xet b/addressbook/templates/mobile/edit.xet
index 2ed36ef5bb..3987157bf9 100644
--- a/addressbook/templates/mobile/edit.xet
+++ b/addressbook/templates/mobile/edit.xet
@@ -314,7 +314,7 @@
-
+
diff --git a/admin/inc/class.admin_mail.inc.php b/admin/inc/class.admin_mail.inc.php
index 5f538faa8e..0b8d2213c8 100644
--- a/admin/inc/class.admin_mail.inc.php
+++ b/admin/inc/class.admin_mail.inc.php
@@ -1236,7 +1236,7 @@ class admin_mail
// if account is for multiple user, change delete confirmation to reflect that
if (Mail\Account::is_multiple($content))
{
- $tpl->setElementAttribute('button[delete]', 'onclick', "et2_dialog.confirm(widget,'This is NOT a personal mail account!\\n\\nAccount will be deleted for ALL users!\\n\\nAre you really sure you want to do that?','Delete this account')");
+ $tpl->setElementAttribute('button[delete]', 'onclick', "Et2Dialog.confirm(widget,'This is NOT a personal mail account!\\n\\nAccount will be deleted for ALL users!\\n\\nAre you really sure you want to do that?','Delete this account')");
}
// if no edit access, make whole dialog readonly
diff --git a/admin/templates/default/customfield_edit.xet b/admin/templates/default/customfield_edit.xet
index e22e0ee527..1c371e3f39 100644
--- a/admin/templates/default/customfield_edit.xet
+++ b/admin/templates/default/customfield_edit.xet
@@ -80,7 +80,7 @@
-
+
diff --git a/admin/templates/default/customtranslation.xet b/admin/templates/default/customtranslation.xet
index 66a9ca8498..715978e7fa 100644
--- a/admin/templates/default/customtranslation.xet
+++ b/admin/templates/default/customtranslation.xet
@@ -17,7 +17,7 @@
-
+
diff --git a/admin/templates/default/mailaccount.xet b/admin/templates/default/mailaccount.xet
index a7b122ad6c..40c435ebfa 100644
--- a/admin/templates/default/mailaccount.xet
+++ b/admin/templates/default/mailaccount.xet
@@ -266,7 +266,7 @@
-
+
@@ -374,8 +374,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/admin/templates/default/token.edit.xet b/admin/templates/default/token.edit.xet
index 6414027cba..2dd471c658 100644
--- a/admin/templates/default/token.edit.xet
+++ b/admin/templates/default/token.edit.xet
@@ -66,7 +66,7 @@
+ onclick="Et2Dialog.confirm(widget,'Revoke this token','Revoke')">
diff --git a/admin/templates/mobile/mailaccount.xet b/admin/templates/mobile/mailaccount.xet
index 49272eddc4..7b7f8c1417 100644
--- a/admin/templates/mobile/mailaccount.xet
+++ b/admin/templates/mobile/mailaccount.xet
@@ -238,7 +238,7 @@
-
+
@@ -302,8 +302,8 @@
-
-
+
+
@@ -131,7 +131,7 @@
-
+
@@ -152,7 +152,7 @@
-
+
diff --git a/calendar/templates/default/meeting.xet b/calendar/templates/default/meeting.xet
index 270b616868..340f26179e 100644
--- a/calendar/templates/default/meeting.xet
+++ b/calendar/templates/default/meeting.xet
@@ -53,7 +53,7 @@
-
+
diff --git a/calendar/templates/mobile/edit.xet b/calendar/templates/mobile/edit.xet
index 7ead94e546..bcec06995f 100644
--- a/calendar/templates/mobile/edit.xet
+++ b/calendar/templates/mobile/edit.xet
@@ -43,7 +43,7 @@
-
+
@@ -131,7 +131,7 @@
-
+
@@ -191,7 +191,7 @@
-
+
diff --git a/filemanager/templates/default/admin.xet b/filemanager/templates/default/admin.xet
index 024d6ea3e6..f58046699b 100644
--- a/filemanager/templates/default/admin.xet
+++ b/filemanager/templates/default/admin.xet
@@ -88,7 +88,7 @@
-
+
diff --git a/filemanager/templates/default/file.xet b/filemanager/templates/default/file.xet
index 3bb1c81190..16b52fa6b2 100644
--- a/filemanager/templates/default/file.xet
+++ b/filemanager/templates/default/file.xet
@@ -131,7 +131,7 @@
-
+
diff --git a/filemanager/templates/mobile/file.xet b/filemanager/templates/mobile/file.xet
index 87375c0295..bafccb04cd 100644
--- a/filemanager/templates/mobile/file.xet
+++ b/filemanager/templates/mobile/file.xet
@@ -141,7 +141,7 @@
-
+
diff --git a/home/js/Et2PortletList.ts b/home/js/Et2PortletList.ts
index 27e844c79e..ec2a7cecfb 100644
--- a/home/js/Et2PortletList.ts
+++ b/home/js/Et2PortletList.ts
@@ -67,7 +67,7 @@ export class Et2PortletList extends Et2Portlet
let dialog = et2_createWidget("dialog", {
callback: function(button_id, value)
{
- if(button_id == et2_dialog.CANCEL_BUTTON)
+ if(button_id == Et2Dialog.CANCEL_BUTTON)
{
return;
}
@@ -91,7 +91,7 @@ export class Et2PortletList extends Et2Portlet
list.set_value(new_list);
}
},
- buttons: et2_dialog.BUTTONS_OK_CANCEL,
+ buttons: Et2Dialog.BUTTONS_OK_CANCEL,
title: app.home.egw.lang('add'),
template: path,
value: {content: [{label: app.home.egw.lang('add'), type: 'link-entry', name: 'add', size: ''}]}
@@ -122,7 +122,7 @@ export class Et2PortletList extends Et2Portlet
}
if(changed)
{
- widget._process_edit(et2_dialog.OK_BUTTON, {
+ widget._process_edit(Et2Dialog.OK_BUTTON, {
list: new_list || {}
});
}
diff --git a/home/js/app.ts b/home/js/app.ts
index edf6ee8d0d..3f34b4b1c0 100644
--- a/home/js/app.ts
+++ b/home/js/app.ts
@@ -20,6 +20,7 @@ import "./Et2PortletNote";
import './Et2PortletWeather';
import "../../calendar/js/Et2PortletCalendar";
import Sortable from "sortablejs/modular/sortable.complete.esm.js";
+import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
/**
* JS for home application
@@ -343,7 +344,7 @@ export class HomeApp extends EgwApp
// If you use a template, the second parameter will be the value of the template, as if it were submitted.
callback: function(button_id, value)
{
- if(button_id != et2_dialog.OK_BUTTON)
+ if(button_id != Et2Dialog.OK_BUTTON)
{
return;
}
@@ -351,7 +352,7 @@ export class HomeApp extends EgwApp
// Pass them to server
egw.json('home_ui::ajax_set_default', ['add', portlet_ids, value.group || false]).sendRequest(true);
},
- buttons: et2_dialog.BUTTONS_OK_CANCEL,
+ buttons: Et2Dialog.BUTTONS_OK_CANCEL,
title: action.caption,
template: "home.set_default",
value: {content: {}, sel_options: {group: {default: egw.lang('All'), forced: egw.lang('Forced')}}}
diff --git a/infolog/templates/default/edit.xet b/infolog/templates/default/edit.xet
index de3659df3e..21d63adbd2 100644
--- a/infolog/templates/default/edit.xet
+++ b/infolog/templates/default/edit.xet
@@ -212,7 +212,7 @@
-
+
diff --git a/infolog/templates/mobile/edit.xet b/infolog/templates/mobile/edit.xet
index bb5b53f222..8034845876 100644
--- a/infolog/templates/mobile/edit.xet
+++ b/infolog/templates/mobile/edit.xet
@@ -139,7 +139,7 @@
-
+
diff --git a/mail/js/app.js b/mail/js/app.js
index 2bc73618a1..b9126b7bf5 100755
--- a/mail/js/app.js
+++ b/mail/js/app.js
@@ -13,8 +13,7 @@
import {AppJS} from "../../api/js/jsapi/app_base.js";
import {et2_createWidget} from "../../api/js/etemplate/et2_core_widget";
-import {et2_dialog} from "../../api/js/etemplate/et2_widget_dialog";
-import {et2_button} from "../../api/js/etemplate/et2_widget_button";
+import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
import {egw_getObjectManager} from '../../api/js/egw_action/egw_action';
import {egwIsMobile, egwSetBit} from "../../api/js/egw_action/egw_action_common";
import {EGW_AO_FLAG_DEFAULT_FOCUS} from "../../api/js/egw_action/egw_action_constants";
@@ -5899,8 +5898,7 @@ app.classes.mail = AppJS.extend(
{
var self = this;
var pass_exp = egw.preference('smime_pass_exp', 'mail');
- et2_createWidget("dialog",
- {
+ const dialog = loadWebComponent("et2-dialog", {
callback: function(_button_id, _value)
{
if (_button_id == 'send' && _value)
@@ -5926,7 +5924,8 @@ app.classes.mail = AppJS.extend(
}},
template: egw.webserverUrl+'/api/templates/default/password.xet',
resizable: false
- }, et2_dialog._create_parent('mail'));
+ });
+ document.body.append(dialog);
},
/**
@@ -6107,8 +6106,7 @@ app.classes.mail = AppJS.extend(
'presets[org_unit]': _metadata.certDetails.subject.organizationUnitName
};
content.class="";
- et2_createWidget("dialog",
- {
+ const dialog = et2_createWidget('et2-dialog', {
callback: function(_button_id, _value)
{
if (_button_id == 'contact' && _value)
@@ -6130,7 +6128,8 @@ app.classes.mail = AppJS.extend(
value:{content:content},
template: egw.webserverUrl+'/mail/templates/default/smimeCertAddToContact.xet?1',
resizable: false
- }, et2_dialog._create_parent('mail'));
+ });
+ document.body.append(dialog);
},
/**
@@ -6177,7 +6176,7 @@ app.classes.mail = AppJS.extend(
var data = (_sender && _sender.uid) ? {data:_sender} : egw.dataGetUIDdata(id);
var subject = data && data.data? data.data.subject : "";
- et2_createWidget("dialog",
+ const dialog = et2_createWidget("et2-dialog",
{
callback: function(_button_id, _value) {
var newSubject = null;
@@ -6215,7 +6214,8 @@ app.classes.mail = AppJS.extend(
template: egw.webserverUrl + '/mail/templates/default/modifyMessageSubjectDialog.xet?1',
resizable: false,
width: 500
- }, et2_dialog._create_parent('mail'));
+ });
+ document.body.append(dialog);
},
/**
@@ -6263,7 +6263,7 @@ app.classes.mail = AppJS.extend(
var pref_id = _senders[0].id.split('::')[0]+'_predefined_compose_addresses';
var prefs = egw.preference(pref_id, 'mail');
- et2_createWidget("dialog",
+ const dialog = loadWebComponent("et2-dialog",
{
callback: function (_button_id, _value)
{
@@ -6281,7 +6281,8 @@ app.classes.mail = AppJS.extend(
minWidth: 410,
template: egw.webserverUrl + '/mail/templates/default/predefinedAddressesDialog.xet?',
resizable: false,
- }, et2_dialog._create_parent('mail'));
+ });
+ document.body.append(dialog);
},
/**
diff --git a/mail/templates/default/acl.xet b/mail/templates/default/acl.xet
index 4cedf42194..e02308452a 100755
--- a/mail/templates/default/acl.xet
+++ b/mail/templates/default/acl.xet
@@ -74,7 +74,7 @@
-
+
diff --git a/mail/templates/mobile/acl.xet b/mail/templates/mobile/acl.xet
index ad1ec3540d..ec1a7a22cf 100644
--- a/mail/templates/mobile/acl.xet
+++ b/mail/templates/mobile/acl.xet
@@ -32,7 +32,7 @@
-
+
diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js
index 2227c7f840..e352e7f429 100644
--- a/notifications/js/notificationajaxpopup.js
+++ b/notifications/js/notificationajaxpopup.js
@@ -949,12 +949,13 @@
$egwpopup_fw.click(function(){window.app.notifications.toggle();});
jQuery(".egwpopup_deleteall", '#egwpopup').click(function(_ev){
_ev.stopPropagation();
- et2_dialog.show_dialog( function(_button){
+ Et2Dialog.show_dialog(function (_button)
+ {
if (_button == 2) window.app.notifications.delete_all();
},
egw.lang('Are you sure you want to delete all notifications?'),
egw.lang('Delete notifications'),
- null, et2_dialog.BUTTON_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw
+ null, Et2Dialog.BUTTON_YES_NO, Et2Dialog.WARNING_MESSAGE, undefined, egw
);
});
jQuery(".egwpopup_seenall", '#egwpopup').click(function(){window.app.notifications.mark_all_seen()});
diff --git a/pixelegg/js/fw_mobile.js b/pixelegg/js/fw_mobile.js
index 93245dd5d9..730e202c9e 100644
--- a/pixelegg/js/fw_mobile.js
+++ b/pixelegg/js/fw_mobile.js
@@ -1139,7 +1139,8 @@ import {tapAndSwipe} from "../../api/js/tapandswipe";
jQuery(window).on('popstate', function(e){
// Check if user wants to logout and ask a confirmation
if (window.location.hash == '#main') {
- et2_dialog.show_dialog(function(button){
+ Et2Dialog.show_dialog(function (button)
+ {
if (button === 3){
history.forward();
return;
diff --git a/preferences/templates/default/password.xet b/preferences/templates/default/password.xet
index a5658f2e1b..526c2c5190 100644
--- a/preferences/templates/default/password.xet
+++ b/preferences/templates/default/password.xet
@@ -37,7 +37,7 @@
-
+
diff --git a/preferences/templates/mobile/password.xet b/preferences/templates/mobile/password.xet
index 142b5298d0..701bf0f001 100644
--- a/preferences/templates/mobile/password.xet
+++ b/preferences/templates/mobile/password.xet
@@ -30,7 +30,7 @@
-
+
diff --git a/resources/templates/default/edit.xet b/resources/templates/default/edit.xet
index e29e085470..07d5445094 100644
--- a/resources/templates/default/edit.xet
+++ b/resources/templates/default/edit.xet
@@ -175,7 +175,7 @@
-
+
diff --git a/resources/templates/mobile/edit.xet b/resources/templates/mobile/edit.xet
index e3bd3382ef..20e87235f5 100644
--- a/resources/templates/mobile/edit.xet
+++ b/resources/templates/mobile/edit.xet
@@ -121,7 +121,7 @@
-
+
diff --git a/timesheet/templates/default/edit.xet b/timesheet/templates/default/edit.xet
index 03a8cfb2e0..ff3485efb8 100644
--- a/timesheet/templates/default/edit.xet
+++ b/timesheet/templates/default/edit.xet
@@ -187,7 +187,7 @@
-
+
diff --git a/timesheet/templates/default/editstatus.xet b/timesheet/templates/default/editstatus.xet
index 1616bb5719..335702911c 100644
--- a/timesheet/templates/default/editstatus.xet
+++ b/timesheet/templates/default/editstatus.xet
@@ -40,7 +40,7 @@
-
+
diff --git a/timesheet/templates/mobile/edit.xet b/timesheet/templates/mobile/edit.xet
index f6e9f54f06..218a3343a9 100644
--- a/timesheet/templates/mobile/edit.xet
+++ b/timesheet/templates/mobile/edit.xet
@@ -98,7 +98,7 @@
-
+
diff --git a/timesheet/templates/mobile/view.xet b/timesheet/templates/mobile/view.xet
index 419767db32..3348df65cd 100644
--- a/timesheet/templates/mobile/view.xet
+++ b/timesheet/templates/mobile/view.xet
@@ -83,7 +83,7 @@
-
+