Merge branch 'releases/release-h2f-prod' of https://gitlab.com/ezwaytechnology/nextcloud_custom_apps into releases/release-h2f-prod
This commit is contained in:
commit
a776078b2f
@ -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":"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":"870a881bc445f47fd3e0","src_store_index_js":"748ab31152e1226f9b22","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"8bfde7d389740c269cd6","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":"870a881bc445f47fd3e0","src_store_index_js":"2be5b7fbd170f137419b","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"8bfde7d389740c269cd6","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=fd08a5d56f376e2cd30d
|
||||
//# sourceMappingURL=calendar-dashboard.js.map?v=0a024ce546d1ab440f8d
|
||||
File diff suppressed because one or more lines are too long
@ -22527,6 +22527,7 @@ var render = function render() {
|
||||
}
|
||||
}), _vm._v(" "), _c("div", {
|
||||
staticStyle: {
|
||||
"margin-top": "13px",
|
||||
display: "flex",
|
||||
"margin-left": "8px"
|
||||
}
|
||||
@ -329105,4 +329106,4 @@ appointmentsConfigsStore.addInitialConfigs((0,_nextcloud_initial_state__WEBPACK_
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=calendar-main.js.map?v=53edc8d1594b2ef14b12
|
||||
//# sourceMappingURL=calendar-main.js.map?v=223cd85da337d0560a98
|
||||
File diff suppressed because one or more lines are too long
@ -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":"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":"870a881bc445f47fd3e0","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"8bfde7d389740c269cd6","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"297f1f42ac74bad32e69","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"748ab31152e1226f9b22","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":"870a881bc445f47fd3e0","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"8bfde7d389740c269cd6","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"297f1f42ac74bad32e69","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"2be5b7fbd170f137419b","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=c50a6845f9eb0b6964ef
|
||||
//# sourceMappingURL=calendar-reference.js.map?v=33465db446709d12e4ed
|
||||
File diff suppressed because one or more lines are too long
@ -8423,4 +8423,4 @@ function getLinkToConfig(key) {
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=748ab31152e1226f9b22
|
||||
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=2be5b7fbd170f137419b
|
||||
File diff suppressed because one or more lines are too long
@ -105,7 +105,7 @@
|
||||
|
||||
|
||||
|
||||
<div style='display:flex ;margin-left: 8px;'>
|
||||
<div style='margin-top: 13px; display:flex ;margin-left: 8px;'>
|
||||
<div style='width:70%'>
|
||||
<PropertySelectAbsenceType
|
||||
:value="absenceType"
|
||||
|
||||
8
gestion/lib/Constants/GeoConstant.php
Normal file
8
gestion/lib/Constants/GeoConstant.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace OCA\Gestion\Constants;
|
||||
abstract class GeoConstant
|
||||
{
|
||||
const DRIVING_MODE = "drive";
|
||||
}
|
||||
@ -242,7 +242,7 @@ class OrderController extends Controller {
|
||||
public function exportOrderToPdf($orderId) {
|
||||
try{
|
||||
$factureFilenames = $this->orderPdfService->generateOrderPdfByOrderId($orderId,$this->idNextcloud);
|
||||
return json_encode($factureFilenames);
|
||||
return json_encode($factureFilenames["filenames"]);
|
||||
}
|
||||
catch(\OCP\Files\NotFoundException $e) { }
|
||||
}
|
||||
|
||||
@ -130,7 +130,10 @@ class DevisPdfService {
|
||||
$storage->newFile($ff_pdf);
|
||||
$file_pdf = $storage->get($ff_pdf);
|
||||
$file_pdf->putContent($pdfContent);
|
||||
$filenames[] = $ff_pdf;
|
||||
$filenames[] = [
|
||||
"name" => $pdfFilename.'.pdf',
|
||||
"path" => $ff_pdf,
|
||||
];
|
||||
}
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
@ -233,6 +233,8 @@ class GestionService {
|
||||
//Nothing to do manage fo a private calendar
|
||||
return;
|
||||
}
|
||||
$orderContent = [];
|
||||
$attachmentsCalendar = [];
|
||||
|
||||
$thanato = $this->GetThanatoFromVCalendarString($vCalendarString);
|
||||
if($thanato != null){
|
||||
@ -269,33 +271,30 @@ class GestionService {
|
||||
$order = $this->orderBdd->getOrderByDevisId($devisId);
|
||||
$this->logger->debug(json_encode($order));
|
||||
if($order != null){
|
||||
$this->orderPdfService->generateOrderPdfByOrderId($order['id'],$this->userConnectedUuid);
|
||||
$orderPdf = $this->orderPdfService->generateOrderPdfByOrderId($order['id'],$this->userConnectedUuid);
|
||||
if (!empty($orderPdf['content'])) {
|
||||
$orderContent[] = $orderPdf['content'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$devisTalkMessage = $this->gestionBdd->getDevisTalkRoomMessage($devisId,$userName);
|
||||
$this->talkService->sendDevisTalkNotifications($devisTalkMessage,$userName,$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){
|
||||
|
||||
//Move calendar attachment file to defunt folder
|
||||
$devisExist = $devis != null && $devis["client_entreprise"] != null;
|
||||
if (VCalendarHelpers::hasAttachment($vCalendarString)) {
|
||||
if($devisExist){
|
||||
$destinationFolderAttachment = FolderHelpers::GetDefuntFolder($devis["client_entreprise"],$devis["defunt_nom"]);
|
||||
$attachments = VCalendarHelpers::extractAttachments($vCalendarString);
|
||||
$attachmentsCalendar = VCalendarHelpers::extractAttachments($vCalendarString);
|
||||
$this->moveCalendarAttachmentFile($attachmentsCalendar,$destinationFolderAttachment);
|
||||
|
||||
|
||||
|
||||
$this->moveCalendarAttachmentFile($attachments,$destinationFolderAttachment);
|
||||
if ($thanatoIsSubcontractor) {
|
||||
$thanatoHasEmail = $thanato["thanato_email"] != null;
|
||||
if($thanatoHasEmail){
|
||||
$emailBody = $this->extractBodyOfEmailAttachment(VCalendarHelpers::getEmailIdInVCalendar($vCalendarString));
|
||||
$this->sendEmailAndAttachment($thanato["thanato_email"] , $devis["defunt_nom"],$emailBody ,$attachments);
|
||||
}
|
||||
}else {
|
||||
if (!$thanatoIsSubcontractor) {
|
||||
$roomToken = $this->talkService->getRoomTokenBeetwenTwoUser($this->userConnectedUuid, $userName);
|
||||
if($roomToken != null){
|
||||
foreach ( $attachments as $attachment) {
|
||||
foreach ( $attachmentsCalendar as $attachment) {
|
||||
$this->userConnectedStorage->getFullPath("/");
|
||||
$path = Filesystem::getPath($attachment['file_id']);
|
||||
$destination = 'Talk/';
|
||||
@ -304,10 +303,18 @@ class GestionService {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($thanatoIsSubcontractor && $devisExist) {
|
||||
$thanatoHasEmail = $thanato["thanato_email"] != null;
|
||||
if($thanatoHasEmail){
|
||||
$emailBody = $this->extractBodyOfEmailAttachment(VCalendarHelpers::getEmailIdInVCalendar($vCalendarString));
|
||||
$this->sendEmailAndAttachment($thanato["thanato_email"] , $devis["defunt_nom"],$emailBody ,$attachmentsCalendar ,$orderContent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->gestionBdd->createDevisTrajetFromVCalendar($devisId,$userName);
|
||||
}
|
||||
catch(Exception $e){
|
||||
@ -501,8 +508,10 @@ class GestionService {
|
||||
$this->logger->debug("error creating devis");
|
||||
}
|
||||
}
|
||||
|
||||
private function extractBodyOfEmailAttachment($emailId){
|
||||
if ( $emailId == null || $emailId == '') {
|
||||
return [];
|
||||
}
|
||||
$messageId = (int) $emailId;
|
||||
try {
|
||||
$message = $this->mailManager->getMessage($this->currentUserId, $messageId);
|
||||
@ -510,7 +519,10 @@ class GestionService {
|
||||
$account = $this->accountService->find($this->currentUserId, $mailbox->getAccountId());
|
||||
|
||||
} catch (DoesNotExistException $e) {
|
||||
|
||||
return [];
|
||||
}
|
||||
if ($account == null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$client = $this->clientFactory->getClient($account);
|
||||
@ -526,10 +538,14 @@ class GestionService {
|
||||
$client->logout();
|
||||
}
|
||||
|
||||
return $fullMessage["body"] ?? '';
|
||||
return [
|
||||
"body" => $fullMessage["body"] ?? '',
|
||||
"subject" => $fullMessage["subject"] ?? '',
|
||||
'from' => $fullMessage["from"] ? $fullMessage["from"]['label'] : '',
|
||||
];
|
||||
}
|
||||
|
||||
public function sendEmailAndAttachment($to , $defunt_nom ,$emailBody = '' ,$attachments = []){
|
||||
public function sendEmailAndAttachment($to , $defunt_nom ,$emailBody = [] ,$attachmentsCalendar = [] ,$attachmentOrderContent = []){
|
||||
$this->userConnectedStorage->getFullPath("/");
|
||||
$subject = "Piece jointe";
|
||||
$body = "
|
||||
@ -537,17 +553,30 @@ class GestionService {
|
||||
<p>Vous trouverez ci-dessous l'email et le(s) pièce(s) jointe(s) de « $defunt_nom ».</p>
|
||||
<p>Vous en souhaitant bonne réception</p>
|
||||
|
||||
<div>$emailBody</div>";
|
||||
<div>" . ($emailBody['from'] ?? '') . "</div>
|
||||
<div>" . ($emailBody['subject'] ?? '') . "</div>
|
||||
<div>" . ($emailBody['body'] ?? '') . "</div>";
|
||||
|
||||
$message = $this->mailer->createMessage();
|
||||
$message->setSubject($subject);
|
||||
$message->setTo(recipients: [$to]);
|
||||
|
||||
foreach ($attachments as $attachment) {
|
||||
foreach ($attachmentsCalendar as $attachment) {
|
||||
$path = Filesystem::getPath($attachment['file_id']) ;
|
||||
$content = $this->mailer->createAttachment( Filesystem::file_get_contents($path),$attachment['name'],$attachment['mime_type']);
|
||||
$content = $this->mailer->createAttachment( Filesystem::file_get_contents($path), ($attachment['name'] ?? null),($attachment['mime_type']) ?? null);
|
||||
$message->attach($content);
|
||||
}
|
||||
foreach ($attachmentOrderContent as $orderContent) {
|
||||
$content = $this->mailer->createAttachment( $orderContent ,"bdc.pdf", "application/pdf");
|
||||
$message->attach($content);
|
||||
}
|
||||
|
||||
$senderEmailAddress = $this->config->getSystemValue('mail_from_address') ?? null;
|
||||
$senderEmailDomain = $this->config->getSystemValue('mail_domain') ?? null;
|
||||
if($senderEmailAddress && $senderEmailDomain){
|
||||
$senderEmail = $senderEmailAddress.'@'.$senderEmailDomain;
|
||||
$message->setCc([$senderEmail]);
|
||||
}
|
||||
|
||||
$message->setHtmlBody($body);
|
||||
|
||||
|
||||
@ -172,7 +172,10 @@ class OrderPdfService {
|
||||
$pdf->SetOrderContent();
|
||||
$pdfContent = $pdf->Output('','S');
|
||||
$pdfFilename = $this->GetOrderFilename($orderPdfData);
|
||||
$filenames = [];
|
||||
$filenames = [
|
||||
"content" => $pdfContent,
|
||||
"filenames" => [],
|
||||
];
|
||||
foreach($orderFolders as $folder){
|
||||
try {
|
||||
$storage->newFolder($folder);
|
||||
@ -183,7 +186,7 @@ class OrderPdfService {
|
||||
$storage->newFile($ff_pdf);
|
||||
$file_pdf = $storage->get($ff_pdf);
|
||||
$file_pdf->putContent($pdfContent);
|
||||
$filenames[] = $ff_pdf;
|
||||
$filenames["filenames"][] = $ff_pdf;
|
||||
}
|
||||
return $filenames;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user