[freeside-commits] branch FREESIDE_3_BRANCH updated. 2cb16bcb5d43d9194ca1eaf95fe5e59ec9076b76

Ivan ivan at 420.am
Mon Jan 26 20:31:40 PST 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  2cb16bcb5d43d9194ca1eaf95fe5e59ec9076b76 (commit)
      from  1ee868ab5c32494fffd601ef38457e57efbc1f57 (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 2cb16bcb5d43d9194ca1eaf95fe5e59ec9076b76
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Jan 26 20:31:39 2015 -0800

    fix handling of no installer and one installer cases, RT#16584

diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html
index 8290472..34ba142 100644
--- a/rt/share/html/Search/Schedule.html
+++ b/rt/share/html/Search/Schedule.html
@@ -55,11 +55,11 @@
      Query       => "( Status = 'new' OR Status = 'open' OR Status = 'stalled')
                      AND ( Type = 'reminder' OR 'Type' = 'ticket' )",
                     #XXX and we have the magic custom field
-     slots       => scalar( @{ $ARGS{username} } ),
+     slots       => scalar(@usernames),
      Embed       => 'Schedule.html',
      DimPast     => 1,
      Display     => 'Schedule',
-     DisplayArgs => [ username  => $ARGS{username},
+     DisplayArgs => [ username  => \@usernames,
                       LengthMin => $LengthMin,
                       #oops, more freeside abstraction-leaking
                       custnum   => $ARGS{custnum},
@@ -80,6 +80,17 @@ my @files = ();
   push @files, map { "${_}contentmws" } qw( iframe ajax );
 #%}
 
+my @usernames = ();
+if ( ref($ARGS{username}) ) {
+  @usernames = @{ $ARGS{username} };
+} elsif ( $ARGS{username} ) {
+  @usernames = ( $ARGS{username} );
+} else {
+  #XXX shouldn't even get offered the link in the first place rather than perl
+  # barf, but this is better than erroring out later or empty @username
+  die "Can't schedule an appointment - no employees are configured as installers";
+}
+
 ( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin';
 
 my $cells = int($LengthMin / $timestep);


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

Summary of changes:
 rt/share/html/Search/Schedule.html |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list