Commit Graph

412 Commits

Author SHA1 Message Date
ralf
74ad3ba7b0 change egw.jsonq() and egw.link_title() to return promises
* egw.jsonq() now always returns a promise like egw.request(), still supporting old callback syntax
* egw.link_title(_app, _id, _callback, _context, _force_reload) supports boolean values for _callback (to not break existing code)
- false: just a cache lookup (like current call with just 2 parameters), returning null, if no title is cached, or the title
- true: always return a promise, which might already be resolved, if title was cached
- function: also returns a promise and calls the callback
--> calling egw.link_title(_app, _id) without 3rd parameter is deprecated now (gives a console.trace), to be changed in future to always return a promise, unless called with false, to just return a cache-lookup
* Et2SelectAccountReadonly and et2_link_widget is changed to use the new/updated syntax with promises
2022-05-02 11:27:33 +02:00
ralf
e4c2432f4c replace jQuery.ui.keyCode.X with EGW_KEY_X 2022-04-30 10:33:07 +02:00
ralf
c62b305b4a return a Promise from egw.accountData and deprecated, but still support, the use of a callback
egw.accounts can be called with a second parameter async=true to query accounts async and return a Promise
2022-04-27 17:33:07 +02:00
nathan
7d86272b28 CSS / Layout cleanup
- Fix select with tags=true causes hidden WebComponents to display

