From: Ivan Kohler Date: Wed, 9 Oct 2013 06:04:11 +0000 (-0700) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=ce89af6a65868fd0f5cde05ef866611aacad39aa;hp=744c7da5bad2de7b4e0f9f3d416e46e0671eb3ff Merge branch 'master' of git.freeside.biz:/home/git/freeside --- diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index f1fc5cba4..1215ca414 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -355,6 +355,7 @@ if ( -e $addl_handler_use_file ) { use FS::cable_model; use FS::invoice_mode; use FS::invoice_conf; + use FS::cable_provider; # Sammath Naur if ( $FS::Mason::addl_handler_use ) { diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index fd035249b..71eddc1eb 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -3038,13 +3038,8 @@ Checks to see if the string is encrypted and returns true or false (1/0) to indi sub is_encrypted { my ($self, $value) = @_; - # Possible Bug - Some work may be required here.... - - if ($value =~ /^M/ && length($value) > 80) { - return 1; - } else { - return 0; - } + # could be more precise about it, but this will do for now + $value =~ /^M/ && length($value) > 80; } =item decrypt($value) diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 5ea24e43a..e44b74edc 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -4272,6 +4272,8 @@ sub tables_hashref { 'svc_cable' => { 'columns' => [ 'svcnum', 'int', '', '', '', '', + 'providernum', 'int', 'NULL', '', '', '', + # XXX "Circuit ID/Order number" 'modelnum', 'int', 'NULL', '', '', '', 'serialnum', 'varchar', 'NULL', $char_d, '', '', 'mac_addr', 'varchar', 'NULL', 12, '', '', @@ -4292,6 +4294,17 @@ sub tables_hashref { 'index' => [], }, + 'cable_provider' => { + 'columns' => [ + 'providernum', 'serial', '', '', '', '', + 'provider', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'providernum', + 'unique' => [ [ 'provider' ], ], + 'index' => [], + }, + 'vend_main' => { 'columns' => [ 'vendnum', 'serial', '', '', '', '', diff --git a/FS/FS/cable_provider.pm b/FS/FS/cable_provider.pm new file mode 100644 index 000000000..e988192f4 --- /dev/null +++ b/FS/FS/cable_provider.pm @@ -0,0 +1,112 @@ +package FS::cable_provider; + +use strict; +use base qw( FS::Record ); +use FS::Record qw( qsearch qsearchs ); + +=head1 NAME + +FS::cable_provider - Object methods for cable_provider records + +=head1 SYNOPSIS + + use FS::cable_provider; + + $record = new FS::cable_provider \%hash; + $record = new FS::cable_provider { 'column' => 'value' }; + + $error = $record->insert; + + $error = $new_record->replace($old_record); + + $error = $record->delete; + + $error = $record->check; + +=head1 DESCRIPTION + +An FS::cable_provider object represents a cable service provider. +FS::cable_provider inherits from FS::Record. The following fields are +currently supported: + +=over 4 + +=item providernum + +primary key + +=item provider + +provider + +=item disabled + +disabled + + +=back + +=head1 METHODS + +=over 4 + +=item new HASHREF + +Creates a new provider. To add the provider to the database, see L<"insert">. + +Note that this stores the hash reference, not a distinct copy of the hash it +points to. You can ask the object for a copy with the I method. + +=cut + +# the new method can be inherited from FS::Record, if a table method is defined + +sub table { 'cable_provider'; } + +=item insert + +Adds this record to the database. If there is an error, returns the error, +otherwise returns false. + +=item delete + +Delete this record from the database. + +=item replace OLD_RECORD + +Replaces the OLD_RECORD with this one in the database. If there is an error, +returns the error, otherwise returns false. + +=item check + +Checks all fields to make sure this is a valid provider. If there is +an error, returns the error, otherwise returns false. Called by the insert +and replace methods. + +=cut + +sub check { + my $self = shift; + + my $error = + $self->ut_numbern('providernum') + || $self->ut_text('provider') + || $self->ut_enum('disabled', [ '', 'Y' ] ) + ; + return $error if $error; + + $self->SUPER::check; +} + +=back + +=head1 BUGS + +=head1 SEE ALSO + +L, schema.html from the base documentation. + +=cut + +1; + diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e39312504..a9a4cb0ef 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2097,6 +2097,21 @@ sub cust_contact { qsearch('contact', { 'custnum' => $self->custnum } ); } +=item cust_payby + +Returns all payment methods (see L) for this customer. + +=cut + +sub cust_payby { + my $self = shift; + qsearch({ + 'table' => 'cust_payby', + 'hashref' => { 'custnum' => $self->custnum }, + 'order_by' => 'ORDER BY weight ASC', + }); +} + =item unsuspend Unsuspends all unflagged suspended packages (see L @@ -5140,7 +5155,6 @@ sub _upgrade_data { #class method die $error if $error; $cust_main->setfield($_, '') foreach @payfields; - #$DEBUG = 2; $error = $cust_main->replace; die $error if $error; diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 19ef1f326..0cb1b50a2 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -2613,14 +2613,30 @@ sub part_pkg_currency_option { =item cust_svc [ OPTION => VALUE ... ] (current usage) +=item cust_svc_unsorted [ OPTION => VALUE ... ] + Returns the services for this package, as FS::cust_svc objects (see L). Available options are svcpart and svcdb. If either is spcififed, returns only the matching services. +As an optimization, use the cust_svc_unsorted version if you are not displaying +the results. + =cut sub cust_svc { my $self = shift; + cluck "cust_pkg->cust_svc called" if $DEBUG > 2; + $self->_sort_cust_svc( $self->cust_svc_unsorted_arrayref ); +} + +sub cust_svc_unsorted { + my $self = shift; + @{ $self->cust_svc_unsorted_arrayref }; +} + +sub cust_svc_unsorted_arrayref { + my $self = shift; return () unless $self->num_cust_svc(@_); @@ -2645,13 +2661,7 @@ sub cust_svc { $search{extra_sql} = ' AND svcdb = '. dbh->quote( $opt{'svcdb'} ); } - cluck "cust_pkg->cust_svc called" if $DEBUG > 2; - - #if ( $self->{'_svcnum'} ) { - # values %{ $self->{'_svcnum'}->cache }; - #} else { - $self->_sort_cust_svc( [ qsearch(\%search) ] ); - #} + [ qsearch(\%search) ]; } diff --git a/FS/FS/part_event/Condition/pkg_age_Common.pm b/FS/FS/part_event/Condition/pkg_age_Common.pm index 726b01d70..33e49b8a6 100644 --- a/FS/FS/part_event/Condition/pkg_age_Common.pm +++ b/FS/FS/part_event/Condition/pkg_age_Common.pm @@ -49,7 +49,7 @@ sub condition { } sub pkg_age_age { - my( $self, $cust_pkg, %opt ); + my( $self, $cust_pkg, %opt ) = @_; $self->option_age_from('age', $opt{'time'} ); } diff --git a/FS/FS/part_export/domain_shellcommands.pm b/FS/FS/part_export/domain_shellcommands.pm index 582e29217..8e85d71e1 100644 --- a/FS/FS/part_export/domain_shellcommands.pm +++ b/FS/FS/part_export/domain_shellcommands.pm @@ -49,8 +49,7 @@ The following variables are available for interpolation (prefixed with new
  • $uid - of catchall account
  • $gid - of catchall account
  • $dir - home directory of catchall account -
  • All other fields in - svc_domain are also available. +
  • All other fields in svc_domain are also available. END ); diff --git a/FS/FS/part_export/shellcommands_withdomain.pm b/FS/FS/part_export/shellcommands_withdomain.pm index 1b59589bf..29715b75b 100644 --- a/FS/FS/part_export/shellcommands_withdomain.pm +++ b/FS/FS/part_export/shellcommands_withdomain.pm @@ -141,7 +141,32 @@ The following variables are available for interpolation (prefixed with
  • $shell
  • $quota
  • @radius_groups -
  • All other fields in svc_acct are also available. +
  • $reasonnum (when suspending) +
  • $reasontext (when suspending) +
  • $reasontypenum (when suspending) +
  • $reasontypetext (when suspending) +
  • $pkgnum +
  • $custnum +
  • All other fields in svc_acct are also available. +
  • The following fields from cust_main are also available (except during replace): company, address1, address2, city, state, zip, county, daytime, night, fax, otaker, agent_custid, locale. When used on the command line (rather than STDIN), they will be quoted for the shell already (do not add additional quotes). + +For the package changed command only, the following fields are also available: +
      +
    • $old_pkgnum and $new_pkgnum +
    • $old_pkgpart and $new_pkgpart +
    • $old_agent_pkgid and $new_agent_pkgid +
    • $old_order_date and $new_order_date +
    • $old_start_date and $new_start_date +
    • $old_setup and $new_setup +
    • $old_bill and $new_bill +
    • $old_last_bill and $new_last_bill +
    • $old_susp and $new_susp +
    • $old_adjourn and $new_adjourn +
    • $old_resume and $new_resume +
    • $old_cancel and $new_cancel +
    • $old_unancel and $new_unancel +
    • $old_expire and $new_expire +
    • $old_contract_end and $new_contract_end
    END ); diff --git a/FS/FS/payby.pm b/FS/FS/payby.pm index e223a050f..b33f8f3d1 100644 --- a/FS/FS/payby.pm +++ b/FS/FS/payby.pm @@ -70,12 +70,12 @@ tie %hash, 'Tie::IxHash', cust_pay => 'CHEK', #this is a customer type only, payments are CHEK... realtime => 1, }, - 'LECB' => { - tinyname => 'phone bill', - shortname => 'Phone bill billing', - longname => 'Phone bill billing', - realtime => 1, - }, + #'LECB' => { + # tinyname => 'phone bill', + # shortname => 'Phone bill billing', + # longname => 'Phone bill billing', + # realtime => 1, + #}, 'BILL' => { tinyname => 'billing', shortname => 'Billing', diff --git a/FS/FS/svc_cable.pm b/FS/FS/svc_cable.pm index 1980c0ee9..596f69995 100644 --- a/FS/FS/svc_cable.pm +++ b/FS/FS/svc_cable.pm @@ -4,6 +4,7 @@ use base qw( FS::svc_Common ); #qw( FS::device_Common FS::svc_Common ); use strict; use Tie::IxHash; use FS::Record qw( qsearchs ); # qw( qsearch qsearchs ); +use FS::cable_provider; use FS::cable_model; =head1 NAME @@ -72,24 +73,35 @@ sub search_sql { sub table_info { tie my %fields, 'Tie::IxHash', - 'svcnum' => 'Service', - 'modelnum' => { label => 'Model', - type => 'select-cable_model', - disable_inventory => 1, - disable_select => 1, - value_callback => sub { - my $svc = shift; - $svc->cable_model->model_name; - }, - }, - 'serialnum' => 'Serial number', - 'mac_addr' => { label => 'MAC address', - type => 'input-mac_addr', - value_callback => sub { - my $svc = shift; - join(':', $svc->mac_addr =~ /../g); - }, - }, + 'svcnum' => 'Service', + 'providernum' => { label => 'Provider', + type => 'select-cable_provider', + disable_inventory => 1, + disable_select => 1, + value_callback => sub { + my $svc = shift; + my $p = $svc->cable_provider; + $p ? $p->provider : ''; + }, + }, + #XXX "Circuit ID/Order number" + 'modelnum' => { label => 'Model', + type => 'select-cable_model', + disable_inventory => 1, + disable_select => 1, + value_callback => sub { + my $svc = shift; + $svc->cable_model->model_name; + }, + }, + 'serialnum' => 'Serial number', + 'mac_addr' => { label => 'MAC address', + type => 'input-mac_addr', + value_callback => sub { + my $svc = shift; + join(':', $svc->mac_addr =~ /../g); + }, + }, ; { @@ -130,6 +142,7 @@ sub check { my $error = $self->ut_numbern('svcnum') + || $self->ut_foreign_key('providernum', 'cable_provider', 'providernum') || $self->ut_foreign_key('modelnum', 'cable_model', 'modelnum') || $self->ut_alpha('serialnum') || $self->ut_mac_addr('mac_addr') @@ -139,6 +152,17 @@ sub check { $self->SUPER::check; } +=item cable_provider + +Returns the cable_provider object for this record. + +=cut + +sub cable_provider { + my $self = shift; + qsearchs('cable_provider', { 'providernum'=>$self->providernum } ); +} + =item cable_model Returns the cable_model object for this record. diff --git a/FS/MANIFEST b/FS/MANIFEST index 339965ef3..5dbe754c1 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -724,3 +724,5 @@ FS/invoice_mode.pm t/invoice_mode.t FS/invoice_conf.pm t/invoice_conf.t +FS/cable_provider.pm +t/cable_provider.t diff --git a/FS/t/cable_provider.t b/FS/t/cable_provider.t new file mode 100644 index 000000000..c794379a9 --- /dev/null +++ b/FS/t/cable_provider.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::cable_provider; +$loaded=1; +print "ok 1\n"; diff --git a/bin/test-event b/bin/test-event old mode 100644 new mode 100755 index d3a9f110d..73c9d31ec --- a/bin/test-event +++ b/bin/test-event @@ -34,7 +34,10 @@ print "\n"; my @conditions = $part_event->part_event_condition; foreach my $condition ( @conditions ) { - my $sat = $condition->condition( $object, 'cust_event' => $cust_event ); + my $sat = $condition->condition( $object, + 'cust_event' => $cust_event, + 'time' => time, + ); my $sql = $condition->condition_sql(); diff --git a/httemplate/browse/cable_provider.html b/httemplate/browse/cable_provider.html new file mode 100644 index 000000000..0d344984b --- /dev/null +++ b/httemplate/browse/cable_provider.html @@ -0,0 +1,32 @@ +<& elements/browse.html, + 'title' => 'Cable providers', + 'html_init' => $html_init, + 'name' => 'providers', + 'disableable' => 1, + 'disabled_statuspos' => 1, + 'query' => { 'table' => 'cable_provider', + 'hashref' => {}, + 'order_by' => 'ORDER BY provider', + }, + 'count_query' => $count_query, + 'header' => $header, + 'fields' => $fields, + 'links' => $links, +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $html_init = + qq!Add a provider

    !; + +my $count_query = 'SELECT COUNT(*) FROM cable_provider'; + +my $link = [ $p.'edit/cable_provider.html?', 'providernum' ]; + +my $header = [ 'Provider' ]; +my $fields = [ 'provider' ]; +my $links = [ $link ]; + + diff --git a/httemplate/docs/about.html b/httemplate/docs/about.html index c2ba4e4a0..80d9488b6 100644 --- a/httemplate/docs/about.html +++ b/httemplate/docs/about.html @@ -56,7 +56,7 @@ GNU Affero General Public License.
    % unless ( $agentnum ) {
    - "I can't figure out ... if it's an end or the beginning" - R. Hunter + "" - R. Hunter
    % } diff --git a/httemplate/edit/cable_provider.html b/httemplate/edit/cable_provider.html new file mode 100644 index 000000000..9a911ccfa --- /dev/null +++ b/httemplate/edit/cable_provider.html @@ -0,0 +1,20 @@ +<& elements/edit.html, + 'name_singular' => 'Provider', + 'table' => 'cable_provider', + 'fields' => [ + 'provider', + { field=>'disabled', type=>'checkbox', value=>'Y', }, + ], + 'labels' => { + 'providernum' => 'Provider', + 'provider' => 'Provider', + 'disabled' => 'Disabled', + }, + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + diff --git a/httemplate/edit/cust_main-contacts.html b/httemplate/edit/cust_main-contacts.html index bae58bd33..cd83a2960 100644 --- a/httemplate/edit/cust_main-contacts.html +++ b/httemplate/edit/cust_main-contacts.html @@ -1,8 +1,9 @@ -<% include('elements/edit.html', +<& elements/edit.html, 'name_singular' => 'customer contacts', #yes, we're editing all of them 'table' => 'cust_main', - 'post_url' => popurl(1). 'process/cust_main-contacts.html', - 'labels' => { 'custnum' => ' ', #XXX supress this line entirely, its being redundant + 'post_url' => popurl(1). 'process/cust_main-contacts.html', + 'no_pkey_display' => 1, + 'labels' => { 'contactnum' => 'Contact', #'locationnum' => ' ', }, @@ -20,17 +21,17 @@ #'edit_callback' => $edit_callback, #'error_callback' => $error_callback, 'agent_virt' => 1, - 'menubar' => [], #remove "view all" link + 'menubar' => [], #remove "view all" link #XXX it would be nice if this could instead be after the error but before # the table - 'html_init' => include('/elements/small_custview.html', - $custnum, - $conf->config('countrydefault') || 'US', - 1, #no balance - ), - ) -%> + 'html_init' => include('/elements/small_custview.html', + $custnum, + $conf->config('countrydefault') || 'US', + 1, #no balance + ). + '
    ', +&> <%init> my $curuser = $FS::CurrentUser::CurrentUser; diff --git a/httemplate/edit/cust_payby.html b/httemplate/edit/cust_payby.html new file mode 100644 index 000000000..67eb40a89 --- /dev/null +++ b/httemplate/edit/cust_payby.html @@ -0,0 +1,184 @@ +%# #based on / some false laziness w/ cust_main-contacts.html +<& elements/edit.html, + 'name_singular' => 'payment methods', #"customer payment methods" ? + 'table' => 'cust_main', + 'post_url' => popurl(1). 'process/cust_payby.html', + 'no_pkey_display' => 1, + 'labels' => { + 'custpaybynum' => ' ', #'Payment method', + #'locationnum' => ' ', + }, + 'fields' => [ + { field => 'custpaybynum', + type => 'selectlayers', + options => [ '', + grep { ! /^(DCRD|DCHK)$/ } + FS::payby->cust_payby + ], + labels => { '' => 'Select payment method', + FS::payby->payby2shortname + }, + layer_fields => \%payby_fields, + layer_values_callback => $payby_layer_values, + m2m_method => 'cust_payby', + m2m_dstcol => 'custpaybynum', + m2_label => ' ', #'Payment method', + m2_error_callback => $m2_error_callback, + }, + ], + #'new_callback' => $new_callback, + #'edit_callback' => $edit_callback, + #'error_callback' => $error_callback, + 'agent_virt' => 1, + 'menubar' => [], #remove "view all" link + + #XXX it would be nice if this could instead be after the error but before + # the table + 'html_init' => include('/elements/small_custview.html', + $custnum, + $conf->config('countrydefault') || 'US', + 1, #no balance + ). + '
    ', +&> +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; +my $conf = new FS::Conf; + +my $custnum; +if ( $cgi->param('error') ) { + $custnum = scalar($cgi->param('custnum')); + + die "access denied" + unless $curuser->access_right(($custnum ? 'Edit' : 'New'). ' customer'); #payment methods? + +} elsif ( $cgi->keywords ) { #editing + $custnum = ($cgi->keywords)[0]; + + die "access denied" + unless $curuser->access_right('Edit customer'); + +} else { #new customer + + #this doesn't really work here, we're an edit only + die "guru meditation #53"; + + die "access denied" + unless $curuser->access_right('New customer'); + +} + + +#XXX +my %payby_fields = ( + 'CARD' => [ 'CARD_payinfo' => mt('Card number'), + 'CARD_exp' => { + label => 'Expiration', + type => 'select-month_year', + #XXX prefix? + }, + 'CARD_paycvv' => 'CVV2', #XXX help popup + 'CARD_payname' => mt('Exact name on card'), + 'CARD_payauto' => { label => mt('Charge future payments to this credit card automatically'), + type => 'checkbox', + }, + ], + 'CHEK' => [ 'CHEK_payinfo1' => mt('Account number'), + 'CHEK_paytype' => { label => 'Type', + #XXX select values + #@FS::cust_main::paytypes #?? + }, + 'CHEK_payinfo2' => mt('ABA/Routing number'), #XXX help popup + 'CHEK_exp_month' => { type => 'hidden', + value => 12, + }, + 'CHEK_exp_year' => { type => 'hidden', + value => 2037, + }, + 'CHEK_payname' => mt('Bank name'), + #'CHEK_paystate' => { label => $paystate_label, + # type => 'select-state', + # }, + 'CHEK_payauto' => { label => mt('Charge future payments to this electronic check automatically'), + type => 'checkbox', + }, + ], + #'LECB' + 'BILL' => [ 'BILL_payinfo' => mt('P.O.'), + 'BILL_exp_month' => { type => 'hidden', + value => 12, + }, + 'BILL_exp_year' => { type => 'hidden', + value => 2037, + }, + 'BILL_payname' => mt('Attention'), + ], + 'COMP' => [ + 'COMP_payinfo' => mt('Approved by'), + ], + +); + +#XXX +my $payby_layer_values = sub { + my ( $cgi, $cust_payby, $switches ) = @_; + +{ +# #map { $_ => { $part_event_condition->options } } +# # keys %condition_fields +# map { my $conditionname = $_; +# my %opts = $switches->{'mode'} eq 'error' +# ? %{ $cgi_conditions{$conditionname} || {} } +# : $part_event_condition->options; +# %opts = ( +# map { ( "$conditionname.$_" => $opts{$_} ); } +# keys %opts +# ); +# ( $conditionname => \%opts ); +# } +# keys %condition_fields + }; +}; + + +#my $new_callback = sub { +# my( $cgi, $cust_main, $fields_listref, $opt_hashref ) = @_; +#}; + +#my $edit_callback = sub { +# my( $cgi, $cust_main, $fields_listref, $opt_hashref ) = @_; +#}; + +#my $error_callback = sub { +# my( $cgi, $cust_main, $fields_listref, $opt_hashref ) = @_; +#}; + +my $m2_error_callback = sub { + my($cgi, $object) = @_; + + #XXX + + #process_o2m fields in process/cust_main-contacts.html + my @fields = qw( first last title comment ); + my @gfields = ( '', map "_$_", @fields ); + + map { + if ( /^contactnum(\d+)$/ ) { + my $num = $1; + if ( grep $cgi->param("contactnum$num$_"), @gfields ) { + my $x = new FS::contact { + 'contactnum' => scalar($cgi->param("contactnum$num")), + map { $_ => scalar($cgi->param("contactnum${num}_$_")) } @fields, + }; + $x; + } else { + (); + } + } else { + (); + } + } + $cgi->param; +}; + + diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html index 051788cf7..6c965326b 100644 --- a/httemplate/edit/elements/edit.html +++ b/httemplate/edit/elements/edit.html @@ -116,6 +116,9 @@ Example: # display of primary key, no submit button, no html_foot, no footer) 'embed' => $object, #need to pass the object + #don't show the primary key label and value + 'no_pkey_display' => 1, + ### # HTML callbacks ### @@ -236,13 +239,17 @@ Example: - - <% ( $opt{labels} && exists $opt{labels}->{$pkey} ) - ? $opt{labels}->{$pkey} - : $pkey - %> - - #<% ( !$clone && $object->$pkey() ) || "(NEW)" %> +% unless ( $opt{'no_pkey_display'} ) { + + + <% ( $opt{labels} && exists $opt{labels}->{$pkey} ) + ? $opt{labels}->{$pkey} + : $pkey + %> + + #<% ( !$clone && $object->$pkey() ) || "(NEW)" %> + +% } % } diff --git a/httemplate/edit/process/cable_provider.html b/httemplate/edit/process/cable_provider.html new file mode 100644 index 000000000..ecffaf692 --- /dev/null +++ b/httemplate/edit/process/cable_provider.html @@ -0,0 +1,10 @@ +<& elements/process.html, + 'table' => 'cable_provider', + 'viewall_dir' => 'browse', +&> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + diff --git a/httemplate/edit/process/cust_payby.html b/httemplate/edit/process/cust_payby.html new file mode 100644 index 000000000..a999e4d74 --- /dev/null +++ b/httemplate/edit/process/cust_payby.html @@ -0,0 +1,19 @@ +<% include('elements/process.html', + 'table' => 'cust_main', + 'error_redirect' => popurl(3). 'edit/cust_payby.html?', + 'agent_virt' => 1, + 'skip_process' => 1, #we don't want to make any changes to cust_main + 'process_o2m' => { + 'table' => 'cust_payby', + 'fields' => \@payby_fields, + }, + 'redirect' => popurl(3). 'view/cust_main.cgi?', + ) +%> +<%init> + +#XXX +my @payby_fields = qw(); +} + + diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index c8fe5f2e8..8cb967518 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -521,6 +521,7 @@ tie my %config_radius, 'Tie::IxHash', ; tie my %config_cable, 'Tie::IxHash', + 'Cable providers' => [ $fsurl.'browse/cable_provider.html', '' ], 'Cable modem models' => [ $fsurl.'browse/cable_model.html', '' ], ; diff --git a/httemplate/elements/select-cable_provider.html b/httemplate/elements/select-cable_provider.html new file mode 100644 index 000000000..9530b78c0 --- /dev/null +++ b/httemplate/elements/select-cable_provider.html @@ -0,0 +1,7 @@ +<% include( '/elements/select-table.html', + 'table' => 'cable_provider', + 'name_col' => 'provider', + 'empty_label' => 'Select provider', + @_, + ) +%> diff --git a/httemplate/elements/tr-select-cable_provider.html b/httemplate/elements/tr-select-cable_provider.html new file mode 100644 index 000000000..abb8564dc --- /dev/null +++ b/httemplate/elements/tr-select-cable_provider.html @@ -0,0 +1,12 @@ +% #if ( scalar(@domains) < 2 ) { +% #} else { + + <% $opt{'label'} || 'Provider' %> + + <% include( '/elements/select-cable_provider.html', %opt) %> + + +% #} +<%init> + my %opt = @_; + diff --git a/httemplate/elements/tr-select-month_year.html b/httemplate/elements/tr-select-month_year.html new file mode 100644 index 000000000..b1943bdbd --- /dev/null +++ b/httemplate/elements/tr-select-month_year.html @@ -0,0 +1,22 @@ +% unless ( $opt{'js_only'} ) { + + <% include('tr-td-label.html', %opt ) %> + + <% $style %>> +% } + + <% include('select-month_year.html', %opt ) %> + +% unless ( $opt{'js_only'} ) { + + +% } +<%init> + +my %opt = @_; + +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + +my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : ''; + + diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 430c50c5f..391988190 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -147,7 +147,6 @@ function areyousure(href, message) { % if ( $br ) {

    % } - %my $signupurl = $conf->config('signupurl'); %if ( $signupurl ) { diff --git a/ng_selfservice/.freeside.class.php.swp b/ng_selfservice/.freeside.class.php.swp deleted file mode 100644 index 5c3952439..000000000 Binary files a/ng_selfservice/.freeside.class.php.swp and /dev/null differ diff --git a/ng_selfservice/.index.php.swp b/ng_selfservice/.index.php.swp deleted file mode 100644 index 50c9cfbc5..000000000 Binary files a/ng_selfservice/.index.php.swp and /dev/null differ diff --git a/ng_selfservice/.logout.php.swp b/ng_selfservice/.logout.php.swp deleted file mode 100644 index ec27faaed..000000000 Binary files a/ng_selfservice/.logout.php.swp and /dev/null differ diff --git a/ng_selfservice/.main.php.swp b/ng_selfservice/.main.php.swp deleted file mode 100644 index cc5562690..000000000 Binary files a/ng_selfservice/.main.php.swp and /dev/null differ diff --git a/ng_selfservice/.password.php.swp b/ng_selfservice/.password.php.swp deleted file mode 100644 index e1e968f1f..000000000 Binary files a/ng_selfservice/.password.php.swp and /dev/null differ diff --git a/ng_selfservice/.payment.php.swp b/ng_selfservice/.payment.php.swp deleted file mode 100644 index 2b705a31f..000000000 Binary files a/ng_selfservice/.payment.php.swp and /dev/null differ diff --git a/ng_selfservice/.payment_ach.php.swp b/ng_selfservice/.payment_ach.php.swp deleted file mode 100644 index 1a87a2d34..000000000 Binary files a/ng_selfservice/.payment_ach.php.swp and /dev/null differ diff --git a/ng_selfservice/.payment_cc.php.swp b/ng_selfservice/.payment_cc.php.swp deleted file mode 100644 index 369d104d1..000000000 Binary files a/ng_selfservice/.payment_cc.php.swp and /dev/null differ diff --git a/ng_selfservice/.payment_paypal.php.swp b/ng_selfservice/.payment_paypal.php.swp deleted file mode 100644 index 3abff2f4d..000000000 Binary files a/ng_selfservice/.payment_paypal.php.swp and /dev/null differ diff --git a/ng_selfservice/.payment_webpay.php.swp b/ng_selfservice/.payment_webpay.php.swp deleted file mode 100644 index 6ef3df9d9..000000000 Binary files a/ng_selfservice/.payment_webpay.php.swp and /dev/null differ diff --git a/ng_selfservice/.personal.php.swp b/ng_selfservice/.personal.php.swp deleted file mode 100644 index f5e8c23c1..000000000 Binary files a/ng_selfservice/.personal.php.swp and /dev/null differ diff --git a/ng_selfservice/.process_login.php.swp b/ng_selfservice/.process_login.php.swp deleted file mode 100644 index c530f11d6..000000000 Binary files a/ng_selfservice/.process_login.php.swp and /dev/null differ diff --git a/ng_selfservice/.process_ticket_create.php.swp b/ng_selfservice/.process_ticket_create.php.swp deleted file mode 100644 index c286792cd..000000000 Binary files a/ng_selfservice/.process_ticket_create.php.swp and /dev/null differ diff --git a/ng_selfservice/.services.php.swp b/ng_selfservice/.services.php.swp deleted file mode 100644 index e063e406b..000000000 Binary files a/ng_selfservice/.services.php.swp and /dev/null differ diff --git a/ng_selfservice/.services_new.php.swp b/ng_selfservice/.services_new.php.swp deleted file mode 100644 index 8d0c657af..000000000 Binary files a/ng_selfservice/.services_new.php.swp and /dev/null differ diff --git a/ng_selfservice/.ticket.php.swp b/ng_selfservice/.ticket.php.swp deleted file mode 100644 index e9b25032b..000000000 Binary files a/ng_selfservice/.ticket.php.swp and /dev/null differ diff --git a/ng_selfservice/.ticket_create.php.swp b/ng_selfservice/.ticket_create.php.swp deleted file mode 100644 index 65b00fe06..000000000 Binary files a/ng_selfservice/.ticket_create.php.swp and /dev/null differ diff --git a/ng_selfservice/.tickets.php.swp b/ng_selfservice/.tickets.php.swp deleted file mode 100644 index 7b4d67b48..000000000 Binary files a/ng_selfservice/.tickets.php.swp and /dev/null differ diff --git a/ng_selfservice/.tickets_resolved.php.swp b/ng_selfservice/.tickets_resolved.php.swp deleted file mode 100644 index 1b3c634f0..000000000 Binary files a/ng_selfservice/.tickets_resolved.php.swp and /dev/null differ diff --git a/ng_selfservice/.usage.php.swp b/ng_selfservice/.usage.php.swp deleted file mode 100644 index 61fd4fa4d..000000000 Binary files a/ng_selfservice/.usage.php.swp and /dev/null differ diff --git a/ng_selfservice/.usage_cdr.php.swp b/ng_selfservice/.usage_cdr.php.swp deleted file mode 100644 index 83c270a83..000000000 Binary files a/ng_selfservice/.usage_cdr.php.swp and /dev/null differ diff --git a/ng_selfservice/.usage_data.php.swp b/ng_selfservice/.usage_data.php.swp deleted file mode 100644 index e5a9272b0..000000000 Binary files a/ng_selfservice/.usage_data.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.card.php.swp b/ng_selfservice/elements/.card.php.swp deleted file mode 100644 index 15d30cefd..000000000 Binary files a/ng_selfservice/elements/.card.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.check.php.swp b/ng_selfservice/elements/.check.php.swp deleted file mode 100644 index fe08303ff..000000000 Binary files a/ng_selfservice/elements/.check.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.error.php.swp b/ng_selfservice/elements/.error.php.swp deleted file mode 100644 index 1a6eb2833..000000000 Binary files a/ng_selfservice/elements/.error.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.header.php.swp b/ng_selfservice/elements/.header.php.swp deleted file mode 100644 index 237177069..000000000 Binary files a/ng_selfservice/elements/.header.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.menu.php.swp b/ng_selfservice/elements/.menu.php.swp deleted file mode 100644 index 0c29ff942..000000000 Binary files a/ng_selfservice/elements/.menu.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.menu_footer.php.swp b/ng_selfservice/elements/.menu_footer.php.swp deleted file mode 100644 index 4bd2b30a8..000000000 Binary files a/ng_selfservice/elements/.menu_footer.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.session.php.swp b/ng_selfservice/elements/.session.php.swp deleted file mode 100644 index ddd013701..000000000 Binary files a/ng_selfservice/elements/.session.php.swp and /dev/null differ diff --git a/ng_selfservice/elements/.ticketlist.php.swp b/ng_selfservice/elements/.ticketlist.php.swp deleted file mode 100644 index db3d0fe4a..000000000 Binary files a/ng_selfservice/elements/.ticketlist.php.swp and /dev/null differ diff --git a/ng_selfservice/js/.menu.js.swp b/ng_selfservice/js/.menu.js.swp deleted file mode 100644 index 8df94a9c4..000000000 Binary files a/ng_selfservice/js/.menu.js.swp and /dev/null differ diff --git a/rt/lib/RT/Interface/Web.pm b/rt/lib/RT/Interface/Web.pm index 4a6bfda88..2dc16e3f3 100644 --- a/rt/lib/RT/Interface/Web.pm +++ b/rt/lib/RT/Interface/Web.pm @@ -2070,7 +2070,6 @@ sub _ProcessUpdateMessageRecipients { if (grep $_ eq 'Requestor' || $_ eq 'Requestors', @{ $args{ARGSRef}->{'SkipNotification'} || [] }) { push @txn_squelch, map $_->address, Email::Address->parse( $message_args->{Requestor} ); push @txn_squelch, $args{TicketObj}->Requestors->MemberEmailAddresses; - } push @txn_squelch, @{$args{ARGSRef}{SquelchMailTo}} if $args{ARGSRef}{SquelchMailTo}; @@ -2092,6 +2091,39 @@ sub _ProcessUpdateMessageRecipients { } } +sub ProcessAttachments { + my %args = ( + ARGSRef => {}, + @_ + ); + + my $ARGSRef = $args{ARGSRef} || {}; + # deal with deleting uploaded attachments + foreach my $key ( keys %$ARGSRef ) { + if ( $key =~ m/^DeleteAttach-(.+)$/ ) { + delete $session{'Attachments'}{$1}; + } + $session{'Attachments'} = { %{ $session{'Attachments'} || {} } }; + } + + # store the uploaded attachment in session + if ( defined $ARGSRef->{'Attach'} && length $ARGSRef->{'Attach'} ) + { # attachment? + my $attachment = MakeMIMEEntity( AttachmentFieldName => 'Attach' ); + + my $file_path = Encode::decode_utf8("$ARGSRef->{'Attach'}"); + $session{'Attachments'} = + { %{ $session{'Attachments'} || {} }, $file_path => $attachment, }; + } + + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGSRef->{'UpdateAttach'} ) + { + delete $session{'Attachments'}; + } +} + + =head2 MakeMIMEEntity PARAMHASH Takes a paramhash Subject, Body and AttachmentFieldName. @@ -2174,37 +2206,6 @@ sub MakeMIMEEntity { } -sub ProcessAttachments { - my %args = ( - ARGSRef => {}, - @_ - ); - - my $ARGSRef = $args{ARGSRef} || {}; - # deal with deleting uploaded attachments - foreach my $key ( keys %$ARGSRef ) { - if ( $key =~ m/^DeleteAttach-(.+)$/ ) { - delete $session{'Attachments'}{$1}; - } - $session{'Attachments'} = { %{ $session{'Attachments'} || {} } }; - } - - # store the uploaded attachment in session - if ( defined $ARGSRef->{'Attach'} && length $ARGSRef->{'Attach'} ) - { # attachment? - my $attachment = MakeMIMEEntity( AttachmentFieldName => 'Attach' ); - - my $file_path = Encode::decode_utf8("$ARGSRef->{'Attach'}"); - $session{'Attachments'} = - { %{ $session{'Attachments'} || {} }, $file_path => $attachment, }; - } - - # delete temporary storage entry to make WebUI clean - unless ( keys %{ $session{'Attachments'} } and $ARGSRef->{'UpdateAttach'} ) - { - delete $session{'Attachments'}; - } -} =head2 ParseDateToISO diff --git a/rt/share/html/Ticket/Update.html b/rt/share/html/Ticket/Update.html index 26a37e80a..8a3d8e30d 100755 --- a/rt/share/html/Ticket/Update.html +++ b/rt/share/html/Ticket/Update.html @@ -290,6 +290,7 @@ if ( $ARGS{'SubmitTicket'} ) { my %squelched = ProcessTransactionSquelching( \%ARGS ); $ARGS{'SquelchMailTo'} = [keys %squelched] if keys %squelched; +warn @{ $ARGS{'SquelchMailTo'} } if $ARGS{'SquelchMailTo'}; my $CFs = $TicketObj->TransactionCustomFields; my $ValidCFs = $m->comp( @@ -311,6 +312,7 @@ if ( $ARGS{'SubmitTicket'} ) { ); $checks_failure = 1 unless $status; } +warn @{ $ARGS{'SquelchMailTo'} } if $ARGS{'SquelchMailTo'}; # check email addresses for RT's {