[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-309-g0c40f5a

Shawn Moore shawn at bestpractical.com
Tue Feb 21 11:43:50 EST 2017


The branch, 4.4-trunk has been updated
       via  0c40f5a68ce4027b28de558281cdeca52057f8cd (commit)
       via  c15ed17e68d9fd4ed795734c3f3c27ef47d5c269 (commit)
      from  310c7b06df2a2fa6020351e42db2869ba4c52fec (commit)

Summary of changes:
 share/html/Elements/SelectDate       | 20 ++++++++++----------
 share/html/Ticket/Create.html        | 24 ++++++++++++++++++++++--
 share/html/Ticket/Elements/EditDates | 35 +++++++++++++++++++++++++++++------
 3 files changed, 61 insertions(+), 18 deletions(-)

- Log -----------------------------------------------------------------
commit c15ed17e68d9fd4ed795734c3f3c27ef47d5c269
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Fri Feb 17 14:56:13 2017 -0600

    pass along more arguments to SelectDate callbacks
    
    This allows callbacks to modify the ShowTime argument for SelectDate
    based on things like the Ticket's Queue.

diff --git a/share/html/Elements/SelectDate b/share/html/Elements/SelectDate
index 66cf136..99ed800 100644
--- a/share/html/Elements/SelectDate
+++ b/share/html/Elements/SelectDate
@@ -45,9 +45,9 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-% $m->callback( %ARGS, Name => $Name, CallbackName => 'BeforeDateInput' );
+% $m->callback( %ARGS, Name => $Name, CallbackName => 'BeforeDateInput', Object => $Object, ARGSRef => $ARGSRef, ShowTimeRef => \$ShowTime, );
 <input type="text" class="datepicker<% $ShowTime ? ' withtime' : '' %>" id="<% $Name %>" name="<% $Name %>" value="<% $Default %>" size="<% $Size %>" />
-% $m->callback( %ARGS, Name => $Name, CallbackName => 'AfterDateInput' );
+% $m->callback( %ARGS, Name => $Name, CallbackName => 'AfterDateInput', Object => $Object, ARGSRef => $ARGSRef, );
 <%init>
 unless ((defined $Default) or ($current <= 0)) {
     my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
@@ -62,13 +62,13 @@ unless ($Name) {
     $Name = $menu_prefix. "_Date";
 }
 </%init>
-
 <%args>
-
-$ShowTime => 1
-$menu_prefix=>''
-$current=>time
-$Default => ''
-$Name => undef
-$Size => 16
+$ShowTime    => 1
+$menu_prefix => ''
+$current     => time
+$Default     => ''
+$Name        => undef
+$Size        => 16
+$Object      => undef
+$ARGSRef     => undef
 </%args>
diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 87febb0..98599cf 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -299,8 +299,28 @@
   color => "#663366" &>
 
 <table>
-<tr><td class="label"><&|/l&>Starts</&>:</td><td><& /Elements/SelectDate, Name => "Starts", Default => $ARGS{Starts} || $QueueObj->DefaultValue('Starts') || '' &></td></tr>
-<tr><td class="label"><&|/l&>Due</&>:</td><td><& /Elements/SelectDate, Name => "Due", Default => $ARGS{Due} || $QueueObj->DefaultValue('Due') || '' &></td></tr>
+<tr>
+    <td class="label"><&|/l&>Starts</&>:</td>
+    <td>
+        <& /Elements/SelectDate,
+            Name    => 'Starts',
+            Default => $ARGS{Starts} || $QueueObj->DefaultValue('Starts') || '',
+            Object  => $ticket,
+            ARGSRef => \%ARGS,
+        &>
+    </td>
+</tr>
+<tr>
+    <td class="label"><&|/l&>Due</&>:</td>
+    <td>
+        <& /Elements/SelectDate,
+            Name    => 'Due',
+            Default => $ARGS{Due} || $QueueObj->DefaultValue('Due') || '',
+            Object  => $ticket,
+            ARGSRef => \%ARGS,
+        &>
+    </td>
+</tr>
 <& /Elements/EditCustomFields,
     %ARGS,
     Object => $ticket,
diff --git a/share/html/Ticket/Elements/EditDates b/share/html/Ticket/Elements/EditDates
index b08a7d8..2372827 100644
--- a/share/html/Ticket/Elements/EditDates
+++ b/share/html/Ticket/Elements/EditDates
@@ -49,14 +49,26 @@
   <tr>
     <td class="label"><&|/l&>Starts</&>:</td>
     <td class="entry">
-        <& /Elements/SelectDate, menu_prefix => 'Starts', current => 0, Default => $TicketObj->StartsObj->Unix ? $TicketObj->StartsObj->ISO( Timezone => 'user' ) : '' &>
+        <& /Elements/SelectDate,
+            menu_prefix => 'Starts',
+            current     => 0,
+            Default     => $TicketObj->StartsObj->Unix ?  $TicketObj->StartsObj->ISO(Timezone => 'user') : '',
+            Object      => $TicketObj,
+            ARGSRef     => \%ARGS,
+        &>
         (<% $TicketObj->StartsObj->AsString %>)
     </td>
   </tr>
   <tr>
     <td class="label"><&|/l&>Started</&>:</td>
     <td class="entry">
-        <& /Elements/SelectDate, menu_prefix => 'Started', current => 0, Default => $TicketObj->StartedObj->Unix ? $TicketObj->StartedObj->ISO( Timezone => 'user' )  : '' &>
+        <& /Elements/SelectDate,
+            menu_prefix => 'Started',
+            current     => 0,
+            Default     => $TicketObj->StartedObj->Unix ?  $TicketObj->StartedObj->ISO(Timezone => 'user')  : '',
+            Object      => $TicketObj,
+            ARGSRef     => \%ARGS,
+        &>
         (<%$TicketObj->StartedObj->AsString %>)
     </td>
   </tr>
@@ -66,15 +78,27 @@
       <&|/l&>Last Contact</&>:
     </td>
     <td class="entry">
-        <& /Elements/SelectDate, menu_prefix => 'Told', current => 0, Default => $TicketObj->ToldObj->Unix ?  $TicketObj->ToldObj->ISO(Timezone => 'user') : '' &>
+        <& /Elements/SelectDate,
+            menu_prefix => 'Told',
+            current     => 0,
+            Default     => $TicketObj->ToldObj->Unix ?  $TicketObj->ToldObj->ISO(Timezone => 'user') : '',
+            Object      => $TicketObj,
+            ARGSRef     => \%ARGS,
+        &>
         (<% $TicketObj->ToldObj->AsString %>)
     </td>
   </tr>
   <tr>
     <td class="label"><&|/l&>Due</&>:</td>
     <td class="entry">
-      <& /Elements/SelectDate, menu_prefix => 'Due', current => 0, Default => $TicketObj->DueObj->Unix ? $TicketObj->DueObj->ISO(Timezone => 'user') : '' &>
-      (<% $TicketObj->DueObj->AsString %>)
+        <& /Elements/SelectDate,
+            menu_prefix => 'Due',
+            current     => 0,
+            Default     => $TicketObj->DueObj->Unix ? $TicketObj->DueObj->ISO(Timezone => 'user') : '',
+            Object      => $TicketObj,
+            ARGSRef     => \%ARGS,
+        &>
+        (<% $TicketObj->DueObj->AsString %>)
     </td>
   </tr>
   <& /Elements/EditCustomFields, Object => $TicketObj, Grouping => 'Dates', InTable => 1 &>
@@ -83,4 +107,3 @@
 <%ARGS>
 $TicketObj => undef
 </%ARGS>
-

commit 0c40f5a68ce4027b28de558281cdeca52057f8cd
Merge: 310c7b0 c15ed17
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Tue Feb 21 11:43:37 2017 -0500

    Merge branch '4.4/select-date-callbacks' into 4.4-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list