[TikiWiki-commits] [Git][tikiwiki/tiki][28.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 | <68a5b20b56826_2c27ddbb8225ae@gitlab-sidekiq-low-urgency-cpu-bound-v2-78d9d68c78-dcrwb.mail> |
Baraka Kinywa pushed to branch 28.x at Tiki Wiki CMS Groupware / Tiki
Commits:
1f054d6f by MAGENE Sem Joel at 2025-08-20T14:24:41+03:00
[BP][FIX][UX] Surveys: Improve feedback and error handling in admin actions
---
* [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
(cherry picked from commit 6e452638e07a44d257083fe46f9404e2574e45ad)
See merge request tikiwiki/tiki!8341
- - - - -
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()">
+ <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/1f054d6f9dd7c8ae44a8a019555e225f4a2603f5
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/1f054d6f9dd7c8ae44a8a019555e225f4a2603f5
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