[freeside-commits] branch master updated. afaeb8d17e05caf0a596fb5385059bc5040f7fbd

Jonathan Prykop jonathan at 420.am
Thu Mar 31 16:11:26 PDT 2016


The branch, master has been updated
       via  afaeb8d17e05caf0a596fb5385059bc5040f7fbd (commit)
       via  59867e99e8020b3b8ab1844c9e2e7de24d45e6cf (commit)
      from  cf5cc61b84cfde1d1c2bd96bd8e1b69c9b15306e (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 afaeb8d17e05caf0a596fb5385059bc5040f7fbd
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Mar 31 18:10:41 2016 -0500

    RT#34237: installer scheduling [SetOwner not necessarily a Steal]

diff --git a/httemplate/misc/xmlhttp-ticket-update.html b/httemplate/misc/xmlhttp-ticket-update.html
index bd58b95..e81e353 100644
--- a/httemplate/misc/xmlhttp-ticket-update.html
+++ b/httemplate/misc/xmlhttp-ticket-update.html
@@ -8,14 +8,12 @@ my $username = $cgi->param('username');
 
 my $ticket = FS::TicketSystem->get_ticket_object( \%session, ticket_id=>$id );
 
-#hmm, this should happen in a single transaction and either commit or rollback,
-# but in reality failures "Don't Happen" so its not like a ticket gets
-# half changed
+#hmm, this should happen in a single transaction and either commit or rollback
 
 my $return;
 if ( $ticket ) {
 
-  my($orv, $omsg) = $ticket->SetOwner( $username, 'Steal' );
+  my($orv, $omsg) = $ticket->SetOwner( $username );
   $orv = 1 if ! $orv && $omsg =~ /already own/i;
 
   if ( $orv ) {

commit 59867e99e8020b3b8ab1844c9e2e7de24d45e6cf
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Mar 31 18:08:37 2016 -0500

    RT#34237: installer scheduling [bug fixes for refactor]

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 );

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

Summary of changes:
 httemplate/misc/xmlhttp-ticket-update.html  |    6 ++---
 rt/share/html/Elements/CalendarSlotSchedule |   39 ++++++++++++++-------------
 rt/share/html/Search/Schedule.html          |    2 --
 3 files changed, 23 insertions(+), 24 deletions(-)




More information about the freeside-commits mailing list