72393: High-priority: Tags history
authorJonathan Prykop <jonathan@freeside.biz>
Thu, 8 Sep 2016 05:14:03 +0000 (00:14 -0500)
committerJonathan Prykop <jonathan@freeside.biz>
Thu, 8 Sep 2016 05:14:03 +0000 (00:14 -0500)
httemplate/elements/change_history_common.html
httemplate/view/cust_main/change_history.html

index e228e65..5aaf6e6 100644 (file)
@@ -197,6 +197,12 @@ my $svc_labelsub = sub {
   $label. ': <b>'. encode_entities($item->label($item->history_date)). '</b>';
 };
 
+my $tag_labelsub = sub {
+  my($item, $label) = @_;
+  my $part_tag = qsearchs('part_tag',{ tagnum => $item->tagnum });
+  $label. ': <SPAN STYLE="background-color: #'.$part_tag->tagcolor.'">'. encode_entities($part_tag->tagname). '</SPAN>';
+};
+
 my %h_table_labelsub = (
   'h_cust_pkg'      => $pkg_labelsub,
   'h_svc_acct'      => $svc_labelsub,
@@ -208,6 +214,7 @@ my %h_table_labelsub = (
   'h_svc_external'  => $svc_labelsub,
   'h_svc_phone'     => $svc_labelsub,
   #'h_phone_device'
+  'h_cust_tag'      => $tag_labelsub,
 );
 
 my $discounts = {};
index d46a4ff..a781c73 100644 (file)
@@ -46,6 +46,7 @@ tie my %tables, 'Tie::IxHash',
   'phone_device'      => 'Phone device',
   'cust_pkg_discount' => 'Discount',
   #? it gets provisioned anyway 'phone_avail'         => 'Phone',
+  'cust_tag'          => 'Tag',
 ;
 
 my $pkg_join = "JOIN cust_pkg USING ( pkgnum )";