nodebb-plugin-onekite-calendar 2.0.33 → 2.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/api.js
CHANGED
|
@@ -1042,6 +1042,9 @@ api.createReservation = async function (req, res) {
|
|
|
1042
1042
|
start: formatFR(start),
|
|
1043
1043
|
end: formatFR(end),
|
|
1044
1044
|
total: resv.total || 0,
|
|
1045
|
+
// Link to the plugin ACP page so managers can process the request quickly.
|
|
1046
|
+
// Kept as `adminUrl` to match the email template placeholder.
|
|
1047
|
+
adminUrl: `${normalizeBaseUrl(meta)}/admin/plugins/calendar-onekite`,
|
|
1045
1048
|
});
|
|
1046
1049
|
}
|
|
1047
1050
|
}
|
package/lib/helloassoWebhook.js
CHANGED
|
@@ -313,6 +313,12 @@ async function handler(req, res, next) {
|
|
|
313
313
|
const requesterUid = parseInt(r.uid, 10);
|
|
314
314
|
const requester = await user.getUserFields(requesterUid, ['username']);
|
|
315
315
|
if (requesterUid) {
|
|
316
|
+
const latNum = Number(r.pickupLat);
|
|
317
|
+
const lonNum = Number(r.pickupLon);
|
|
318
|
+
const mapUrl = (Number.isFinite(latNum) && Number.isFinite(lonNum))
|
|
319
|
+
? `https://www.openstreetmap.org/?mlat=${encodeURIComponent(String(latNum))}&mlon=${encodeURIComponent(String(lonNum))}#map=18/${encodeURIComponent(String(latNum))}/${encodeURIComponent(String(lonNum))}`
|
|
320
|
+
: '';
|
|
321
|
+
|
|
316
322
|
await sendEmail('calendar-onekite_paid', requesterUid, 'Location matériel - Paiement reçu', {
|
|
317
323
|
uid: requesterUid,
|
|
318
324
|
username: requester && requester.username ? requester.username : '',
|
|
@@ -320,6 +326,8 @@ async function handler(req, res, next) {
|
|
|
320
326
|
itemNames: (Array.isArray(r.itemNames) ? r.itemNames : (r.itemName ? [r.itemName] : [])),
|
|
321
327
|
dateRange: `Du ${formatFR(r.start)} au ${formatFR(r.end)}`,
|
|
322
328
|
paymentReceiptUrl: r.paymentReceiptUrl || '',
|
|
329
|
+
pickupAddress: r.pickupAddress || '',
|
|
330
|
+
mapUrl,
|
|
323
331
|
});
|
|
324
332
|
}
|
|
325
333
|
|
|
@@ -346,4 +354,4 @@ async function handler(req, res, next) {
|
|
|
346
354
|
|
|
347
355
|
module.exports = {
|
|
348
356
|
handler,
|
|
349
|
-
};
|
|
357
|
+
};
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p>Bonjour {username},</p>
|
|
2
|
-
<p>Votre réservation
|
|
2
|
+
<p>Votre réservation est validée. Veuillez procéder à son règlement.</p>
|
|
3
3
|
|
|
4
4
|
<!-- IF validatedBy -->
|
|
5
5
|
<p><strong>Validée par :</strong> <a href="{validatedByUrl}">{validatedBy}</a></p>
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
<!-- IF pickupTime -->
|
|
18
18
|
<p><strong>Heure de récupération :</strong> {pickupTime}</p>
|
|
19
|
+
|
|
20
|
+
<!-- IF pickupAddress -->
|
|
21
|
+
<p><strong>Adresse :</strong> {pickupAddress}</p>
|
|
22
|
+
<!-- ENDIF pickupAddress -->
|
|
19
23
|
<!-- ENDIF pickupTime -->
|
|
20
24
|
|
|
21
25
|
<!-- IF pickupAddress -->
|
|
@@ -23,7 +27,7 @@
|
|
|
23
27
|
<!-- ENDIF pickupAddress -->
|
|
24
28
|
|
|
25
29
|
<!-- IF mapUrl -->
|
|
26
|
-
<p style="font-size: 12px; color: #666;">Voir sur la carte
|
|
30
|
+
<p style="font-size: 12px; color: #666;"><strong>Voir sur la carte :</strong> <a href="{mapUrl}">OpenStreetMap</a</p>
|
|
27
31
|
<!-- ENDIF mapUrl -->
|
|
28
32
|
|
|
29
33
|
<!-- IF notes -->
|
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
<p>{dateRange}</p>
|
|
12
12
|
|
|
13
|
+
|
|
14
|
+
<!-- IF pickupAddress -->
|
|
15
|
+
<p><strong>Adresse :</strong> {pickupAddress}</p>
|
|
16
|
+
<!-- ENDIF pickupAddress -->
|
|
17
|
+
|
|
18
|
+
<!-- IF mapUrl -->
|
|
19
|
+
<p style="font-size: 12px; color: #666;"><strong>Voir sur la carte :</strong> <a href="{mapUrl}">OpenStreetMap</a></p>
|
|
20
|
+
<!-- ENDIF mapUrl -->
|
|
13
21
|
<!-- IF paymentReceiptUrl -->
|
|
14
22
|
<p><strong>Reçu :</strong> <a href="{paymentReceiptUrl}">{paymentReceiptUrl}</a></p>
|
|
15
23
|
<!-- ENDIF paymentReceiptUrl -->
|