[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [BP][FIX][UX] Calendar: show a setup prompt when no calendars exist

"MAGENE Sem Joel \(@Jomagene\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6a747593eadba_3819f34815410@gitlab-sidekiq-low-urgency-cpu-bound-v2-c84d8dfcb-dvcxm.mail>

MAGENE Sem Joel pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
f34bac76 by MAGENE Sem Joel at 2026-08-06T11:45:09+00:00
[BP][FIX][UX] Calendar: show a setup prompt when no calendars exist
---
* [FIX][UX] Calendar: show a setup prompt when no calendars exist
---
* [FIX][UX] Calendar: show a setup prompt when no calendars exist

See merge request tikiwiki/tiki!10574

(cherry picked from commit 65ec6ff2aae901e10d45f4f4afb0b05eb34ac509)

See merge request tikiwiki/tiki!10600

- - - - -


2 changed files:

- templates/tiki-calendar.tpl
- tiki-calendar.php


Changes:

=====================================
templates/tiki-calendar.tpl
=====================================
@@ -1,4 +1,18 @@
 {include file='token_view_actions.tpl'}
+{if !empty($calendarEmptyState)}
+{title admpage="calendar"}{tr}Calendar{/tr}{/title}
+<div id="calscreen">
+    {remarksbox type="info" title="{tr}No calendars available{/tr}" close="n"}
+        <p>{tr}You don't have any calendars yet.{/tr}</p>
+        {if $tiki_p_admin_calendar eq 'y' or $tiki_p_admin eq 'y' or $tiki_p_admin_private_calendar eq 'y'}
+            <p>{tr}Create a calendar to start adding and viewing events.{/tr}</p>
+            {button href="tiki-admin_calendars.php?cookietab=2" _type="primary" _icon_name="create" _text="{tr}Create Calendar{/tr}"}
+        {else}
+            <p>{tr}Please ask an administrator to create one.{/tr}</p>
+        {/if}
+    {/remarksbox}
+</div>
+{else}
 {title admpage="calendar"}
     {if $displayedcals|@count eq 1}
     {tr}Calendar:{/tr} {$calendars[$displayedcals[0]].displayName|escape}
@@ -119,3 +133,4 @@
 {if $prefs.feature_jscalendar eq 'y'}
     {js_insert_icon type="jscalendar"}
 {/if}
+{/if}


=====================================
tiki-calendar.php
=====================================
@@ -68,12 +68,11 @@ if (! isset($cookietab)) {
 $rawcals = $calendarlib->list_calendars();
 
 if (empty($rawcals['data'])) {
-    if (Perms::get(['type' => 'calendar'])->admin_calendar) {
-        $message = tr('You need to %0create a calendar%1', '<a href="tiki-admin_calendars.php?cookietab=2">', '</a>');
-    } else {
-        $message = tra('No calendars found');
-    }
-    Feedback::errorAndDie($message, \Laminas\Http\Response::STATUS_CODE_404);
+    $smarty->assign('calendarEmptyState', true);
+    $smarty->assign('mid', 'tiki-calendar.tpl');
+    $smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
+    $smarty->display("tiki.tpl");
+    die;
 }
 
 $rawcals['data'] = Perms::filter(



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/f34bac7607e63bbce9b9a72ffcfd1ff4e7d31cda
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.