Chosen wants to do sizing calculations which wasn't working properly on w.c.
2022-04-25 10:46:51 -06:00
Hadi Nategh
8b147bc285 Fix removeSessionItem not working 2022-04-05 10:24:06 +02:00
nathan
9693cfe538 Switch nextmatch print & select all to using Et2Dialog 2022-03-23 13:28:15 -06:00
nathan
96039e0729 egw_open doesn't like the import... 2022-03-17 16:54:43 -06:00
nathan
255add7d98 Api: Switch from et2_dialog to Et2Dialog
Might be some I missed or can't change just yet
2022-03-17 16:18:39 -06:00
nathan
d2020727fe Fix some missing translation problems 2022-02-11 13:02:21 -07:00
nathan
c964ccd584 - Fix 'Forgot password' could not complete due to redirect
- Avoid error if no groups selected in registration configuration
2022-02-08 15:26:52 -07:00
Ralf Becker
1f4cb50e74 use $method parameter of Api\Etemplate::exec() plus new et2_process handler as menuaction GET parameter
allows determining the called function on the URL to eg. send it to different FPM pool
(before the menuaction of et2 was always "EGroupware\Api\Etemplate::ajax_process_content")
2022-01-09 16:38:14 +02:00
nathan
50f4b5cd47 Fix missing calendar participant + button
set_readonly() was missing, getWindowTitle() was using .options.value instead of get_value()
2021-12-07 13:36:53 -07:00
nathan
a73f0771e6 Fix TypeError: Cannot read properties of undefined (reading 'position')
Caused by LitElement not having a styles property.  Just skip those to avoid the error
2021-12-06 14:42:17 -07:00
nathan
a717234b2f Merge branch 'master' into web-components 2021-11-09 15:02:25 -07:00
Hadi Nategh
968774d829 Update jQuery-ui to 1.13.0 2021-11-09 11:06:17 +01:00
nathan
fbbc466c78 Merge branch 'master' into web-components 2021-10-18 10:56:05 -06:00
nathan
cbe32069c2 Fix kanban merge into document stopped working with introduction of PDF checkbox 2021-10-18 09:42:12 -06:00
nathan
02dce82010 Merge branch 'master' into web-components 2021-10-06 14:02:22 -06:00
nathan
707c57ecf0 * Add option to merge documents as PDF 2021-09-28 17:00:55 -06:00
Ralf Becker
582793d52b Revert "Bring web-component work into master branch"
To many things are not working :(
- addressbook, infolog, even timesheet index lacks at least r/o textbox and problably other widgets
- smallPART (with many extra widgets) is completly unusable
- *box widget seems not to skip empty boxes
--> we need more testing and progress, before we can merge that

This reverts commit 9cee681b94.
2021-09-03 11:28:22 +02:00
nathan
9cee681b94 Bring web-component work into master branch 2021-09-02 10:52:10 -06:00
nathan
61da5c544a Merge branch 'master' into web-components 2021-08-27 11:40:22 -06:00
Ralf Becker
44ae9650f8 legacy-load old javascript from etemplate(1) and phpbrain, to fix eg. DB-Tools 2021-08-26 17:51:45 +02:00
Nathan Gray
3e0f302bb5
Remove unneeded import 2021-08-25 11:34:10 -06:00
nathan
538e483499 Merge branch 'master' into web-components 2021-08-23 15:41:27 -06:00
Ralf Becker
0203ce5a1f also augmenting Promise returned from egw.request() with an abort method and using that in link-widget 2021-08-23 09:37:18 +02:00
Ralf Becker
6c641f824b fix missing abort method for link-widget
also remove jQuery.proxy
2021-08-22 11:55:29 +02:00
Hadi Nategh
466371fa03 Check element exist before applying to sortable as sortablejs needs an HTMLElement instance 2021-08-18 11:15:38 +02:00
Hadi Nategh
4e7ebc509a Make sure the DOM object is there before using it 2021-08-18 11:02:48 +02:00
Ralf Becker
29ab26b731 fix egw.request() which was using jQuery defered.always() which egw_json.sendRequest() no longer returns in favor to a Promise 2021-08-14 08:42:37 +02:00
nathan
fac1dfb8d4 Merge branch 'master' into web-components 2021-08-12 10:35:46 -06:00
Hadi Nategh
d07a7ab194 WIP of replacing bower-asset packages:
- Get jquery-ui and touch event plugin working (although still modular import is not possible becuase of a wierd issue with jquery-ui tooltip plugin)
- Import timepicker-addon plugin as npm package
- Update composer.lock file
2021-08-12 14:51:38 +02:00
Ralf Becker
72699fad30 fix ESM module import (no currly brackets) as suggested by Guy Bedford 2021-08-11 19:28:01 +02:00
Hadi Nategh
572908e300 Get favorites list sorting working with Sortablejs 2021-08-11 16:49:29 +02:00
Ralf Becker
5f7bafd030 allow to explicit register callbacks for the broadcasted push messages
egw.registerPush(Function)

The callback should have a bound context, if it requires one!
2021-07-30 15:21:58 +02:00
nathan
30d835fa39 - Get label "for" attribute working when target is a WebComponent
- Remove requirement that tooltip target be jQuery, get tooltips working on WebComponents
2021-07-23 10:18:45 -06:00
Ralf Becker
0a1e784f2e egw.getCache(name) function to get a cache-object shared between all EGroupware windows and popups
used to share server-side generated options for et2_selectbox
also removed nextmatch specific code from et2_selectbox which seems no longer necessary
2021-07-19 17:02:37 +02:00
Ralf Becker
3a618937a9 do NOT check Content-Type header as it's sometimes not set to application/json
parsing JSON will error out, if payload is no JSON anyway
happens with mark-as-spam and SpamTitan
2021-07-19 10:24:58 +02:00
Ralf Becker
59ac3f4bda always name generated file app.min.js so client-side can load it without knowing source is .ts or .js
--> fixes client-side initiated load errors
2021-07-19 08:31:06 +02:00
Ralf Becker
ce0a513187 egw.preference(name, app, true) returns now a promise to query preference async
changed notifications to query preference async together with lang-files
fixed error-handling in new egw.json()
2021-07-16 14:50:06 +02:00
Ralf Becker
50b8839609 fix not working InfoLog index: synchronous request must return fulfilled promise 2021-07-16 11:49:53 +02:00
Ralf Becker
b780c7ebd8 replace jQuery.ajax with fetch (or XMLHttpRequest for synchronous requests) 2021-07-16 08:47:22 +02:00
Ralf Becker
a5ad691757 deprecated egw.includeJS() in favor of es6 import statement
with egw composition happening in main window the used import statement happens in that context and NOT in the window (eg. popup or iframe) this module is instantiated for!
2021-07-09 17:27:22 +02:00
Ralf Becker
65502ace6e re-added daily cache-buster for app.js and removed explicit timepicker include causing a double include
(we still sometimes get a jQuery.datepicker is not defined, but it seems a timing issue and is NOT fixed by including it twice!)
2021-07-09 10:07:31 +02:00
Ralf Becker
edacfc12cb remove (unnecessary) double egw.min.js import 2021-07-09 08:15:17 +02:00
Ralf Becker
5b8923f548 replace include of egw.js with egw_core.js, which provides the egw.extend
fixes the stray egw.js include
2021-07-08 17:04:48 +02:00
Hadi Nategh
052f5f23cc Remove framework object from import statement which would override the actual object 2021-07-07 12:31:11 +02:00
Ralf Becker
e8da7caa64 fix after rollup build popups need extra reload
caused by no longer necessary import of etemplate2 in egw.js, as Promise works and etemplate2 is global
2021-07-07 10:32:06 +02:00
Ralf Becker
cfd11cf821 replace eval with Function constructor to quiten rollup warning 2021-07-02 15:27:46 +02:00
Ralf Becker
b88716c8b6 legacy load jQueryUI as tooltip has wired context problems if loaded as module 2021-07-02 08:52:18 +02:00
Ralf Becker
68155251fa fixing a couple of jQuery plugin includes
thought jQueryUI-tooltip is still broken and we either need to legacy-load jQuery(UI) or fix the tooltip
2021-07-01 16:33:15 +02:00
Ralf Becker
8c7722c8b0 1. loading dhmtlx(tree|menu) again via script tag
2. fixed not loaded app.js in egw_json by using import direct and not includeJS (and therefore removed additional include in et2_load)
3. adding cache-buster for egw.js and app.js endpoints to force reloads (not adding them for anything else, as it interferes with rollup
2021-07-01 14:36:51 +02:00
Hadi Nategh
e5d0e5def0 Avoid triggering initial resize if not necessary 2021-07-01 10:22:42 +02:00
Ralf Becker
05405b955a remove generated .js files from git 2021-07-01 08:38:08 +02:00
nathangray
154946f39e Get news_admin loading with rollup 2021-06-30 14:21:58 -06:00
nathangray
3add958afa The results of Guy Bedford's help
Egroupware will load into addressbook & show rows
Most base files should be bundled server-side & included
rollup.config.js controls the process

Still needs work:
- consider /dist directory for best-practice
- cleanup
- other built-in apps
- EPL / external apps need Guy's multi-stage work
2021-06-25 14:49:24 -06:00
Ralf Becker
45758aaada we must not make json_request object global as it interferes with registered plugins from different windows
Example was tracker site config opened in an iframe, then stopped further et2_load responses to the main window
because it still used window object from the iframe and therefore could not find the node
2021-06-18 11:09:53 +02:00
nathangray
5a209a00f0 Avoid infinite loop if loading JS file fails 2021-06-17 14:17:58 -06:00
Ralf Becker
af3193480c fix not working applyFunc if app.js was not yet loaded (missing return of the Promise) 2021-06-15 11:51:10 +02:00
Ralf Becker
8432cca3ea show (caught) exceptions during import now as error for easier spotting
console.error instead of console.log
2021-06-14 15:22:16 +02:00
Ralf Becker
829defa0c1 also import old jsapi with rest of egw object 2021-06-14 15:12:52 +02:00
Ralf Becker
1035ff31ec fix async loading caused et2 widgets calling api before loaded
using a strict order now:
1. legacy stuff like jquery and dhtmlx
2. client-side api / egw-object
3. et2 and rest
2021-06-14 14:16:07 +02:00
Ralf Becker
685a0d3328 handel empty objects like empty array 2021-06-14 10:35:54 +02:00
Ralf Becker
ee508c50b9 filter out legacy JS code from importmap and sort it
also only add extension-less includes for .ts files (was accidentally commented out) and fix some .js imports without extension
2021-06-12 11:44:28 +02:00
nathangray
2c2563eccf Fix PUSH new entries did not show if filter had multiple values
(cherry picked from commit 0caabaf516)
2021-06-11 13:17:27 -06:00
Ralf Becker
f503f7139a EgwApp object need to be global / assigned to window.EgwApp
as that's how we iterate through all EgwApp instances for observer and push
2021-06-11 15:21:18 +02:00
Ralf Becker
78e30f1a27 load egw_ready.js again 2021-06-11 15:05:44 +02:00
Ralf Becker
89967336e2 removed app_base.js from egw.js requirement to not pull in etemplate, but had to move app to egw.js too 2021-06-11 13:48:09 +02:00
Ralf Becker
771d6c727f got mail app.js incl. jsapi/app_base.js working
plus marking et2 methods returning promisses as async and removing cache-buster from includeJS calls in egw_action_common.js as it causes double loads
2021-06-11 10:11:13 +02:00
Ralf Becker
1f4ba0156a remove (unused) etemplate2 import causing login page to constantly reload 2021-06-11 09:11:28 +02:00
Ralf Becker
e18832e110 defer calls to app.* after et2_load is finished
changing et2_load egw_json plugin to return a promise for that
2021-06-11 09:05:57 +02:00
Ralf Becker
5298336886 include jquery and other legacy js files via script tag 2021-06-10 11:38:54 +02:00
Ralf Becker
38cb855017 fixing a couple more imports to get addressbook list show up 2021-06-09 11:11:34 +02:00
Ralf Becker
027c087a06 remove egw_app dependency and only import et2, if there is an eTemplate on the page
stops login-page from loading eT2 stuff
2021-06-09 10:13:51 +02:00
Ralf Becker
bfea641321 fix async loading caused app.js not being loaded before et2.load() tried to instantiate it 2021-06-08 17:13:30 +02:00
Ralf Becker
8fa2bb466b fixed includeJS causing jQuery to be included twice and breaking plugins 2021-06-08 15:11:37 +02:00
Ralf Becker
304dbb95ab got empty nextmatch in timesheet working 2021-06-08 14:11:59 +02:00
Ralf Becker
f91bca83e1 got et2 mostly working: timesheet.edit renders 2021-06-07 17:33:53 +02:00
Ralf Becker
592b7fb97d replace LAB.js with native es5 loading 2021-06-05 20:39:39 +02:00
Ralf Becker
069cf4c3ac fix security exception if opener is from a different security context eg. LTI opening in a new window 2021-05-20 16:44:35 +02:00
Ralf Becker
450febb623 fix security exeception if opener is from a different security context eg. LTI opening in a new window 2021-05-20 16:35:54 +02:00
nathangray
aad2a77666 JS quality improvement
- add missing declaration
2021-05-19 10:01:07 -06:00
Hadi Nategh
67fb220778 Check popup blocker for when trying to open mail compose popup from filemamanger/Collabora 2021-05-17 16:27:51 +02:00
Ralf Becker
eefd8ed972 improve egw.langRequire to return a Promise, if no callback specified 2021-04-29 09:45:16 +02:00
nathangray
8fb0048c17 Fix linking an image/svg+xml image to an unsaved entry would give an error
An error happened! (EGroupware\Api\Exception\AssertionFailed): File 'true' is not an absolute path!
was generated because we tried to use webdav.phptrue as the thumbnail
2021-04-28 12:00:02 -06:00
Hadi Nategh
c370941c51 Keep private app objects if dialog gets destroyed 2021-04-20 15:30:46 +02:00
nathangray
d5aacd190d Add 'no_quick_add' link registry setting so apps can opt out of the quick add 2021-03-30 10:12:29 -06:00
nathangray
87ff6842ea Api: Stop annoying "column saved" message that kept coming up 2021-03-24 10:21:02 -06:00
Ralf Becker
fa0e7715c1 mark context as optional parameter 2021-03-15 08:57:45 +02:00
Ralf Becker
46c4e0e118 add daily cache-buster to client-side included app.js files for applyFunc 2021-03-12 11:23:26 +02:00
Hadi Nategh
e5674bbc5d Fix missing mailvelope readonly properties from egw_app object 2021-03-09 15:19:27 +01:00
Ralf Becker
d2626085f6 fix wrong context causing eg. attachments to mail to no longer work 2021-03-08 21:20:11 +02:00
nathangray
19bd3a03b0 Addressbook: Update CRM view contact info in sidebox if it's changed by push message 2021-03-04 13:53:52 -07:00
nathangray
df54dcace4 Apply client-side push refactoring to calendar, infolog, timesheet 2021-03-04 11:27:35 -07:00
Ralf Becker
58ae23c74c allow "app.<appname>.<method>" in link registry and use it to open CRM view 2021-03-04 11:50:13 +02:00
Ralf Becker
7e4ccc8311 fix some points in top-menu and probably some other stuff using et2_call were not working 2021-03-03 19:13:45 +02:00
Ralf Becker
a467bab01f return hashed appName of opened tab eg. to set notifcation counter 2021-03-02 21:00:59 +02:00
Ralf Becker
7a060b205b not overwriting call and apply method of egw function/object using callFunc and applyFunc instead, fixes several problems 2021-03-02 12:16:47 +02:00
Ralf Becker
e36c6c4cec move global et2_call function to egw.call and egw.apply methods, ensuring app.js is loaded, if not yet loaded, also using that as apply plugin for egw.json 2021-03-01 11:50:41 +02:00
nathangray
1eb174d3f7 For push update filter, consider empty array as having no value 2021-02-25 13:59:32 -07:00
nathangray
158e65fc90 Take contact shares into account for push ACL checks 2021-02-25 09:11:39 -07:00
Hadi Nategh
1f41bba904 Fix youtube API loading player after initiation 2021-02-25 13:51:20 +01:00
nathangray
3c72462b5e Enable push for addressbook
Refactor EgwApp.push() to cover more common stuff for simpler app code
2021-02-24 09:18:42 -07:00
Hadi Nategh
2a2f0bf390 Keep darkmode state in serverside session too. Fix darkmode state in egroupware iframes. 2021-02-24 12:22:27 +01:00
Ralf Becker
cf9e3ae4e1 WIP to display calls in calendar 2021-02-23 00:16:51 +02:00
Hadi Nategh
dc2f80c39c Some TypeScript definitions 2021-02-10 14:12:27 +01:00
Hadi Nategh
b9570b9b60 Some fixes for darkmode:
- Fix darkmode not switched in popups
- Fix a quick white page shown before switching to darkmode when it's set to 'auto'
2021-01-27 12:26:37 +01:00
Hadi Nategh
dad82bf1f1 Implement auto color-scheme in order to respect browser's selected prefers-color-scheme 2021-01-26 17:04:37 +01:00
nathangray
6af3e37bed * Etemplate: Add context menu action on linked files to copy them somewhere else
Also, update vfsSelect to use request(), so it processes the additional stuff in response so we can have a success message.
2020-12-21 13:53:24 -07:00
Hadi Nategh
f21ac58c87 Introduce dark/light mode theme switch into framework 2020-12-15 20:24:25 +01:00
nathangray
9bc4c41941 Api: Clear sorting with 'No filters' favorite 2020-11-16 10:57:04 -07:00
Hadi Nategh
f064ff8242 Make sure the params exists before addressing it 2020-11-03 11:47:26 +01:00
Hadi Nategh
b0e2e1f1be Open crm view for contact link 2020-10-29 11:47:29 +01:00
nathangray
bf615644d4 Api: Add egw.request() into egw_global.d.ts 2020-10-27 16:17:32 -06:00
Ralf Becker
086771ee66 try to fix race-condition in reconnecting a "lost" websocket connection 2020-10-27 14:19:25 +01:00
Ralf Becker
82d7a103a9 try to fix race-condition in reconnecting a "lost" websocket connection 2020-10-27 14:16:11 +01:00
Ralf Becker
765b545697 * SmallPART: fix not working LTI launch after last maintenance release
checking if we are about to load required files, before redirecting to cd=popup to load them
2020-10-22 10:00:27 +02:00
Hadi Nategh
d4d63d382e Fix error message still remains even after connection is up again 2020-10-21 11:54:45 +02:00
nathangray
5bf4d4866f WIP on sharing prompt to ask about mounting new share 2020-10-20 16:47:26 -06:00
Hadi Nategh
a8c136f1cc No longer need to send ajax=true at the end of url 2020-10-20 16:04:32 +02:00
nathangray
38ff63f778 Api: New JavaScript API method egw.request(menuaction : string, parameters : any[]) : Promise
Does an AJAX request, and resolves the returned Promise with just the data (no piggybacks) when it arrives from the server.  Any registered data handlers are run before resolving the Promise.
2020-10-16 10:33:13 -06:00
Ralf Becker
83eabe4d8e login page does NOT need client-side api and redirect with cd=popup shows as message 2020-10-16 09:45:30 +02:00
Ralf Becker
1ef16c9c55 closing websocket explicit, before reopening it, to not end up with multiple connections and doublicated messages 2020-10-15 18:17:31 +02:00
Ralf Becker
663816769e fix TypeError this.openWebSocket() is not a function 2020-10-14 22:28:32 +02:00
Ralf Becker
313a378539 * Swoolepush: periodically pinging server from browser to detect lost websocket connection and reconnect 2020-10-14 20:16:13 +02:00
Ralf Becker
175d94f3e3 * Api: detect if framework data is missing for popups too and redirect to cd=popup to load it 2020-10-14 17:31:36 +02:00
nathangray
857943720e Api: Make sure we don't add any unwanted data to account store
Push fallback can piggy-back some data, we don't want it
2020-10-05 10:55:34 -06:00
Ralf Becker
7db25dce5e * Admin: push server test to diagnose problems and improved recovery from failed requests / network problems 2020-10-02 20:28:02 +02:00
Hadi Nategh
2ed186079e Implement openTab for egw_open object and make tab attributes configurable 2020-09-24 16:19:56 +02:00
Hadi Nategh
4bf65486ef WIP of framework's multitab implementation 2020-09-23 16:55:35 +02:00
Hadi Nategh
c01beef108 We can't use let in js files as we still supporting old devices with es5 only 2020-09-17 15:36:02 +02:00
nathangray
f38f61cf1b Correct parameters in TS 2020-09-15 09:05:48 -06:00
nathangray
210c54b689 Etemplate: More fixes for row count when updating / adding
Now fixed the situation where 1 row was updated & 1 added, but the added one did not match filter and was not returned when server was asked.  Now removed blank row waiting for it, and keeping row count consistent
2020-09-01 14:49:06 -06:00
nathangray
b43f51b52e Api: Handle refreshing multiple UIDs but not getting them all back.
Previously we were assuming only 1 was requested, now properly handling multiple UIDs in a single request and not all of them being returned (eg ACL or doesn't match filters)
2020-08-31 14:57:22 -06:00
nathangray
bec67d63ee Etemplate: Change how nextmatch handles update & refresh push messages 2020-08-07 09:19:15 -06:00
Hadi Nategh
c43d0684cc Do not show close button on success message and dismiss it on container click handler 2020-08-07 13:29:30 +02:00
Ralf Becker
3b4d8071e9 improve fix not updated number of nextmatch rows on push type "delete" 2020-08-05 18:48:35 +02:00
Ralf Becker
321cd60fb5 fix not updated number of nextmatch rows on push type "delete" 2020-08-05 18:26:40 +02:00
Hadi Nategh
70e8a1b3ae Fix errors happening in mobile framework 2020-08-03 15:21:11 +02:00
Ralf Becker
33e88d25ae * Preferences: use push to ask every affected client to reload preferences, if affected 2020-07-31 09:47:49 +02:00
Hadi Nategh
1624ceae07 Return an object for egw message in order to have access to it after display 2020-07-30 15:01:50 +02:00
Hadi Nategh
14c908de78 Do not include egw message in print 2020-07-29 15:45:25 +02:00
Ralf Becker
08acad038c * Mail: replying to a mail should only update icon, not move it to top of list 2020-07-29 13:58:15 +02:00
Hadi Nategh
7900bfd9cd Avoid outputting same message multiple times if it's still alive 2020-07-24 12:46:29 +02:00
nathangray
6d2af76576 * Infolog: Push updates 2020-07-23 13:34:08 -06:00
nathangray
a6688ab3f8 Etemplate: Allow app to specify a new row index for updated rows as well. 2020-07-22 12:00:01 -06:00
nathangray
f0b924008b Etemplate: Add a callback so apps can decide where to put new push rows 2020-07-21 15:32:22 -06:00
nathangray
69420c19ad Api: Handle add push messages in the nextmatch list 2020-07-20 13:43:26 -06:00
Ralf Becker
bf44ee753a WIP push for mail (currently only Dovecot with further configuration!) 2020-07-20 12:09:08 +02:00
Hadi Nategh
1f066dee26 Implement new egw messaging (keeps not deliberately dismissed messages) 2020-07-17 14:09:37 +02:00