[Bps-public-commit] rtx-calendar branch add-new-features-to-calendar updated. 1.05-6-g10f443b
BPS Git Server
git at git.bestpractical.com
Thu Aug 17 20:32:18 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rtx-calendar".
The branch, add-new-features-to-calendar has been updated
via 10f443b5ceebb659b2a5059429cd594339c46335 (commit)
from 5c6a9fd71ac85a15a869b1b821586fccb3949abf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 10f443b5ceebb659b2a5059429cd594339c46335
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date: Thu Aug 17 17:32:10 2023 -0300
Add Statuses Filter to the Calendar
diff --git a/html/Elements/CalendarFilter b/html/Elements/CalendarFilter
new file mode 100644
index 0000000..bb0f4a0
--- /dev/null
+++ b/html/Elements/CalendarFilter
@@ -0,0 +1,56 @@
+<%args>
+$Month
+$Year
+$QueryString
+$rtdate
+</%args>
+<div class="container col-12 mt-1 mb-1">
+ <div class="row align-items-center">
+ <div class="col-1 text-left">
+% my ($PMonth, $PYear) = ($Month - 1, $Year);
+% if ($PMonth < 0) {
+% $PYear--;
+% $PMonth = 11;
+% }
+ <a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$PMonth%>&Year=<%$PYear%>&<%$QueryString%>">« <%$rtdate->GetMonth($PMonth)%></a>
+ </div>
+ <div class="col text-center">
+ <form action="<%$RT::WebPath%>/Search/Calendar.html?<%$QueryString%>" method="post">
+ <& /Ticket/Elements/SelectStatus,
+ Multiple => 1,
+ DefaultValue => 0,
+ Queues => \%queues,
+ Class => "col-2"
+ &>
+ <select name="Month" class="selectpicker">
+% for (0..11) {
+ <option value="<%$_%>" <% $_ == $Month ? 'selected' : ''%> ><%$rtdate->GetMonth($_)%></option>
+% }
+ </select>
+% my $year = (localtime)[5] + 1900;
+ <select name="Year" class="selectpicker">
+% for ( ($year-5) .. ($year+5)) {
+ <option value="<%$_%>" <% $_ == $Year ? 'selected' : ''%>><%$_%></option>
+% }
+ </select>
+ <input type="submit" value="<% loc('Submit') %>" class="button btn btn-primary" />
+ </form>
+ </div>
+ <div class="col-1 text-right">
+% my ($NMonth, $NYear) = ($Month + 1, $Year);
+% if ($NMonth > 11) {
+% $NYear++;
+% $NMonth = 0;
+% }
+ <a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$NMonth%>&Year=<%$NYear%>&<%$QueryString%>"><%$rtdate->GetMonth($NMonth)%> »</a>
+ </div>
+ </div>
+</div>
+
+<%init>
+my $Queues = RT::Queues->new($session{'CurrentUser'});
+$Queues->UnLimit;
+my $right = 'ShowTicket';
+my @QueuesRef = grep { $right ? $_->CurrentUserHasRight($right) : 1 } @{$Queues->ItemsArrayRef};
+my %queues = map { $_->id => $_ } @QueuesRef;
+</%init>
diff --git a/html/Search/Calendar.html b/html/Search/Calendar.html
index 71ea271..611b250 100644
--- a/html/Search/Calendar.html
+++ b/html/Search/Calendar.html
@@ -22,29 +22,12 @@ $NewQuery => 0
<&| /Widgets/TitleBox,
title => loc('Calendar for [_1] [_2]', $rtdate->GetMonth($Month), $Year) &>
-<table width="100%">
-<tr>
-<td align="left">
-% my ($PMonth, $PYear) = ($Month - 1, $Year);
-% if ($PMonth < 0) {
-% $PYear--;
-% $PMonth = 11;
-% }
-<a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$PMonth%>&Year=<%$PYear%>&<%$QueryString%>">« <%$rtdate->GetMonth($PMonth)%></a>
-</td>
-<th align="center">
- <font size="+1"><% $rtdate->GetMonth($Month). " $Year" %></font>
-</th>
-<td align="right">
-% my ($NMonth, $NYear) = ($Month + 1, $Year);
-% if ($NMonth > 11) {
-% $NYear++;
-% $NMonth = 0;
-% }
-<a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$NMonth%>&Year=<%$NYear%>&<%$QueryString%>"><%$rtdate->GetMonth($NMonth)%> »</a>
-</td>
-</tr>
-</table>
+<& /Elements/CalendarFilter,
+ Month => $Month,
+ Year => $Year,
+ QueryString => $QueryString,
+ rtdate => $rtdate,
+&>
<table class="rtxcalendar">
@@ -84,37 +67,12 @@ $NewQuery => 0
</tbody>
</table>
-<table width="100%">
-<tr>
-<td align="left">
-<a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$PMonth%>&Year=<%$PYear%>&<%$QueryString%>">« <%$rtdate->GetMonth($PMonth)%></a>
-</td>
-
-<td valign="top" align="center">
-<form action="<%$RT::WebPath%>/Search/Calendar.html?<%$QueryString%>" method="post">
-
-<select name="Month" class="selectpicker">
-% for (0..11) {
-<option value="<%$_%>" <% $_ == $Month ? 'selected' : ''%> ><%$rtdate->GetMonth($_)%></option>
-% }
-</select>
-% my $year = (localtime)[5] + 1900;
-<select name="Year" class="selectpicker">
-% for ( ($year-5) .. ($year+5)) {
-<option value="<%$_%>" <% $_ == $Year ? 'selected' : ''%>><%$_%></option>
-% }
-</select>
-
-<input type="submit" value="<% loc('Submit') %>" class="button btn btn-primary" />
-
-</form>
-</td>
-
-<td align="right">
-<a href="<%$RT::WebPath%>/Search/Calendar.html?Month=<%$NMonth%>&Year=<%$NYear%>&<%$QueryString%>"><%$rtdate->GetMonth($NMonth)%> »</a>
-</td>
-</tr>
-</table>
+<& /Elements/CalendarFilter,
+ Month => $Month,
+ Year => $Year,
+ QueryString => $QueryString,
+ rtdate => $rtdate,
+&>
<div class="container mt-4">
<div class="row">
-----------------------------------------------------------------------
Summary of changes:
html/Elements/CalendarFilter | 56 +++++++++++++++++++++++++++++++++++++
html/Search/Calendar.html | 66 ++++++++------------------------------------
2 files changed, 68 insertions(+), 54 deletions(-)
create mode 100644 html/Elements/CalendarFilter
hooks/post-receive
--
rtx-calendar
More information about the Bps-public-commit
mailing list