use strict;
use vars qw( $conf $DEBUG $me );
use vars qw( $realtime_bop_decline_quiet ); #ugh
+use Carp;
use Data::Dumper;
use Business::CreditCard 0.28;
use FS::UID qw( dbh );
sub realtime_bop {
my $self = shift;
+ confess "Can't call realtime_bop within another transaction ".
+ '($FS::UID::AutoCommit is false)'
+ unless $FS::UID::AutoCommit;
+
local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
my %options = ();
# tells whether cust_bill_pkg_detail should return a single line for
# each phonenum
+# i think this is currently unused?
sub sum_usage {
my $self = shift;
$self->option('output_format') =~ /^sum_/;
label => 'Quota', #Mail storage limit
type => 'text',
disable_inventory => 1,
- disable_select => 1,
},
'file_quota'=> {
label => 'File storage limit',
type => 'text',
disable_inventory => 1,
- disable_select => 1,
},
'file_maxnum'=> {
label => 'Number of files limit',
type => 'text',
disable_inventory => 1,
- disable_select => 1,
},
'file_maxsize'=> {
label => 'File size limit',
type => 'text',
disable_inventory => 1,
- disable_select => 1,
},
'_password' => 'Password',
'gid' => {
--- /dev/null
+% if (!$init) {
+% if ($clipboard_hack) {
+<& init_overlib.html &>
+<script>
+<&| /elements/onload.js &>
+ var transform_text = function(str) {
+ var regexp = new RegExp('.*(..):(..):(..):(..):(..):(..).*');
+ return str.replace(regexp, '$1$2$3$4$5$6');
+ }
+ var span_onclick = function() {
+ var input = document.createElement('INPUT');
+ // IE8 doesn't support textContent
+ var str = this.textContent || this.innerText || '';
+ input.value = transform_text(str);
+ input.style.position = 'absolute';
+ input.style.top = '0px';
+ input.style.left = '0px';
+ input.onblur = function() { input.parentNode.removeChild(input) }
+ this.appendChild(input);
+ input.select();
+ }
+ // set this on any ".mac_addr" object in the doc
+
+ // IE8 doesn't support getElementsByClassName
+ var els = document.getElementsByTagName('span');
+ for (var i = 0; i < els.length; i++) {
+ if (els[i].className = 'mac_addr') {
+ els[i].id = 'span_mac_addr' + i;
+ els[i].onclick = span_onclick;
+ }
+ }
+</&>
+</SCRIPT>
+<style type="text/css">
+.mac_addr {
+ border-bottom: 1px dotted blue;
+ color: blue;
+ position: relative;
+}
+</style>
+% } # if $clipboard_hack
+% $init++;
+% }
+%# the only part to be included in every instance
+<SPAN CLASS="mac_addr"><% $value |h %></SPAN>
+<%shared>
+my $init = 0;
+</%shared>
+<%init>
+my $clipboard_hack =
+ $FS::CurrentUser::CurrentUser->option('enable_mask_clipboard_hack');
+my $value = shift; # no other params
+</%init>
% # One-time charge. Nothing you can do with this, unless:
% if ( $curuser->access_right('Modify one-time charge') ) {
( <%onetime_change_link($cust_pkg)%> )
- <BR>
% }
+% # also, you can discount it
+% if ( $curuser->access_right('Discount customer package')
+% && ! scalar($cust_pkg->cust_pkg_discount_active)
+% && ! scalar($cust_pkg->part_pkg->part_pkg_discount)
+% ) {
+ ( <%pkg_discount_link($cust_pkg)%> )
+% }
+ <BR>
%
% } elsif ( !$cust_pkg->get('cancel') and !$opt{no_links} ) {
%
$field = $f;
$type = 'text';
}
+ warn "$field\t$type\t$value\n";
my $columndef = $part_svc->part_svc_column($field);
# skip fields that are fixed and empty
$value = time2str("$date_format %H:%M",$value)
} elsif ( $type eq 'checkbox' ) {
$value = $value eq 'Y' ? emt('Yes') : emt('No');
- } elsif ( $type eq 'mac_addr' and $value =~ /\w/) {
- $value .= ' ('. (Net::MAC::Vendor::lookup($value))->[0]. ')'
+ } elsif ( $type =~ /(input-)?mac_addr/ and $value =~ /\w/) {
+ my $vendor = Net::MAC::Vendor::lookup($value)->[0];
+ $value .= " ($vendor)" if $vendor;
+ $value = $m->scomp('/elements/mac_addr.html', $value);
}
# 'link' option