projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
349bfb3
)
fix handling of no installer and one installer cases, RT#16584
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 27 Jan 2015 04:31:37 +0000
(20:31 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 27 Jan 2015 04:31:37 +0000
(20:31 -0800)
rt/share/html/Search/Schedule.html
patch
|
blob
|
history
diff --git
a/rt/share/html/Search/Schedule.html
b/rt/share/html/Search/Schedule.html
index
8290472
..
34ba142
100644
(file)
--- 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
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',
Embed => 'Schedule.html',
DimPast => 1,
Display => 'Schedule',
- DisplayArgs => [ username =>
$ARGS{username}
,
+ DisplayArgs => [ username =>
\@usernames
,
LengthMin => $LengthMin,
#oops, more freeside abstraction-leaking
custnum => $ARGS{custnum},
LengthMin => $LengthMin,
#oops, more freeside abstraction-leaking
custnum => $ARGS{custnum},
@@
-80,6
+80,17
@@
my @files = ();
push @files, map { "${_}contentmws" } qw( iframe ajax );
#%}
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);
( my $LengthMin = $ARGS{LengthMin} ) =~ /^\d+$/ or die 'non-numeric LengthMin';
my $cells = int($LengthMin / $timestep);