[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Calendar: make the selected calendar the default option in the calendar...

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]> Wed, 08 Jul 2026 18:22:49 +0000
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a4e9579329da_3719b8b013724@gitlab-sidekiq-low-urgency-cpu-bound-v2-74875cdbb9-vm6x7.mail>

Adrien Mbuya Maloba pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
2d59efeb by franck franck kalunga at 2026-07-08T21:01:45+03:00
[FIX] Calendar: make the selected calendar the default option in the calendar field of the event creation form
---
* [FIX] Make the selected calendar the default option in the calendar field of the event creation form

See merge request tikiwiki/tiki!10661

- - - - -


2 changed files:

- src/js/jquery-tiki/tiki-calendar.js
- templates/tiki-calendar.tpl


Changes:

=====================================
src/js/jquery-tiki/tiki-calendar.js
=====================================
@@ -10,7 +10,8 @@ $.fn.setupEventCalendar = function (
     targetId = "calendar",
     urlEventSource = "tiki-ajax_services.php?controller=calendar&action=list_items",
     returnUrl = "tiki-calendar.php",
-    associatedWikiPage = null
+    associatedWikiPage = null,
+    defaultCalendarId = null
 ) {
     let isOpeningModal = false;
     this.each(function () {
@@ -57,6 +58,7 @@ $.fn.setupEventCalendar = function (
                     prefill_start: prefillStart,
                     modal: 1,
                     return_url: returnUrl,
+                    defaultCalendarId: defaultCalendarId,
                 };
 
                 if (browserTimezone) {
@@ -679,7 +681,8 @@ $.fn.defineParameterOfMultipleCalendar = function (
     moduleCalendarFocusdate,
     linkToFindItemsOfCalendar,
     associatedWikiPage,
-    returnUrl
+    returnUrl,
+    defaultCalendarId = null
 ) {
     let paramOfModuleCalendar = eventCalendarParams;
 
@@ -729,7 +732,8 @@ $.fn.defineParameterOfMultipleCalendar = function (
             "calendar-" + takeIndex,
             linkToFindItemsOfCalendar,
             returnUrl,
-            associatedWikiPage
+            associatedWikiPage,
+            defaultCalendarId
         );
         if (pdf_export == "y" && pdf_warning == "n") {
             const printButton = $('<a href="#" class="text-end d-none" role="button"> Export as PDF</a>').attr("id", "calendar-pdf-btn-" + takeIndex);


=====================================
templates/tiki-calendar.tpl
=====================================
@@ -122,10 +122,9 @@
             {else}
                 {jq}
                     var printingParams = {pdf_export: '{{$pdf_export}}', pdf_warning: '{{$pdf_warning}}', pref_print_pdf_from_url: '{{$prefs.print_pdf_from_url}}'};
-                    $('.calendar-container').defineParameterOfMultipleCalendar({{$eventCalendarParams|json_encode}}, printingParams, '.calendar-container', {{$eventCalendarParams.initialDate|json_encode}}, undefined, undefined, undefined);
+                    $('.calendar-container').defineParameterOfMultipleCalendar({{$eventCalendarParams|json_encode}}, printingParams, '.calendar-container', {{$eventCalendarParams.initialDate|json_encode}}, undefined, undefined, undefined, {{$defaultCalendarId}});
                 {/jq}
             {/if}
-            
             <div class='calendar-container'></div>
         </div>
         



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2d59efeb5390ad06668f38cdd03c58757b433ece

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2d59efeb5390ad06668f38cdd03c58757b433ece
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs