[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] tiki-admin_notifications.php : Make it easier to find where to edit...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68c842be62df3_2cde8f0103627@gitlab-sidekiq-low-urgency-cpu-bound-v2-679dd6fdf9-r9g2d.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
de2d10a9 by Alain Cisirika at 2025-09-15T16:37:38+00:00
[FIX] tiki-admin_notifications.php : Make it easier to find where to edit email notifications to changes in trackers
---
* [FIX] tiki-admin_notifications.php : Make it easier to find where to edit email notifications to changes in trackers (Copy activity to email for a whole tracker)

See merge request tikiwiki/tiki!8216

- - - - -


4 changed files:

- lib/core/Services/Tracker/Controller.php
- lib/smarty_tiki/BlockHandler/AccordionGroup.php
- templates/tiki-admin_notifications.tpl
- templates/tracker/replace.tpl


Changes:

=====================================
lib/core/Services/Tracker/Controller.php
=====================================
@@ -2155,6 +2155,10 @@ class Services_Tracker_Controller
 
     public function action_replace($input)
     {
+        // This variable indicates which accordion_group to activate in the Smarty .tpl file
+        // when the user uses this method. By default, its value is set to 1.
+        $accordion_pos = $input->accordion_pos->int() ?? 1;
+
         $trackerId = $input->trackerId->int();
         $confirm = $input->confirm->int();
 
@@ -2229,6 +2233,7 @@ class Services_Tracker_Controller
         }
 
         return [
+            'accordion_pos' => $accordion_pos,
             'title' => $trackerId ? tr('Edit') . " " . tr('%0', $definition->getConfiguration('name')) : tr('Create Tracker'),
             'trackerId' => $trackerId,
             'info' => $info,


=====================================
lib/smarty_tiki/BlockHandler/AccordionGroup.php
=====================================
@@ -44,8 +44,13 @@ class AccordionGroup extends Base
         $title = smarty_modifier_escape($params['title']);
         $id = $accordion_current_group . '-' . ++$accordion_position;
 
-        $first = ($accordion_position == 1) ? 'show' : '';
-        $expanded = ($accordion_position == 1) ? 'true' : 'false';
+        if (! empty($params['accordion_pos'])) {
+            $first = ($accordion_position == $params['accordion_pos']) ? 'show' : '';
+            $expanded = ($accordion_position == $params['accordion_pos']) ? 'true' : 'false';
+        } else {
+            $first = ($accordion_position == 1) ? 'show' : '';
+            $expanded = ($accordion_position == 1) ? 'true' : 'false';
+        }
 
         return <<<CONTENT
     <div class="card card-accordian">


=====================================
templates/tiki-admin_notifications.tpl
=====================================
@@ -166,7 +166,11 @@
         <table class="table">
             {section name=ix loop=$trackers}
                 <tr>
-                    <td><a href="tiki-list_trackers.php?trackerId={$trackers[ix].trackerId}">{$trackers[ix].value|escape}</a></td>
+                    <td>
+                        <a href="{service controller=tracker action=replace trackerId=$trackers[ix].trackerId accordion_pos=6 modal=true}" 
+                        data-bs-toggle="modal" data-backdrop="static" data-bs-target="#bootstrap-modal" 
+                        onclick="$('[data-bs-toggle=popover]').popover('hide');">{$trackers[ix].value|escape}</a>
+                    </td>
                 </tr>
             {/section}
         </table>


=====================================
templates/tracker/replace.tpl
=====================================
@@ -8,7 +8,7 @@
 
 <form method="post" action="{service controller=tracker action=replace}">
     {accordion}
-        {accordion_group title="{tr}General{/tr}"}
+        {accordion_group title="{tr}General{/tr}" accordion_pos=$accordion_pos}
             <div class="mb-3 mx-0">
                 <label for="name">{tr}Name{/tr}</label>
                 <input class="form-control" type="text" name="name" id="name" value="{$info.name|escape}" required="required">
@@ -33,22 +33,24 @@
                 <input class="form-control" type="text" name="permName" id="permName" value="{$info.permName|escape}">
                 {tr}Required for Advanced Shopping Cart and some other tracker features, do not change this unless you are sure.{/tr}
             </div>
-            {jq}$("#name").on("change", function() {
-    if ($("#name").val()) {
-        const prefix = $("#fieldPrefix")
-        if (! prefix.val()) {
-            prefix.val($("#name").val().replace(/s$/, "").replace(/\W/g, "").toLowerCase());
-            prefix.next('el-input').attr("value", prefix.val());
-        }
-        const permName = $("#permName")
-        if (! permName.val()) {
-            permName.val($("#name").val().replace(/s$/, "").replace(/\W/g, "").toLowerCase());
-            permName.next('el-input').attr("value", permName.val());
-        }
-    }
-});{/jq}
+            {jq}
+                $("#name").on("change", function() {
+                    if ($("#name").val()) {
+                        const prefix = $("#fieldPrefix")
+                        if (! prefix.val()) {
+                            prefix.val($("#name").val().replace(/s$/, "").replace(/\W/g, "").toLowerCase());
+                            prefix.next('el-input').attr("value", prefix.val());
+                        }
+                        const permName = $("#permName")
+                        if (! permName.val()) {
+                            permName.val($("#name").val().replace(/s$/, "").replace(/\W/g, "").toLowerCase());
+                            permName.next('el-input').attr("value", permName.val());
+                        }
+                    }
+                });
+            {/jq}
         {/accordion_group}
-        {accordion_group title="{tr}Features{/tr}"}
+        {accordion_group title="{tr}Features{/tr}" accordion_pos=$accordion_pos}
             <div class="form-check">
                 <input type="checkbox" class="form-check-input" name="allowOffline" value="1"
                     {if $info.allowOffline eq 'y'} checked="checked"{/if}>
@@ -138,7 +140,7 @@
                 </div>
             {/if}
         {/accordion_group}
-        {accordion_group title="{tr}Display{/tr}"}
+        {accordion_group title="{tr}Display{/tr}" accordion_pos=$accordion_pos}
             <div class="mb-3 mx-0">
                 <label class="col-form-label" for="logo">{tr}Logo{/tr}</label>
                 <input class="form-control" type="text" name="logo" id="logo" value="{$info.logo|escape}">
@@ -250,7 +252,7 @@
                 </label>
             </div>
         {/accordion_group}
-    {accordion_group title="{tr}Section Format{/tr}"}
+    {accordion_group title="{tr}Section Format{/tr}" accordion_pos=$accordion_pos}
                 <div class="mb-3 mx-0">
                     <label for="sectionFormat">{tr}Section format{/tr}</label>
                     <select name="sectionFormat" id="sectionFormat" class="form-select">
@@ -291,7 +293,7 @@
                     </div>
                 </div>
     {/accordion_group}
-        {accordion_group title="{tr}Status{/tr}"}
+        {accordion_group title="{tr}Status{/tr}" accordion_pos=$accordion_pos}
             <div class="mb-3 mx-0">
                 <label for="newItemStatus">{tr}New item status{/tr}</label>
                 <select name="newItemStatus" id="newItemStatus" class="form-select">
@@ -343,7 +345,7 @@
 
             </div>
         {/accordion_group}
-        {accordion_group title="{tr}Notifications{/tr}"}
+        {accordion_group title="{tr}Notifications{/tr}" accordion_pos=$accordion_pos}
             <div class="mb-3 mx-0">
                 <label for="outboundEmail">{tr}Copy activity to email{/tr}</label>
                 <input name="outboundEmail" id="outboundEmail" value="{$info.outboundEmail|escape}" class="email_multi form-control" size="60">
@@ -403,7 +405,7 @@
                 </div>
             {/if}
         {/accordion_group}
-        {accordion_group title="{tr}Permissions{/tr}"}
+        {accordion_group title="{tr}Permissions{/tr}" accordion_pos=$accordion_pos}
             <div class="form-check">
                 <input type="checkbox" class="form-check-input" name="userCanSeeOwn" id="userCanSeeOwn" value="1"
                                            {if $info.userCanSeeOwn eq 'y'}checked="checked"{/if}>
@@ -528,7 +530,7 @@
             </fieldset>
         {/accordion_group}
         {if $prefs.feature_categories eq 'y'}
-            {accordion_group title="{tr}Categories{/tr}"}
+            {accordion_group title="{tr}Categories{/tr}" accordion_pos=$accordion_pos}
                 <div class="mb-3 mx-0">
                     {include file='categorize.tpl' notable=y auto=y}
                 </div>
@@ -590,7 +592,7 @@
             {/accordion_group}
         {/if}
         {if $prefs.tracker_tabular_enabled eq 'y' and $remoteTabulars}
-            {accordion_group title="{tr}Remote synchronization{/tr}"}
+            {accordion_group title="{tr}Remote synchronization{/tr}" accordion_pos=$accordion_pos}
                 <div class="mb-3 mx-0">
                     <label for="tabularSync">{tr}Choose import-export format(s){/tr}</label>
                     <select name="tabularSync" id="tabularSync" class="form-control" multiple="multiple">



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

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