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

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68a327619e902_2cd6cb8806b@gitlab-sidekiq-low-urgency-cpu-bound-v2-5b8f9fb769-znpmh.mail>

luci pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
74a239f8 by MAGENE Sem Joel at 2025-08-18T13:07:11+00:00
[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

- - - - -


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/74a239f8f5407719994171d6c859fe0821b33630

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/74a239f8f5407719994171d6c859fe0821b33630
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.