[freeside-commits] branch FREESIDE_4_BRANCH updated. 525c5b843587d7a9c876d875e1ad93458073ac02
Ivan
ivan at 420.am
Mon Oct 5 20:14:02 PDT 2015
The branch, FREESIDE_4_BRANCH has been updated
via 525c5b843587d7a9c876d875e1ad93458073ac02 (commit)
via 07b80c21a35784bb82373eac701f95f59871d4ed (commit)
from 692ebee8c496c6ddf42afe999dd0df0acadf4b60 (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 525c5b843587d7a9c876d875e1ad93458073ac02
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon Oct 5 20:14:01 2015 -0700
show customer name on appointments, RT#34237
diff --git a/httemplate/misc/xmlhttp-ticket-update.html b/httemplate/misc/xmlhttp-ticket-update.html
new file mode 100644
index 0000000..147fbef
--- /dev/null
+++ b/httemplate/misc/xmlhttp-ticket-update.html
@@ -0,0 +1,66 @@
+<% encode_json($return) %>\
+<%init>
+
+my $id = $cgi->param('id');
+my $starts = $cgi->param('starts');
+my $due = $cgi->param('due');
+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
+
+my $return;
+if ( $ticket ) {
+
+ my($orv, $omsg) = $ticket->SetOwner( $username, 'Steal' );
+ $orv = 1 if ! $orv && $omsg =~ /already owns/i;
+
+ if ( $orv ) {
+
+ my $date = RT::Date->new( $session{CurrentUser} );
+ $date->Set( Format=>'unix', Value=>$starts, );
+ my($srv, $smsg) = $ticket->SetStarts( $date->ISO );
+
+ my $ddate;
+ unless ( ! $srv ) {
+ $ddate = RT::Date->new( $session{CurrentUser} );
+ $ddate->Set( Format=>'unix', Value=>$due, );
+ my($drv, $dmsg) = $ticket->SetDue( $ddate->ISO );
+ #XXX lame
+ }
+
+ if ( $srv ) {
+
+ my ($sm, $sh) = ( $date->Localtime('user'))[1,2];
+ my ($em, $eh) = ($ddate->Localtime('user'))[1,2];
+
+ #false laziness w/CalendarSlotSchedule and CalendarDaySchedule
+ my %hash = $m->comp('/rt/Ticket/Elements/Customers', Ticket => $ticket);
+ my @cust_main = values( %{$hash{cust_main}} );
+
+ $return = { 'error' => '',
+ #'starts' => $starts,
+ #'due' => $due,
+ #'username' => $username,
+ #false laziness w/CalendarSlotSchedule
+ 'sched_label' =>
+ FS::sched_avail::pretty_time($sh*60+$sm). '-'.
+ FS::sched_avail::pretty_time($eh*60+$em). ': '.
+ $cust_main[0]->_FreesideURILabel,
+ };
+ } else {
+ $return = { 'error' => $smsg };
+ }
+
+ } else {
+ $return = { 'error' => $omsg };
+ }
+
+} else {
+ $return = { 'error' => 'Unknown ticket id' };
+}
+
+</%init>
commit 07b80c21a35784bb82373eac701f95f59871d4ed
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon Oct 5 20:12:14 2015 -0700
show customer name on appointments, RT#34237
diff --git a/rt/share/html/Elements/CalendarDaySchedule b/rt/share/html/Elements/CalendarDaySchedule
index 5be5b06..bac9a78 100644
--- a/rt/share/html/Elements/CalendarDaySchedule
+++ b/rt/share/html/Elements/CalendarDaySchedule
@@ -31,8 +31,13 @@ $CurrentUser => undef
% my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} };
% my $s = int(($starts-$stime)/10);
% my $e = int(($due-$stime)/10)-1;
+
+% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarSlotSchedule
+% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t);
+% my @cust_main = values( %{$hash{cust_main}} );
+
<AREA
- onmouseover = "overlib('<%$id%>: <% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>XX miles away<BR>more info', WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')"
+ onmouseover = "overlib('<% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>' + <% $cust_main[0]->_FreesideURILabel |js_string %>, WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')"
onmouseout = "nd(); return true;"
shape = "rect"
coords = "<%$s%>,0,<%$e%>,<%$height%>"
diff --git a/rt/share/html/Elements/CalendarSlotSchedule b/rt/share/html/Elements/CalendarSlotSchedule
index 4a9b3bc..632fabb 100644
--- a/rt/share/html/Elements/CalendarSlotSchedule
+++ b/rt/share/html/Elements/CalendarSlotSchedule
@@ -48,10 +48,16 @@
% $selectable = 0;
%
% 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}} );
+%
% $content .= ($content?', ':''). #$id. ': '.
% #false laziness w/xmlhttp-ticket-update.html
% FS::sched_avail::pretty_time($starts). '-'.
-% FS::sched_avail::pretty_time($due);
+% FS::sched_avail::pretty_time($due).
+% ': '. encode_entities($cust_main[0]->_FreesideURILabel);
% #'install for custname XX miles away'; #XXX placeholder/more
% $draggable_ticketid = $id;
% $draggable_length = $due - $starts;
-----------------------------------------------------------------------
Summary of changes:
httemplate/misc/xmlhttp-ticket-update.html | 66 +++++++++++++++++++++++++++
rt/share/html/Elements/CalendarDaySchedule | 7 ++-
rt/share/html/Elements/CalendarSlotSchedule | 8 +++-
3 files changed, 79 insertions(+), 2 deletions(-)
create mode 100644 httemplate/misc/xmlhttp-ticket-update.html
More information about the freeside-commits
mailing list