Merge branch 'features/feature-add-comment-in-talk-h2f' into releases/release-h2f

This commit is contained in:
Tiavina 2025-03-26 11:14:39 +03:00
commit 822492b244
20 changed files with 325 additions and 26 deletions

View File

@ -1322,7 +1322,7 @@ function b(n) {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // 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":"7bde6f386631234ba146","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":"273df538e0dc19672feb","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"86eaa619747854c0da61","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_store_index_js":"2c493e91e10998374f26","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","dashboard-lazy":"0dd354a2fd4b9e38ddcf","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"2e0b0e8bc0e8488c397c","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","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":"7bde6f386631234ba146","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":"273df538e0dc19672feb","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"86eaa619747854c0da61","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"d2880e4c429713e99f7b","src_store_index_js":"ec20095566748d2f9a12","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"4ec4f960e50da6a1f2cd","dashboard-lazy":"0dd354a2fd4b9e38ddcf","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"2e0b0e8bc0e8488c397c","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","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] + "";
/******/ };
/******/ })();
/******/

View File

@ -22395,6 +22395,16 @@ var render = function render() {
"add-single-value": _vm.addArticle,
"remove-single-value": _vm.removeArticle
}
}), _vm._v(" "), _c("PropertyText", {
attrs: {
"is-read-only": _vm.isReadOnly,
"prop-model": _vm.rfcProps.comment,
value: _vm.comment,
"linkify-links": false
},
on: {
"update:value": _vm.updateComment
}
}), _vm._v(" "), _vm.isViewedByAttendee ? _c("InvitationResponseButtons", {
attrs: {
attendee: _vm.userAsAttendee,
@ -22954,6 +22964,16 @@ var render = function render() {
"add-single-value": _vm.addArticle,
"remove-single-value": _vm.removeArticle
}
}), _vm._v(" "), _c("PropertyText", {
attrs: {
"is-read-only": _vm.isReadOnly,
"prop-model": _vm.rfcProps.comment,
value: _vm.comment,
"linkify-links": false
},
on: {
"update:value": _vm.updateComment
}
}), _vm._v(" "), _c("InviteesList", {
staticClass: "event-popover__invitees",
attrs: {
@ -26281,7 +26301,7 @@ __webpack_require__.r(__webpack_exports__);
* Returns an object with properties from RFCs including
* their displayName, a description, options, etc.
*
* @return {{geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
* @return {{comment, geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
*/
rfcProps() {
return (0,_models_rfcProps_js__WEBPACK_IMPORTED_MODULE_0__.getRFCProperties)();
@ -26543,6 +26563,17 @@ __webpack_require__.r(__webpack_exports__);
location
});
},
/**
* Updates the comments of this event
*
* @param {string} comment New comments
*/
updateComment(comment) {
this.$store.commit('changeComment', {
calendarObjectInstance: this.calendarObjectInstance,
comment
});
},
/**
* Updates the client of the event
*
@ -28283,6 +28314,7 @@ const mapEventComponentToEventObject = eventComponent => {
location: eventComponent.location,
client: "CLIENT",
embalmer: "TEST",
comment: "",
description: eventComponent.description,
accessClass: eventComponent.accessClass,
status: eventComponent.status,
@ -28374,6 +28406,9 @@ const mapEventComponentToEventObject = eventComponent => {
if (eventComponent.hasProperty('EMBALMER')) {
eventObject.embalmer = eventComponent.getFirstPropertyFirstValue('EMBALMER');
}
if (eventComponent.hasProperty('COMMENT')) {
eventObject.comment = eventComponent.getFirstPropertyFirstValue('COMMENT');
}
return eventObject;
};
@ -29225,6 +29260,15 @@ const getRFCProperties = () => {
placeholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Choisir les soins'),
tagPlaceholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Choisir les soins'),
options: []
},
comment: {
readableName: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Comment'),
icon: 'TextBoxOutline',
info: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires.'),
placeholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires'),
tagPlaceholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires'),
options: [],
defaultNumberOfRows: 4
}
};
};
@ -31543,6 +31587,22 @@ const mutations = {
calendarObjectInstance.eventComponent.location = location;
calendarObjectInstance.location = location;
},
/**
* Change the comment of an event
*
* @param {object} state The Vuex state
* @param {object} data The destructuring object
* @param {object} data.calendarObjectInstance The calendarObjectInstance object
* @param {string} data.comment New comment to set
*/
changeComment(state, _ref11) {
let {
calendarObjectInstance,
comment
} = _ref11;
calendarObjectInstance.eventComponent.comment = comment;
calendarObjectInstance.comment = comment;
},
/**
* Change the client of an event
*
@ -33955,7 +34015,31 @@ const actions = {
if (eventComponent != null) {
if (eventComponent.client != null) {
let newClientKeyValue = "CLIENT:" + eventComponent.client;
icsValue = icsValue.replace(/CLIENT:\d+/, newClientKeyValue);
let regexEmptyClient = /CLIENT:(?!\d)(?=\s*[\r\n])/g;
if (regexEmptyClient.test(icsValue)) {
icsValue = icsValue.replace(regexEmptyClient, newClientKeyValue);
}
let regex = /CLIENT:\d+/;
if (regex.test(icsValue)) {
icsValue = icsValue.replace(regex, newClientKeyValue);
} else {
const customKeyValue = {
"CLIENT": eventComponent.client
};
icsValue = (0,_models_calendarObject_js__WEBPACK_IMPORTED_MODULE_0__.setCustomKeyValuesArrayToIcsAndReturnIcs)(icsValue, customKeyValue);
}
}
if (eventComponent.comment != null) {
let newCommentKeyValue = "COMMENT:" + eventComponent.comment;
let regex = /^COMMENT:.*$/m;
if (regex.test(icsValue)) {
icsValue = icsValue.replace(regex, newCommentKeyValue);
} else {
const customKeyValue = {
"COMMENT": eventComponent.comment
};
icsValue = (0,_models_calendarObject_js__WEBPACK_IMPORTED_MODULE_0__.setCustomKeyValuesArrayToIcsAndReturnIcs)(icsValue, customKeyValue);
}
}
if (eventComponent.isPrivate != null) {
let isPrivateValue = eventComponent.isPrivate ? "1" : "0";

View File

@ -8865,7 +8865,7 @@ window._registerCustomPickerElement = _;
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // 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":"7bde6f386631234ba146","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":"2e0b0e8bc0e8488c397c","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"273df538e0dc19672feb","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"56373f2063898525e8de","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":"925781d9db1ffc96ba17","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"2c493e91e10998374f26","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"9168fca99a878d4c37e3","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":"7bde6f386631234ba146","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":"2e0b0e8bc0e8488c397c","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"273df538e0dc19672feb","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"56373f2063898525e8de","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"d2880e4c429713e99f7b","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"4ec4f960e50da6a1f2cd","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"cd8a0993186cf9d527b6","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"ec20095566748d2f9a12","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"9168fca99a878d4c37e3","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] + "";
/******/ };
/******/ })();
/******/

View File

@ -1054,4 +1054,4 @@ module.exports = "data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/sv
/***/ })
}]);
//# sourceMappingURL=calendar-src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258.js.map?v=b5a1f8246e3d20bdaf6b
//# sourceMappingURL=calendar-src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258.js.map?v=b5a1f8246e3d20bdaf6b

