Merge remote-tracking branch 'origin/features/feature/email-pj-h2f' into releases/release-h2f
This commit is contained in:
commit
c6e47e73d4
@ -63,6 +63,10 @@ return [
|
|||||||
['name' => 'settings#setConfig', 'url' => '/v1/config/{key}', 'verb' => 'POST'],
|
['name' => 'settings#setConfig', 'url' => '/v1/config/{key}', 'verb' => 'POST'],
|
||||||
// Tools
|
// Tools
|
||||||
['name' => 'email#sendEmailPublicLink', 'url' => '/v1/public/sendmail', 'verb' => 'POST'],
|
['name' => 'email#sendEmailPublicLink', 'url' => '/v1/public/sendmail', 'verb' => 'POST'],
|
||||||
|
|
||||||
|
//Email box
|
||||||
|
['name' => 'emailBox#loadEmailboxMessage', 'url' => '/load-email-box', 'verb' => 'GET'],
|
||||||
|
['name' => 'emailBox#loadEmailboxAttachement', 'url' => '/load-email-attachement/{messageId}', 'verb' => 'GET'],
|
||||||
],
|
],
|
||||||
'resources' => [
|
'resources' => [
|
||||||
'appointmentConfig' => ['url' => '/v1/appointment_configs']
|
'appointmentConfig' => ['url' => '/v1/appointment_configs']
|
||||||
|
|||||||
@ -1322,7 +1322,7 @@ function b(n) {
|
|||||||
/******/ // This function allow to reference async chunks
|
/******/ // This function allow to reference async chunks
|
||||||
/******/ __webpack_require__.u = (chunkId) => {
|
/******/ __webpack_require__.u = (chunkId) => {
|
||||||
/******/ // return url for filenames based on template
|
/******/ // return url for filenames based on template
|
||||||
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"741d92f5ec54d0c1ff41","vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"01a7eb6779cc0e417f44","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"c2bd3081c493a88308a2","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_store_index_js":"276ff6be1cb450405b79","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","dashboard-lazy":"60b7f707e08fff04c7a1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"0658eb6db50a09dd2afe","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"e0f3178442f3c9eb35e1","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
|
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"741d92f5ec54d0c1ff41","vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"01a7eb6779cc0e417f44","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"c2bd3081c493a88308a2","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_store_index_js":"256e15d8889d4ef4234b","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","dashboard-lazy":"60b7f707e08fff04c7a1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"0658eb6db50a09dd2afe","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"e0f3178442f3c9eb35e1","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
|
||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
@ -1580,4 +1580,4 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
|
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
//# sourceMappingURL=calendar-dashboard.js.map?v=ea575d366c0a35d0da21
|
//# sourceMappingURL=calendar-dashboard.js.map?v=76085d55951f19ac3dcc
|
||||||
File diff suppressed because one or more lines are too long
@ -7655,16 +7655,24 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/vue */ "./node_modules/@nextcloud/vue/dist/index.mjs");
|
/* harmony import */ var _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/vue */ "./node_modules/@nextcloud/vue/dist/index.mjs");
|
||||||
/* harmony import */ var vue_material_design_icons_Upload_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-material-design-icons/Upload.vue */ "./node_modules/vue-material-design-icons/Upload.vue");
|
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
|
||||||
/* harmony import */ var vue_material_design_icons_Close_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-material-design-icons/Close.vue */ "./node_modules/vue-material-design-icons/Close.vue");
|
/* harmony import */ var vue_material_design_icons_Upload_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-material-design-icons/Upload.vue */ "./node_modules/vue-material-design-icons/Upload.vue");
|
||||||
/* harmony import */ var vue_material_design_icons_Folder_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-material-design-icons/Folder.vue */ "./node_modules/vue-material-design-icons/Folder.vue");
|
/* harmony import */ var vue_material_design_icons_Close_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-material-design-icons/Close.vue */ "./node_modules/vue-material-design-icons/Close.vue");
|
||||||
/* harmony import */ var vue_material_design_icons_Paperclip_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue-material-design-icons/Paperclip.vue */ "./node_modules/vue-material-design-icons/Paperclip.vue");
|
/* harmony import */ var vue_material_design_icons_Folder_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue-material-design-icons/Folder.vue */ "./node_modules/vue-material-design-icons/Folder.vue");
|
||||||
/* harmony import */ var vue_material_design_icons_Plus_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue-material-design-icons/Plus.vue */ "./node_modules/vue-material-design-icons/Plus.vue");
|
/* harmony import */ var vue_material_design_icons_Paperclip_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue-material-design-icons/Paperclip.vue */ "./node_modules/vue-material-design-icons/Paperclip.vue");
|
||||||
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
/* harmony import */ var vue_material_design_icons_Plus_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vue-material-design-icons/Plus.vue */ "./node_modules/vue-material-design-icons/Plus.vue");
|
||||||
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
|
/* harmony import */ var vue_material_design_icons_Email_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vue-material-design-icons/Email.vue */ "./node_modules/vue-material-design-icons/Email.vue");
|
||||||
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utils/logger.js */ "./src/utils/logger.js");
|
/* harmony import */ var vue_material_design_icons_ArrowLeft_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vue-material-design-icons/ArrowLeft.vue */ "./node_modules/vue-material-design-icons/ArrowLeft.vue");
|
||||||
/* harmony import */ var _services_attachmentService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../services/attachmentService.js */ "./src/services/attachmentService.js");
|
/* harmony import */ var vue_material_design_icons_Reload_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vue-material-design-icons/Reload.vue */ "./node_modules/vue-material-design-icons/Reload.vue");
|
||||||
/* harmony import */ var webdav__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! webdav */ "./node_modules/webdav/dist/web/index.js");
|
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
||||||
|
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
|
||||||
|
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../utils/logger.js */ "./src/utils/logger.js");
|
||||||
|
/* harmony import */ var _services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../services/attachmentService.js */ "./src/services/attachmentService.js");
|
||||||
|
/* harmony import */ var webdav__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! webdav */ "./node_modules/webdav/dist/web/index.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -7682,12 +7690,19 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
NcListItem: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcListItem,
|
NcListItem: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcListItem,
|
||||||
NcActions: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcActions,
|
NcActions: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcActions,
|
||||||
NcActionButton: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcActionButton,
|
NcActionButton: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcActionButton,
|
||||||
Upload: vue_material_design_icons_Upload_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
|
Upload: vue_material_design_icons_Upload_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
|
||||||
Close: vue_material_design_icons_Close_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
|
Close: vue_material_design_icons_Close_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
|
||||||
Folder: vue_material_design_icons_Folder_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
|
Folder: vue_material_design_icons_Folder_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
|
||||||
Paperclip: vue_material_design_icons_Paperclip_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
|
Paperclip: vue_material_design_icons_Paperclip_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
|
||||||
Plus: vue_material_design_icons_Plus_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
|
Plus: vue_material_design_icons_Plus_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
|
||||||
NcDialog: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcDialog
|
NcDialog: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcDialog,
|
||||||
|
NcModal: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcModal,
|
||||||
|
NcButton: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcButton,
|
||||||
|
Email: vue_material_design_icons_Email_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
|
||||||
|
ArrowLeft: vue_material_design_icons_ArrowLeft_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
|
||||||
|
Reload: vue_material_design_icons_Reload_vue__WEBPACK_IMPORTED_MODULE_9__["default"],
|
||||||
|
NcAvatar: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcAvatar,
|
||||||
|
NcLoadingIcon: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcLoadingIcon
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
calendarObjectInstance: {
|
calendarObjectInstance: {
|
||||||
@ -7704,7 +7719,13 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
uploading: false,
|
uploading: false,
|
||||||
showOpenConfirmation: false,
|
showOpenConfirmation: false,
|
||||||
openConfirmationMessage: '',
|
openConfirmationMessage: '',
|
||||||
openConfirmationButtons: []
|
openConfirmationButtons: [],
|
||||||
|
showModal: false,
|
||||||
|
showAttachmentsSection: false,
|
||||||
|
loadingDataEmailBox: false,
|
||||||
|
mailBoxData: [],
|
||||||
|
mailAttachments: [],
|
||||||
|
loadingText: 'Chargement ...'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -7729,10 +7750,10 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async openFilesModal() {
|
async openFilesModal() {
|
||||||
const picker = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_7__.getFilePickerBuilder)(t('calendar', 'Choose a file to add as attachment')).setMultiSelect(false).allowDirectories(true).addButton({
|
const picker = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_11__.getFilePickerBuilder)(t('calendar', 'Choose a file to add as attachment')).setMultiSelect(false).allowDirectories(true).addButton({
|
||||||
label: t('calendar', 'Pick'),
|
label: t('calendar', 'Pick'),
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
callback: nodes => _utils_logger_js__WEBPACK_IMPORTED_MODULE_8__["default"].debug('Picked attachment', {
|
callback: nodes => _utils_logger_js__WEBPACK_IMPORTED_MODULE_12__["default"].debug('Picked attachment', {
|
||||||
nodes
|
nodes
|
||||||
})
|
})
|
||||||
}).build();
|
}).build();
|
||||||
@ -7741,11 +7762,11 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
if (!this.isDuplicateAttachment(filename)) {
|
if (!this.isDuplicateAttachment(filename)) {
|
||||||
var _davRes$multistatus;
|
var _davRes$multistatus;
|
||||||
// TODO do not share Move this to PHP
|
// TODO do not share Move this to PHP
|
||||||
const data = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_9__.getFileInfo)(filename, this.currentUser.dav.userId);
|
const data = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__.getFileInfo)(filename, this.currentUser.dav.userId);
|
||||||
const davRes = await (0,webdav__WEBPACK_IMPORTED_MODULE_10__.parseXML)(data);
|
const davRes = await (0,webdav__WEBPACK_IMPORTED_MODULE_14__.parseXML)(data);
|
||||||
const davRespObj = davRes === null || davRes === void 0 || (_davRes$multistatus = davRes.multistatus) === null || _davRes$multistatus === void 0 || (_davRes$multistatus = _davRes$multistatus.response[0]) === null || _davRes$multistatus === void 0 || (_davRes$multistatus = _davRes$multistatus.propstat) === null || _davRes$multistatus === void 0 ? void 0 : _davRes$multistatus.prop;
|
const davRespObj = davRes === null || davRes === void 0 || (_davRes$multistatus = davRes.multistatus) === null || _davRes$multistatus === void 0 || (_davRes$multistatus = _davRes$multistatus.response[0]) === null || _davRes$multistatus === void 0 || (_davRes$multistatus = _davRes$multistatus.propstat) === null || _davRes$multistatus === void 0 ? void 0 : _davRes$multistatus.prop;
|
||||||
davRespObj.fileName = filename;
|
davRespObj.fileName = filename;
|
||||||
davRespObj.url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_6__.generateUrl)("/f/".concat(davRespObj.fileid));
|
davRespObj.url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)("/f/".concat(davRespObj.fileid));
|
||||||
davRespObj.value = davRespObj.url;
|
davRespObj.value = davRespObj.url;
|
||||||
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj);
|
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj);
|
||||||
}
|
}
|
||||||
@ -7754,7 +7775,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
isDuplicateAttachment(path) {
|
isDuplicateAttachment(path) {
|
||||||
return this.attachments.find(attachment => {
|
return this.attachments.find(attachment => {
|
||||||
if (attachment.fileName === path) {
|
if (attachment.fileName === path) {
|
||||||
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_7__.showError)(t('calendar', 'Attachment {name} already exist!', {
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_11__.showError)(t('calendar', 'Attachment {name} already exist!', {
|
||||||
name: this.getBaseName(path)
|
name: this.getBaseName(path)
|
||||||
}));
|
}));
|
||||||
return true;
|
return true;
|
||||||
@ -7768,24 +7789,24 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
async onLocalAttachmentSelected(e) {
|
async onLocalAttachmentSelected(e) {
|
||||||
try {
|
try {
|
||||||
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder');
|
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder');
|
||||||
const attachments = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_9__.uploadLocalAttachment)(attachmentsFolder, Array.from(e.target.files), this.currentUser.dav, this.attachments);
|
const attachments = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__.uploadLocalAttachment)(attachmentsFolder, Array.from(e.target.files), this.currentUser.dav);
|
||||||
// TODO do not share file, move to PHP
|
// TODO do not share file, move to PHP
|
||||||
attachments.map(async attachment => {
|
attachments.map(async attachment => {
|
||||||
var _davRes$multistatus2;
|
var _davRes$multistatus2;
|
||||||
const data = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_9__.getFileInfo)("".concat(attachmentsFolder, "/").concat(attachment.path), this.currentUser.dav.userId);
|
const data = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__.getFileInfo)("".concat(attachmentsFolder, "/").concat(attachment.path), this.currentUser.dav.userId);
|
||||||
const davRes = await (0,webdav__WEBPACK_IMPORTED_MODULE_10__.parseXML)(data);
|
const davRes = await (0,webdav__WEBPACK_IMPORTED_MODULE_14__.parseXML)(data);
|
||||||
const davRespObj = davRes === null || davRes === void 0 || (_davRes$multistatus2 = davRes.multistatus) === null || _davRes$multistatus2 === void 0 || (_davRes$multistatus2 = _davRes$multistatus2.response[0]) === null || _davRes$multistatus2 === void 0 || (_davRes$multistatus2 = _davRes$multistatus2.propstat) === null || _davRes$multistatus2 === void 0 ? void 0 : _davRes$multistatus2.prop;
|
const davRespObj = davRes === null || davRes === void 0 || (_davRes$multistatus2 = davRes.multistatus) === null || _davRes$multistatus2 === void 0 || (_davRes$multistatus2 = _davRes$multistatus2.response[0]) === null || _davRes$multistatus2 === void 0 || (_davRes$multistatus2 = _davRes$multistatus2.propstat) === null || _davRes$multistatus2 === void 0 ? void 0 : _davRes$multistatus2.prop;
|
||||||
davRespObj.fileName = attachment.path;
|
davRespObj.fileName = attachment.path;
|
||||||
davRespObj.url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_6__.generateUrl)("/f/".concat(davRespObj.fileid));
|
davRespObj.url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)("/f/".concat(davRespObj.fileid));
|
||||||
davRespObj.value = davRespObj.url;
|
davRespObj.value = davRespObj.url;
|
||||||
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj);
|
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj);
|
||||||
});
|
});
|
||||||
e.target.value = '';
|
e.target.value = '';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
_utils_logger_js__WEBPACK_IMPORTED_MODULE_8__["default"].error('Could not upload attachment(s)', {
|
_utils_logger_js__WEBPACK_IMPORTED_MODULE_12__["default"].error('Could not upload attachment(s)', {
|
||||||
error
|
error
|
||||||
});
|
});
|
||||||
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_7__.showError)(t('calendar', 'Could not upload attachment(s)'));
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_11__.showError)(t('calendar', 'Could not upload attachment(s)'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getIcon(mime) {
|
getIcon(mime) {
|
||||||
@ -7793,7 +7814,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
},
|
},
|
||||||
getPreview(attachment) {
|
getPreview(attachment) {
|
||||||
if (attachment.xNcHasPreview) {
|
if (attachment.xNcHasPreview) {
|
||||||
return (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_6__.generateUrl)("/core/preview?fileId=".concat(attachment.xNcFileId, "&x=100&y=100&a=0"));
|
return (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)("/core/preview?fileId=".concat(attachment.xNcFileId, "&x=100&y=100&a=0"));
|
||||||
}
|
}
|
||||||
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : OC.MimeType.getIconUrl('folder');
|
return attachment.formatType ? OC.MimeType.getIconUrl(attachment.formatType) : OC.MimeType.getIconUrl('folder');
|
||||||
},
|
},
|
||||||
@ -7803,14 +7824,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
openFile(rawUrl) {
|
openFile(rawUrl) {
|
||||||
let url;
|
let url;
|
||||||
try {
|
try {
|
||||||
url = new URL(rawUrl, (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_6__.getBaseUrl)());
|
url = new URL(rawUrl, (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.getBaseUrl)());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
_utils_logger_js__WEBPACK_IMPORTED_MODULE_8__["default"].error("Refusing to open invalid URL: ".concat(rawUrl), {
|
_utils_logger_js__WEBPACK_IMPORTED_MODULE_12__["default"].error("Refusing to open invalid URL: ".concat(rawUrl), {
|
||||||
error
|
error
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const baseUrl = new URL((0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_6__.getBaseUrl)());
|
const baseUrl = new URL((0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.getBaseUrl)());
|
||||||
if (url.href.startsWith(baseUrl.href)) {
|
if (url.href.startsWith(baseUrl.href)) {
|
||||||
// URL belongs to this instance and is safe
|
// URL belongs to this instance and is safe
|
||||||
window.open(url.href, '_blank', 'noopener noreferrer');
|
window.open(url.href, '_blank', 'noopener noreferrer');
|
||||||
@ -7835,6 +7856,120 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
this.showOpenConfirmation = true;
|
this.showOpenConfirmation = true;
|
||||||
|
},
|
||||||
|
async syncEmailBox() {
|
||||||
|
this.loadingText = 'Synchronisation encours ...';
|
||||||
|
this.loadingDataEmailBox = true;
|
||||||
|
this.mailBoxData = [];
|
||||||
|
await this.loadEmailsBox(true);
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
},
|
||||||
|
async openEmailBoxModal() {
|
||||||
|
this.loadingText = 'Chargement des emails ...';
|
||||||
|
this.showModal = true;
|
||||||
|
this.loadingDataEmailBox = true;
|
||||||
|
await this.loadEmailsBox();
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
},
|
||||||
|
async getAttachments(mail) {
|
||||||
|
this.loadingText = 'Récupération des piecs jointes ...';
|
||||||
|
this.loadingDataEmailBox = true;
|
||||||
|
this.showAttachmentsSection = true;
|
||||||
|
this.mailAttachments = [];
|
||||||
|
await this.loadAttachments(mail);
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
},
|
||||||
|
async pickEmailAttachement(attachement) {
|
||||||
|
this.loadingText = 'Ajout de l\'attachement encours ...';
|
||||||
|
this.loadingDataEmailBox = true;
|
||||||
|
await this.pickEmailAttachementTodavFile(attachement);
|
||||||
|
this.closeMailBoxModal();
|
||||||
|
this.resetMailBoxModal();
|
||||||
|
},
|
||||||
|
resetMailBoxModal() {
|
||||||
|
this.mailBoxData = [];
|
||||||
|
this.mailAttachments = [];
|
||||||
|
this.showModal = false;
|
||||||
|
this.showAttachmentsSection = false;
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
this.loadingText = 'Chargement ...';
|
||||||
|
},
|
||||||
|
displayAttachmentsSection() {
|
||||||
|
this.showAttachmentsSection = false;
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
},
|
||||||
|
closeMailBoxModal() {
|
||||||
|
this.showModal = false;
|
||||||
|
this.showAttachmentsSection = false;
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
this.loadingText = 'Chargement ...';
|
||||||
|
},
|
||||||
|
async loadEmailsBox() {
|
||||||
|
let withSync = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
||||||
|
const ajaxUrl = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)('/apps/calendar/load-email-box');
|
||||||
|
await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_1__["default"].get(ajaxUrl, {
|
||||||
|
params: {
|
||||||
|
withSync
|
||||||
|
}
|
||||||
|
}).then(response => {
|
||||||
|
console.log(response.data.success);
|
||||||
|
if (!response.data.success && response.data.message == "MAILBOX_NOT_FOUND") {
|
||||||
|
this.closeMailBoxModal();
|
||||||
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_11__.showError)(t('calendar', 'Veuillez configurer le compte apps email pour pouvoir utiliser cette fonctionnalité.', {
|
||||||
|
timeout: 7000
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.mailBoxData = response.data;
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async loadAttachments(mail) {
|
||||||
|
if (!this.hasAttachements(mail)) {
|
||||||
|
this.mailAttachments = [];
|
||||||
|
this.loadingDataEmailBox = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ajaxUrl = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)('/apps/calendar/load-email-attachement/' + mail.databaseId);
|
||||||
|
await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_1__["default"].get(ajaxUrl).then(response => {
|
||||||
|
console.log(response.data);
|
||||||
|
this.mailAttachments = response.data.attachments;
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async pickEmailAttachementTodavFile(attachement) {
|
||||||
|
var _davRes$multistatus3;
|
||||||
|
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder');
|
||||||
|
const attachment = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__.uploadRemoteFile)(attachmentsFolder, attachement.downloadUrl, attachement.fileName, this.currentUser.dav);
|
||||||
|
// TODO do not share file, move to PHP
|
||||||
|
const data = await (0,_services_attachmentService_js__WEBPACK_IMPORTED_MODULE_13__.getFileInfo)("".concat(attachmentsFolder, "/").concat(attachment.path), this.currentUser.dav.userId);
|
||||||
|
const davRes = await (0,webdav__WEBPACK_IMPORTED_MODULE_14__.parseXML)(data);
|
||||||
|
const davRespObj = davRes === null || davRes === void 0 || (_davRes$multistatus3 = davRes.multistatus) === null || _davRes$multistatus3 === void 0 || (_davRes$multistatus3 = _davRes$multistatus3.response[0]) === null || _davRes$multistatus3 === void 0 || (_davRes$multistatus3 = _davRes$multistatus3.propstat) === null || _davRes$multistatus3 === void 0 ? void 0 : _davRes$multistatus3.prop;
|
||||||
|
davRespObj.fileName = attachment.path;
|
||||||
|
davRespObj.url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_10__.generateUrl)("/f/".concat(davRespObj.fileid));
|
||||||
|
davRespObj.value = davRespObj.url;
|
||||||
|
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj);
|
||||||
|
},
|
||||||
|
getLabelEmailBox() {
|
||||||
|
let from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||||
|
if (from.length) {
|
||||||
|
var _from$0$label;
|
||||||
|
return (_from$0$label = from[0].label) !== null && _from$0$label !== void 0 ? _from$0$label : from[0].email;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
getSubstringText() {
|
||||||
|
let text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
||||||
|
let length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
|
||||||
|
if (text.length < length) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
return text.substring(0, length) + '...';
|
||||||
|
},
|
||||||
|
hasAttachements(mail) {
|
||||||
|
return mail.flags.hasAttachments;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -18225,7 +18360,22 @@ var render = function render() {
|
|||||||
},
|
},
|
||||||
proxy: true
|
proxy: true
|
||||||
}], null, false, 1329850251)
|
}], null, false, 1329850251)
|
||||||
}, [_vm._v("\n\t\t\t\t" + _vm._s(_vm.t("calendar", "Upload from device")) + "\n\t\t\t")])], 1) : _vm._e()], 1), _vm._v(" "), _vm.attachments.length > 0 ? _c("div", [_c("ul", {
|
}, [_vm._v("\n\t\t\t\t" + _vm._s(_vm.t("calendar", "Upload from device")) + "\n\t\t\t")]), _vm._v(" "), _c("NcActionButton", {
|
||||||
|
on: {
|
||||||
|
click: _vm.openEmailBoxModal
|
||||||
|
},
|
||||||
|
scopedSlots: _vm._u([{
|
||||||
|
key: "icon",
|
||||||
|
fn: function () {
|
||||||
|
return [_c("Email", {
|
||||||
|
attrs: {
|
||||||
|
size: 20
|
||||||
|
}
|
||||||
|
})];
|
||||||
|
},
|
||||||
|
proxy: true
|
||||||
|
}], null, false, 1680463460)
|
||||||
|
}, [_vm._v("\n\t\t\t\t" + _vm._s(_vm.t("calendar", "Depuis un email")) + "\n\t\t\t")])], 1) : _vm._e()], 1), _vm._v(" "), _vm.attachments.length > 0 ? _c("div", [_c("ul", {
|
||||||
staticClass: "attachments-list"
|
staticClass: "attachments-list"
|
||||||
}, _vm._l(_vm.attachments, function (attachment) {
|
}, _vm._l(_vm.attachments, function (attachment) {
|
||||||
return _c("NcListItem", {
|
return _c("NcListItem", {
|
||||||
@ -18289,7 +18439,124 @@ var render = function render() {
|
|||||||
}
|
}
|
||||||
}, [_c("p", {
|
}, [_c("p", {
|
||||||
staticClass: "external-link-message"
|
staticClass: "external-link-message"
|
||||||
}, [_vm._v("\n\t\t\t" + _vm._s(_vm.openConfirmationMessage) + "\n\t\t")])])], 1);
|
}, [_vm._v("\n\t\t\t" + _vm._s(_vm.openConfirmationMessage) + "\n\t\t")])]), _vm._v(" "), _vm.showModal ? _c("NcModal", {
|
||||||
|
attrs: {
|
||||||
|
name: ""
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
close: _vm.resetMailBoxModal
|
||||||
|
}
|
||||||
|
}, [!_vm.showAttachmentsSection && !_vm.showAttachmentsSection ? _c("div", {
|
||||||
|
staticClass: "modal__content"
|
||||||
|
}, [!_vm.loadingDataEmailBox ? _c("NcButton", {
|
||||||
|
staticStyle: {
|
||||||
|
"text-align": "center"
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.syncEmailBox();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scopedSlots: _vm._u([{
|
||||||
|
key: "icon",
|
||||||
|
fn: function () {
|
||||||
|
return [_c("Reload", {
|
||||||
|
attrs: {
|
||||||
|
size: 20
|
||||||
|
}
|
||||||
|
})];
|
||||||
|
},
|
||||||
|
proxy: true
|
||||||
|
}], null, false, 163584889)
|
||||||
|
}, [_vm._v("\n\t\t\t\tActualiser \n\t\t\t")]) : _vm._e(), _vm._v(" "), _vm._l(_vm.mailBoxData, function (mail) {
|
||||||
|
return _vm.mailBoxData.length > 0 ? [_c("ul", [_c("NcListItem", {
|
||||||
|
attrs: {
|
||||||
|
name: _vm.getLabelEmailBox(mail.from) + " : " + _vm.getSubstringText(mail.subject, 30),
|
||||||
|
bold: false,
|
||||||
|
counterType: "outlined"
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.getAttachments(mail);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scopedSlots: _vm._u([{
|
||||||
|
key: "subname",
|
||||||
|
fn: function () {
|
||||||
|
return [_vm._v("\n\t\t\t\t\t\t\t\t" + _vm._s(_vm.getSubstringText(mail.previewText, 50)) + " \n\t\t\t\t\t\t")];
|
||||||
|
},
|
||||||
|
proxy: true
|
||||||
|
}, _vm.hasAttachements(mail) ? {
|
||||||
|
key: "icon",
|
||||||
|
fn: function () {
|
||||||
|
return [_c("Paperclip", {
|
||||||
|
attrs: {
|
||||||
|
size: 20
|
||||||
|
}
|
||||||
|
})];
|
||||||
|
},
|
||||||
|
proxy: true
|
||||||
|
} : null], null, true)
|
||||||
|
})], 1)] : _vm._e();
|
||||||
|
})], 2) : _vm._e(), _vm._v(" "), _vm.showAttachmentsSection ? _c("div", {
|
||||||
|
staticClass: "modal__content__attachments"
|
||||||
|
}, [_c("ul", {
|
||||||
|
staticClass: "attachments-list"
|
||||||
|
}, [_c("NcActionButton", {
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.displayAttachmentsSection();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scopedSlots: _vm._u([{
|
||||||
|
key: "icon",
|
||||||
|
fn: function () {
|
||||||
|
return [_c("ArrowLeft", {
|
||||||
|
attrs: {
|
||||||
|
size: 20
|
||||||
|
}
|
||||||
|
})];
|
||||||
|
},
|
||||||
|
proxy: true
|
||||||
|
}], null, false, 1821202730)
|
||||||
|
}, [_vm._v("\n\t\t\t\t\tRevenir dans la listes des emails\n\t\t\t\t")]), _vm._v(" "), _vm._l(_vm.mailAttachments, function (attachment) {
|
||||||
|
return !_vm.loadingDataEmailBox && _vm.mailAttachments.length > 0 ? _c("div", {
|
||||||
|
staticClass: "image-list-attachement"
|
||||||
|
}, [attachment.isImage ? _c("div", {
|
||||||
|
staticClass: "image-item-attachement",
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.pickEmailAttachement(attachment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [_c("img", {
|
||||||
|
attrs: {
|
||||||
|
src: attachment.downloadUrl,
|
||||||
|
alt: attachment.fileName
|
||||||
|
}
|
||||||
|
}), _vm._v(" "), _c("label", [_vm._v(_vm._s(attachment.fileName))])]) : !attachment.isImage && !attachment.isCalendarEvent ? _c("div", {
|
||||||
|
staticClass: "image-item-attachement",
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.pickEmailAttachement(attachment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [_c("label", [_vm._v(_vm._s("Pièce joint : " + attachment.fileName))])]) : attachment.isCalendarEvent ? _c("div", {
|
||||||
|
staticClass: "image-item-attachement"
|
||||||
|
}, [_c("label", [_vm._v(_vm._s("Pièce joint : " + attachment.fileName) + " ( nNon allouée)")])]) : _vm._e()]) : _vm._e();
|
||||||
|
}), _vm._v(" "), !_vm.mailAttachments.length && !_vm.loadingDataEmailBox ? [_c("p", [_vm._v(" Pas d'Attachements")])] : _vm._e()], 2)]) : _vm._e(), _vm._v(" "), _vm.loadingDataEmailBox ? _c("div", {
|
||||||
|
staticClass: "modal__content"
|
||||||
|
}, [_c("div", [_c("NcLoadingIcon", {
|
||||||
|
attrs: {
|
||||||
|
size: 40,
|
||||||
|
appearance: "light",
|
||||||
|
name: _vm.loadingText
|
||||||
|
}
|
||||||
|
})], 1), _vm._v(" "), _c("p", {
|
||||||
|
staticStyle: {
|
||||||
|
"text-align": "center"
|
||||||
|
}
|
||||||
|
}, [_vm._v(" " + _vm._s(_vm.loadingText))])]) : _vm._e()]) : _vm._e()], 1);
|
||||||
};
|
};
|
||||||
var staticRenderFns = [];
|
var staticRenderFns = [];
|
||||||
render._withStripped = true;
|
render._withStripped = true;
|
||||||
@ -29064,7 +29331,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ getFileInfo: () => (/* binding */ getFileInfo),
|
/* harmony export */ getFileInfo: () => (/* binding */ getFileInfo),
|
||||||
/* harmony export */ shareFile: () => (/* binding */ shareFile),
|
/* harmony export */ shareFile: () => (/* binding */ shareFile),
|
||||||
/* harmony export */ shareFileWith: () => (/* binding */ shareFileWith),
|
/* harmony export */ shareFileWith: () => (/* binding */ shareFileWith),
|
||||||
/* harmony export */ uploadLocalAttachment: () => (/* binding */ uploadLocalAttachment)
|
/* harmony export */ uploadLocalAttachment: () => (/* binding */ uploadLocalAttachment),
|
||||||
|
/* harmony export */ uploadRemoteFile: () => (/* binding */ uploadRemoteFile)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
|
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
|
||||||
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
||||||
@ -29238,7 +29506,39 @@ const uploadLocalAttachment = async function (folder, files, dav, componentAttac
|
|||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
return attachments;
|
return attachments;
|
||||||
};
|
};
|
||||||
|
const uploadRemoteFile = async function (folder, fileUrl, fileName, dav) {
|
||||||
|
try {
|
||||||
|
// Télécharger le fichier distant
|
||||||
|
const response = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__["default"].get(fileUrl, {
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Envoyer le fichier récupéré en PUT vers WebDAV
|
||||||
|
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(dav.userId, "/").concat(folder, "/").concat(fileName));
|
||||||
|
const uploadResponse = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__["default"].put(url, response.data, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': response.data.type // Utilise le type MIME du fichier
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (uploadResponse.status === 204 || uploadResponse.status === 201) {
|
||||||
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_2__.showSuccess)((0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translate)('calendar', 'Attachment {fileName} added!', {
|
||||||
|
fileName: fileName
|
||||||
|
}));
|
||||||
|
return {
|
||||||
|
fileName: fileName,
|
||||||
|
formatType: response.data.type,
|
||||||
|
uri: url,
|
||||||
|
value: url,
|
||||||
|
path: "/".concat(fileName)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_2__.showError)((0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translate)('calendar', 'An error occurred during uploading file {fileName}', {
|
||||||
|
fileName: fileName
|
||||||
|
}));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
// TODO is shared or not @share-types@
|
// TODO is shared or not @share-types@
|
||||||
const getFileInfo = async function (path, userId) {
|
const getFileInfo = async function (path, userId) {
|
||||||
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(userId, "/").concat(path));
|
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(userId, "/").concat(path));
|
||||||
@ -56149,7 +56449,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
||||||
// Module
|
// Module
|
||||||
___CSS_LOADER_EXPORT___.push([module.id, `.attachments-input[data-v-5efccc46] {
|
___CSS_LOADER_EXPORT___.push([module.id, `@charset "UTF-8";
|
||||||
|
.attachments-input[data-v-5efccc46] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.attachments-summary[data-v-5efccc46] {
|
.attachments-summary[data-v-5efccc46] {
|
||||||
@ -56206,6 +56507,35 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.attachments-input[data-v-5efccc46] {
|
|||||||
}
|
}
|
||||||
.external-link-message[data-v-5efccc46] {
|
.external-link-message[data-v-5efccc46] {
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.modal__content[data-v-5efccc46] {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
.modal__content__attachments[data-v-5efccc46] {
|
||||||
|
margin: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.attachments-list[data-v-5efccc46] {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.image-list-attachement[data-v-5efccc46] {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.image-item-attachement[data-v-5efccc46] {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
.image-item-attachement img[data-v-5efccc46] {
|
||||||
|
width: 100px; /* Largeur de l'image */
|
||||||
|
height: auto; /* Hauteur automatique pour garder le ratio */
|
||||||
|
margin-right: 10px; /* Espace entre l'image et la légende */
|
||||||
|
}
|
||||||
|
label[data-v-5efccc46] {
|
||||||
|
font-size: 16px; /* Taille de police pour la légende */
|
||||||
}`, ""]);
|
}`, ""]);
|
||||||
// Exports
|
// Exports
|
||||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
||||||
@ -130541,6 +130871,78 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/ArrowLeft.vue":
|
||||||
|
/*!**************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/ArrowLeft.vue ***!
|
||||||
|
\**************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ArrowLeft.vue?vue&type=template&id=b9ea0198 */ "./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198");
|
||||||
|
/* harmony import */ var _ArrowLeft_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ArrowLeft.vue?vue&type=script&lang=js */ "./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js");
|
||||||
|
/* harmony import */ var _vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* normalize component */
|
||||||
|
;
|
||||||
|
var component = (0,_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||||
|
_ArrowLeft_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
|
_ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__.render,
|
||||||
|
_ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
/* hot reload */
|
||||||
|
if (false) { var api; }
|
||||||
|
component.options.__file = "node_modules/vue-material-design-icons/ArrowLeft.vue"
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js":
|
||||||
|
/*!*************************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js ***!
|
||||||
|
\*************************************************************************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
|
name: "ArrowLeftIcon",
|
||||||
|
emits: ['click'],
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
fillColor: {
|
||||||
|
type: String,
|
||||||
|
default: "currentColor"
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: 24
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue":
|
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue":
|
||||||
@ -133277,6 +133679,78 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/Reload.vue":
|
||||||
|
/*!***********************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/Reload.vue ***!
|
||||||
|
\***********************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Reload.vue?vue&type=template&id=e27a0376 */ "./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376");
|
||||||
|
/* harmony import */ var _Reload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Reload.vue?vue&type=script&lang=js */ "./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js");
|
||||||
|
/* harmony import */ var _vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* normalize component */
|
||||||
|
;
|
||||||
|
var component = (0,_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||||
|
_Reload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
|
_Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__.render,
|
||||||
|
_Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns,
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
null
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
/* hot reload */
|
||||||
|
if (false) { var api; }
|
||||||
|
component.options.__file = "node_modules/vue-material-design-icons/Reload.vue"
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (component.exports);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js":
|
||||||
|
/*!**********************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js ***!
|
||||||
|
\**********************************************************************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||||
|
name: "ReloadIcon",
|
||||||
|
emits: ['click'],
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
fillColor: {
|
||||||
|
type: String,
|
||||||
|
default: "currentColor"
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: Number,
|
||||||
|
default: 24
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/Repeat.vue":
|
/***/ "./node_modules/vue-material-design-icons/Repeat.vue":
|
||||||
@ -141323,6 +141797,22 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js":
|
||||||
|
/*!**************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js ***!
|
||||||
|
\**************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _vue_loader_lib_index_js_vue_loader_options_ArrowLeft_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/index.js??vue-loader-options!./ArrowLeft.vue?vue&type=script&lang=js */ "./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=script&lang=js");
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_vue_loader_lib_index_js_vue_loader_options_ArrowLeft_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=script&lang=js":
|
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=script&lang=js":
|
||||||
/*!*************************************************************************************************!*\
|
/*!*************************************************************************************************!*\
|
||||||
!*** ./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=script&lang=js ***!
|
!*** ./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=script&lang=js ***!
|
||||||
@ -141931,6 +142421,22 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js":
|
||||||
|
/*!***********************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js ***!
|
||||||
|
\***********************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _vue_loader_lib_index_js_vue_loader_options_Reload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/index.js??vue-loader-options!./Reload.vue?vue&type=script&lang=js */ "./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=script&lang=js");
|
||||||
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_vue_loader_lib_index_js_vue_loader_options_Reload_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"]);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/Repeat.vue?vue&type=script&lang=js":
|
/***/ "./node_modules/vue-material-design-icons/Repeat.vue?vue&type=script&lang=js":
|
||||||
/*!***********************************************************************************!*\
|
/*!***********************************************************************************!*\
|
||||||
!*** ./node_modules/vue-material-design-icons/Repeat.vue?vue&type=script&lang=js ***!
|
!*** ./node_modules/vue-material-design-icons/Repeat.vue?vue&type=script&lang=js ***!
|
||||||
@ -142155,6 +142661,23 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_AlertCircle_vue_vue_type_template_id_7b52a7d0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./AlertCircle.vue?vue&type=template&id=7b52a7d0 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/AlertCircle.vue?vue&type=template&id=7b52a7d0");
|
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_AlertCircle_vue_vue_type_template_id_7b52a7d0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./AlertCircle.vue?vue&type=template&id=7b52a7d0 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/AlertCircle.vue?vue&type=template&id=7b52a7d0");
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198":
|
||||||
|
/*!********************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198 ***!
|
||||||
|
\********************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ render: () => (/* reexport safe */ _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__.render),
|
||||||
|
/* harmony export */ staticRenderFns: () => (/* reexport safe */ _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_ArrowLeft_vue_vue_type_template_id_b9ea0198__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./ArrowLeft.vue?vue&type=template&id=b9ea0198 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198");
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=template&id=674c29be":
|
/***/ "./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=template&id=674c29be":
|
||||||
@ -142801,6 +143324,23 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_Plus_vue_vue_type_template_id_18bbb6c6__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./Plus.vue?vue&type=template&id=18bbb6c6 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Plus.vue?vue&type=template&id=18bbb6c6");
|
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_Plus_vue_vue_type_template_id_18bbb6c6__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./Plus.vue?vue&type=template&id=18bbb6c6 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Plus.vue?vue&type=template&id=18bbb6c6");
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376":
|
||||||
|
/*!*****************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376 ***!
|
||||||
|
\*****************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ render: () => (/* reexport safe */ _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__.render),
|
||||||
|
/* harmony export */ staticRenderFns: () => (/* reexport safe */ _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__.staticRenderFns)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* harmony import */ var _vue_loader_lib_loaders_templateLoader_js_ruleSet_1_rules_3_vue_loader_lib_index_js_vue_loader_options_Reload_vue_vue_type_template_id_e27a0376__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!../vue-loader/lib/index.js??vue-loader-options!./Reload.vue?vue&type=template&id=e27a0376 */ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376");
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-material-design-icons/Repeat.vue?vue&type=template&id=1e2ad947":
|
/***/ "./node_modules/vue-material-design-icons/Repeat.vue?vue&type=template&id=1e2ad947":
|
||||||
@ -143823,6 +144363,75 @@ render._withStripped = true
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198":
|
||||||
|
/*!************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowLeft.vue?vue&type=template&id=b9ea0198 ***!
|
||||||
|
\************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ render: () => (/* binding */ render),
|
||||||
|
/* harmony export */ staticRenderFns: () => (/* binding */ staticRenderFns)
|
||||||
|
/* harmony export */ });
|
||||||
|
var render = function render() {
|
||||||
|
var _vm = this,
|
||||||
|
_c = _vm._self._c
|
||||||
|
return _c(
|
||||||
|
"span",
|
||||||
|
_vm._b(
|
||||||
|
{
|
||||||
|
staticClass: "material-design-icon arrow-left-icon",
|
||||||
|
attrs: {
|
||||||
|
"aria-hidden": _vm.title ? null : true,
|
||||||
|
"aria-label": _vm.title,
|
||||||
|
role: "img",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.$emit("click", $event)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"span",
|
||||||
|
_vm.$attrs,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
[
|
||||||
|
_c(
|
||||||
|
"svg",
|
||||||
|
{
|
||||||
|
staticClass: "material-design-icon__svg",
|
||||||
|
attrs: {
|
||||||
|
fill: _vm.fillColor,
|
||||||
|
width: _vm.size,
|
||||||
|
height: _vm.size,
|
||||||
|
viewBox: "0 0 24 24",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[
|
||||||
|
_c(
|
||||||
|
"path",
|
||||||
|
{
|
||||||
|
attrs: {
|
||||||
|
d: "M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[_vm.title ? _c("title", [_vm._v(_vm._s(_vm.title))]) : _vm._e()]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
var staticRenderFns = []
|
||||||
|
render._withStripped = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=template&id=674c29be":
|
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/ArrowRightDropCircle.vue?vue&type=template&id=674c29be":
|
||||||
@ -146433,6 +147042,75 @@ render._withStripped = true
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376":
|
||||||
|
/*!*********************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Reload.vue?vue&type=template&id=e27a0376 ***!
|
||||||
|
\*********************************************************************************************************************************************************************************************************************************/
|
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ render: () => (/* binding */ render),
|
||||||
|
/* harmony export */ staticRenderFns: () => (/* binding */ staticRenderFns)
|
||||||
|
/* harmony export */ });
|
||||||
|
var render = function render() {
|
||||||
|
var _vm = this,
|
||||||
|
_c = _vm._self._c
|
||||||
|
return _c(
|
||||||
|
"span",
|
||||||
|
_vm._b(
|
||||||
|
{
|
||||||
|
staticClass: "material-design-icon reload-icon",
|
||||||
|
attrs: {
|
||||||
|
"aria-hidden": _vm.title ? null : true,
|
||||||
|
"aria-label": _vm.title,
|
||||||
|
role: "img",
|
||||||
|
},
|
||||||
|
on: {
|
||||||
|
click: function ($event) {
|
||||||
|
return _vm.$emit("click", $event)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"span",
|
||||||
|
_vm.$attrs,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
[
|
||||||
|
_c(
|
||||||
|
"svg",
|
||||||
|
{
|
||||||
|
staticClass: "material-design-icon__svg",
|
||||||
|
attrs: {
|
||||||
|
fill: _vm.fillColor,
|
||||||
|
width: _vm.size,
|
||||||
|
height: _vm.size,
|
||||||
|
viewBox: "0 0 24 24",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[
|
||||||
|
_c(
|
||||||
|
"path",
|
||||||
|
{
|
||||||
|
attrs: {
|
||||||
|
d: "M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
[_vm.title ? _c("title", [_vm._v(_vm._s(_vm.title))]) : _vm._e()]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
var staticRenderFns = []
|
||||||
|
render._withStripped = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Repeat.vue?vue&type=template&id=1e2ad947":
|
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./node_modules/vue-material-design-icons/Repeat.vue?vue&type=template&id=1e2ad947":
|
||||||
@ -310204,4 +310882,4 @@ appointmentsConfigsStore.addInitialConfigs((0,_nextcloud_initial_state__WEBPACK_
|
|||||||
|
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
//# sourceMappingURL=calendar-main.js.map?v=e2db448fb505c0b97453
|
//# sourceMappingURL=calendar-main.js.map?v=6688bbead46c5a1516a8
|
||||||
File diff suppressed because one or more lines are too long
@ -8865,7 +8865,7 @@ window._registerCustomPickerElement = _;
|
|||||||
/******/ // This function allow to reference async chunks
|
/******/ // This function allow to reference async chunks
|
||||||
/******/ __webpack_require__.u = (chunkId) => {
|
/******/ __webpack_require__.u = (chunkId) => {
|
||||||
/******/ // return url for filenames based on template
|
/******/ // return url for filenames based on template
|
||||||
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"741d92f5ec54d0c1ff41","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"0658eb6db50a09dd2afe","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"01a7eb6779cc0e417f44","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"c3527b981de24f56109b","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"0b6b2228ab6a9dcb591c","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"276ff6be1cb450405b79","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"e0f3178442f3c9eb35e1","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"0c8b5b050db3beb63d49","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
|
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"741d92f5ec54d0c1ff41","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"0658eb6db50a09dd2afe","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"01a7eb6779cc0e417f44","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"c3527b981de24f56109b","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"0baf126227b0fea74ee4","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"256e15d8889d4ef4234b","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"e0f3178442f3c9eb35e1","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"0c8b5b050db3beb63d49","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
|
||||||
/******/ };
|
/******/ };
|
||||||
/******/ })();
|
/******/ })();
|
||||||
/******/
|
/******/
|
||||||
@ -9115,4 +9115,4 @@ __webpack_require__.p = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.linkTo
|
|||||||
|
|
||||||
/******/ })()
|
/******/ })()
|
||||||
;
|
;
|
||||||
//# sourceMappingURL=calendar-reference.js.map?v=df693546df64c9b5cce0
|
//# sourceMappingURL=calendar-reference.js.map?v=adaba8c8d3feb02efffe
|
||||||
File diff suppressed because one or more lines are too long
@ -1559,7 +1559,8 @@ __webpack_require__.r(__webpack_exports__);
|
|||||||
/* harmony export */ getFileInfo: () => (/* binding */ getFileInfo),
|
/* harmony export */ getFileInfo: () => (/* binding */ getFileInfo),
|
||||||
/* harmony export */ shareFile: () => (/* binding */ shareFile),
|
/* harmony export */ shareFile: () => (/* binding */ shareFile),
|
||||||
/* harmony export */ shareFileWith: () => (/* binding */ shareFileWith),
|
/* harmony export */ shareFileWith: () => (/* binding */ shareFileWith),
|
||||||
/* harmony export */ uploadLocalAttachment: () => (/* binding */ uploadLocalAttachment)
|
/* harmony export */ uploadLocalAttachment: () => (/* binding */ uploadLocalAttachment),
|
||||||
|
/* harmony export */ uploadRemoteFile: () => (/* binding */ uploadRemoteFile)
|
||||||
/* harmony export */ });
|
/* harmony export */ });
|
||||||
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
|
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
|
||||||
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
|
||||||
@ -1733,7 +1734,39 @@ const uploadLocalAttachment = async function (folder, files, dav, componentAttac
|
|||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
return attachments;
|
return attachments;
|
||||||
};
|
};
|
||||||
|
const uploadRemoteFile = async function (folder, fileUrl, fileName, dav) {
|
||||||
|
try {
|
||||||
|
// Télécharger le fichier distant
|
||||||
|
const response = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__["default"].get(fileUrl, {
|
||||||
|
responseType: 'blob'
|
||||||
|
});
|
||||||
|
|
||||||
|
// Envoyer le fichier récupéré en PUT vers WebDAV
|
||||||
|
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(dav.userId, "/").concat(folder, "/").concat(fileName));
|
||||||
|
const uploadResponse = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_0__["default"].put(url, response.data, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': response.data.type // Utilise le type MIME du fichier
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (uploadResponse.status === 204 || uploadResponse.status === 201) {
|
||||||
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_2__.showSuccess)((0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translate)('calendar', 'Attachment {fileName} added!', {
|
||||||
|
fileName: fileName
|
||||||
|
}));
|
||||||
|
return {
|
||||||
|
fileName: fileName,
|
||||||
|
formatType: response.data.type,
|
||||||
|
uri: url,
|
||||||
|
value: url,
|
||||||
|
path: "/".concat(fileName)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
(0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_2__.showError)((0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_3__.translate)('calendar', 'An error occurred during uploading file {fileName}', {
|
||||||
|
fileName: fileName
|
||||||
|
}));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
// TODO is shared or not @share-types@
|
// TODO is shared or not @share-types@
|
||||||
const getFileInfo = async function (path, userId) {
|
const getFileInfo = async function (path, userId) {
|
||||||
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(userId, "/").concat(path));
|
const url = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.generateRemoteUrl)("dav/files/".concat(userId, "/").concat(path));
|
||||||
@ -8190,4 +8223,4 @@ function getLinkToConfig(key) {
|
|||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=276ff6be1cb450405b79
|
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=256e15d8889d4ef4234b
|
||||||
File diff suppressed because one or more lines are too long
@ -27393,4 +27393,4 @@ module.exports = "data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/sv
|
|||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=0b6b2228ab6a9dcb591c
|
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=0baf126227b0fea74ee4
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
209
calendar/lib/Controller/EmailBoxController.php
Normal file
209
calendar/lib/Controller/EmailBoxController.php
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace OCA\Calendar\Controller;
|
||||||
|
|
||||||
|
use OCP\IRequest;
|
||||||
|
use Horde_Imap_Client;
|
||||||
|
use OCA\Calendar\Db\MailRepository;
|
||||||
|
use OCP\IURLGenerator;
|
||||||
|
use OCP\AppFramework\Http;
|
||||||
|
use OCP\AppFramework\Controller;
|
||||||
|
use OCP\Files\IMimeTypeDetector;
|
||||||
|
use OCA\Mail\Contracts\IMailSearch;
|
||||||
|
use OCP\AppFramework\Http\Response;
|
||||||
|
use OCA\Mail\Contracts\IMailManager;
|
||||||
|
use OCA\Mail\IMAP\IMAPClientFactory;
|
||||||
|
use OCA\Mail\Service\AccountService;
|
||||||
|
use OCA\Mail\Service\Sync\SyncService;
|
||||||
|
use OCP\AppFramework\Http\JSONResponse;
|
||||||
|
use OCA\Mail\Contracts\IUserPreferences;
|
||||||
|
use OCP\AppFramework\Db\DoesNotExistException;
|
||||||
|
|
||||||
|
class EmailBoxController extends Controller {
|
||||||
|
private ?string $currentUserId;
|
||||||
|
|
||||||
|
private IMailManager $mailManager;
|
||||||
|
|
||||||
|
private IUserPreferences $preferences;
|
||||||
|
|
||||||
|
private IMailSearch $mailSearch;
|
||||||
|
|
||||||
|
private AccountService $accountService;
|
||||||
|
|
||||||
|
private IURLGenerator $urlGenerator;
|
||||||
|
|
||||||
|
private IMimeTypeDetector $mimeTypeDetector;
|
||||||
|
|
||||||
|
private IMAPClientFactory $clientFactory;
|
||||||
|
|
||||||
|
private SyncService $syncService;
|
||||||
|
|
||||||
|
private MailRepository $mailRepository;
|
||||||
|
|
||||||
|
public function __construct(string $appName,
|
||||||
|
IRequest $request,
|
||||||
|
?string $UserId,
|
||||||
|
IMailManager $mailManager,
|
||||||
|
IUserPreferences $preferences,
|
||||||
|
IMailSearch $mailSearch,
|
||||||
|
AccountService $accountService,
|
||||||
|
IURLGenerator $urlGenerator,
|
||||||
|
IMimeTypeDetector $mimeTypeDetector,
|
||||||
|
IMAPClientFactory $clientFactory,
|
||||||
|
SyncService $syncService,
|
||||||
|
MailRepository $mailRepository,
|
||||||
|
|
||||||
|
) {
|
||||||
|
parent::__construct($appName, $request);
|
||||||
|
$this->currentUserId = $UserId;
|
||||||
|
$this->mailManager = $mailManager;
|
||||||
|
$this->preferences = $preferences;
|
||||||
|
$this->mailSearch = $mailSearch;
|
||||||
|
$this->accountService = $accountService;
|
||||||
|
$this->urlGenerator = $urlGenerator;
|
||||||
|
$this->mimeTypeDetector = $mimeTypeDetector;
|
||||||
|
$this->clientFactory = $clientFactory;
|
||||||
|
$this->syncService = $syncService;
|
||||||
|
$this->mailRepository = $mailRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function loadEmailboxMessage(): JSONResponse {
|
||||||
|
|
||||||
|
$mailboxId = $this->mailRepository->getCurrentUserMailBoxId($this->currentUserId);
|
||||||
|
if($mailboxId == null){
|
||||||
|
return new JSONResponse([
|
||||||
|
"success" => false,
|
||||||
|
"message" => "MAILBOX_NOT_FOUND",
|
||||||
|
], Http::STATUS_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
$lastMessageTimestamp = null;
|
||||||
|
$init = true;
|
||||||
|
$sortOrder = 'newest';
|
||||||
|
$query = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$mailbox = $this->mailManager->getMailbox($this->currentUserId, $mailboxId);
|
||||||
|
$account = $this->accountService->find($this->currentUserId, $mailbox->getAccountId());
|
||||||
|
// try {
|
||||||
|
// if (boolval($this->request->getParam('withSync'))) {
|
||||||
|
// $this->syncService->syncMailbox(
|
||||||
|
// $account,
|
||||||
|
// $mailbox,
|
||||||
|
// Horde_Imap_Client::SYNC_NEWMSGSUIDS | Horde_Imap_Client::SYNC_FLAGSUIDS | Horde_Imap_Client::SYNC_VANISHEDUIDS,
|
||||||
|
// null,
|
||||||
|
// $lastMessageTimestamp,
|
||||||
|
// $init,
|
||||||
|
// $sortOrder,
|
||||||
|
// $query
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// } catch (\Throwable $th) {
|
||||||
|
// // on ignioir car il n'est pas est deja synchronise
|
||||||
|
// }
|
||||||
|
} catch (DoesNotExistException $e) {
|
||||||
|
return new JSONResponse([], Http::STATUS_FORBIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
$order = $this->preferences->getPreference($this->currentUserId, 'sort-order', 'newest') === 'newest' ? 'DESC': 'ASC';
|
||||||
|
return new JSONResponse(
|
||||||
|
$this->mailSearch->findMessages(
|
||||||
|
$account,
|
||||||
|
$mailbox,
|
||||||
|
$order,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
100,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function loadEmailboxAttachement(int $messageId = 0): Response {
|
||||||
|
try {
|
||||||
|
$message = $this->mailManager->getMessage($this->currentUserId, $messageId);
|
||||||
|
$mailbox = $this->mailManager->getMailbox($this->currentUserId, $message->getMailboxId());
|
||||||
|
$account = $this->accountService->find($this->currentUserId, $mailbox->getAccountId());
|
||||||
|
} catch (DoesNotExistException $e) {
|
||||||
|
return new JSONResponse([], Http::STATUS_FORBIDDEN);
|
||||||
|
}
|
||||||
|
$data = [];
|
||||||
|
$client = $this->clientFactory->getClient($account);
|
||||||
|
try {
|
||||||
|
$imapMessage = $this->mailManager->getImapMessage(
|
||||||
|
$client,
|
||||||
|
$account,
|
||||||
|
$mailbox,
|
||||||
|
$message->getUid(), true
|
||||||
|
);
|
||||||
|
$json = $imapMessage->getFullMessage($messageId);
|
||||||
|
} finally {
|
||||||
|
$client->logout();
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['attachments'] = array_map(function ($a) use ($messageId) {
|
||||||
|
return $this->enrichDownloadUrl(
|
||||||
|
$messageId,
|
||||||
|
$a
|
||||||
|
);
|
||||||
|
}, $json['attachments']);
|
||||||
|
return new JSONResponse(($data));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param int $id
|
||||||
|
* @param array $attachment
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function enrichDownloadUrl(int $id,
|
||||||
|
array $attachment) {
|
||||||
|
$downloadUrl = $this->urlGenerator->linkToRoute('mail.messages.downloadAttachment',
|
||||||
|
[
|
||||||
|
'id' => $id,
|
||||||
|
'attachmentId' => $attachment['id'],
|
||||||
|
]);
|
||||||
|
$downloadUrl = $this->urlGenerator->getAbsoluteURL($downloadUrl);
|
||||||
|
$attachment['downloadUrl'] = $downloadUrl;
|
||||||
|
$attachment['mimeUrl'] = $this->mimeTypeDetector->mimeTypeIcon($attachment['mime']);
|
||||||
|
|
||||||
|
$attachment['isImage'] = $this->attachmentIsImage($attachment);
|
||||||
|
$attachment['isCalendarEvent'] = $this->attachmentIsCalendarEvent($attachment);
|
||||||
|
|
||||||
|
return $attachment;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the content of this attachment is an image
|
||||||
|
*
|
||||||
|
* @param array $attachment
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function attachmentIsImage(array $attachment): bool {
|
||||||
|
return in_array(
|
||||||
|
$attachment['mime'], [
|
||||||
|
'image/jpeg',
|
||||||
|
'image/png',
|
||||||
|
'image/gif'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $attachment
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function attachmentIsCalendarEvent(array $attachment): bool {
|
||||||
|
return in_array($attachment['mime'], ['text/calendar', 'application/ics'], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -26,19 +26,24 @@ declare(strict_types=1);
|
|||||||
*/
|
*/
|
||||||
namespace OCA\Calendar\Controller;
|
namespace OCA\Calendar\Controller;
|
||||||
|
|
||||||
use OCP\AppFramework\Controller;
|
|
||||||
use OCP\AppFramework\Http;
|
|
||||||
use OCP\AppFramework\Http\JSONResponse;
|
|
||||||
use OCP\Defaults;
|
|
||||||
use OCP\IConfig;
|
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
|
use OCP\IConfig;
|
||||||
|
use OCP\Defaults;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IURLGenerator;
|
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCP\Mail\IEMailTemplate;
|
|
||||||
use OCP\Mail\IMailer;
|
use OCP\Mail\IMailer;
|
||||||
|
use OCP\IURLGenerator;
|
||||||
use OCP\Mail\IMessage;
|
use OCP\Mail\IMessage;
|
||||||
|
use OCP\AppFramework\Http;
|
||||||
|
use OCP\Mail\IEMailTemplate;
|
||||||
|
use OCP\AppFramework\Controller;
|
||||||
|
use OCA\Mail\Contracts\IMailSearch;
|
||||||
|
use OCA\Mail\Contracts\IMailManager;
|
||||||
|
use OCA\Mail\Service\AccountService;
|
||||||
|
use OCP\AppFramework\Http\JSONResponse;
|
||||||
|
use OCA\Mail\Contracts\IUserPreferences;
|
||||||
|
use OCP\AppFramework\Db\DoesNotExistException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EmailController
|
* Class EmailController
|
||||||
@ -67,6 +72,18 @@ class EmailController extends Controller {
|
|||||||
/** @var IUserManager */
|
/** @var IUserManager */
|
||||||
private $userManager;
|
private $userManager;
|
||||||
|
|
||||||
|
|
||||||
|
private ?string $currentUserId;
|
||||||
|
|
||||||
|
|
||||||
|
private IMailManager $mailManager;
|
||||||
|
|
||||||
|
private IUserPreferences $preferences;
|
||||||
|
|
||||||
|
private IMailSearch $mailSearch;
|
||||||
|
|
||||||
|
private AccountService $accountService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EmailController constructor.
|
* EmailController constructor.
|
||||||
*
|
*
|
||||||
@ -88,7 +105,15 @@ class EmailController extends Controller {
|
|||||||
IL10N $l10N,
|
IL10N $l10N,
|
||||||
Defaults $defaults,
|
Defaults $defaults,
|
||||||
IURLGenerator $urlGenerator,
|
IURLGenerator $urlGenerator,
|
||||||
IUserManager $userManager) {
|
IUserManager $userManager,
|
||||||
|
?string $UserId,
|
||||||
|
IMailManager $mailManager,
|
||||||
|
IUserPreferences $preferences,
|
||||||
|
IMailSearch $mailSearch,
|
||||||
|
AccountService $accountService,
|
||||||
|
|
||||||
|
|
||||||
|
) {
|
||||||
parent::__construct($appName, $request);
|
parent::__construct($appName, $request);
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
@ -97,6 +122,11 @@ class EmailController extends Controller {
|
|||||||
$this->defaults = $defaults;
|
$this->defaults = $defaults;
|
||||||
$this->urlGenerator = $urlGenerator;
|
$this->urlGenerator = $urlGenerator;
|
||||||
$this->userManager = $userManager;
|
$this->userManager = $userManager;
|
||||||
|
$this->currentUserId = $UserId;
|
||||||
|
$this->mailManager = $mailManager;
|
||||||
|
$this->preferences = $preferences;
|
||||||
|
$this->mailSearch = $mailSearch;
|
||||||
|
$this->accountService = $accountService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -226,4 +256,7 @@ class EmailController extends Controller {
|
|||||||
'token' => $token,
|
'token' => $token,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
52
calendar/lib/Db/MailRepository.php
Normal file
52
calendar/lib/Db/MailRepository.php
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
namespace OCA\Calendar\Db;
|
||||||
|
|
||||||
|
use OCP\IDBConnection;
|
||||||
|
|
||||||
|
class MailRepository {
|
||||||
|
|
||||||
|
private IDbConnection $pdo;
|
||||||
|
|
||||||
|
public function __construct(IDbConnection $db) {
|
||||||
|
$this->pdo = $db;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function execSQL($sql, $conditions){
|
||||||
|
$stmt = $this->pdo->prepare($sql);
|
||||||
|
$stmt->execute($conditions);
|
||||||
|
$data = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
$stmt->closeCursor();
|
||||||
|
return json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function execSQLNoData($sql, $conditions){
|
||||||
|
$stmt = $this->pdo->prepare($sql);
|
||||||
|
$stmt->execute($conditions);
|
||||||
|
$stmt->closeCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function execSQLNoJsonReturn($sql, $conditions){
|
||||||
|
$stmt = $this->pdo->prepare($sql);
|
||||||
|
$stmt->execute($conditions);
|
||||||
|
$data = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
$stmt->closeCursor();
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCurrentUserMailBoxId(string $currentUserId ) {
|
||||||
|
$sql = 'SELECT mail_mailbox.id as mail_box_id
|
||||||
|
FROM oc_mail_accounts as mail_account
|
||||||
|
LEFT JOIN oc_mail_mailboxes as mail_mailbox ON mail_account.id = mail_mailbox.account_id
|
||||||
|
WHERE mail_account.user_id = ?
|
||||||
|
AND mail_mailbox.name = ?';
|
||||||
|
|
||||||
|
$result = $this->execSQLNoJsonReturn($sql, [$currentUserId,"INBOX"]);
|
||||||
|
if(!empty($result)){
|
||||||
|
return $result[0]['mail_box_id'];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -32,6 +32,12 @@
|
|||||||
</template>
|
</template>
|
||||||
{{ t('calendar', 'Upload from device') }}
|
{{ t('calendar', 'Upload from device') }}
|
||||||
</NcActionButton>
|
</NcActionButton>
|
||||||
|
<NcActionButton @click="openEmailBoxModal">
|
||||||
|
<template #icon>
|
||||||
|
<Email :size="20" />
|
||||||
|
</template>
|
||||||
|
{{ t('calendar', 'Depuis un email') }}
|
||||||
|
</NcActionButton>
|
||||||
</NcActions>
|
</NcActions>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="attachments.length > 0">
|
<div v-if="attachments.length > 0">
|
||||||
@ -65,6 +71,65 @@
|
|||||||
{{ openConfirmationMessage }}
|
{{ openConfirmationMessage }}
|
||||||
</p>
|
</p>
|
||||||
</NcDialog>
|
</NcDialog>
|
||||||
|
<NcModal v-if="showModal" name="" @close="resetMailBoxModal">
|
||||||
|
|
||||||
|
<div class="modal__content" v-if="!showAttachmentsSection && !showAttachmentsSection">
|
||||||
|
<NcButton style="text-align: center;" @click="syncEmailBox()" v-if="!loadingDataEmailBox">
|
||||||
|
<template #icon>
|
||||||
|
<Reload :size="20" />
|
||||||
|
</template>
|
||||||
|
Actualiser
|
||||||
|
</NcButton>
|
||||||
|
<template v-if="mailBoxData.length > 0" v-for="mail in mailBoxData">
|
||||||
|
<ul>
|
||||||
|
<NcListItem
|
||||||
|
@click="getAttachments(mail)"
|
||||||
|
:name="getLabelEmailBox(mail.from) + ' : ' + getSubstringText(mail.subject, 30) "
|
||||||
|
:bold="false"
|
||||||
|
counterType="outlined">
|
||||||
|
<template #subname>
|
||||||
|
{{ getSubstringText(mail.previewText ,50) }}
|
||||||
|
</template>
|
||||||
|
<template v-if="hasAttachements(mail)" #icon>
|
||||||
|
<Paperclip :size="20" />
|
||||||
|
</template>
|
||||||
|
</NcListItem>
|
||||||
|
</ul>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
<div class="modal__content__attachments" v-if="showAttachmentsSection">
|
||||||
|
<ul class="attachments-list">
|
||||||
|
<NcActionButton @click="displayAttachmentsSection()">
|
||||||
|
<template #icon>
|
||||||
|
<ArrowLeft :size="20" />
|
||||||
|
</template>
|
||||||
|
Revenir dans la listes des emails
|
||||||
|
</NcActionButton>
|
||||||
|
<div class="image-list-attachement " v-if="!loadingDataEmailBox && mailAttachments.length > 0" v-for="attachment in mailAttachments">
|
||||||
|
<div v-if="attachment.isImage" class="image-item-attachement " @click="pickEmailAttachement(attachment)">
|
||||||
|
<img :src="attachment.downloadUrl" :alt="attachment.fileName ">
|
||||||
|
<label>{{ attachment.fileName }}</label>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="! attachment.isImage && !attachment.isCalendarEvent" class="image-item-attachement " @click="pickEmailAttachement(attachment)">
|
||||||
|
<label>{{ 'Pièce joint : ' + attachment.fileName }}</label>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="attachment.isCalendarEvent" class="image-item-attachement " >
|
||||||
|
<label>{{ 'Pièce joint : ' + attachment.fileName }} ( nNon allouée)</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<template v-if="!mailAttachments.length && !loadingDataEmailBox" >
|
||||||
|
<p> Pas d'Attachements</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="modal__content" v-if="loadingDataEmailBox" >
|
||||||
|
<div >
|
||||||
|
<NcLoadingIcon :size="40" appearance="light" :name="loadingText" />
|
||||||
|
</div>
|
||||||
|
<p style="text-align: center;"> {{ loadingText }}</p>
|
||||||
|
</div>
|
||||||
|
</NcModal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -74,13 +139,22 @@ import {
|
|||||||
NcActions,
|
NcActions,
|
||||||
NcActionButton,
|
NcActionButton,
|
||||||
NcDialog,
|
NcDialog,
|
||||||
|
NcModal,
|
||||||
|
NcButton,
|
||||||
|
NcAvatar,
|
||||||
|
NcLoadingIcon,
|
||||||
} from '@nextcloud/vue'
|
} from '@nextcloud/vue'
|
||||||
|
|
||||||
|
import axios from "@nextcloud/axios";
|
||||||
|
|
||||||
import Upload from 'vue-material-design-icons/Upload.vue'
|
import Upload from 'vue-material-design-icons/Upload.vue'
|
||||||
import Close from 'vue-material-design-icons/Close.vue'
|
import Close from 'vue-material-design-icons/Close.vue'
|
||||||
import Folder from 'vue-material-design-icons/Folder.vue'
|
import Folder from 'vue-material-design-icons/Folder.vue'
|
||||||
import Paperclip from 'vue-material-design-icons/Paperclip.vue'
|
import Paperclip from 'vue-material-design-icons/Paperclip.vue'
|
||||||
import Plus from 'vue-material-design-icons/Plus.vue'
|
import Plus from 'vue-material-design-icons/Plus.vue'
|
||||||
|
import Email from 'vue-material-design-icons/Email.vue'
|
||||||
|
import ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'
|
||||||
|
import Reload from 'vue-material-design-icons/Reload.vue'
|
||||||
|
|
||||||
import { generateUrl, getBaseUrl } from '@nextcloud/router'
|
import { generateUrl, getBaseUrl } from '@nextcloud/router'
|
||||||
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
|
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
|
||||||
@ -88,6 +162,7 @@ import logger from '../../../utils/logger.js'
|
|||||||
import {
|
import {
|
||||||
uploadLocalAttachment,
|
uploadLocalAttachment,
|
||||||
getFileInfo,
|
getFileInfo,
|
||||||
|
uploadRemoteFile
|
||||||
} from '../../../services/attachmentService.js'
|
} from '../../../services/attachmentService.js'
|
||||||
import { parseXML } from 'webdav'
|
import { parseXML } from 'webdav'
|
||||||
|
|
||||||
@ -103,6 +178,13 @@ export default {
|
|||||||
Paperclip,
|
Paperclip,
|
||||||
Plus,
|
Plus,
|
||||||
NcDialog,
|
NcDialog,
|
||||||
|
NcModal,
|
||||||
|
NcButton,
|
||||||
|
Email,
|
||||||
|
ArrowLeft,
|
||||||
|
Reload,
|
||||||
|
NcAvatar,
|
||||||
|
NcLoadingIcon
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
calendarObjectInstance: {
|
calendarObjectInstance: {
|
||||||
@ -120,6 +202,12 @@ export default {
|
|||||||
showOpenConfirmation: false,
|
showOpenConfirmation: false,
|
||||||
openConfirmationMessage: '',
|
openConfirmationMessage: '',
|
||||||
openConfirmationButtons: [],
|
openConfirmationButtons: [],
|
||||||
|
showModal: false,
|
||||||
|
showAttachmentsSection: false,
|
||||||
|
loadingDataEmailBox: false,
|
||||||
|
mailBoxData: [],
|
||||||
|
mailAttachments: [],
|
||||||
|
loadingText: 'Chargement ...',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -185,7 +273,7 @@ export default {
|
|||||||
async onLocalAttachmentSelected(e) {
|
async onLocalAttachmentSelected(e) {
|
||||||
try {
|
try {
|
||||||
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder')
|
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder')
|
||||||
const attachments = await uploadLocalAttachment(attachmentsFolder, Array.from(e.target.files), this.currentUser.dav, this.attachments)
|
const attachments = await uploadLocalAttachment(attachmentsFolder, Array.from(e.target.files), this.currentUser.dav)
|
||||||
// TODO do not share file, move to PHP
|
// TODO do not share file, move to PHP
|
||||||
attachments.map(async attachment => {
|
attachments.map(async attachment => {
|
||||||
const data = await getFileInfo(`${attachmentsFolder}/${attachment.path}`, this.currentUser.dav.userId)
|
const data = await getFileInfo(`${attachmentsFolder}/${attachment.path}`, this.currentUser.dav.userId)
|
||||||
@ -255,6 +343,116 @@ export default {
|
|||||||
]
|
]
|
||||||
this.showOpenConfirmation = true
|
this.showOpenConfirmation = true
|
||||||
},
|
},
|
||||||
|
async syncEmailBox(){
|
||||||
|
this.loadingText = 'Synchronisation encours ...'
|
||||||
|
this.loadingDataEmailBox = true
|
||||||
|
this.mailBoxData = [];
|
||||||
|
await this.loadEmailsBox(true)
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
},
|
||||||
|
async openEmailBoxModal(){
|
||||||
|
this.loadingText = 'Chargement des emails ...'
|
||||||
|
this.showModal = true
|
||||||
|
this.loadingDataEmailBox = true
|
||||||
|
await this.loadEmailsBox()
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
},
|
||||||
|
async getAttachments(mail){
|
||||||
|
this.loadingText = 'Récupération des piecs jointes ...'
|
||||||
|
this.loadingDataEmailBox = true
|
||||||
|
this.showAttachmentsSection = true
|
||||||
|
this.mailAttachments = [] ;
|
||||||
|
await this.loadAttachments(mail)
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
},
|
||||||
|
async pickEmailAttachement(attachement){
|
||||||
|
this.loadingText = 'Ajout de l\'attachement encours ...'
|
||||||
|
this.loadingDataEmailBox = true
|
||||||
|
await this.pickEmailAttachementTodavFile(attachement)
|
||||||
|
this.closeMailBoxModal()
|
||||||
|
this.resetMailBoxModal()
|
||||||
|
},
|
||||||
|
resetMailBoxModal() {
|
||||||
|
this.mailBoxData = []
|
||||||
|
this.mailAttachments = []
|
||||||
|
this.showModal = false
|
||||||
|
this.showAttachmentsSection = false
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
this.loadingText = 'Chargement ...'
|
||||||
|
},
|
||||||
|
displayAttachmentsSection() {
|
||||||
|
this.showAttachmentsSection = false
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
},
|
||||||
|
closeMailBoxModal() {
|
||||||
|
this.showModal = false
|
||||||
|
this.showAttachmentsSection = false
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
this.loadingText = 'Chargement ...'
|
||||||
|
},
|
||||||
|
async loadEmailsBox(withSync = false) {
|
||||||
|
const ajaxUrl = generateUrl('/apps/calendar/load-email-box')
|
||||||
|
await axios.get(ajaxUrl , { params: { withSync } })
|
||||||
|
.then(response => {
|
||||||
|
console.log(response.data.success);
|
||||||
|
if (!response.data.success && response.data.message == "MAILBOX_NOT_FOUND") {
|
||||||
|
this.closeMailBoxModal();
|
||||||
|
showError(t('calendar', 'Veuillez configurer le compte apps email pour pouvoir utiliser cette fonctionnalité.' , {
|
||||||
|
timeout : 7000,
|
||||||
|
}))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.mailBoxData = response.data;
|
||||||
|
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async loadAttachments(mail) {
|
||||||
|
if (!this.hasAttachements(mail)) {
|
||||||
|
this.mailAttachments = [] ;
|
||||||
|
this.loadingDataEmailBox = false
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const ajaxUrl = generateUrl('/apps/calendar/load-email-attachement/' + mail.databaseId)
|
||||||
|
|
||||||
|
await axios.get(ajaxUrl)
|
||||||
|
.then(response => {
|
||||||
|
console.log(response.data)
|
||||||
|
this.mailAttachments = response.data.attachments
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async pickEmailAttachementTodavFile(attachement) {
|
||||||
|
const attachmentsFolder = await this.$store.dispatch('createAttachmentsFolder')
|
||||||
|
const attachment = await uploadRemoteFile(attachmentsFolder, attachement.downloadUrl, attachement.fileName ,this.currentUser.dav)
|
||||||
|
// TODO do not share file, move to PHP
|
||||||
|
const data = await getFileInfo(`${attachmentsFolder}/${attachment.path}`, this.currentUser.dav.userId)
|
||||||
|
const davRes = await parseXML(data)
|
||||||
|
const davRespObj = davRes?.multistatus?.response[0]?.propstat?.prop
|
||||||
|
davRespObj.fileName = attachment.path
|
||||||
|
davRespObj.url = generateUrl(`/f/${davRespObj.fileid}`)
|
||||||
|
davRespObj.value = davRespObj.url
|
||||||
|
this.addAttachmentWithProperty(this.calendarObjectInstance, davRespObj)
|
||||||
|
},
|
||||||
|
getLabelEmailBox(from = []) {
|
||||||
|
if (from.length) {
|
||||||
|
return from[0].label ?? from[0].email
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
getSubstringText(text = '' , length = 20) {
|
||||||
|
if (text.length < length) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
return text.substring(0, length) + '...'
|
||||||
|
},
|
||||||
|
hasAttachements(mail) {
|
||||||
|
return mail.flags.hasAttachments;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -332,4 +530,38 @@ export default {
|
|||||||
.external-link-message {
|
.external-link-message {
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
.modal__content {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
.modal__content__attachments {
|
||||||
|
margin: 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.attachments-list{
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-list-attachement {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-item-attachement {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-item-attachement img {
|
||||||
|
width: 100px; /* Largeur de l'image */
|
||||||
|
height: auto; /* Hauteur automatique pour garder le ratio */
|
||||||
|
margin-right: 10px; /* Espace entre l'image et la légende */
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-size: 16px; /* Taille de police pour la légende */
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -167,7 +167,34 @@ const uploadLocalAttachment = async function(folder, files, dav, componentAttach
|
|||||||
return attachments
|
return attachments
|
||||||
|
|
||||||
}
|
}
|
||||||
|
const uploadRemoteFile = async function(folder , fileUrl, fileName , dav) {
|
||||||
|
try {
|
||||||
|
// Télécharger le fichier distant
|
||||||
|
const response = await axios.get(fileUrl, { responseType: 'blob' });
|
||||||
|
|
||||||
|
// Envoyer le fichier récupéré en PUT vers WebDAV
|
||||||
|
const url = generateRemoteUrl(`dav/files/${dav.userId}/${folder}/${fileName}`)
|
||||||
|
const uploadResponse = await axios.put(url, response.data, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': response.data.type, // Utilise le type MIME du fichier
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (uploadResponse.status === 204 || uploadResponse.status === 201) {
|
||||||
|
showSuccess(t('calendar', 'Attachment {fileName} added!', { fileName: fileName }));
|
||||||
|
return {
|
||||||
|
fileName: fileName,
|
||||||
|
formatType: response.data.type,
|
||||||
|
uri: url,
|
||||||
|
value: url,
|
||||||
|
path: `/${fileName}`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
showError(t('calendar', 'An error occurred during uploading file {fileName}', { fileName: fileName }));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
// TODO is shared or not @share-types@
|
// TODO is shared or not @share-types@
|
||||||
const getFileInfo = async function(path, userId) {
|
const getFileInfo = async function(path, userId) {
|
||||||
const url = generateRemoteUrl(`dav/files/${userId}/${path}`)
|
const url = generateRemoteUrl(`dav/files/${userId}/${path}`)
|
||||||
@ -200,4 +227,5 @@ export {
|
|||||||
shareFileWith,
|
shareFileWith,
|
||||||
uploadLocalAttachment,
|
uploadLocalAttachment,
|
||||||
createFolder,
|
createFolder,
|
||||||
|
uploadRemoteFile
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,5 +203,11 @@ return [
|
|||||||
|
|
||||||
//user groups getUserConnectedGroups
|
//user groups getUserConnectedGroups
|
||||||
['name' => 'page#getUserConnectedGroups', 'url' => '/getUserConnectedGroups', 'verb' => 'GET'],
|
['name' => 'page#getUserConnectedGroups', 'url' => '/getUserConnectedGroups', 'verb' => 'GET'],
|
||||||
|
|
||||||
|
|
||||||
|
['name' => 'provider#moveAttachmentFile', 'url' => '/test-move', 'verb' => 'GET'],
|
||||||
|
['name' => 'provider#sendEmailAttachment', 'url' => '/test-send-mail-attach', 'verb' => 'GET'],
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
@ -1,29 +1,34 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace OCA\Gestion\Controller;
|
namespace OCA\Gestion\Controller;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use OCA\Gestion\Service\ConfigurationService;
|
use OCP\IConfig;
|
||||||
use OCA\Gestion\Service\NavigationService;
|
|
||||||
use OCA\Gestion\Service\Provider\ProviderService;
|
|
||||||
use OCA\Gestion\Service\Provider\Statistic\ProviderStatisticService;
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
defined("TAB1") or define("TAB1", "\t");
|
|
||||||
|
|
||||||
use OCP\IGroupManager;
|
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use OCP\Mail\IMailer;
|
use OCP\Mail\IMailer;
|
||||||
use OCP\Files\IRootFolder;
|
use OCP\IGroupManager;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
defined("TAB1") or define("TAB1", "\t");
|
||||||
use OCP\AppFramework\Controller;
|
|
||||||
use OCA\Gestion\Db\Bdd;
|
|
||||||
use OCP\IURLGenerator;
|
use OCP\IURLGenerator;
|
||||||
use OCP\IConfig;
|
use OCA\Gestion\Db\Bdd;
|
||||||
|
use OC\Files\Filesystem;
|
||||||
|
use OCP\Files\IRootFolder;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
use OCP\AppFramework\Controller;
|
||||||
|
use OCA\Gestion\Service\GestionService;
|
||||||
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
|
use OCA\Gestion\Service\NavigationService;
|
||||||
|
use OCP\AppFramework\Http\TemplateResponse;
|
||||||
|
use OCA\Gestion\Service\ConfigurationService;
|
||||||
|
use OCA\Gestion\Service\Provider\ProviderService;
|
||||||
|
use OCA\Gestion\Service\Provider\Statistic\ProviderStatisticService;
|
||||||
|
|
||||||
date_default_timezone_set('Europe/Paris');
|
date_default_timezone_set('Europe/Paris');
|
||||||
|
|
||||||
class ProviderController extends Controller {
|
class ProviderController extends Controller
|
||||||
|
{
|
||||||
private $idNextcloud;
|
private $idNextcloud;
|
||||||
private $urlGenerator;
|
private $urlGenerator;
|
||||||
private $mailer;
|
private $mailer;
|
||||||
@ -38,31 +43,36 @@ class ProviderController extends Controller {
|
|||||||
/** @var \OCA\Gestion\Service\NavigationService */
|
/** @var \OCA\Gestion\Service\NavigationService */
|
||||||
private $navigationService;
|
private $navigationService;
|
||||||
|
|
||||||
private $providerService;
|
private $providerService;
|
||||||
|
|
||||||
private $providerStatisticService;
|
private $providerStatisticService;
|
||||||
|
|
||||||
private $logger;
|
private $logger;
|
||||||
|
//Gestion service
|
||||||
|
private $gestionService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
public function __construct($AppName,
|
public function __construct(
|
||||||
IRequest $request,
|
$AppName,
|
||||||
$UserId,
|
IRequest $request,
|
||||||
Bdd $myDb,
|
$UserId,
|
||||||
IRootFolder $rootFolder,
|
Bdd $myDb,
|
||||||
IURLGenerator $urlGenerator,
|
IRootFolder $rootFolder,
|
||||||
IMailer $mailer,
|
IURLGenerator $urlGenerator,
|
||||||
Iconfig $config,
|
IMailer $mailer,
|
||||||
IUserSession $userSession,
|
Iconfig $config,
|
||||||
IGroupManager $groupManager,
|
IUserSession $userSession,
|
||||||
NavigationService $navigationService,
|
IGroupManager $groupManager,
|
||||||
ConfigurationService $configurationService,
|
NavigationService $navigationService,
|
||||||
LoggerInterface $logger,
|
ConfigurationService $configurationService,
|
||||||
ProviderService $providerService,
|
LoggerInterface $logger,
|
||||||
ProviderStatisticService $providerStatisticService
|
ProviderService $providerService,
|
||||||
){
|
ProviderStatisticService $providerStatisticService,
|
||||||
|
GestionService $gestionService
|
||||||
|
) {
|
||||||
|
|
||||||
parent::__construct($AppName, $request);
|
parent::__construct($AppName, $request);
|
||||||
|
|
||||||
@ -74,55 +84,89 @@ class ProviderController extends Controller {
|
|||||||
$this->navigationService = $navigationService;
|
$this->navigationService = $navigationService;
|
||||||
$this->configurationService = $configurationService;
|
$this->configurationService = $configurationService;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->providerService = $providerService;
|
$this->providerService = $providerService;
|
||||||
$this->providerStatisticService = $providerStatisticService;
|
$this->providerStatisticService = $providerStatisticService;
|
||||||
|
$this->gestionService = $gestionService;
|
||||||
|
|
||||||
if ($userSession->isLoggedIn()) {
|
if ($userSession->isLoggedIn()) {
|
||||||
$this->user = $userSession->getUser();
|
$this->user = $userSession->getUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->user != null) {
|
if ($this->user != null) {
|
||||||
$groups = $groupManager->getUserGroups($this->user);
|
$groups = $groupManager->getUserGroups($this->user);
|
||||||
$this->groups = [];
|
$this->groups = [];
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
$this->groups[] = $group->getGID();
|
$this->groups[] = $group->getGID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try {
|
||||||
$this->storage = $rootFolder->getUserFolder($this->idNextcloud);
|
$this->storage = $rootFolder->getUserFolder($this->idNextcloud);
|
||||||
}catch(\OC\User\NoUserException $e){
|
} catch (\OC\User\NoUserException $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function provider() {
|
public function provider()
|
||||||
|
{
|
||||||
return new TemplateResponse('gestion', 'provider', array('groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud, 'url' => $this->navigationService->getNavigationLink()));
|
return new TemplateResponse('gestion', 'provider', array('groups' => $this->groups, 'user' => $this->user, 'path' => $this->idNextcloud, 'url' => $this->navigationService->getNavigationLink()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function getProviders() {
|
public function getProviders()
|
||||||
|
{
|
||||||
$providers = $this->providerService->getProvidersAsArray();
|
$providers = $this->providerService->getProvidersAsArray();
|
||||||
return json_encode($providers);
|
return json_encode($providers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @NoAdminRequired
|
||||||
|
* @NoCSRFRequired
|
||||||
|
*/
|
||||||
|
public function getProvidersTest() {
|
||||||
|
|
||||||
|
$client = \OC::$server->getHTTPClientService()->newClient();
|
||||||
|
$token = file_get_contents('http://127.0.0.1/ocs/v2.php/core/getcsrftoken', false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "OCS-APIRequest: true\r\n"
|
||||||
|
]
|
||||||
|
]));
|
||||||
|
$response = $client->post('http://127.0.0.1/ocs/v2.php/apps/files_sharing/api/v1/shares', [
|
||||||
|
'body' => [
|
||||||
|
"path" => "//Talk/narindra-dev.png",
|
||||||
|
"referenceId" => "dkzcesdsdhae",
|
||||||
|
"shareWith" => "dkzcehae",
|
||||||
|
"shareType" => 10,
|
||||||
|
'talkMetaData' => "{\"messageType\":\"\"}"
|
||||||
|
],
|
||||||
|
'headers' => [
|
||||||
|
'Cookie' =>"_ga=GA1.1.259457270.1732194936; _ga_699NE13B0K=GS1.1.1732203040.2.0.1732203040.0.0.0; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; nc_username=Tiavina; oc_sessionPassphrase=v7ncJ0h%2BYxrmzJViNygGkErBa9cSDs1m3mpgW4M6wZ%2BqphceZK2S7PMELp%2BlHgxQxcZuGPrpzZSwzp2SQCXADxDehB7OkwdBEr3DtG8ZzlnXZWzB%2Fbfl7xsuQYTnvmLU; oczp8j7d6k88=1b54a2ea877ffca7154bea254f70886c; nc_token=OEez5vu%2FWTz7FsafIbVDbAXA7lSdkG9U; nc_session_id=1b54a2ea877ffca7154bea254f70886c",
|
||||||
|
'OCS-APIRequest' => 'true',
|
||||||
|
'requesttoken' => $token
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
|
var_dump($response);die;
|
||||||
|
return json_encode($providers);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function createDefaultProvider() {
|
public function createDefaultProvider()
|
||||||
try{
|
{
|
||||||
|
try {
|
||||||
$this->providerService->createDefaultProvider($this->idNextcloud);
|
$this->providerService->createDefaultProvider($this->idNextcloud);
|
||||||
return true;
|
return true;
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e){
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,14 +174,18 @@ class ProviderController extends Controller {
|
|||||||
/**
|
/**
|
||||||
* @NoAdminRequired
|
* @NoAdminRequired
|
||||||
* @NoCSRFRequired
|
* @NoCSRFRequired
|
||||||
*/
|
*/
|
||||||
public function exportProvidersStatistic(array $providerIds,$year){
|
public function exportProvidersStatistic(array $providerIds, $year)
|
||||||
try{
|
{
|
||||||
$filenames = $this->providerStatisticService->exportProvidersStatisticByYear($providerIds,$year,$this->idNextcloud);
|
try {
|
||||||
|
$filenames = $this->providerStatisticService->exportProvidersStatisticByYear($providerIds, $year, $this->idNextcloud);
|
||||||
return $filenames;
|
return $filenames;
|
||||||
}
|
} catch (Exception $e) {
|
||||||
catch(Exception $e){
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
12
gestion/lib/Helpers/FolderHelpers.php
Normal file
12
gestion/lib/Helpers/FolderHelpers.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace OCA\Gestion\Helpers;
|
||||||
|
|
||||||
|
class FolderHelpers
|
||||||
|
{
|
||||||
|
public static function GetDefuntFolder(string $clientEntreprise,string $defuntNom){
|
||||||
|
$clientRacineFolder = 'CLIENTS/'.strtoupper($clientEntreprise).'/';
|
||||||
|
$defuntFolder = $clientRacineFolder.'DEFUNTS/'.strtoupper($defuntNom).'/';
|
||||||
|
return $defuntFolder;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -61,4 +61,22 @@ class VCalendarHelpers
|
|||||||
}
|
}
|
||||||
return $vCalendarData;
|
return $vCalendarData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function hasAttachment(string $vCalendarString) : bool{
|
||||||
|
return str_contains($vCalendarString, 'ATTACH;FMTTYPE');
|
||||||
|
}
|
||||||
|
public static function extractAttachments(string $vCalendarString): array {
|
||||||
|
$attachments = [];
|
||||||
|
preg_match_all('/ATTACH;FMTTYPE=([^;]+);FILENAME=([^;]+);X-NC-FILE-ID=([^;]+);/', $vCalendarString, $matches, PREG_SET_ORDER);
|
||||||
|
foreach ($matches as $match) {
|
||||||
|
$attachments[] = [
|
||||||
|
'type' =>explode("/" , $match[1])[0], // Extrait 'image' de 'image/png'
|
||||||
|
'mime_type' =>$match[1], // Extrait 'image' de 'image/png'
|
||||||
|
'name' => trim($match[2], '/'),
|
||||||
|
'file_id' => (int) $match[3],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $attachments;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,7 @@ use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
|||||||
use OCA\Gestion\Service\GestionService;
|
use OCA\Gestion\Service\GestionService;
|
||||||
use OCP\EventDispatcher\Event;
|
use OCP\EventDispatcher\Event;
|
||||||
use OCP\EventDispatcher\IEventListener;
|
use OCP\EventDispatcher\IEventListener;
|
||||||
|
use OCP\IRequest;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class CalendarObjectCreatedListener implements IEventListener {
|
class CalendarObjectCreatedListener implements IEventListener {
|
||||||
@ -39,9 +40,14 @@ class CalendarObjectCreatedListener implements IEventListener {
|
|||||||
/** @var GestionService */
|
/** @var GestionService */
|
||||||
private $gestionService;
|
private $gestionService;
|
||||||
|
|
||||||
|
/** @var IRequest */
|
||||||
|
private $request;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
IRequest $request,
|
||||||
LoggerInterface $logger,GestionService $gestionService) {
|
LoggerInterface $logger,GestionService $gestionService) {
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
$this->request = $request;
|
||||||
$this->gestionService = $gestionService;
|
$this->gestionService = $gestionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,9 +55,12 @@ class CalendarObjectCreatedListener implements IEventListener {
|
|||||||
if (!($event instanceof CalendarObjectCreatedEvent)) {
|
if (!($event instanceof CalendarObjectCreatedEvent)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$cookie = $this->request->getHeader("Cookie");
|
||||||
|
|
||||||
|
|
||||||
$calendarData = $event->getObjectData();
|
$calendarData = $event->getObjectData();
|
||||||
$vCalendarString = $calendarData["calendardata"];
|
$vCalendarString = $calendarData["calendardata"];
|
||||||
$this->gestionService->HandleCreatedCalendarObject($vCalendarString);
|
$this->gestionService->HandleCreatedCalendarObject($vCalendarString , $cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,18 +26,24 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace OCA\Gestion\Service;
|
namespace OCA\Gestion\Service;
|
||||||
|
|
||||||
|
use OCP\DB\Exception;
|
||||||
|
use OCP\IUserSession;
|
||||||
|
use OCP\Mail\IMailer;
|
||||||
|
use OCA\Gestion\Db\Bdd;
|
||||||
|
use OC\Files\Filesystem;
|
||||||
|
use OCP\Files\IRootFolder;
|
||||||
|
use OCA\Gestion\Db\OrderBdd;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use OCA\Gestion\Constants\BddConstant;
|
use OCA\Gestion\Constants\BddConstant;
|
||||||
use OCA\Gestion\Constants\DevisMentionConstant;
|
use OCA\Gestion\Helpers\FolderHelpers;
|
||||||
|
use OCA\Gestion\Helpers\VCalendarHelpers;
|
||||||
use OCA\Gestion\Constants\OrderStatusConstant;
|
use OCA\Gestion\Constants\OrderStatusConstant;
|
||||||
use OCA\Gestion\Constants\ThanatoTypeConstant;
|
use OCA\Gestion\Constants\ThanatoTypeConstant;
|
||||||
use OCA\Gestion\Db\Bdd;
|
|
||||||
use OCA\Gestion\Db\OrderBdd;
|
|
||||||
use OCA\Gestion\Service\Devis\Pdf\DevisPdfService;
|
|
||||||
use OCA\Gestion\Service\Order\OrderPdfService;
|
use OCA\Gestion\Service\Order\OrderPdfService;
|
||||||
use OCP\DB\Exception;
|
use OCA\Gestion\Constants\DevisMentionConstant;
|
||||||
use Psr\Log\LoggerInterface;
|
use OCA\Gestion\Service\Devis\Pdf\DevisPdfService;
|
||||||
use OCA\Gestion\Helpers\VCalendarHelpers;
|
use OCP\IConfig;
|
||||||
use OCP\IUserSession;
|
use Ramsey\Uuid\Uuid;
|
||||||
|
|
||||||
class GestionService {
|
class GestionService {
|
||||||
/** @var Bdd */
|
/** @var Bdd */
|
||||||
@ -58,6 +64,13 @@ class GestionService {
|
|||||||
|
|
||||||
private string $userConnectedUuid;
|
private string $userConnectedUuid;
|
||||||
|
|
||||||
|
private $userConnectedStorage;
|
||||||
|
|
||||||
|
private $mailer;
|
||||||
|
|
||||||
|
protected $config;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Bdd $gestionBdd,
|
Bdd $gestionBdd,
|
||||||
OrderBdd $orderBdd,
|
OrderBdd $orderBdd,
|
||||||
@ -65,7 +78,11 @@ class GestionService {
|
|||||||
OrderPdfService $orderPdfService,
|
OrderPdfService $orderPdfService,
|
||||||
DevisPdfService $devisPdfService,
|
DevisPdfService $devisPdfService,
|
||||||
TalkService $talkService,
|
TalkService $talkService,
|
||||||
IUserSession $userSession
|
IUserSession $userSession,
|
||||||
|
IRootFolder $rootFolder,
|
||||||
|
IMailer $mailer,
|
||||||
|
IConfig $config,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
$this->orderBdd = $orderBdd;
|
$this->orderBdd = $orderBdd;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
@ -75,6 +92,11 @@ class GestionService {
|
|||||||
$this->talkService = $talkService;
|
$this->talkService = $talkService;
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
$this->userConnectedUuid = $userSession->getUser()?->getUID() ?? BddConstant::DEFAULT_ADMIN_APP_ID_NEXTCLOUD;
|
$this->userConnectedUuid = $userSession->getUser()?->getUID() ?? BddConstant::DEFAULT_ADMIN_APP_ID_NEXTCLOUD;
|
||||||
|
$this->userConnectedStorage = $rootFolder->getUserFolder($this->userConnectedUuid);
|
||||||
|
$this->mailer = $mailer;
|
||||||
|
$this->config = $config;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GetCalendarSummaryFromVCalendarString(string $vCalendarString): string
|
private function GetCalendarSummaryFromVCalendarString(string $vCalendarString): string
|
||||||
@ -169,7 +191,7 @@ class GestionService {
|
|||||||
return $calendarStartDate;
|
return $calendarStartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function HandleCreatedCalendarObject(string $vCalendarString){
|
public function HandleCreatedCalendarObject(string $vCalendarString ,$cookie){
|
||||||
try{
|
try{
|
||||||
$thanato = $this->GetThanatoFromVCalendarString($vCalendarString);
|
$thanato = $this->GetThanatoFromVCalendarString($vCalendarString);
|
||||||
if($thanato != null){
|
if($thanato != null){
|
||||||
@ -184,6 +206,8 @@ class GestionService {
|
|||||||
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
|
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
|
||||||
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
|
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
|
||||||
$devisAlreadyCreated = $this->IsDevisAlreadyCreated($clientId,$locationId,$thanatoId,$calendarSummary,$calendarUuid);
|
$devisAlreadyCreated = $this->IsDevisAlreadyCreated($clientId,$locationId,$thanatoId,$calendarSummary,$calendarUuid);
|
||||||
|
|
||||||
|
|
||||||
if($devisAlreadyCreated){
|
if($devisAlreadyCreated){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -210,6 +234,32 @@ class GestionService {
|
|||||||
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devisId,$userName);
|
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devisId,$userName);
|
||||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
||||||
$this->devisPdfService->generateDevisPdfByDevisId($devisId,$this->userConnectedUuid);
|
$this->devisPdfService->generateDevisPdfByDevisId($devisId,$this->userConnectedUuid);
|
||||||
|
//Move calendar attachment file to defunt folder
|
||||||
|
if (VCalendarHelpers::hasAttachment($vCalendarString)) {
|
||||||
|
$devis = $this->gestionBdd->getDevisByDevisId($devisId);
|
||||||
|
if($devis != null && $devis["client_entreprise"] != null){
|
||||||
|
$destinationFolderAttachment = FolderHelpers::GetDefuntFolder($devis["client_entreprise"],$devis["defunt_nom"]);
|
||||||
|
$attachments = VCalendarHelpers::extractAttachments($vCalendarString);
|
||||||
|
$this->moveCalendarAttachmentFile($attachments,$destinationFolderAttachment);
|
||||||
|
if ($thanatoIsSubcontractor) {
|
||||||
|
$thanatoHasEmail = $thanato["thanato_email"] != null;
|
||||||
|
if($thanatoHasEmail){
|
||||||
|
$this->sendEmailAttachment($thanato["thanato_email"] , $devis["defunt_nom"],$attachments);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
$roomToken = $this->talkService->getRoomTokenBeetwenTwoUser($this->userConnectedUuid, $userName);
|
||||||
|
foreach ( $attachments as $attachment) {
|
||||||
|
$this->userConnectedStorage->getFullPath("/");
|
||||||
|
$path = Filesystem::getPath($attachment['file_id']);
|
||||||
|
$destination = 'Talk/';
|
||||||
|
Filesystem::copy($path, $destination . $attachment['name']);
|
||||||
|
$this->sendFileAttachmentToTalk($roomToken,$cookie , $attachment['name']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
|
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
|
||||||
}
|
}
|
||||||
catch(Exception $e){
|
catch(Exception $e){
|
||||||
@ -217,6 +267,14 @@ class GestionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function moveCalendarAttachmentFile(array $attachments ,string $destinationFolder ){
|
||||||
|
$this->userConnectedStorage->getFullPath("/");
|
||||||
|
foreach ($attachments as $attachment) {
|
||||||
|
$path = Filesystem::getPath($attachment['file_id']);
|
||||||
|
Filesystem::copy($path, $destinationFolder . $attachment['name']);
|
||||||
|
}
|
||||||
|
}
|
||||||
private function GetThanatoNameFromVCalendarString($vCalendarString){
|
private function GetThanatoNameFromVCalendarString($vCalendarString){
|
||||||
$thanatoName = null;
|
$thanatoName = null;
|
||||||
$thanatoNames = $this->GetAttendeesNameFromVCalendarString($vCalendarString);
|
$thanatoNames = $this->GetAttendeesNameFromVCalendarString($vCalendarString);
|
||||||
@ -315,7 +373,7 @@ class GestionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function HandleUpdatedCalendarObject(string $vCalendarString){
|
public function HandleUpdatedCalendarObject(string $vCalendarString , $cookie){
|
||||||
try{
|
try{
|
||||||
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
|
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
|
||||||
$devis = $this->gestionBdd->getDevisByCalendarUuid($calendarUuid);
|
$devis = $this->gestionBdd->getDevisByCalendarUuid($calendarUuid);
|
||||||
@ -329,12 +387,93 @@ class GestionService {
|
|||||||
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
|
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
|
||||||
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devis['id'],$userName);
|
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devis['id'],$userName);
|
||||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
|
||||||
|
$this->devisPdfService->generateDevisPdfByDevisId($devis['id'],$this->userConnectedUuid);
|
||||||
|
|
||||||
|
|
||||||
|
if (VCalendarHelpers::hasAttachment($vCalendarString)) {
|
||||||
|
$thanato = $this->gestionBdd->getThanatoByThanatoId($devis['id_thanato']);
|
||||||
|
$thanatoIsSubcontractor = $thanato["fk_thanato_type_key"] === ThanatoTypeConstant::THANATO_TYPE_SUBCONTRACTOR;
|
||||||
|
|
||||||
|
$devis = $this->gestionBdd->getDevisByDevisId($devis['id']);
|
||||||
|
if($devis != null && $devis["client_entreprise"] != null){
|
||||||
|
$destinationFolderAttachment = FolderHelpers::GetDefuntFolder($devis["client_entreprise"],$devis["defunt_nom"]);
|
||||||
|
$attachments = VCalendarHelpers::extractAttachments($vCalendarString);
|
||||||
|
$this->moveCalendarAttachmentFile($attachments , $destinationFolderAttachment);
|
||||||
|
if ($thanatoIsSubcontractor ) {
|
||||||
|
$thanatoHasEmail = $thanato["thanato_email"] != null;
|
||||||
|
if($thanatoHasEmail){
|
||||||
|
$this->sendEmailAttachment($thanato["thanato_email"] , $devis["defunt_nom"],$attachments);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$roomToken = $this->talkService->getRoomTokenBeetwenTwoUser($this->userConnectedUuid, $userName);
|
||||||
|
foreach ( $attachments as $attachment) {
|
||||||
|
$this->userConnectedStorage->getFullPath("/");
|
||||||
|
$path = Filesystem::getPath($attachment['file_id']);
|
||||||
|
$destination = 'Talk/';
|
||||||
|
Filesystem::copy($path, $destination . $attachment['name']);
|
||||||
|
//sendFileAttachmentToTalk
|
||||||
|
$this->sendFileAttachmentToTalk($roomToken,$cookie , $attachment['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$this->devisPdfService->generateDevisPdfByDevisId($devis['id'],$this->userConnectedUuid);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(Exception $e){
|
catch(Exception $e){
|
||||||
$this->logger->debug("error creating devis");
|
$this->logger->debug("error creating devis");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sendEmailAttachment($to , $defunt_nom ,$attachments = []){
|
||||||
|
$this->userConnectedStorage->getFullPath("/");
|
||||||
|
$subject = "Piece jointe";
|
||||||
|
$body = "
|
||||||
|
<p>Bonjour.</p>
|
||||||
|
<p>Vous trouverez en pièce jointe les documents concernant de « $defunt_nom ».</p>
|
||||||
|
<p>Vous en souhaitant bonne réception</p>
|
||||||
|
|
||||||
|
<p>Cordialement</p>
|
||||||
|
";
|
||||||
|
|
||||||
|
$message = $this->mailer->createMessage();
|
||||||
|
$message->setSubject($subject);
|
||||||
|
$message->setTo(recipients: [$to]);
|
||||||
|
|
||||||
|
foreach ($attachments as $attachment) {
|
||||||
|
$path = Filesystem::getPath($attachment['file_id']);
|
||||||
|
$content = $this->mailer->createAttachment( Filesystem::file_get_contents($path),$attachment['name'],$attachment['mime_type']);
|
||||||
|
$message->attach($content);
|
||||||
|
}
|
||||||
|
$message->setHtmlBody( $body);
|
||||||
|
|
||||||
|
$this->mailer->send($message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sendFileAttachmentToTalk($roomToken, $cookie , $fileName ) {
|
||||||
|
$host = 'http://127.0.0.1';
|
||||||
|
$client = \OC::$server->getHTTPClientService()->newClient();
|
||||||
|
$token = file_get_contents("$host/ocs/v2.php/core/getcsrftoken", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "OCS-APIRequest: true\r\n"
|
||||||
|
]
|
||||||
|
]));
|
||||||
|
$client->post("$host/ocs/v2.php/apps/files_sharing/api/v1/shares", [
|
||||||
|
'body' => [
|
||||||
|
"path" => "//Talk/$fileName",
|
||||||
|
"referenceId" => Uuid::uuid4()->toString(),
|
||||||
|
"shareWith" => $roomToken,
|
||||||
|
"shareType" => 10,
|
||||||
|
'talkMetaData' => "{\"messageType\":\"\"}"
|
||||||
|
],
|
||||||
|
'headers' => [
|
||||||
|
'Cookie' =>$cookie,
|
||||||
|
'OCS-APIRequest' => 'true',
|
||||||
|
'requesttoken' => $token
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class TalkService {
|
|||||||
if($room == null){
|
if($room == null){
|
||||||
$roomToken = $this->generateTalkRandomToken();
|
$roomToken = $this->generateTalkRandomToken();
|
||||||
$room = $this->talkDb->createDevisTalkRoomAndReturnDevisTalkRoom($targetUser,$senderUser, $roomToken);
|
$room = $this->talkDb->createDevisTalkRoomAndReturnDevisTalkRoom($targetUser,$senderUser, $roomToken);
|
||||||
$initialMessage = $this->talkDb->setDevisTalkRoomInitialMessageAndReturnMessage($room['id'],$targetUser);
|
$this->talkDb->setDevisTalkRoomInitialMessageAndReturnMessage($room['id'],$targetUser);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$roomToken = $room['token'];
|
$roomToken = $room['token'];
|
||||||
@ -103,4 +103,24 @@ class TalkService {
|
|||||||
$this->talkDb->sendAttendeeNotifications($targetUser,$roomToken,$notificationsSubjectsParameters,$notificationsMessageParameters);
|
$this->talkDb->sendAttendeeNotifications($targetUser,$roomToken,$notificationsSubjectsParameters,$notificationsMessageParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRoomTokenBeetwenTwoUser( $senderUser , $targetUser){
|
||||||
|
$senderAndTargetIsTheSameUser = $targetUser == $senderUser;
|
||||||
|
$senderUser = $senderAndTargetIsTheSameUser ? BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD : $senderUser;
|
||||||
|
if( $targetUser === BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD && $senderUser === BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$roomNames = $this->getUserDevisTalkRoomNames($targetUser , $senderUser);
|
||||||
|
$room = $this->talkDb->getDevisTalkRoomByNames($roomNames);
|
||||||
|
if($room == null){
|
||||||
|
$roomToken = $this->generateTalkRandomToken();
|
||||||
|
$room = $this->talkDb->createDevisTalkRoomAndReturnDevisTalkRoom($targetUser,$senderUser, $roomToken);
|
||||||
|
$this->talkDb->setDevisTalkRoomInitialMessageAndReturnMessage($room['id'],$targetUser);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$roomToken = $room['token'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $roomToken;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user