summaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-03-31 18:08:37 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-04-04 21:14:25 -0500
commitd07285899ebbe9b9578b90db3913eb8d5b63ebf4 (patch)
tree62c7585cc95ff43a2e94f47cfb7101b464a0fee0 /rt
parenteb985ed029f86ad4056c78ae95417f3402359d62 (diff)
RT#34237: installer scheduling [bug fixes for refactor]
Diffstat (limited to 'rt')
-rw-r--r--rt/share/html/Elements/CalendarSlotSchedule39
-rw-r--r--rt/share/html/Search/Schedule.html2
2 files changed, 21 insertions, 20 deletions
diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule
index c8d3bfa..b5c08d6 100644
--- a/rt/share/html/Elements/CalendarSlotSchedule
+++ b/rt/share/html/Elements/CalendarSlotSchedule
@@ -21,7 +21,7 @@
%
% my $bgcolor = '#666666';
% my $border = '1px solid #555555';
-% my $content = '';
+% my $label = '';
% my $selectable = 0; # can we schedule a new appointment
% my $ticketid = 0;
% my $draggable_length = 0;
@@ -42,13 +42,20 @@
% }
%
% #block out / show / color code existing appointments
+% my $maxstarts = 0;
% foreach my $id ( keys %{ $schedule{'scheduled'} } ) {
%
% my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} };
%
-% # misleading loop--at most one id will pass this test
+% # misleading loop--at most one id should pass this test
% next if $starts >= ($tod_row+$timestep) || $due <= $tod_row;
%
+% # but, if for any reason a scheduling conflict occurs,
+% # use the later starting one to minimize UI conflicts--
+% # not to imply that this scenario has been tested or should ever happen!!!
+% next if $starts < $maxstarts;
+% $maxstarts = $starts;
+%
% $ticketid = $id;
% $bgcolor = '#'.$col;
% $border = '1px solid #D7D7D7';
@@ -60,22 +67,18 @@
% $cells = int( ($due-$starts) / $timestep );
% $cells++ if ($due-$starts) % $timestep;
%
-% if ( $starts >= $tod_row ) { #first row
-%
-% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarDaySchedule
-% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t);
-% my @cust_main = values( %{$hash{cust_main}} );
+% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarDaySchedule
+% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t);
+% my @cust_main = values( %{$hash{cust_main}} );
%
-% #false laziness w/xmlhttp-ticket-update.html
-% $content .= FS::sched_avail::pretty_time($starts). '-'.
-% FS::sched_avail::pretty_time($due).
-% ': '. $cust_main[0]->_FreesideURILabel;
-% #'install for custname XX miles away'; #XXX placeholder/more
+% #false laziness w/xmlhttp-ticket-update.html
+% $label .= FS::sched_avail::pretty_time($starts). '-'.
+% FS::sched_avail::pretty_time($due).
+% ': '. $cust_main[0]->_FreesideURILabel;
+% #'install for custname XX miles away'; #XXX placeholder/more
%
-% } else {
-% $offset = int( ($tod_row - $starts) / $timestep );
-% $offset++ if ($tod_row - $starts) % $timestep;
-% }
+% $offset = int( ($tod_row - $starts) / $timestep );
+% $offset++ if ($tod_row - $starts) % $timestep;
% }
%
% my $td_id = 'td_'. $Date->epoch. '_'. $tod_row. '_'. $username;
@@ -137,7 +140,7 @@
% }
%
% }
- ><% $content |h %></td>
+ ></td>
<SCRIPT TYPE="text/javascript">
var $cell_<% $td_id %> = $('#<% $td_id %>');
@@ -155,7 +158,7 @@
$cell_<% $td_id %>,
<% $ticketid |js_string %>,
<% $bgcolor |n,js_string %>,
- <% $content |n,js_string %>,
+ <% $label |n,js_string %>,
<% $draggable_length * 60 %>,
<% $cells %>,
<% $offset %>
diff --git a/rt/share/html/Search/Schedule.html b/rt/share/html/Search/Schedule.html
index b16f609..cfa4558 100644
--- a/rt/share/html/Search/Schedule.html
+++ b/rt/share/html/Search/Schedule.html
@@ -24,8 +24,6 @@
// sets cell data and appearance as an appointment
function set_appointment_cell ($cell,ticketid,bgcolor,label,length,cells,offset) {
$cell.data('bgcolor', bgcolor );
- $cell.css('background-color', bgcolor);
- $cell.css('border', '1px solid #D7D7D7' );
$cell.data('ticketid', ticketid );
$cell.data('length', length );
$cell.data('cells', cells );