View File

@ -316,6 +316,15 @@ const getRFCProperties = () => {
placeholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Choisir les soins'),
tagPlaceholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Choisir les soins'),
options: []
},
comment: {
readableName: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Comment'),
icon: 'TextBoxOutline',
info: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires.'),
placeholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires'),
tagPlaceholder: (0,_nextcloud_l10n__WEBPACK_IMPORTED_MODULE_0__.translate)('calendar', 'Commentaires'),
options: [],
defaultNumberOfRows: 4
}
};
};
@ -1817,4 +1826,4 @@ function GenColors(steps) {
/***/ })
}]);
//# sourceMappingURL=calendar-src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790.js.map?v=94fac30d128df46a89a6
//# sourceMappingURL=calendar-src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790.js.map?v=d2880e4c429713e99f7b

View File

@ -874,6 +874,7 @@ const mapEventComponentToEventObject = eventComponent => {
location: eventComponent.location,
client: "CLIENT",
embalmer: "TEST",
comment: "",
description: eventComponent.description,
accessClass: eventComponent.accessClass,
status: eventComponent.status,
@ -965,6 +966,9 @@ const mapEventComponentToEventObject = eventComponent => {
if (eventComponent.hasProperty('EMBALMER')) {
eventObject.embalmer = eventComponent.getFirstPropertyFirstValue('EMBALMER');
}
if (eventComponent.hasProperty('COMMENT')) {
eventObject.comment = eventComponent.getFirstPropertyFirstValue('COMMENT');
}
return eventObject;
};
@ -2229,6 +2233,22 @@ const mutations = {
calendarObjectInstance.eventComponent.location = location;
calendarObjectInstance.location = location;
},
/**
* Change the comment of an event
*
* @param {object} state The Vuex state
* @param {object} data The destructuring object
* @param {object} data.calendarObjectInstance The calendarObjectInstance object
* @param {string} data.comment New comment to set
*/
changeComment(state, _ref11) {
let {
calendarObjectInstance,
comment
} = _ref11;
calendarObjectInstance.eventComponent.comment = comment;
calendarObjectInstance.comment = comment;
},
/**
* Change the client of an event
*
@ -4640,7 +4660,31 @@ const actions = {
if (eventComponent != null) {
if (eventComponent.client != null) {
let newClientKeyValue = "CLIENT:" + eventComponent.client;
icsValue = icsValue.replace(/CLIENT:\d+/, newClientKeyValue);
let regexEmptyClient = /CLIENT:(?!\d)(?=\s*[\r\n])/g;
if (regexEmptyClient.test(icsValue)) {
icsValue = icsValue.replace(regexEmptyClient, newClientKeyValue);
}
let regex = /CLIENT:\d+/;
if (regex.test(icsValue)) {
icsValue = icsValue.replace(regex, newClientKeyValue);
} else {
const customKeyValue = {
"CLIENT": eventComponent.client
};
icsValue = (0,_models_calendarObject_js__WEBPACK_IMPORTED_MODULE_0__.setCustomKeyValuesArrayToIcsAndReturnIcs)(icsValue, customKeyValue);
}
}
if (eventComponent.comment != null) {
let newCommentKeyValue = "COMMENT:" + eventComponent.comment;
let regex = /^COMMENT:.*$/m;
if (regex.test(icsValue)) {
icsValue = icsValue.replace(regex, newCommentKeyValue);
} else {
const customKeyValue = {
"COMMENT": eventComponent.comment
};
icsValue = (0,_models_calendarObject_js__WEBPACK_IMPORTED_MODULE_0__.setCustomKeyValuesArrayToIcsAndReturnIcs)(icsValue, customKeyValue);
}
}
if (eventComponent.isPrivate != null) {
let isPrivateValue = eventComponent.isPrivate ? "1" : "0";
@ -8259,4 +8303,4 @@ function getLinkToConfig(key) {
/***/ })
}]);
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=fcfc2d6839479e13e5cc
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=fcfc2d6839479e13e5cc

