[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX][UX] Surveys: Improve feedback and error handling in admin actions

"Baraka Kinywa \(@bkinywa24\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68a5a8323e9a2_2c1172e0696c9@gitlab-sidekiq-low-urgency-cpu-bound-v2-78d9d68c78-pfzl6.mail>

Baraka Kinywa pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
6e452638 by MAGENE Sem Joel at 2025-08-20T13:40:22+03:00
[BP][FIX][UX] Surveys: Improve feedback and error handling in admin actions
---
* [FIX][UX] Surveys: Improve feedback and error handling in admin actions
---
* [FIX][UX] Surveys: Improve feedback and error handling in admin actions

See merge request tikiwiki/tiki!8087

(cherry picked from commit 74a239f8f5407719994171d6c859fe0821b33630)

See merge request tikiwiki/tiki!8332

- - - - -


2 changed files:

- templates/tiki-admin_surveys.tpl
- tiki-admin_surveys.php


Changes:

=====================================
templates/tiki-admin_surveys.tpl
=====================================
@@ -76,7 +76,8 @@
                                             <input type="hidden" name="offset" value="{$offset}">
                                             <input type="hidden" name="sort_mode" value="{$sort_mode}">
                                             <input type="hidden" name="remove" value="{$channels[user].surveyId}">
-                                            <button type="submit" class="btn btn-link px-0 pt-0 pb-0" onclick="confirmPopup()" aria-label="{tr}Remove{/tr}">
+                                            <button type="submit" class="btn btn-link px-0 pt-0 pb-0"
+                                            onclick="confirmPopup('{tr}Are you sure you want to delete this survey?{/tr}')" aria-label="{tr}Remove{/tr}">
                                                 {icon name='remove' _menu_text='y' _menu_icon='y' alt="{tr}Remove{/tr}"}
                                             </button>
                                         </form>


=====================================
tiki-admin_surveys.php
=====================================
@@ -53,8 +53,16 @@ if (isset($_REQUEST["save"])) {
         } else {
             $restriction = 'n';
         }
+
+        $isUpdating = ! empty($_REQUEST["surveyId"]);
+
         $sid = $srvlib->replace_survey($_REQUEST["surveyId"], $_REQUEST["name"], $_REQUEST["description"], $restriction, $_REQUEST["status"]);
         if ($sid) {
+            if ($isUpdating) {
+                Feedback::success(tr('Survey updated successfully.'));
+            } else {
+                Feedback::success(tr('Survey created successfully.'));
+            }
             $cat_type = 'survey';
             $cat_objid = is_int($sid) ? $sid : $_REQUEST["surveyId"];
             $cat_desc = substr($_REQUEST["description"], 0, 200);
@@ -81,6 +89,7 @@ if (! empty($_REQUEST["surveyId"])) {
 $smarty->assign('info', $info);
 if (isset($_REQUEST["remove"]) && $access->checkCsrf()) {
     $srvlib->remove_survey($_REQUEST["remove"]);
+    Feedback::success(tr('The survey has been deleted successfully.'));
 }
 if (! isset($_REQUEST["sort_mode"])) {
     $sort_mode = 'created_desc';



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/6e452638e07a44d257083fe46f9404e2574e45ad
You're receiving this email because of your account on gitlab.com.

_______________________________________________
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.