[TikiWiki-commits] [Git][tikiwiki/tiki][master ] [FIX] Credits: show last 10 years (current → current-9) in Historical Usage Report

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

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


Commits:
3103c829 by Doddy MATABARO at 2025-09-15T13:55:10+00:00
[FIX] Credits: show last 10 years (current → current-9) in Historical Usage Report
---
* [FIX] Credits: show last 10 years (current → current-9) in Historical Usage Report

See merge request tikiwiki/tiki!8395

- - - - -


1 changed file:

- templates/include_credits_usage_report.tpl


Changes:

=====================================
templates/include_credits_usage_report.tpl
=====================================
@@ -1,25 +1,43 @@
 <h2>{tr}Historical Usage Report{/tr}</h2>
 <form method="post" action="{$page}">
+    {ticket}
     <input type="hidden" name="userfilter" value="{$userfilter|escape}">
     <div class="container">
         <div class="row align-items-start mb-4">
             <div class="col-md-6">
                 <div class="form-group">
-                    <label for="startDate" class="form-label sr-only">{tr}Start Date{/tr}</label>
-                    {html_select_date time=$startDate prefix="startDate_" end_year="-10" day_value_format="%02d" field_order=$prefs.display_field_order}
+                    <label class="form-label sr-only">{tr}Start Date{/tr}</label>
+                    {html_select_date
+                        time=$startDate
+                        prefix="startDate_"
+                        start_year="-9"
+                        end_year="+0"
+                        reverse_years=true
+                        day_value_format="%02d"
+                        field_order=$prefs.display_field_order
+                    }
                 </div>
                 <div class="form-group">
-                    <label for="endDate" class="form-label sr-only">{tr}End Date{/tr}</label>
-                    {html_select_date time=$endDate prefix="endDate_" end_year="-10" day_value_format="%02d" field_order=$prefs.display_field_order}
+                    <label class="form-label sr-only">{tr}End Date{/tr}</label>
+                    {html_select_date
+                        time=$endDate
+                        prefix="endDate_"
+                        start_year="-9"
+                        end_year="+0"
+                        reverse_years=true
+                        day_value_format="%02d"
+                        field_order=$prefs.display_field_order
+                    }
                 </div>
             </div>
+
             <div class="col-md-6 row">
                 <div class="col-md-8">
                     <label for="actionType" class="form-label sr-only">{tr}Action Type{/tr}</label>
                     <select class="form-select" name="action_type" id="actionType">
                         <option value="">{tr}all types{/tr}</option>
                         {foreach key=id item=data from=$credit_types}
-                            <option value="{$id}" {if $act_type eq '{$id}'}selected="selected"{/if}>{$id|escape}</option>
+                            <option value="{$id|escape}" {if $act_type eq $id}selected="selected"{/if}>{$id|escape}</option>
                         {/foreach}
                     </select>
                 </div>
@@ -27,28 +45,27 @@
                     <button class="btn btn-primary w-100" type="submit">{tr}Filter{/tr}</button>
                 </div>
             </div>
-
         </div>
+
         <div class="table-responsive">
             <table class="table table-striped table-hover">
                 <thead>
-                <tr>
-                    <th scope="col">{tr}Type{/tr}</th>
-                    <th scope="col">{tr}Usage Date{/tr}</th>
-                    <th scope="col" colspan="2">{tr}Amount Used{/tr}</th>
-                </tr>
-                </thead>
-                <tbody>
-                {foreach item=con_data from=$consumption_data}
                     <tr>
-                        <td>{$con_data.credit_type}</td>
-                        <td>{$con_data.usage_date|date_format:"%d-%m-%Y %H:%M:%S"}</td>
-                        <td colspan="2">{$con_data.used_amount}</td>
+                        <th scope="col">{tr}Type{/tr}</th>
+                        <th scope="col">{tr}Usage Date{/tr}</th>
+                        <th scope="col">{tr}Amount Used{/tr}</th>
                     </tr>
-                {/foreach}
+                </thead>
+                <tbody>
+                    {foreach item=con_data from=$consumption_data}
+                        <tr>
+                            <td>{$con_data.credit_type|escape}</td>
+                            <td>{$con_data.usage_date|date_format:"%d-%m-%Y %H:%M:%S"}</td>
+                            <td>{$con_data.used_amount|escape}</td>
+                        </tr>
+                    {/foreach}
                 </tbody>
             </table>
         </div>
-
     </div>
 </form>



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

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