File diff suppressed because one or more lines are too long

View File

@ -14454,6 +14454,16 @@ var render = function render() {
"add-single-value": _vm.addArticle,
"remove-single-value": _vm.removeArticle
}
}), _vm._v(" "), _c("PropertyText", {
attrs: {
"is-read-only": _vm.isReadOnly,
"prop-model": _vm.rfcProps.comment,
value: _vm.comment,
"linkify-links": false
},
on: {
"update:value": _vm.updateComment
}
}), _vm._v(" "), _c("InviteesList", {
staticClass: "event-popover__invitees",
attrs: {
@ -17205,7 +17215,7 @@ __webpack_require__.r(__webpack_exports__);
* Returns an object with properties from RFCs including
* their displayName, a description, options, etc.
*
* @return {{geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
* @return {{comment, geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
*/
rfcProps() {
return (0,_models_rfcProps_js__WEBPACK_IMPORTED_MODULE_0__.getRFCProperties)();
@ -17467,6 +17477,17 @@ __webpack_require__.r(__webpack_exports__);
location
});
},
/**
* Updates the comments of this event
*
* @param {string} comment New comments
*/
updateComment(comment) {
this.$store.commit('changeComment', {
calendarObjectInstance: this.calendarObjectInstance,
comment
});
},
/**
* Updates the client of the event
*

View File

@ -118,6 +118,15 @@ export default {
return this.calendarObjectInstance?.embalmer ?? null
},
/**
* Returns the comment or null if the event is still loading
*
* @return {string|null}
*/
comment() {
return this.calendarObjectInstance?.comment ?? null
},
/**
* Returns the isPrivate property
@ -351,7 +360,7 @@ export default {
* Returns an object with properties from RFCs including
* their displayName, a description, options, etc.
*
* @return {{geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
* @return {{comment, geo, color, timeTransparency, description, resources, location, client, categories, accessClass, priority, status, locations, articles, clients,embalmer,embalmers}}
*/
rfcProps() {
return getRFCProperties()
@ -623,6 +632,18 @@ export default {
})
},
/**
* Updates the comments of this event
*
* @param {string} comment New comments
*/
updateComment(comment) {
this.$store.commit('changeComment', {
calendarObjectInstance: this.calendarObjectInstance,
comment,
})
},
/**
* Updates the client of the event
*

View File

@ -62,6 +62,8 @@ const getDefaultEventObject = (props = {}) => Object.assign({}, {
embalmer : null,
//Private
isPrivate: false,
//comment of the event
comment : null,
// description of the event
description: null,
// Access class of the event (PUBLIC, PRIVATE, CONFIDENTIAL)
@ -111,6 +113,7 @@ const mapEventComponentToEventObject = (eventComponent) => {
location: eventComponent.location,
client : "CLIENT",
embalmer : "TEST",
comment : "",
description: eventComponent.description,
accessClass: eventComponent.accessClass,
status: eventComponent.status,
@ -208,6 +211,10 @@ const mapEventComponentToEventObject = (eventComponent) => {
eventObject.embalmer = eventComponent.getFirstPropertyFirstValue('EMBALMER');
}
if(eventComponent.hasProperty('COMMENT')){
eventObject.comment = eventComponent.getFirstPropertyFirstValue('COMMENT');
}
return eventObject;
}
@ -223,6 +230,7 @@ const copyCalendarObjectInstanceIntoEventComponent = (eventObject, eventComponen
eventComponent.client = eventObject.client
eventComponent.embalmer = eventObject.embalmer
eventComponent.isPrivate = eventObject.isPrivate
eventComponent.comment = eventObject.comment
eventComponent.description = eventObject.description
eventComponent.accessClass = eventObject.accessClass
eventComponent.status = eventObject.status

View File

@ -169,6 +169,15 @@ const getRFCProperties = () => {
tagPlaceholder: t('calendar', 'Choisir les soins'),
options: [],
},
comment: {
readableName: t('calendar', 'Comment'),
icon: 'TextBoxOutline',
info: t('calendar', 'Commentaires.'),
placeholder: t('calendar', 'Commentaires'),
tagPlaceholder: t('calendar', 'Commentaires'),
options: [],
defaultNumberOfRows: 4
},
}
}

View File

@ -336,6 +336,19 @@ const mutations = {
calendarObjectInstance.location = location
},
/**
* Change the comment of an event
*
* @param {object} state The Vuex state
* @param {object} data The destructuring object
* @param {object} data.calendarObjectInstance The calendarObjectInstance object
* @param {string} data.comment New comment to set
*/
changeComment(state, { calendarObjectInstance, comment }) {
calendarObjectInstance.eventComponent.comment = comment
calendarObjectInstance.comment = comment
},
/**
* Change the client of an event
*
@ -1703,8 +1716,9 @@ const actions = {
updateAlarms(eventComponent)
updateTalkParticipants(eventComponent)
let additionalFieldWasUpdated =
eventComponent.client != null ||
eventComponent.isPrivate != null ||
eventComponent.client != null;
eventComponent.comment != null ;
if (eventComponent.isDirty() || additionalFieldWasUpdated) {
const isForkedItem = eventComponent.primaryItem !== null
let original = null

View File

@ -230,7 +230,33 @@ const actions = {
if(eventComponent != null){
if(eventComponent.client != null){
let newClientKeyValue = "CLIENT:"+eventComponent.client;
icsValue = icsValue.replace(/CLIENT:\d+/, newClientKeyValue);
let regexEmptyClient = /CLIENT:(?!\d)(?=\s*[\r\n])/g;
if (regexEmptyClient.test(icsValue)) {
icsValue = icsValue.replace(regexEmptyClient, newClientKeyValue);
}
let regex = /CLIENT:\d+/;
if(regex.test(icsValue)){
icsValue = icsValue.replace(regex, newClientKeyValue);
}
else{
const customKeyValue = {
"CLIENT": eventComponent.client
};
icsValue = setCustomKeyValuesArrayToIcsAndReturnIcs(icsValue,customKeyValue);
}
}
if(eventComponent.comment != null){
let newCommentKeyValue = "COMMENT:"+eventComponent.comment;
let regex = /^COMMENT:.*$/m;
if(regex.test(icsValue)){
icsValue = icsValue.replace(regex, newCommentKeyValue);
}
else{
const customKeyValue = {
"COMMENT": eventComponent.comment
};
icsValue = setCustomKeyValuesArrayToIcsAndReturnIcs(icsValue,customKeyValue);
}
}
if(eventComponent.isPrivate != null){
@ -266,7 +292,9 @@ const actions = {
const customKeyValue = {
"CLIENT": eventComponent.client,
"EMBALMER": eventComponent.embalmer ,
"ISPRIVATE": eventComponent.isPrivate ? "1" : "0",};
"ISPRIVATE": eventComponent.isPrivate ? "1" : "0",
"COMMENT": eventComponent.comment
};
icsValue = setCustomKeyValuesArrayToIcsAndReturnIcs(icsValue,customKeyValue);
}
calendarObject.dav = await calendar.dav.createVObject(icsValue);

View File

@ -135,6 +135,13 @@
@add-single-value="addArticle"
@remove-single-value="removeArticle" />
<PropertyText
:is-read-only="isReadOnly"
:prop-model="rfcProps.comment"
:value="comment"
:linkify-links="false"
@update:value="updateComment" />
<InvitationResponseButtons v-if="isViewedByAttendee"
:attendee="userAsAttendee"
:calendar-id="calendarId"

View File

@ -152,6 +152,14 @@
@add-single-value="addArticle"
@remove-single-value="removeArticle" />
<PropertyText
:is-read-only="isReadOnly"
:prop-model="rfcProps.comment"
:value="comment"
:linkify-links="false"
@update:value="updateComment"
/>
<InviteesList class="event-popover__invitees"
:hide-if-empty="true"
:hide-buttons="true"

View File

@ -1988,7 +1988,7 @@ class Bdd {
return true;
}
public function insertDevisFromVCalendarAndReturnId($thanatoId,$clientId,$locationId,$defuntId,$calendarUuid = self::DEFAULT_CALENDAR_UUID_FOR_DEVIS,$date = null,$idNextcloud = "admin"){
public function insertDevisFromVCalendarAndReturnId($thanatoId,$clientId,$locationId,$defuntId,$devisComment,$calendarUuid = self::DEFAULT_CALENDAR_UUID_FOR_DEVIS,$date = null,$idNextcloud = "admin"){
if($date == null){
$dateTime = new Datetime();
@ -2032,7 +2032,7 @@ class Bdd {
$this->l->t('New'),
$locationId,
$this->l->t('Mention'),
$this->l->t('Comment'),
$devisComment,
$last,
$devisNumber,
$devisFullNumber
@ -2933,6 +2933,7 @@ class Bdd {
}
$sql = "SELECT
devis.id,
devis.date,
devis.id_thanato,
devis.id_defunt as defunt_id,
devis.num,
@ -3031,6 +3032,23 @@ class Bdd {
}
}
public function updateDevisComment($devisId,$requestedComment,$currentComment = null){
$commentIsUpdated = $currentComment != $requestedComment;
if($commentIsUpdated){
$sql= "UPDATE ".$this->tableprefix."devis as devis
SET devis.comment = ?
WHERE devis.id = ?";
$this->execSQLNoData($sql,[$requestedComment,$devisId]);
}
}
public function updateDevisDate($devisId,$requestedDate){
$sql= "UPDATE ".$this->tableprefix."devis as devis
SET devis.date = ?
WHERE devis.id = ?";
$this->execSQLNoData($sql,[$requestedDate,$devisId]);
}
public function deleteDevisProduit($devisProductId){
$sql = "DELETE FROM ".$this->tableprefix."produit_devis WHERE id = ?;";
$this->execSQLNoData($sql, array($devisProductId));

View File

@ -30,6 +30,7 @@ use OCA\DAV\Events\CalendarObjectUpdatedEvent;
use OCA\Gestion\Service\GestionService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\IRequest;
use Psr\Log\LoggerInterface;
class CalendarObjectUpdatedListener implements IEventListener {
@ -40,19 +41,25 @@ class CalendarObjectUpdatedListener implements IEventListener {
/** @var GestionService */
private $gestionService;
/** @var IRequest */
private $request;
public function __construct(
IRequest $request,
LoggerInterface $logger,GestionService $gestionService) {
$this->logger = $logger;
$this->gestionService = $gestionService;
$this->request = $request;
}
public function handle(Event $event): void {
if (!($event instanceof CalendarObjectUpdatedEvent)) {
return;
}
$cookie = $this->request->getHeader("Cookie");
$calendarData = $event->getObjectData();
$vCalendarString = $calendarData["calendardata"];
$this->gestionService->HandleUpdatedCalendarObject($vCalendarString);
$this->gestionService->HandleUpdatedCalendarObject($vCalendarString,$cookie);
}
}

View File

@ -197,6 +197,13 @@ class GestionService {
$isPrivateValue = VCalendarHelpers::GetValueFromKeyInVCalendarString(VCalendarPropertyConstant::PROPERTY_IS_LEAVE, $vCalendarString);
return $isPrivateValue === "1" ? true : false;
}
private function GetDevisCommentFromVCalendarString(string $vCalendarString){
$commentValue = VCalendarHelpers::GetValueFromKeyInVCalendarString("COMMENT", $vCalendarString);
if($commentValue == ""){
$commentValue = "Commentaire";
}
return $commentValue;
}
public function HandleCreatedCalendarObject(string $vCalendarString ,$cookie){
try{
@ -227,8 +234,9 @@ class GestionService {
}
$defuntId = $this->gestionBdd->insertDefuntByNameAndReturnId($calendarSummary);
$calendarStartDate = $this->GetCalendarDateFromVCalendarString($vCalendarString);
$devisDate = $calendarStartDate->format('Y-m-d');
$devisId = $this->gestionBdd->insertDevisFromVCalendarAndReturnId($thanatoId,$clientId,$locationId,$defuntId,$calendarUuid,$devisDate,$userName);
$devisComment = $this->GetDevisCommentFromVCalendarString($vCalendarString);
$devisDate = $calendarStartDate->format(format: 'Y-m-d');
$devisId = $this->gestionBdd->insertDevisFromVCalendarAndReturnId($thanatoId,$clientId,$locationId,$defuntId,$devisComment,$calendarUuid,$devisDate,$userName);
$articlesValue = $this->GetArticlesNameFromVCalendarString($vCalendarString);
if(!empty($articlesValue)){
$articleIds = $this->gestionBdd->getArticleIdsByArticleReferences($articlesValue);
@ -355,7 +363,10 @@ class GestionService {
$requestedClientId = $this->GetClientIdFromVCalendarString($vCalendarString);
$requestLocationId = $this->GetLocationIdFromVCalendarString($vCalendarString);
$requestedArticleReferences = $this->GetArticlesNameFromVCalendarString($vCalendarString);
$requestedDevisComment = $this->GetDevisCommentFromVCalendarString($vCalendarString);
$requestedArticleIds = $this->gestionBdd->getArticleIdsByArticleReferences($requestedArticleReferences);
$requestedDevisDate = $this->GetCalendarDateFromVCalendarString($vCalendarString);
$requestedDevisDate = $requestedDevisDate->format('Y-m-d');
$articleDevis = $this->gestionBdd->getProduitDevisByDevisId($devis['id']);
$articleDevisIds = [];
foreach($articleDevis as $currentArticleDevis){
@ -368,6 +379,8 @@ class GestionService {
$devis['defunt_nom'] == $requestedDefuntName &&
$devis['client_id'] == $requestedClientId &&
$devis['lieu_id'] == $requestLocationId &&
$devis['comment'] == $requestedDevisComment &&
$devis['date'] == $requestedDevisDate &&
$requestedArticleIds == $articleDevisIds;
}
@ -382,6 +395,13 @@ class GestionService {
$requestLocationId = $this->GetLocationIdFromVCalendarString($vCalendarString);
$this->gestionBdd->updateDevisLieu($devis['id'],$requestLocationId,$devis['lieu_id']);
$requestedDevisComment = $this->GetDevisCommentFromVCalendarString($vCalendarString);
$this->gestionBdd->updateDevisComment($devis['id'],$requestedDevisComment,$devis['comment']);
$requestedDevisDate = $this->GetCalendarDateFromVCalendarString($vCalendarString);
$requestedDevisDate = $requestedDevisDate->format('Y-m-d');
$this->gestionBdd->updateDevisDate($devis['id'],$requestedDevisDate);
$articlesValue = $this->GetArticlesNameFromVCalendarString($vCalendarString);
if(!empty($articlesValue)){
$articleIds = $this->gestionBdd->getArticleIdsByArticleReferences($articlesValue);
@ -394,17 +414,18 @@ class GestionService {
$calendarUuid = $this->GetCalendarUuidFromVCalendarString($vCalendarString);
$devis = $this->gestionBdd->getDevisByCalendarUuid($calendarUuid);
if($devis != null){
$this->gestionBdd->updateDevisMention($devis['id'],DevisMentionConstant::NEW);
$isDevisAlreadyUpdated = $this->CheckIfDevisIsAlreadyUpdated($devis,$vCalendarString);
if($isDevisAlreadyUpdated){
return true;
}
$devisIsAlreadyFactured = $devis['mentions'] == DevisMentionConstant::FACTURED || $devis['mentions'] == DevisMentionConstant::FACTURED_FORMATTED;
$this->UpdateDevisDataByVCalendarString($devis,$vCalendarString);
$userName = $this->GetThanatoNameFromVCalendarString($vCalendarString);
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devis['id'],$userName);
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$this->userConnectedUuid);
$this->devisPdfService->generateDevisPdfByDevisId($devis['id'],$this->userConnectedUuid);
if($devisIsAlreadyFactured == false){
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devis['id'],$userName);
$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']);