[freeside-commits] freeside/httemplate/edit REAL_cust_pkg.cgi, 1.15, 1.16 access_user.html, 1.5, 1.6 agent.cgi, 1.17, 1.18 agent_payment_gateway.html, 1.4, 1.5 agent_type.cgi, 1.17, 1.18 bulk-cust_svc.html, 1.3, 1.4 cust_bill_pay.cgi, 1.16, 1.17 cust_credit.cgi, 1.20, 1.21 cust_credit_bill.cgi, 1.15, 1.16 cust_main.cgi, 1.83, 1.84 cust_main_county-expand.cgi, 1.12, 1.13 cust_main_note.cgi, 1.3, 1.4 cust_pay.cgi, 1.25, 1.26 cust_pkg.cgi, 1.13, 1.14 cust_refund.cgi, 1.6, 1.7 inventory_class.html, 1.3, 1.4 part_bill_event.cgi, 1.40, 1.41 part_export.cgi, 1.28, 1.29 part_pkg.cgi, 1.78, 1.79 part_referral.html, 1.3, 1.4 part_svc.cgi, 1.58, 1.59 part_virtual_field.cgi, 1.8, 1.9 payment_gateway.html, 1.8, 1.9 pkg_class.html, 1.3, 1.4 prepay_credit.cgi, 1.6, 1.7 quick-charge.html, 1.4, 1.5 rate.cgi, 1.14, 1.15 rate_region.cgi, 1.6, 1.7 reason.html, 1.4, 1.5 reason_type.html, 1.2, 1.3 reg_code.cgi, 1.5, 1.6 router.cgi, 1.6, 1.7 svc_Common.html, 1.1, 1.2 svc_acct.cgi, 1.51, 1.52 svc_acct_pop.cgi, 1.9, 1.10 svc_broadband.cgi, 1.15, 1.16 svc_domain.cgi, 1.15, 1.16 svc_external.cgi, 1.4, 1.5 svc_forward.cgi, 1.20, 1.21 svc_phone.cgi, 1.2, 1.3 svc_www.cgi, 1.23, 1.24
Ivan,,,
ivan at wavetail.420.am
Sun Jan 13 13:35:55 PST 2008
- Previous message: [freeside-commits] freeside/httemplate/misc/process batch-cust_pay.cgi, 1.3, 1.3.2.1 cancel_pkg.html, 1.4.2.1, 1.4.2.2 catchall.cgi, 1.5, 1.5.2.1 cdr-import.html, 1.3.2.1, 1.3.2.2 cust_main-import.cgi, 1.5.2.1, 1.5.2.2 cust_main-import_charges.cgi, 1.4.2.1, 1.4.2.2 delete-customer.cgi, 1.5, 1.5.2.1 inventory_item-import.html, 1.3.2.1, 1.3.2.2 link.cgi, 1.15.2.2, 1.15.2.3 meta-import.cgi, 1.7.2.1, 1.7.2.2 payment.cgi, 1.9.2.6, 1.9.2.7 recharge_svc.html, 1.2.2.4, 1.2.2.5
- Next message: [freeside-commits] freeside/httemplate/edit/process REAL_cust_pkg.cgi, 1.9, 1.10 access_user.html, 1.5, 1.6 agent.cgi, 1.5, 1.6 agent_payment_gateway.html, 1.2, 1.3 agent_type.cgi, 1.8, 1.9 bulk-cust_svc.cgi, 1.2, 1.3 cust_bill_pay.cgi, 1.6, 1.7 cust_credit.cgi, 1.11, 1.12 cust_credit_bill.cgi, 1.8, 1.9 cust_main.cgi, 1.35, 1.36 cust_main_county-collapse.cgi, 1.5, 1.6 cust_main_county-expand.cgi, 1.9, 1.10 cust_main_county.html, 1.1, 1.2 cust_main_note.cgi, 1.4, 1.5 cust_pay.cgi, 1.12, 1.13 cust_pkg.cgi, 1.7, 1.8 cust_refund.cgi, 1.7, 1.8 cust_svc.cgi, 1.3, 1.4 domain_record.cgi, 1.4, 1.5 generic.cgi, 1.4, 1.5 inventory_class.html, 1.3, 1.4 msgcat.cgi, 1.3, 1.4 part_bill_event.cgi, 1.10, 1.11 part_export.cgi, 1.8, 1.9 part_pkg.cgi, 1.24, 1.25 part_referral.html, 1.2, 1.3 part_svc.cgi, 1.14, 1.15 payment_gateway.html, 1.4, 1.5 pkg_class.html, 1.2, 1.3 prepay_credit.cgi, 1.6, 1.7 quick-charge.cgi, 1.11, 1.12 quick-cust_pkg.cgi, 1.10, 1.11 rate.cgi, 1.8, 1.9 reason.html, 1.1, 1.2 reason_type.html, 1.1, 1.2 reg_code.cgi, 1.5, 1.6 router.cgi, 1.5, 1.6 svc_Common.html, 1.1, 1.2 svc_acct.cgi, 1.10, 1.11 svc_acct_pop.cgi, 1.5, 1.6 svc_broadband.cgi, 1.6, 1.7 svc_domain.cgi, 1.5, 1.6 svc_external.cgi, 1.2, 1.3 svc_forward.cgi, 1.5, 1.6 svc_phone.html, 1.2, 1.3 svc_www.cgi, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv7082
Modified Files:
REAL_cust_pkg.cgi access_user.html agent.cgi
agent_payment_gateway.html agent_type.cgi bulk-cust_svc.html
cust_bill_pay.cgi cust_credit.cgi cust_credit_bill.cgi
cust_main.cgi cust_main_county-expand.cgi cust_main_note.cgi
cust_pay.cgi cust_pkg.cgi cust_refund.cgi inventory_class.html
part_bill_event.cgi part_export.cgi part_pkg.cgi
part_referral.html part_svc.cgi part_virtual_field.cgi
payment_gateway.html pkg_class.html prepay_credit.cgi
quick-charge.html rate.cgi rate_region.cgi reason.html
reason_type.html reg_code.cgi router.cgi svc_Common.html
svc_acct.cgi svc_acct_pop.cgi svc_broadband.cgi svc_domain.cgi
svc_external.cgi svc_forward.cgi svc_phone.cgi svc_www.cgi
Log Message:
ACLs
Index: cust_bill_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_bill_pay.cgi,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cust_bill_pay.cgi 25 Dec 2007 23:49:21 -0000 1.16
+++ cust_bill_pay.cgi 13 Jan 2008 21:35:52 -0000 1.17
@@ -1,4 +1,4 @@
-<% header("Apply Payment", '') %>
+<% include('/elements/header-popup.html', 'Apply Payment') %>
<% include('/elements/error.html') %>
@@ -47,10 +47,15 @@
<CENTER><INPUT TYPE="submit" VALUE="Apply"></CENTER>
</FORM>
-</BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Apply payment') #;
+ || $FS::CurrentUser::CurrentUser->access_right('Post payment'): #remove after 1.7.3
+
my($paynum, $amount, $invnum);
if ( $cgi->param('error') ) {
$paynum = $cgi->param('paynum');
@@ -78,5 +83,5 @@
}
grep { $_->owed != 0 }
qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } );
-</%init>
+</%init>
Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main.cgi,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- cust_main.cgi 17 Dec 2007 00:59:01 -0000 1.83
+++ cust_main.cgi 13 Jan 2008 21:35:52 -0000 1.84
@@ -1,110 +1,10 @@
-%
-%
-% #for misplaced logic below
-% #use FS::part_pkg;
-%
-% #for false laziness below (now more properly lazy)
-% #use FS::svc_acct_pop;
-%
-% #for (other) false laziness below
-% #use FS::agent;
-% #use FS::type_pkgs;
-%
-%my $conf = new FS::Conf;
-%
-%#get record
-%
-%my $error = '';
-%my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart, $saved_domsvc);
-%my(@invoicing_list);
-%my ($ss,$stateid,$payinfo);
-%my $same = '';
-%if ( $cgi->param('error') ) {
-% $error = $cgi->param('error');
-% $cust_main = new FS::cust_main ( {
-% map { $_, scalar($cgi->param($_)) } fields('cust_main')
-% } );
-% $custnum = $cust_main->custnum;
-% $saved_domsvc = $cgi->param('domsvc') || '';
-% if ( $saved_domsvc =~ /^(\d+)$/ ) {
-% $saved_domsvc = $1;
-% } else {
-% $saved_domsvc = '';
-% }
-% $saved_pkgpart = $cgi->param('pkgpart_svcpart') || '';
-% if ( $saved_pkgpart =~ /^(\d+)_/ ) {
-% $saved_pkgpart = $1;
-% } else {
-% $saved_pkgpart = '';
-% }
-% $username = $cgi->param('username');
-% $password = $cgi->param('_password');
-% $popnum = $cgi->param('popnum');
-% @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
-% $same = $cgi->param('same');
-% $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid');
-% $ss = $cust_main->ss; # don't mask an entered value on errors
-% $stateid = $cust_main->stateid; # don't mask an entered value on errors
-% $payinfo = $cust_main->payinfo; # don't mask an entered value on errors
-%} elsif ( $cgi->keywords ) { #editing
-% my( $query ) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $custnum=$1;
-% $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
-% if ( $cust_main->dbdef_table->column('paycvv')
-% && length($cust_main->paycvv) ) {
-% my $paycvv = $cust_main->paycvv;
-% $paycvv =~ s/./*/g;
-% $cust_main->paycvv($paycvv);
-% }
-% $saved_pkgpart = 0;
-% $saved_domsvc = 0;
-% $username = '';
-% $password = '';
-% $popnum = 0;
-% @invoicing_list = $cust_main->invoicing_list;
-% $ss = $cust_main->masked('ss');
-% $stateid = $cust_main->masked('stateid');
-% $payinfo = $cust_main->paymask;
-%} else {
-% $custnum='';
-% $cust_main = new FS::cust_main ( {} );
-% $cust_main->otaker( &getotaker );
-% $cust_main->referral_custnum( $cgi->param('referral_custnum') );
-% $saved_pkgpart = 0;
-% $saved_domsvc = 0;
-% $username = '';
-% $password = '';
-% $popnum = 0;
-% @invoicing_list = ();
-% push @invoicing_list, 'POST'
-% unless $conf->exists('disablepostalinvoicedefault');
-% $ss = '';
-% $stateid = '';
-% $payinfo = '';
-%}
-%$cgi->delete_all();
-%
-%my $action = $custnum ? 'Edit' : 'Add';
-%$action .= ": ". $cust_main->name if $custnum;
-%
-%my $r = qq!<font color="#ff0000">*</font> !;
-%
-%
-
-
-<!-- top -->
-
<% include('/elements/header.html',
"Customer $action",
'',
' onUnload="myclose()"'
) %>
-% if ( $error ) {
-
-<FONT SIZE="+1" COLOR="#ff0000">Error: <% $error %></FONT><BR><BR>
-% }
+<% include('/elements.error.html') %>
<FORM NAME="topform" STYLE="margin-bottom: 0">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
@@ -544,3 +444,97 @@
<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit customer');
+
+#for misplaced logic below
+#use FS::part_pkg;
+
+#for false laziness below (now more properly lazy)
+#use FS::svc_acct_pop;
+
+#for (other) false laziness below
+#use FS::agent;
+#use FS::type_pkgs;
+
+my $conf = new FS::Conf;
+
+#get record
+
+my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart, $saved_domsvc);
+my(@invoicing_list);
+my ($ss,$stateid,$payinfo);
+my $same = '';
+if ( $cgi->param('error') ) {
+ $cust_main = new FS::cust_main ( {
+ map { $_, scalar($cgi->param($_)) } fields('cust_main')
+ } );
+ $custnum = $cust_main->custnum;
+ $saved_domsvc = $cgi->param('domsvc') || '';
+ if ( $saved_domsvc =~ /^(\d+)$/ ) {
+ $saved_domsvc = $1;
+ } else {
+ $saved_domsvc = '';
+ }
+ $saved_pkgpart = $cgi->param('pkgpart_svcpart') || '';
+ if ( $saved_pkgpart =~ /^(\d+)_/ ) {
+ $saved_pkgpart = $1;
+ } else {
+ $saved_pkgpart = '';
+ }
+ $username = $cgi->param('username');
+ $password = $cgi->param('_password');
+ $popnum = $cgi->param('popnum');
+ @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
+ $same = $cgi->param('same');
+ $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid');
+ $ss = $cust_main->ss; # don't mask an entered value on errors
+ $stateid = $cust_main->stateid; # don't mask an entered value on errors
+ $payinfo = $cust_main->payinfo; # don't mask an entered value on errors
+} elsif ( $cgi->keywords ) { #editing
+ my( $query ) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $custnum=$1;
+ $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+ if ( $cust_main->dbdef_table->column('paycvv')
+ && length($cust_main->paycvv) ) {
+ my $paycvv = $cust_main->paycvv;
+ $paycvv =~ s/./*/g;
+ $cust_main->paycvv($paycvv);
+ }
+ $saved_pkgpart = 0;
+ $saved_domsvc = 0;
+ $username = '';
+ $password = '';
+ $popnum = 0;
+ @invoicing_list = $cust_main->invoicing_list;
+ $ss = $cust_main->masked('ss');
+ $stateid = $cust_main->masked('stateid');
+ $payinfo = $cust_main->paymask;
+} else {
+ $custnum='';
+ $cust_main = new FS::cust_main ( {} );
+ $cust_main->otaker( &getotaker );
+ $cust_main->referral_custnum( $cgi->param('referral_custnum') );
+ $saved_pkgpart = 0;
+ $saved_domsvc = 0;
+ $username = '';
+ $password = '';
+ $popnum = 0;
+ @invoicing_list = ();
+ push @invoicing_list, 'POST'
+ unless $conf->exists('disablepostalinvoicedefault');
+ $ss = '';
+ $stateid = '';
+ $payinfo = '';
+}
+$cgi->delete_all();
+
+my $action = $custnum ? 'Edit' : 'Add';
+$action .= ": ". $cust_main->name if $custnum;
+
+my $r = qq!<font color="#ff0000">*</font> !;
+
+</%init>
Index: agent.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- agent.cgi 25 Dec 2007 23:49:21 -0000 1.17
+++ agent.cgi 13 Jan 2008 21:35:52 -0000 1.18
@@ -1,5 +1,4 @@
<% include("/elements/header.html","$action Agent", menubar(
- 'Main Menu' => $p,
'View all agents' => $p. 'browse/agent.cgi',
)) %>
@@ -77,6 +76,9 @@
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
my $agent;
if ( $cgi->param('error') ) {
$agent = new FS::agent ( {
@@ -94,5 +96,3 @@
my $conf = new FS::Conf;
</%init>
-
-
Index: svc_www.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_www.cgi,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- svc_www.cgi 23 Sep 2007 23:17:33 -0000 1.23
+++ svc_www.cgi 13 Jan 2008 21:35:53 -0000 1.24
@@ -1,227 +1,240 @@
-%my $conf = new FS::Conf;
-%
-%my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_www, $config );
-%
-%if ( $cgi->param('error') ) {
-%
-% $svc_www = new FS::svc_www ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_www')
-% } );
-% $svcnum = $svc_www->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $config = $cgi->param('config');
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_www = new FS::svc_www { svcpart => $svcpart };
-%
-% $svcnum='';
-%
-% $svc_www->set_default_and_fixed;
-%
-%} else { #editing
-%
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_www=qsearchs('svc_www',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_www) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-% $config=$cgi->escapeHTML($svc_www->config);
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%}
-%my $action = $svc_www->svcnum ? 'Edit' : 'Add';
-%
-%my( %svc_acct, %arec );
-%if ($pkgnum) {
-%
-% my @u_acct_svcparts;
-% foreach my $svcpart (
-% map { $_->svcpart } qsearch( 'part_svc', { 'svcdb' => 'svc_acct' } )
-% ) {
-% next if $conf->exists('svc_www-usersvc_svcpart')
-% && ! grep { $svcpart == $_ }
-% $conf->config('svc_www-usersvc_svcpart');
-% push @u_acct_svcparts, $svcpart;
-% }
-%
-% my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-% my($custnum)=$cust_pkg->getfield('custnum');
-% my($i_cust_pkg);
-% foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
-% my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
-% my($acct_svcpart);
-% foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
-% #record(s) in cust_svc ( for this
-% #pkgnum ! )
-% my($i_cust_svc);
-% foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
-% my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
-% $svc_acct{$svc_acct->getfield('svcnum')}=
-% $svc_acct->cust_svc->part_svc->svc. ': '. $svc_acct->email;
-% }
-% }
-% }
-%
-%
-% my($d_part_svc, at d_acct_svcparts);
-% foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) {
-% push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
-% }
-%
-% foreach $i_cust_pkg ( qsearch( 'cust_pkg', { 'custnum' => $custnum } ) ) {
-% my $cust_pkgnum = $i_cust_pkg->pkgnum;
-%
-% foreach my $acct_svcpart (@d_acct_svcparts) {
-%
-% foreach my $i_cust_svc (
-% qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
-% 'svcpart' => $acct_svcpart } )
-% ) {
-% my $svc_domain =
-% qsearchs( 'svc_domain', { 'svcnum' => $i_cust_svc->svcnum } );
-%
-% my $extra_sql = "AND ( rectype = 'A' OR rectype = 'CNAME' )";
-% unless ( $conf->exists('svc_www-enable_subdomains') ) {
-% $extra_sql .= " AND ( reczone = '\@' OR reczone = '".
-% $svc_domain->domain. ".' )";
-% }
-%
-% foreach my $domain_rec (
-% qsearch( 'domain_record',
-% {
-% 'svcnum' => $svc_domain->svcnum,
-% },
-% '',
-% $extra_sql,
-% )
-% ) {
-% $arec{$domain_rec->recnum} = $domain_rec->zone;
-% }
-%
-% if ( $conf->exists('svc_www-enable_subdomains') ) {
-% $arec{'www.'. $svc_domain->domain} = 'www.'. $svc_domain->domain
-% unless qsearchs( 'domain_record', {
-% svcnum => $svc_domain->svcnum,
-% reczone => 'www',
-% } )
-% || qsearchs( 'domain_record', {
-% svcnum => $svc_domain->svcnum,
-% reczone => 'www.'.$svc_domain->domain.'.',
-% } );
-% }
-%
-% $arec{'@.'. $svc_domain->domain} = $svc_domain->domain
-% unless qsearchs('domain_record', {
-% svcnum => $svc_domain->svcnum,
-% reczone => '@',
-% } )
-% || qsearchs('domain_record', {
-% svcnum => $svc_domain->svcnum,
-% reczone => $svc_domain->domain.'.',
-% } );
-%
-% }
-%
-% }
-% }
-%
-%} elsif ( $action eq 'Edit' ) {
-%
-% my($domain_rec) = qsearchs('domain_record', { 'recnum'=>$svc_www->recnum });
-% $arec{$svc_www->recnum} = join '.', $domain_rec->recdata, $domain_rec->reczone;
-%
-%} else {
-% die "\$action eq Add, but \$pkgnum is null!\n";
-%}
-%
-%
-%my $p1 = popurl(1);
+<% include('/elements/header.html', "Web Hosting $action") %>
-<% include("/elements/header.html", "Web Hosting $action", '') %>
+<% include('/elements.error.html') %>
-%print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-% "</FONT>"
-% if $cgi->param('error');
-%
-%print qq!<FORM ACTION="${p1}process/svc_www.cgi" METHOD=POST>!;
-%
-%#display
-%
-%
-%
-%#svcnum
-%print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
-%print qq!Service #<B>!, $svcnum ? $svcnum : "(NEW)", "</B><BR><BR>";
-%
-%#pkgnum
-%print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
-%
-%#svcpart
-%print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
-%
-%my($recnum,$usersvc)=(
-% $svc_www->recnum,
-% $svc_www->usersvc,
-%);
-%
-%print &ntable("#cccccc",2),
-% '<TR><TD ALIGN="right">Zone</TD><TD><SELECT NAME="recnum" SIZE=1>';
-%foreach $_ (keys %arec) {
-% print "<OPTION", $_ eq $recnum ? " SELECTED" : "",
-% qq! VALUE="$_">$arec{$_}!;
-%}
-%print "</SELECT></TD></TR>";
-%
-%if ( $part_svc->part_svc_column('usersvc')->columnflag ne 'F'
+<FORM ACTION="<%$p1%>process/svc_www.cgi" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
+Service #<B><% $svcnum ? $svcnum : "(NEW)" %></B>
+<BR><BR>
+
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
+
+<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
+
+% my $recnum = $svc_www->recnum;
+% my $usersvc = $svc_www->usersvc;
+
+<% &ntable("#cccccc",2) %>
+
+ <TR>
+ <TD ALIGN="right">Zone</TD>
+ <TD>
+ <SELECT NAME="recnum" SIZE=1>
+% foreach $_ (keys %arec) {
+ <OPTION<% $_ eq $recnum ? " SELECTED" : "" %> VALUE="<%$_%>"><%$arec{$_}%>
+% }
+ </SELECT>
+ </TD>
+ </TR>
+
+% if ( $part_svc->part_svc_column('usersvc')->columnflag ne 'F'
% || $part_svc->part_svc_column('usersvc')->columnvalue !~ /^\s*$/) {
-% print '<TR><TD ALIGN="right">Username</TD><TD><SELECT NAME="usersvc" SIZE=1>';
-% print '<OPTION VALUE="">(none)';
-% foreach $_ (keys %svc_acct) {
-% print "<OPTION", ($_ eq $usersvc) ? " SELECTED" : "",
-% qq! VALUE="$_">$svc_acct{$_}!;
-% }
-% print "</SELECT></TD></TR>";
-%}
-%
-%if ( $part_svc->part_svc_column('config')->columnflag ne 'F' &&
-% $FS::CurrentUser::CurrentUser->access_right('Edit www config') ) {
-% print '<TR><TD ALIGN="right">Config lines</TD><TD>';
-% print qq!<TEXTAREA NAME="config" rows="15" cols="80">$config</TEXTAREA></TD></TR>!
-%}else{
-% print qq!<INPUT TYPE="hidden" NAME="config" VALUE="$config">!;
-%}
-%
-%foreach my $field ($svc_www->virtual_fields) {
-% if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
-% # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
-% print $svc_www->pvf($field)->widget('HTML', 'edit',
-% $svc_www->getfield($field));
-% }
+ <TR>
+ <TD ALIGN="right">Username</TD>
+ <TD>
+ <SELECT NAME="usersvc" SIZE=1>
+ <OPTION VALUE="">(none)
+% foreach $_ (keys %svc_acct) {
+ <OPTION<% ($_ eq $usersvc) ? " SELECTED" : "" %> VALUE="<%$_%>"><% $svc_acct{$_} %>
+% }
+ <SELECT>
+ </TD>
+ </TR>
+% }
+
+% if ( $part_svc->part_svc_column('config')->columnflag ne 'F' &&
+% $FS::CurrentUser::CurrentUser->access_right('Edit www config') ) {
+ <TR>
+ <TD ALIGN="right">Config lines</TD>
+ <TD>
+ <TEXTAREA NAME="config" rows="15" cols="80"><% $config |h %></TEXTAREA>
+ </TD>
+ </TR>
+% } else {
+ <INPUT TYPE="hidden" NAME="config" VALUE="<% $config |h %>">
%}
-%
-%print '</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">';
-%
+
+% foreach my $field ($svc_www->virtual_fields) {
+% if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
+% # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
+ <% $svc_www->pvf($field)->widget( 'HTML', 'edit',
+ $svc_www->getfield($field)
+ )
+ %>
+% }
+% }
+
+</TABLE>
+<BR>
+
+<INPUT TYPE="submit" VALUE="Submit">
</FORM>
<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my $conf = new FS::Conf;
+
+my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_www, $config );
+
+if ( $cgi->param('error') ) {
+
+ $svc_www = new FS::svc_www ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_www')
+ } );
+ $svcnum = $svc_www->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $config = $cgi->param('config');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_www = new FS::svc_www { svcpart => $svcpart };
+
+ $svcnum='';
+
+ $svc_www->set_default_and_fixed;
+
+} else { #editing
+
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_www=qsearchs('svc_www',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_www) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+ #$config=$cgi->escapeHTML($svc_www->config);
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+}
+my $action = $svc_www->svcnum ? 'Edit' : 'Add';
+
+my( %svc_acct, %arec );
+if ($pkgnum) {
+
+ my @u_acct_svcparts;
+ foreach my $svcpart (
+ map { $_->svcpart } qsearch( 'part_svc', { 'svcdb' => 'svc_acct' } )
+ ) {
+ next if $conf->exists('svc_www-usersvc_svcpart')
+ && ! grep { $svcpart == $_ }
+ $conf->config('svc_www-usersvc_svcpart');
+ push @u_acct_svcparts, $svcpart;
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ my($i_cust_pkg);
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ $svc_acct{$svc_acct->getfield('svcnum')}=
+ $svc_acct->cust_svc->part_svc->svc. ': '. $svc_acct->email;
+ }
+ }
+ }
+
+
+ my($d_part_svc, at d_acct_svcparts);
+ foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) {
+ push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
+ }
+
+ foreach $i_cust_pkg ( qsearch( 'cust_pkg', { 'custnum' => $custnum } ) ) {
+ my $cust_pkgnum = $i_cust_pkg->pkgnum;
+
+ foreach my $acct_svcpart (@d_acct_svcparts) {
+
+ foreach my $i_cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
+ 'svcpart' => $acct_svcpart } )
+ ) {
+ my $svc_domain =
+ qsearchs( 'svc_domain', { 'svcnum' => $i_cust_svc->svcnum } );
+
+ my $extra_sql = "AND ( rectype = 'A' OR rectype = 'CNAME' )";
+ unless ( $conf->exists('svc_www-enable_subdomains') ) {
+ $extra_sql .= " AND ( reczone = '\@' OR reczone = '".
+ $svc_domain->domain. ".' )";
+ }
+
+ foreach my $domain_rec (
+ qsearch( 'domain_record',
+ {
+ 'svcnum' => $svc_domain->svcnum,
+ },
+ '',
+ $extra_sql,
+ )
+ ) {
+ $arec{$domain_rec->recnum} = $domain_rec->zone;
+ }
+
+ if ( $conf->exists('svc_www-enable_subdomains') ) {
+ $arec{'www.'. $svc_domain->domain} = 'www.'. $svc_domain->domain
+ unless qsearchs( 'domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => 'www',
+ } )
+ || qsearchs( 'domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => 'www.'.$svc_domain->domain.'.',
+ } );
+ }
+
+ $arec{'@.'. $svc_domain->domain} = $svc_domain->domain
+ unless qsearchs('domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => '@',
+ } )
+ || qsearchs('domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => $svc_domain->domain.'.',
+ } );
+
+ }
+
+ }
+ }
+
+} elsif ( $action eq 'Edit' ) {
+
+ my($domain_rec) = qsearchs('domain_record', { 'recnum'=>$svc_www->recnum });
+ $arec{$svc_www->recnum} = join '.', $domain_rec->recdata, $domain_rec->reczone;
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my $p1 = popurl(1);
+
+</%init>
Index: cust_credit_bill.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_credit_bill.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cust_credit_bill.cgi 25 Dec 2007 23:49:21 -0000 1.15
+++ cust_credit_bill.cgi 13 Jan 2008 21:35:52 -0000 1.16
@@ -1,4 +1,4 @@
-<% header("Apply Credit", '') %>
+<% include('/elements/header-popup.html', 'Apply Credit') %>
<% include('/elements/error.html') %>
@@ -53,6 +53,11 @@
</HTML>
<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Apply credit') #;
+ || $FS::CurrentUser::CurrentUser->access_right('Post credit'): #remove after 1.7.3
+
my($crednum, $amount, $invnum);
if ( $cgi->param('error') ) {
#$cust_credit_bill = new FS::cust_credit_bill ( {
@@ -85,5 +90,5 @@
}
grep { $_->owed != 0 }
qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } );
-</%init>
+</%init>
Index: cust_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_credit.cgi,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- cust_credit.cgi 25 Dec 2007 23:49:21 -0000 1.20
+++ cust_credit.cgi 13 Jan 2008 21:35:52 -0000 1.21
@@ -48,12 +48,16 @@
</FORM>
</BODY>
</HTML>
-
<%once>
+
my $conf = new FS::Conf;
-</%once>
+</%once>
<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
+
my($custnum, $amount, $reason);
if ( $cgi->param('error') ) {
#$cust_credit = new FS::cust_credit ( {
@@ -76,4 +80,5 @@
my $otaker = getotaker;
my $p1 = popurl(1);
+
</%init>
Index: reason.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/reason.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- reason.html 4 Dec 2007 18:20:58 -0000 1.4
+++ reason.html 13 Jan 2008 21:35:52 -0000 1.5
@@ -42,3 +42,9 @@
'viewall_url' => $p . "browse/reason.html?class=$class",
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
Index: rate.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/rate.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- rate.cgi 10 Jan 2008 21:53:49 -0000 1.14
+++ rate.cgi 13 Jan 2008 21:35:52 -0000 1.15
@@ -1,5 +1,4 @@
<% include("/elements/header.html","$action Rate plan", menubar(
- 'Main Menu' => $p,
'View all rate plans' => "${p}browse/rate.cgi",
))
%>
Index: part_referral.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_referral.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- part_referral.html 1 Aug 2007 22:25:03 -0000 1.3
+++ part_referral.html 13 Jan 2008 21:35:52 -0000 1.4
@@ -10,3 +10,10 @@
'viewall_dir' => 'browse',
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit advertising sources')
+ || $FS::CurrentUser::CurrentUser->access_right('Edit global advertising sources');
+
+</%init>
Index: cust_main_note.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main_note.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cust_main_note.cgi 25 Dec 2007 23:49:21 -0000 1.3
+++ cust_main_note.cgi 13 Jan 2008 21:35:52 -0000 1.4
@@ -20,13 +20,12 @@
</HTML>
<%init>
-my($custnum, $comment, $notenum, $action);
-$comment = '';
+my $comment;
+my $notenum = '';
if ( $cgi->param('error') ) {
$comment = $cgi->param('comment');
-}elsif ($cgi->param('notenum')) {
- $cgi->param('notenum') =~ /^(\d+)$/;
+} elsif ( $cgi->param('notenum') =~ /^(\d+)$/ ) {
$notenum = $1;
die "illegal query ". $cgi->keywords unless $notenum;
my $note = qsearchs('cust_main_note', { 'notenum' => $notenum });
@@ -34,15 +33,13 @@
$comment = $note->comments;
}
-$cgi->param('notenum') =~ /^(\d+)$/;
-$notenum = $1;
-
-$cgi->param('custnum') =~ /^(\d+)$/;
-$custnum = $1;
+$cgi->param('custnum') =~ /^(\d+)$/ or die "illeagl custnum";
+my $custnum = $1;
-die "illegal query ". $cgi->keywords unless $custnum;
+my $action = $notenum ? 'Edit' : 'Add';
-$action = $notenum ? 'Edit' : 'Add';
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right("$action customer note");
</%init>
Index: cust_refund.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_refund.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cust_refund.cgi 25 Dec 2007 23:49:21 -0000 1.6
+++ cust_refund.cgi 13 Jan 2008 21:35:52 -0000 1.7
@@ -1,33 +1,3 @@
-%
-%
-%my $conf = new FS::Conf;
-%my $custnum = $cgi->param('custnum');
-%my $refund = $cgi->param('refund');
-%my $payby = $cgi->param('payby');
-%my $reason = $cgi->param('reason');
-%
-%my( $paynum, $cust_pay ) = ( '', '' );
-%if ( $cgi->param('paynum') =~ /^(\d+)$/ ) {
-% $paynum = $1;
-% $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } )
-% or die "unknown payment # $paynum";
-% $refund ||= $cust_pay->unrefunded;
-% if ( $custnum ) {
-% die "payment # $paynum is not for specified customer # $custnum"
-% unless $custnum == $cust_pay->custnum;
-% } else {
-% $custnum = $cust_pay->custnum;
-% }
-%}
-%die "no custnum or paynum specified!" unless $custnum;
-%
-%my $_date = time;
-%
-%my $p1 = popurl(1);
-%
-%
-
-
<% include('/elements/header.html', 'Refund '. ucfirst(lc($payby)). ' payment', '') %>
<% include('/elements/error.html') %>
@@ -138,3 +108,34 @@
<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Refund payment');
+
+my $conf = new FS::Conf;
+my $custnum = $cgi->param('custnum');
+my $refund = $cgi->param('refund');
+my $payby = $cgi->param('payby');
+my $reason = $cgi->param('reason');
+
+my( $paynum, $cust_pay ) = ( '', '' );
+if ( $cgi->param('paynum') =~ /^(\d+)$/ ) {
+ $paynum = $1;
+ $cust_pay = qsearchs('cust_pay', { paynum=>$paynum } )
+ or die "unknown payment # $paynum";
+ $refund ||= $cust_pay->unrefunded;
+ if ( $custnum ) {
+ die "payment # $paynum is not for specified customer # $custnum"
+ unless $custnum == $cust_pay->custnum;
+ } else {
+ $custnum = $cust_pay->custnum;
+ }
+}
+die "no custnum or paynum specified!" unless $custnum;
+
+my $_date = time;
+
+my $p1 = popurl(1);
+
+</%init>
Index: part_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_bill_event.cgi,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- part_bill_event.cgi 25 Dec 2007 23:49:21 -0000 1.40
+++ part_bill_event.cgi 13 Jan 2008 21:35:52 -0000 1.41
@@ -1,40 +1,6 @@
-<!--mason kludge-->
-%
-%
-%if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) {
-% $cgi->param('eventpart', $1);
-%} else {
-% $cgi->param('eventpart', '');
-%}
-%
-%my ($creason, $newcreasonT, $newcreason);
-%my ($sreason, $newsreasonT, $newsreason);
-%
-%
-%my ($query) = $cgi->keywords;
-%my $action = '';
-%my $part_bill_event = '';
-%my $currentreasonclass = '';
-%if ( $cgi->param('error') ) {
-% $part_bill_event = new FS::part_bill_event ( {
-% map { $_, scalar($cgi->param($_)) } fields('part_bill_event')
-% } );
-%}
-%if ( $query && $query =~ /^(\d+)$/ ) {
-% $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1});
-%} else {
-% $part_bill_event ||= new FS::part_bill_event {};
-%}
-%$action ||= $part_bill_event->eventpart ? 'Edit' : 'Add';
-%my $hashref = $part_bill_event->hashref;
-%
-%
-
-
<% include('/elements/header.html',
"$action Invoice Event Definition",
menubar(
- 'Main Menu' => popurl(2),
'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi',
)
)
@@ -536,7 +502,38 @@
</FORM>
- </BODY>
-</HTML>
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) {
+ $cgi->param('eventpart', $1);
+} else {
+ $cgi->param('eventpart', '');
+}
+
+my ($creason, $newcreasonT, $newcreason);
+my ($sreason, $newsreasonT, $newsreason);
+
+my ($query) = $cgi->keywords;
+my $action = '';
+my $part_bill_event = '';
+my $currentreasonclass = '';
+if ( $cgi->param('error') ) {
+ $part_bill_event = new FS::part_bill_event ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_bill_event')
+ } );
+}
+if ( $query && $query =~ /^(\d+)$/ ) {
+ $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1});
+} else {
+ $part_bill_event ||= new FS::part_bill_event {};
+}
+$action ||= $part_bill_event->eventpart ? 'Edit' : 'Add';
+my $hashref = $part_bill_event->hashref;
+</%init>
Index: rate_region.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/rate_region.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- rate_region.cgi 10 Jan 2008 21:53:49 -0000 1.6
+++ rate_region.cgi 13 Jan 2008 21:35:52 -0000 1.7
@@ -81,7 +81,7 @@
</TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <INPUT TYPE="text" SIZE=5 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included %>">
+ <INPUT TYPE="text" SIZE=5 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included |h %>">
</TD>
<TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
Index: svc_domain.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_domain.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- svc_domain.cgi 25 Dec 2007 23:49:22 -0000 1.15
+++ svc_domain.cgi 13 Jan 2008 21:35:53 -0000 1.16
@@ -1,67 +1,3 @@
-%my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
-% $svc_domain);
-%if ( $cgi->param('error') ) {
-%
-% $svc_domain = new FS::svc_domain ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_domain')
-% } );
-% $svcnum = $svc_domain->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $kludge_action = $cgi->param('action');
-% $purpose = $cgi->param('purpose');
-% $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
-% die "No part_svc entry!" unless $part_svc;
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_domain = new FS::svc_domain({});
-%
-% $svcnum='';
-%
-% $svc_domain->set_default_and_fixed;
-%
-%} else { #editing
-%
-% $kludge_action = '';
-% $purpose = '';
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_domain) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%}
-%my $action = $svcnum ? 'Edit' : 'Add';
-%
-%my $svc = $part_svc->getfield('svc');
-%
-%my $otaker = getotaker;
-%
-%my $domain = $svc_domain->domain;
-%
-%my $p1 = popurl(1);
-%
-%
-
-
<% include('/elements/header.html', "$action $svc", '') %>
<% include('/elements/error.html') %>
@@ -85,3 +21,71 @@
</FORM>
<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
+ $svc_domain);
+if ( $cgi->param('error') ) {
+
+ $svc_domain = new FS::svc_domain ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_domain')
+ } );
+ $svcnum = $svc_domain->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $kludge_action = $cgi->param('action');
+ $purpose = $cgi->param('purpose');
+ $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry!" unless $part_svc;
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_domain = new FS::svc_domain({});
+
+ $svcnum='';
+
+ $svc_domain->set_default_and_fixed;
+
+} else { #editing
+
+ $kludge_action = '';
+ $purpose = '';
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_domain) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+}
+my $action = $svcnum ? 'Edit' : 'Add';
+
+my $svc = $part_svc->getfield('svc');
+
+my $otaker = getotaker;
+
+my $domain = $svc_domain->domain;
+
+my $p1 = popurl(1);
+
+</%init>
Index: part_virtual_field.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_virtual_field.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- part_virtual_field.cgi 25 Dec 2007 23:49:21 -0000 1.8
+++ part_virtual_field.cgi 13 Jan 2008 21:35:52 -0000 1.9
@@ -1,27 +1,3 @@
-%
-%my ($vfieldpart, $part_virtual_field);
-%
-%if ( $cgi->param('error') ) {
-% $part_virtual_field = new FS::part_virtual_field ( {
-% map { $_, scalar($cgi->param($_)) } fields('part_virtual_field')});
-% $vfieldpart = $part_virtual_field->vfieldpart;
-%} else {
-% my($query) = $cgi->keywords;
-% if ( $query =~ /^(\d+)$/ ) { #editing
-% $vfieldpart=$1;
-% $part_virtual_field=qsearchs('part_virtual_field',
-% {'vfieldpart' => $vfieldpart})
-% or die "Unknown vfieldpart!";
-%
-% } else { #adding
-% $part_virtual_field = new FS::part_virtual_field({});
-% }
-%}
-%my $action = $part_virtual_field->vfieldpart ? 'Edit' : 'Add';
-%
-%my $p1 = popurl(1);
-%
-%
<% include('/elements/header.html', "$action Virtual Field Definition") %>
<% include('/elements/error.html') %>
@@ -97,3 +73,32 @@
<I>list_source</I> mean, <B>LEAVE THEM BLANK</B>. We mean it.</FONT>
<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my ($vfieldpart, $part_virtual_field);
+
+if ( $cgi->param('error') ) {
+ $part_virtual_field = new FS::part_virtual_field ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_virtual_field')});
+ $vfieldpart = $part_virtual_field->vfieldpart;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $vfieldpart=$1;
+ $part_virtual_field=qsearchs('part_virtual_field',
+ {'vfieldpart' => $vfieldpart})
+ or die "Unknown vfieldpart!";
+
+ } else { #adding
+ $part_virtual_field = new FS::part_virtual_field({});
+ }
+}
+my $action = $part_virtual_field->vfieldpart ? 'Edit' : 'Add';
+
+my $p1 = popurl(1);
+
+</%init>
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_pkg.cgi,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- part_pkg.cgi 25 Dec 2007 23:49:21 -0000 1.78
+++ part_pkg.cgi 13 Jan 2008 21:35:52 -0000 1.79
@@ -1,5 +1,4 @@
-<% include("/elements/header.html","$action Package Definition", menubar(
- 'Main Menu' => popurl(2),
+<% include('/elements/header.html', "$action Package Definition", menubar(
'View all packages' => popurl(2). 'browse/part_pkg.cgi',
)) %>
% #), ' onLoad="visualize()"');
@@ -360,10 +359,18 @@
<BR><BR>Price plan <% $widget->html %>
- </BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
<%init>
+#1.7
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+#1.9
+#die "access denied"
+# unless $FS::CurrentUser::CurrentUser->access_right('Edit package definitions')
+# || $FS::CurrentUser::CurrentUser->access_right('Edit global package definitions');
+
if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
$cgi->param('clone', $1);
} else {
Index: svc_acct_pop.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_acct_pop.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- svc_acct_pop.cgi 23 Aug 2006 22:25:37 -0000 1.9
+++ svc_acct_pop.cgi 13 Jan 2008 21:35:53 -0000 1.10
@@ -1,57 +1,50 @@
-<!-- mason kludge -->
-%
-%
-%my $svc_acct_pop;
-%if ( $cgi->param('error') ) {
-% $svc_acct_pop = new FS::svc_acct_pop ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
-% } );
-%} elsif ( $cgi->keywords ) { #editing
-% my($query)=$cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
-%} else { #adding
-% $svc_acct_pop = new FS::svc_acct_pop {};
-%}
-%my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
-%my $hashref = $svc_acct_pop->hashref;
-%
-%my $p1 = popurl(1);
-%print header("$action Access Number", menubar(
-% 'Main Menu' => popurl(2),
-% 'View all Access Numbers' => popurl(2). "browse/svc_acct_pop.cgi",
-%));
-%
-%print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-% "</FONT>"
-% if $cgi->param('error');
-%
-%print qq!<FORM ACTION="${p1}process/svc_acct_pop.cgi" METHOD=POST>!;
-%
-%#display
-%
-%print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
-% "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
-%
-%print <<END;
-%<PRE>
-%City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
-%State <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="$hashref->{state}">
-%Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
-%Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
-%Local <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="$hashref->{loc}">
-%</PRE>
-%END
-%
-%print qq!<BR><INPUT TYPE="submit" VALUE="!,
-% $hashref->{popnum} ? "Apply changes" : "Add Access Number",
-% qq!">!;
-%
-%print <<END;
-% </FORM>
-% </BODY>
-%</HTML>
-%END
-%
-%
+<% include('/elements/header.html', "$action Access Number", menubar(
+ 'View all Access Numbers' => popurl(2). "browse/svc_acct_pop.cgi",
+ ))
+%>
+
+<% include('/elements/error.html') %>
+
+<FORM ACTION="<%$p1%>process/svc_acct_pop.cgi" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="popnum" VALUE="<% $hashref->{popnum} %>">
+Access Number #<% $hashref->{popnum} ? $hashref->{popnum} : "(NEW)" %>
+
+<PRE>
+City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="<% $hashref->{city} %>">
+State <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="<% $hashref->{state} %>">
+Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="<% $hashref->{ac} %>">
+Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="<% $hashref->{exch} %>">
+Local <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="<% $hashref->{loc} %>">
+</PRE>
+
+<BR>
+<INPUT TYPE="submit" VALUE="<% $hashref->{popnum} ? "Apply changes" : "Add Access Number" %>">
+
+</FORM>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $svc_acct_pop;
+if ( $cgi->param('error') ) {
+ $svc_acct_pop = new FS::svc_acct_pop ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
+ } );
+} elsif ( $cgi->keywords ) { #editing
+ my($query)=$cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
+} else { #adding
+ $svc_acct_pop = new FS::svc_acct_pop {};
+}
+my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
+my $hashref = $svc_acct_pop->hashref;
+my $p1 = popurl(1);
+
+</%init>
Index: agent_payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent_payment_gateway.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- agent_payment_gateway.html 25 Dec 2007 23:49:21 -0000 1.4
+++ agent_payment_gateway.html 13 Jan 2008 21:35:52 -0000 1.5
@@ -1,20 +1,4 @@
-%
-%
-%$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
-%my $agent = qsearchs('agent', { 'agentnum' => $1 } );
-%die "agentnum $1 not found" unless $agent;
-%
-%#my @agent_payment_gateway;
-%if ( $cgi->param('error') ) {
-%}
-%
-%my $action = 'Add';
-%
-%
-
-
<% include("/elements/header.html","$action payment gateway override for ". $agent->agent, menubar(
- 'Main Menu' => $p,
#'View all payment gateways' => $p. 'browse/payment_gateway.html',
'View all agents' => $p. 'browse/agent.html',
)) %>
@@ -63,5 +47,22 @@
<INPUT TYPE="submit" VALUE="Add gateway override">
</FORM>
-</BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
+my $agent = qsearchs('agent', { 'agentnum' => $1 } );
+die "agentnum $1 not found" unless $agent;
+
+#my @agent_payment_gateway;
+if ( $cgi->param('error') ) {
+}
+
+my $action = 'Add';
+
+</%init>
Index: quick-charge.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/quick-charge.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- quick-charge.html 26 Dec 2007 07:51:37 -0000 1.4
+++ quick-charge.html 13 Jan 2008 21:35:52 -0000 1.5
@@ -163,6 +163,9 @@
</HTML>
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('One-time charge');
+
$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
my $custnum = $1;
Index: svc_external.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_external.cgi,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svc_external.cgi 29 Dec 2006 08:51:32 -0000 1.4
+++ svc_external.cgi 13 Jan 2008 21:35:53 -0000 1.5
@@ -1,99 +1,102 @@
-%my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_external );
-%if ( $cgi->param('error') ) {
-%
-% $svc_external = new FS::svc_external ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_external')
-% } );
-% $svcnum = $svc_external->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_external = new FS::svc_external { svcpart => $svcpart };
-%
-% $svcnum='';
-%
-% $svc_external->set_default_and_fixed;
-%
-%} else { #adding
-%
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_external=qsearchs('svc_external',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_external) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%}
-%my $action = $svc_external->svcnum ? 'Edit' : 'Add';
-%
-%my $p1 = popurl(1);
-%print header("External service $action", '');
-%
-%print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
-% "</FONT>"
-% if $cgi->param('error');
-%
-%print qq!<FORM ACTION="${p1}process/svc_external.cgi" METHOD=POST>!;
-%
-%#display
-%
-%
-%#svcnum
-%print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
-%print qq!Service #<B>!, $svcnum ? $svcnum : "(NEW)", "</B><BR><BR>";
-%
-%#pkgnum
-%print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
-%
-%#svcpart
-%print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
-%
-%my($id,$title)=(
-% $svc_external->id,
-% $svc_external->title,
-%);
-%
-%print &ntable("#cccccc",2),
-% '<TR><TD ALIGN="right">External ID</TD><TD>'.
-% qq!<INPUT TYPE="text" NAME="id" VALUE="$id">!.
-% '</TD></TR>'.
-% '<TR><TD ALIGN="right">Title</TD><TD>'.
-% qq!<INPUT TYPE="text" NAME="title" VALUE="$title">!.
-% '</TD></TR>';
-%
-%foreach my $field ($svc_external->virtual_fields) {
-% if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
-% # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
-% print $svc_external->pvf($field)->widget('HTML', 'edit',
-% $svc_external->getfield($field));
-% }
-%}
-%
+<% include('/elements/header.html', "External service $action") %>
+
+<% include('/elements/error.html') %>
+
+<FORM ACTION="<%$p1%>process/svc_external.cgi" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<% $svcnum %>">
+Service #<B><% $svcnum ? $svcnum : "(NEW)" %></B>
+<BR><BR>
+
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
+
+<INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $svcpart %>">
+
+% my $id = $svc_external->id;
+% my $title = $svc_external->title;
%
+<% &ntable("#cccccc",2) %>
+ <TR>
+ <TD ALIGN="right">External ID</TD>
+ <TD><INPUT TYPE="text" NAME="id" VALUE="<% $id %>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Title</TD>
+ <TD><INPUT TYPE="text" NAME="title" VALUE="<% $title %>"></TD>
+ </TR>
+
+% foreach my $field ($svc_external->virtual_fields) {
+% if ( $part_svc->part_svc_column($field)->columnflag ne 'F' ) {
+% # If the flag is X, it won't even show up in $svc_acct->virtual_fields.
+ <% $svc_external->pvf($field)->widget( 'HTML',
+ 'edit',
+ $svc_external->getfield($field)
+ )
+ %>
+% }
+% }
+</TABLE>
+<BR>
-</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">
- </FORM>
- </BODY>
-</HTML>
+<INPUT TYPE="submit" VALUE="Submit">
+</FORM>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_external );
+if ( $cgi->param('error') ) {
+ $svc_external = new FS::svc_external ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_external')
+ } );
+ $svcnum = $svc_external->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_external = new FS::svc_external { svcpart => $svcpart };
+
+ $svcnum='';
+
+ $svc_external->set_default_and_fixed;
+
+} else { #adding
+
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_external=qsearchs('svc_external',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_external) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+}
+my $action = $svc_external->svcnum ? 'Edit' : 'Add';
+
+my $p1 = popurl(1);
+
+</%init>
Index: payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/payment_gateway.html,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- payment_gateway.html 25 Dec 2007 23:49:21 -0000 1.8
+++ payment_gateway.html 13 Jan 2008 21:35:52 -0000 1.9
@@ -1,25 +1,4 @@
-%
-%
-%my $payment_gateway;
-%if ( $cgi->param('error') ) {
-% $payment_gateway = new FS::payment_gateway ( {
-% map { $_, scalar($cgi->param($_)) } fields('payment_gateway')
-% } );
-%} elsif ( $cgi->keywords ) {
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $payment_gateway = qsearchs( 'payment_gateway', { 'gatewaynum' => $1 } );
-%} else { #adding
-% $payment_gateway = new FS::payment_gateway {};
-%}
-%my $action = $payment_gateway->gatewaynum ? 'Edit' : 'Add';
-%#my $hashref = $payment_gateway->hashref;
-%
-%
-
-
<% include("/elements/header.html","$action Payment gateway", menubar(
- 'Main Menu' => $p,
'View all payment gateways' => $p. 'browse/payment_gateway.html',
)) %>
@@ -127,6 +106,27 @@
<BR><INPUT TYPE="submit" VALUE="<% $payment_gateway->gatewaynum ? "Apply changes" : "Add gateway" %>">
</FORM>
- </BODY>
-</HTML>
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $payment_gateway;
+if ( $cgi->param('error') ) {
+ $payment_gateway = new FS::payment_gateway ( {
+ map { $_, scalar($cgi->param($_)) } fields('payment_gateway')
+ } );
+} elsif ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $payment_gateway = qsearchs( 'payment_gateway', { 'gatewaynum' => $1 } );
+} else { #adding
+ $payment_gateway = new FS::payment_gateway {};
+}
+my $action = $payment_gateway->gatewaynum ? 'Edit' : 'Add';
+#my $hashref = $payment_gateway->hashref;
+
+</%init>
Index: pkg_class.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/pkg_class.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- pkg_class.html 20 Dec 2006 09:49:08 -0000 1.3
+++ pkg_class.html 13 Jan 2008 21:35:52 -0000 1.4
@@ -14,3 +14,9 @@
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
Index: svc_Common.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_Common.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- svc_Common.html 29 Dec 2006 08:51:32 -0000 1.1
+++ svc_Common.html 13 Jan 2008 21:35:52 -0000 1.2
@@ -1,5 +1,14 @@
+<% include('elements/svc_Common.html',
+ 'table' => $table,
+ 'post_url' => popurl(1). "process/svc_Common.html",
+ %opt,
+ )
+%>
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
# false laziness w/view/svc_Common.html
$cgi->param('svcdb') =~ /^(svc_\w+)$/ or die "unparsable svcdb";
@@ -22,9 +31,3 @@
}
</%init>
-<% include('elements/svc_Common.html',
- 'table' => $table,
- 'post_url' => popurl(1). "process/svc_Common.html",
- %opt,
- )
-%>
Index: agent_type.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/agent_type.cgi,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- agent_type.cgi 25 Dec 2007 23:49:21 -0000 1.17
+++ agent_type.cgi 13 Jan 2008 21:35:52 -0000 1.18
@@ -1,22 +1,4 @@
-%
-%
-%my($agent_type);
-%if ( $cgi->param('error') ) {
-% $agent_type = new FS::agent_type ( {
-% map { $_, scalar($cgi->param($_)) } fields('agent')
-% } );
-%} elsif ( $cgi->keywords ) { #editing
-% my( $query ) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $agent_type=qsearchs('agent_type',{'typenum'=>$1});
-%} else { #adding
-% $agent_type = new FS::agent_type {};
-%}
-%my $action = $agent_type->typenum ? 'Edit' : 'Add';
-%
-%
<% include("/elements/header.html","$action Agent Type", menubar(
- 'Main Menu' => "$p",
'View all agent types' => "${p}browse/agent_type.cgi",
))
%>
@@ -52,3 +34,24 @@
</FORM>
<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my($agent_type);
+if ( $cgi->param('error') ) {
+ $agent_type = new FS::agent_type ( {
+ map { $_, scalar($cgi->param($_)) } fields('agent')
+ } );
+} elsif ( $cgi->keywords ) { #editing
+ my( $query ) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $agent_type=qsearchs('agent_type',{'typenum'=>$1});
+} else { #adding
+ $agent_type = new FS::agent_type {};
+}
+my $action = $agent_type->typenum ? 'Edit' : 'Add';
+
+</%init>
Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_svc.cgi,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- part_svc.cgi 12 Apr 2007 03:16:43 -0000 1.58
+++ part_svc.cgi 13 Jan 2008 21:35:52 -0000 1.59
@@ -1,34 +1,7 @@
-%
-%my $part_svc;
-%my $clone = '';
-%if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone
-% #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query";
-% $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } )
-% or die "unknown svcpart: $1";
-% $clone = $part_svc->svcpart;
-% $part_svc->svcpart('');
-%} elsif ( $cgi->keywords ) { #edit
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "malformed query: $query";
-% $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } )
-% or die "unknown svcpart: $1";
-%} else { #adding
-% $part_svc = new FS::part_svc {};
-%}
-%
-%my $action = $part_svc->svcpart ? 'Edit' : 'Add';
-%my $hashref = $part_svc->hashref;
-%# my $p_svcdb = $part_svc->svcdb || 'svc_acct';
-%
-%
-% #" onLoad=\"visualize()\""
-%
-
-<% include("/elements/header.html","$action Service Definition",
- menubar( 'Main Menu' => $p,
- 'View all service definitions' => "${p}browse/part_svc.cgi"
- ),
- )
+<% include('/elements/header.html', "$action Service Definition",
+ menubar('View all service definitions' => "${p}browse/part_svc.cgi"),
+ #" onLoad=\"visualize()\""
+ )
%>
<FORM NAME="dummy">
@@ -350,6 +323,38 @@
%
Table <% $widget->html %>
- </BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $part_svc;
+my $clone = '';
+if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone
+ #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query";
+ $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } )
+ or die "unknown svcpart: $1";
+ $clone = $part_svc->svcpart;
+ $part_svc->svcpart('');
+} elsif ( $cgi->keywords ) { #edit
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "malformed query: $query";
+ $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } )
+ or die "unknown svcpart: $1";
+} else { #adding
+ $part_svc = new FS::part_svc {};
+}
+
+my $action = $part_svc->svcpart ? 'Edit' : 'Add';
+my $hashref = $part_svc->hashref;
+# my $p_svcdb = $part_svc->svcdb || 'svc_acct';
+
+
+
+</%init>
+
+
Index: router.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/router.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- router.cgi 25 Dec 2007 23:49:22 -0000 1.6
+++ router.cgi 13 Jan 2008 21:35:52 -0000 1.7
@@ -1,27 +1,7 @@
-<HTML><BODY>
-%
-%
-%my $router;
-%if ( $cgi->keywords ) {
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $router = qsearchs('router', { routernum => $1 })
-% or print $cgi->redirect(popurl(2)."browse/router.cgi") ;
-%} else {
-% $router = new FS::router ( {
-% map { $_, scalar($cgi->param($_)) } fields('router')
-% } );
-%}
-%
-%my $routernum = $router->routernum;
-%my $action = $routernum ? 'Edit' : 'Add';
-%
-%print header("$action Router", menubar(
-% 'Main Menu' => "$p",
-% 'View all routers' => "${p}browse/router.cgi",
-%));
-%
-%my $p3 = popurl(3);
+<% include('/elements/header.html', "$action Router", menubar(
+ 'View all routers' => "${p}browse/router.cgi",
+ ))
+%>
<% include('/elements/error.html') %>
@@ -70,5 +50,29 @@
<BR><BR><INPUT TYPE="submit" VALUE="Apply changes">
</FORM>
-</BODY></HTML>
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $router;
+if ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $router = qsearchs('router', { routernum => $1 })
+ or print $cgi->redirect(popurl(2)."browse/router.cgi") ;
+} else {
+ $router = new FS::router ( {
+ map { $_, scalar($cgi->param($_)) } fields('router')
+ } );
+}
+
+my $routernum = $router->routernum;
+my $action = $routernum ? 'Edit' : 'Add';
+
+my $p3 = popurl(3);
+
+</%init>
Index: svc_broadband.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_broadband.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- svc_broadband.cgi 25 Dec 2007 23:49:22 -0000 1.15
+++ svc_broadband.cgi 13 Jan 2008 21:35:53 -0000 1.16
@@ -1,91 +1,4 @@
-%# If it's stupid but it works, it's still stupid.
-%# -Kristian
-%
-%use HTML::Widgets::SelectLayers;
-%use Tie::IxHash;
-%
-%my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_broadband );
-%if ( $cgi->param('error') ) {
-%
-% $svc_broadband = new FS::svc_broadband ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_broadband'), qw(svcpart)
-% } );
-% $svcnum = $svc_broadband->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $svc_broadband->svcpart;
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_broadband = new FS::svc_broadband({ svcpart => $svcpart });
-%
-% $svcnum='';
-%
-% $svc_broadband->set_default_and_fixed;
-%
-%} else { #editing
-%
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_broadband) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%}
-%my $action = $svc_broadband->svcnum ? 'Edit' : 'Add';
-%
-%if ($pkgnum) {
-%
-% #Nothing?
-%
-%} elsif ( $action eq 'Edit' ) {
-%
-% #Nothing?
-%
-%} else {
-% die "\$action eq Add, but \$pkgnum is null!\n";
-%}
-%
-%my $p1 = popurl(1);
-%
-%my ($ip_addr, $speed_up, $speed_down, $blocknum, $mac_addr,
-% $latitude, $longitude, $altitude, $vlan_profile, $auth_key,
-% $description) =
-% ($svc_broadband->ip_addr,
-% $svc_broadband->speed_up,
-% $svc_broadband->speed_down,
-% $svc_broadband->blocknum,
-% $svc_broadband->mac_addr,
-% $svc_broadband->latitude,
-% $svc_broadband->longitude,
-% $svc_broadband->altitude,
-% $svc_broadband->vlan_profile,
-% $svc_broadband->auth_key,
-% $svc_broadband->description,
-% );
-%
-%
-
-
-<% include("/elements/header.html","Broadband Service $action", '') %>
+<% include('/elements/header.html', "Broadband Service $action") %>
<% include('/elements/error.html') %>
@@ -246,6 +159,96 @@
<BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Submit">
</FORM>
-</BODY>
-</HTML>
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+# If it's stupid but it works, it's still stupid.
+# -Kristian
+
+use HTML::Widgets::SelectLayers;
+use Tie::IxHash;
+
+my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_broadband );
+if ( $cgi->param('error') ) {
+
+ $svc_broadband = new FS::svc_broadband ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_broadband'), qw(svcpart)
+ } );
+ $svcnum = $svc_broadband->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $svc_broadband->svcpart;
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_broadband = new FS::svc_broadband({ svcpart => $svcpart });
+
+ $svcnum='';
+
+ $svc_broadband->set_default_and_fixed;
+
+} else { #editing
+
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_broadband) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+}
+my $action = $svc_broadband->svcnum ? 'Edit' : 'Add';
+
+if ($pkgnum) {
+
+ #Nothing?
+
+} elsif ( $action eq 'Edit' ) {
+
+ #Nothing?
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my $p1 = popurl(1);
+
+my ($ip_addr, $speed_up, $speed_down, $blocknum, $mac_addr,
+ $latitude, $longitude, $altitude, $vlan_profile, $auth_key,
+ $description) =
+ ($svc_broadband->ip_addr,
+ $svc_broadband->speed_up,
+ $svc_broadband->speed_down,
+ $svc_broadband->blocknum,
+ $svc_broadband->mac_addr,
+ $svc_broadband->latitude,
+ $svc_broadband->longitude,
+ $svc_broadband->altitude,
+ $svc_broadband->vlan_profile,
+ $svc_broadband->auth_key,
+ $svc_broadband->description,
+ );
+
+</%init>
Index: svc_forward.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_forward.cgi,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- svc_forward.cgi 25 Dec 2007 23:49:22 -0000 1.20
+++ svc_forward.cgi 13 Jan 2008 21:35:53 -0000 1.21
@@ -1,111 +1,4 @@
-<!-- mason kludge -->
-%
-%
-%my $conf = new FS::Conf;
-%
-%my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward);
-%if ( $cgi->param('error') ) {
-% $svc_forward = new FS::svc_forward ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_forward')
-% } );
-% $svcnum = $svc_forward->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_forward = new FS::svc_forward({});
-%
-% $svcnum='';
-%
-% $svc_forward->set_default_and_fixed;
-%
-%} else { #editing
-%
-% my($query) = $cgi->keywords;
-%
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_forward=qsearchs('svc_forward',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_forward) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-%}
-%my $action = $svc_forward->svcnum ? 'Edit' : 'Add';
-%
-%my %email;
-%
-%#starting with those currently attached
-%foreach my $method (qw( srcsvc_acct dstsvc_acct )) {
-% my $svc_acct = $svc_forward->$method();
-% $email{$svc_acct->svcnum} = $svc_acct->email if $svc_acct;
-%}
-%
-%if ($pkgnum) {
-%
-% #find all possible user svcnums (and emails)
-%
-% #and including the rest for this customer
-% my($u_part_svc, at u_acct_svcparts);
-% foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
-% push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
-% }
-%
-% my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-% my($custnum)=$cust_pkg->getfield('custnum');
-% my($i_cust_pkg);
-% foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
-% my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
-% my($acct_svcpart);
-% foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
-% #record(s) in cust_svc ( for this
-% #pkgnum ! )
-% foreach my $i_cust_svc (
-% qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
-% 'svcpart' => $acct_svcpart } )
-% ) {
-% my $svc_acct =
-% qsearchs( 'svc_acct', { 'svcnum' => $i_cust_svc->svcnum } );
-% $email{$svc_acct->svcnum} = $svc_acct->email;
-% }
-% }
-% }
-%
-%} elsif ( $action eq 'Add' ) {
-% die "\$action eq Add, but \$pkgnum is null!\n";
-%}
-%
-%my($srcsvc,$dstsvc,$dst)=(
-% $svc_forward->srcsvc,
-% $svc_forward->dstsvc,
-% $svc_forward->dst,
-%);
-%my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
-%
-%#display
-%
-%
-
-
-<% include("/elements/header.html","Mail Forward $action") %>
+<% include('/elements/header.html', "Mail Forward $action") %>
<% include('/elements/error.html') %>
@@ -172,5 +65,111 @@
</TABLE>
<BR><INPUT TYPE="submit" VALUE="Submit">
</FORM>
- </BODY>
-</HTML>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my $conf = new FS::Conf;
+
+my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward);
+if ( $cgi->param('error') ) {
+ $svc_forward = new FS::svc_forward ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_forward')
+ } );
+ $svcnum = $svc_forward->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_forward = new FS::svc_forward({});
+
+ $svcnum='';
+
+ $svc_forward->set_default_and_fixed;
+
+} else { #editing
+
+ my($query) = $cgi->keywords;
+
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_forward=qsearchs('svc_forward',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_forward) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+}
+my $action = $svc_forward->svcnum ? 'Edit' : 'Add';
+
+my %email;
+
+#starting with those currently attached
+foreach my $method (qw( srcsvc_acct dstsvc_acct )) {
+ my $svc_acct = $svc_forward->$method();
+ $email{$svc_acct->svcnum} = $svc_acct->email if $svc_acct;
+}
+
+if ($pkgnum) {
+
+ #find all possible user svcnums (and emails)
+
+ #and including the rest for this customer
+ my($u_part_svc, at u_acct_svcparts);
+ foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
+ push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ my($i_cust_pkg);
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ foreach my $i_cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
+ 'svcpart' => $acct_svcpart } )
+ ) {
+ my $svc_acct =
+ qsearchs( 'svc_acct', { 'svcnum' => $i_cust_svc->svcnum } );
+ $email{$svc_acct->svcnum} = $svc_acct->email;
+ }
+ }
+ }
+
+} elsif ( $action eq 'Add' ) {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my($srcsvc,$dstsvc,$dst)=(
+ $svc_forward->srcsvc,
+ $svc_forward->dstsvc,
+ $svc_forward->dst,
+);
+my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : '';
+
+</%init>
Index: access_user.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/access_user.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- access_user.html 19 Jan 2007 16:31:20 -0000 1.5
+++ access_user.html 13 Jan 2008 21:35:52 -0000 1.6
@@ -42,3 +42,9 @@
},
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
Index: cust_main_county-expand.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main_county-expand.cgi,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- cust_main_county-expand.cgi 4 Jan 2008 02:42:07 -0000 1.12
+++ cust_main_county-expand.cgi 13 Jan 2008 21:35:52 -0000 1.13
@@ -18,6 +18,9 @@
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
my($taxnum, $expansion, $taxclass);
my($query) = $cgi->keywords;
if ( $cgi->param('error') ) {
Index: reason_type.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/reason_type.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- reason_type.html 4 Dec 2007 18:20:58 -0000 1.2
+++ reason_type.html 13 Jan 2008 21:35:52 -0000 1.3
@@ -1,9 +1,3 @@
-%
-%$cgi->param('class') =~ /^(\w)$/;
-%my $class = $1;
-%
-%my $classname = $FS::reason_type::class_name{$class};
-%
<% include( 'elements/edit.html',
'name' => $classname . ' Reason Type',
'table' => 'reason_type',
@@ -22,3 +16,14 @@
'new_hashref_callback' => sub {{ 'class' => $class }},
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+$cgi->param('class') =~ /^(\w)$/;
+my $class = $1;
+
+my $classname = $FS::reason_type::class_name{$class};
+
+</%init>
Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_pay.cgi,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cust_pay.cgi 25 Dec 2007 23:49:21 -0000 1.25
+++ cust_pay.cgi 13 Jan 2008 21:35:52 -0000 1.26
@@ -86,6 +86,7 @@
</HTML>
<%once>
+
my $conf = new FS::Conf;
my %payby = (
@@ -96,9 +97,13 @@
);
my $money_char = $conf->config('money_char') || '$';
-</%once>
+</%once>
<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
+
my($link, $linknum, $paid, $payby, $payinfo, $_date);
if ( $cgi->param('error') ) {
$link = $cgi->param('link');
Index: inventory_class.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/inventory_class.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- inventory_class.html 23 Aug 2006 22:25:37 -0000 1.3
+++ inventory_class.html 13 Jan 2008 21:35:52 -0000 1.4
@@ -8,3 +8,9 @@
'viewall_dir' => 'browse',
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
Index: svc_phone.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_phone.cgi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- svc_phone.cgi 23 Aug 2006 22:25:37 -0000 1.2
+++ svc_phone.cgi 13 Jan 2008 21:35:53 -0000 1.3
@@ -9,3 +9,9 @@
},
)
%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+</%init>
Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/REAL_cust_pkg.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- REAL_cust_pkg.cgi 29 Nov 2007 23:51:37 -0000 1.15
+++ REAL_cust_pkg.cgi 13 Jan 2008 21:35:52 -0000 1.16
@@ -2,7 +2,6 @@
%#, menubar(
%# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
-%# 'Main Menu' => popurl(2)
%#));
<LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
@@ -13,9 +12,12 @@
<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
+% # raw error from below
% if ( $error ) {
<FONT SIZE="+1" COLOR="#ff0000">Error: <% $error %></FONT>
% }
+% #or, regular error handler
+<% include('/elements/error.html') %>
<% ntable("#cccccc",2) %>
@@ -122,16 +124,19 @@
</%once>
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates');
+
my $error = '';
my( $pkgnum, $cust_pkg );
if ( $cgi->param('error') ) {
- $error = $cgi->param('error');
$pkgnum = $cgi->param('pkgnum');
- if ( $error eq '_bill_areyousure' ) {
+ if ( $cgi->param('error') eq '_bill_areyousure' ) {
if ( $cgi->param('bill') =~ /^([\s\d\/\:\-\(\w\)]*)$/ ) {
my $bill = $1;
+ $cgi->param('error', '');
$error = "You are attempting to set the next bill date to $bill, which is
in the past. This will charge the customer for the interval
from $bill until now. Are you sure you want to do this? ".
@@ -174,4 +179,3 @@
}
</%init>
-
Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_acct.cgi,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- svc_acct.cgi 25 Dec 2007 23:49:22 -0000 1.51
+++ svc_acct.cgi 13 Jan 2008 21:35:53 -0000 1.52
@@ -1,132 +1,4 @@
-%
-%
-%my $conf = new FS::Conf;
-%my @shells = $conf->config('shells');
-%
-%my $curuser = $FS::CurrentUser::CurrentUser;
-%
-%my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct, @groups);
-%if ( $cgi->param('error') ) {
-%
-% $svc_acct = new FS::svc_acct ( {
-% map { $_, scalar($cgi->param($_)) } fields('svc_acct')
-% } );
-% $svcnum = $svc_acct->svcnum;
-% $pkgnum = $cgi->param('pkgnum');
-% $svcpart = $cgi->param('svcpart');
-% $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
-% die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
-% @groups = $cgi->param('radius_usergroup');
-%
-%} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
-%
-% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
-% $pkgnum = $1;
-% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
-% $svcpart = $1;
-%
-% $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
-% die "No part_svc entry!" unless $part_svc;
-%
-% $svc_acct = new FS::svc_acct({svcpart => $svcpart});
-%
-% $svcnum='';
-%
-%} else { #editing
-%
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum=$1;
-% $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum})
-% or die "Unknown (svc_acct) svcnum!";
-%
-% my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
-% or die "Unknown (cust_svc) svcnum!";
-%
-% $pkgnum=$cust_svc->pkgnum;
-% $svcpart=$cust_svc->svcpart;
-%
-% $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
-% die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
-%
-% @groups = $svc_acct->radius_groups;
-%
-%}
-%
-%my( $cust_pkg, $cust_main ) = ( '', '' );
-%if ( $pkgnum ) {
-% $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $pkgnum } );
-% $cust_main = $cust_pkg->cust_main;
-%}
-%
-%unless ( $svcnum || $cgi->param('error') ) { #adding
-%
-% #set gecos
-% if ($cust_main) {
-% unless ( $part_svc->part_svc_column('uid')->columnflag eq 'F' ) {
-% $svc_acct->setfield('finger',
-% $cust_main->getfield('first') . " " . $cust_main->getfield('last')
-% );
-% }
-% }
-%
-% $svc_acct->set_default_and_fixed( {
-% #false laziness w/svc-acct::_fieldhandlers
-% 'usergroup' => sub {
-% my( $self, $groups ) = @_;
-% if ( ref($groups) eq 'ARRAY' ) {
-% @groups = @$groups;
-% $groups;
-% } elsif ( length($groups) ) {
-% @groups = split(/\s*,\s*/, $groups);
-% [ @groups ];
-% } else {
-% @groups = ();
-% [];
-% }
-% }
-% } );
-%
-%}
-%
-%#fixed radius groups always override & display
-%if ( $part_svc->part_svc_column('usergroup')->columnflag eq 'F' ) {
-% @groups = split(',', $part_svc->part_svc_column('usergroup')->columnvalue);
-%}
-%
-%my $action = $svcnum ? 'Edit' : 'Add';
-%
-%my $svc = $part_svc->getfield('svc');
-%
-%my $otaker = getotaker;
-%
-%my $username = $svc_acct->username;
-%my $password;
-%if ( $svc_acct->_password ) {
-% if ( $conf->exists('showpasswords') || ! $svcnum ) {
-% $password = $svc_acct->_password;
-% } else {
-% $password = "*HIDDEN*";
-% }
-%} else {
-% $password = '';
-%}
-%
-%my $ulen =
-% $conf->exists('usernamemax')
-% ? $conf->config('usernamemax')
-% : dbdef->table('svc_acct')->column('username')->length;
-%my $ulen2 = $ulen+2;
-%
-%my $pmax = $conf->config('passwordmax') || 8;
-%my $pmax2 = $pmax+2;
-%
-%my $p1 = popurl(1);
-%
-%
-
-
-<% include("/elements/header.html","$action $svc account") %>
+<% include('/elements/header.html', "$action $svc account") %>
<% include('/elements/error.html') %>
@@ -445,4 +317,136 @@
<INPUT TYPE="submit" VALUE="Submit">
-</FORM></BODY></HTML>
+</FORM>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+my $conf = new FS::Conf;
+my @shells = $conf->config('shells');
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct, @groups);
+if ( $cgi->param('error') ) {
+
+ $svc_acct = new FS::svc_acct ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_acct')
+ } );
+ $svcnum = $svc_acct->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+ @groups = $cgi->param('radius_usergroup');
+
+} elsif ( $cgi->param('pkgnum') && $cgi->param('svcpart') ) { #adding
+
+ $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum';
+ $pkgnum = $1;
+ $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart';
+ $svcpart = $1;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_acct = new FS::svc_acct({svcpart => $svcpart});
+
+ $svcnum='';
+
+} else { #editing
+
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum=$1;
+ $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_acct) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+
+ @groups = $svc_acct->radius_groups;
+
+}
+
+my( $cust_pkg, $cust_main ) = ( '', '' );
+if ( $pkgnum ) {
+ $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $pkgnum } );
+ $cust_main = $cust_pkg->cust_main;
+}
+
+unless ( $svcnum || $cgi->param('error') ) { #adding
+
+ #set gecos
+ if ($cust_main) {
+ unless ( $part_svc->part_svc_column('uid')->columnflag eq 'F' ) {
+ $svc_acct->setfield('finger',
+ $cust_main->getfield('first') . " " . $cust_main->getfield('last')
+ );
+ }
+ }
+
+ $svc_acct->set_default_and_fixed( {
+ #false laziness w/svc-acct::_fieldhandlers
+ 'usergroup' => sub {
+ my( $self, $groups ) = @_;
+ if ( ref($groups) eq 'ARRAY' ) {
+ @groups = @$groups;
+ $groups;
+ } elsif ( length($groups) ) {
+ @groups = split(/\s*,\s*/, $groups);
+ [ @groups ];
+ } else {
+ @groups = ();
+ [];
+ }
+ }
+ } );
+
+}
+
+#fixed radius groups always override & display
+if ( $part_svc->part_svc_column('usergroup')->columnflag eq 'F' ) {
+ @groups = split(',', $part_svc->part_svc_column('usergroup')->columnvalue);
+}
+
+my $action = $svcnum ? 'Edit' : 'Add';
+
+my $svc = $part_svc->getfield('svc');
+
+my $otaker = getotaker;
+
+my $username = $svc_acct->username;
+my $password;
+if ( $svc_acct->_password ) {
+ if ( $conf->exists('showpasswords') || ! $svcnum ) {
+ $password = $svc_acct->_password;
+ } else {
+ $password = "*HIDDEN*";
+ }
+} else {
+ $password = '';
+}
+
+my $ulen =
+ $conf->exists('usernamemax')
+ ? $conf->config('usernamemax')
+ : dbdef->table('svc_acct')->column('username')->length;
+my $ulen2 = $ulen+2;
+
+my $pmax = $conf->config('passwordmax') || 8;
+my $pmax2 = $pmax+2;
+
+my $p1 = popurl(1);
+
+</%init>
Index: part_export.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_export.cgi,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- part_export.cgi 25 Dec 2007 23:49:21 -0000 1.28
+++ part_export.cgi 13 Jan 2008 21:35:52 -0000 1.29
@@ -1,110 +1,4 @@
-<!-- mason kludge -->
-%
-%
-%#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
-%# $cgi->param('clone', $1);
-%#} else {
-%# $cgi->param('clone', '');
-%#}
-%
-%my($query) = $cgi->keywords;
-%my $action = '';
-%my $part_export = '';
-%if ( $cgi->param('error') ) {
-% $part_export = new FS::part_export ( {
-% map { $_, scalar($cgi->param($_)) } fields('part_export')
-% } );
-%} elsif ( $query =~ /^(\d+)$/ ) {
-% $part_export = qsearchs('part_export', { 'exportnum' => $1 } );
-%} else {
-% $part_export = new FS::part_export;
-%}
-%$action ||= $part_export->exportnum ? 'Edit' : 'Add';
-%
-%#my $exports = FS::part_export::export_info($svcdb);
-%my $exports = FS::part_export::export_info();
-%
-%my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports;
-%$layers{''}='';
-%
-%my $widget = new HTML::Widgets::SelectLayers(
-% 'selected_layer' => $part_export->exporttype,
-% 'options' => \%layers,
-% 'form_name' => 'dummy',
-% 'form_action' => 'process/part_export.cgi',
-% 'form_text' => [qw( exportnum machine )],
-%# 'form_checkbox' => [qw()],
-% 'html_between' => "</TD></TR></TABLE>\n",
-% 'layer_callback' => sub {
-% my $layer = shift;
-% my $html = qq!<INPUT TYPE="hidden" NAME="exporttype" VALUE="$layer">!.
-% ntable("#cccccc",2);
-%
-% $html .= '<TR><TD ALIGN="right">Description</TD><TD BGCOLOR=#ffffff>'.
-% $exports->{$layer}{notes}. '</TD></TR>'
-% if $layer;
-%
-% foreach my $option ( keys %{$exports->{$layer}{options}} ) {
-% my $optinfo = $exports->{$layer}{options}{$option};
-% die "Retreived non-ref export info option from $layer export: $optinfo"
-% unless ref($optinfo);
-% my $label = $optinfo->{label};
-% my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
-% my $value = $cgi->param($option)
-% || ( $part_export->exportnum && $part_export->option($option) )
-% || ( (exists $optinfo->{default} && !$part_export->exportnum)
-% ? $optinfo->{default}
-% : ''
-% );
-% $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
-% if ( $type eq 'select' ) {
-% $html .= qq!<SELECT NAME="$option">!;
-% foreach my $select_option ( @{$optinfo->{options}} ) {
-% #if ( ref($select_option) ) {
-% #} else {
-% my $selected = $select_option eq $value ? ' SELECTED' : '';
-% $html .= qq!<OPTION VALUE="$select_option"$selected>!.
-% qq!$select_option</OPTION>!;
-% #}
-% }
-% $html .= '</SELECT>';
-% } elsif ( $type eq 'textarea' ) {
-% $html .= qq!<TEXTAREA NAME="$option" COLS=80 ROWS=8 WRAP="virtual">!.
-% encode_entities($value). '</TEXTAREA>';
-% } elsif ( $type eq 'text' ) {
-% $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="!.
-% encode_entities($value). '" SIZE=64>';
-% } elsif ( $type eq 'checkbox' ) {
-% $html .= qq!<INPUT TYPE="checkbox" NAME="$option" VALUE="1"!;
-% $html .= ' CHECKED' if $value;
-% $html .= '>';
-% } else {
-% $html .= "unknown type $type";
-% }
-% $html .= '</TD></TR>';
-% }
-% $html .= '</TABLE>';
-%
-% $html .= '<INPUT TYPE="hidden" NAME="options" VALUE="'.
-% join(',', keys %{$exports->{$layer}{options}} ). '">';
-%
-% $html .= '<INPUT TYPE="hidden" NAME="nodomain" VALUE="'.
-% $exports->{$layer}{nodomain}. '">';
-%
-% $html .= '<INPUT TYPE="submit" VALUE="'.
-% ( $part_export->exportnum ? "Apply changes" : "Add export" ).
-% '">';
-%
-% $html;
-% },
-%);
-%
-%
-
-<% include("/elements/header.html","$action Export", menubar(
- 'Main Menu' => popurl(2),
-), ' onLoad="visualize()"')
-%>
+<% include('/elements/header.html', "$action Export", '', ' onLoad="visualize()"') %>
<% include('/elements/error.html') %>
@@ -121,6 +15,109 @@
<TR>
<TD ALIGN="right">Export</TD>
<TD><% $widget->html %>
-</BODY>
-</HTML>
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
+# $cgi->param('clone', $1);
+#} else {
+# $cgi->param('clone', '');
+#}
+
+my($query) = $cgi->keywords;
+my $action = '';
+my $part_export = '';
+if ( $cgi->param('error') ) {
+ $part_export = new FS::part_export ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_export')
+ } );
+} elsif ( $query =~ /^(\d+)$/ ) {
+ $part_export = qsearchs('part_export', { 'exportnum' => $1 } );
+} else {
+ $part_export = new FS::part_export;
+}
+$action ||= $part_export->exportnum ? 'Edit' : 'Add';
+
+#my $exports = FS::part_export::export_info($svcdb);
+my $exports = FS::part_export::export_info();
+
+my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports;
+$layers{''}='';
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => $part_export->exporttype,
+ 'options' => \%layers,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/part_export.cgi',
+ 'form_text' => [qw( exportnum machine )],
+# 'form_checkbox' => [qw()],
+ 'html_between' => "</TD></TR></TABLE>\n",
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="exporttype" VALUE="$layer">!.
+ ntable("#cccccc",2);
+
+ $html .= '<TR><TD ALIGN="right">Description</TD><TD BGCOLOR=#ffffff>'.
+ $exports->{$layer}{notes}. '</TD></TR>'
+ if $layer;
+
+ foreach my $option ( keys %{$exports->{$layer}{options}} ) {
+ my $optinfo = $exports->{$layer}{options}{$option};
+ die "Retreived non-ref export info option from $layer export: $optinfo"
+ unless ref($optinfo);
+ my $label = $optinfo->{label};
+ my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
+ my $value = $cgi->param($option)
+ || ( $part_export->exportnum && $part_export->option($option) )
+ || ( (exists $optinfo->{default} && !$part_export->exportnum)
+ ? $optinfo->{default}
+ : ''
+ );
+ $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
+ if ( $type eq 'select' ) {
+ $html .= qq!<SELECT NAME="$option">!;
+ foreach my $select_option ( @{$optinfo->{options}} ) {
+ #if ( ref($select_option) ) {
+ #} else {
+ my $selected = $select_option eq $value ? ' SELECTED' : '';
+ $html .= qq!<OPTION VALUE="$select_option"$selected>!.
+ qq!$select_option</OPTION>!;
+ #}
+ }
+ $html .= '</SELECT>';
+ } elsif ( $type eq 'textarea' ) {
+ $html .= qq!<TEXTAREA NAME="$option" COLS=80 ROWS=8 WRAP="virtual">!.
+ encode_entities($value). '</TEXTAREA>';
+ } elsif ( $type eq 'text' ) {
+ $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="!.
+ encode_entities($value). '" SIZE=64>';
+ } elsif ( $type eq 'checkbox' ) {
+ $html .= qq!<INPUT TYPE="checkbox" NAME="$option" VALUE="1"!;
+ $html .= ' CHECKED' if $value;
+ $html .= '>';
+ } else {
+ $html .= "unknown type $type";
+ }
+ $html .= '</TD></TR>';
+ }
+ $html .= '</TABLE>';
+
+ $html .= '<INPUT TYPE="hidden" NAME="options" VALUE="'.
+ join(',', keys %{$exports->{$layer}{options}} ). '">';
+
+ $html .= '<INPUT TYPE="hidden" NAME="nodomain" VALUE="'.
+ $exports->{$layer}{nodomain}. '">';
+
+ $html .= '<INPUT TYPE="submit" VALUE="'.
+ ( $part_export->exportnum ? "Apply changes" : "Add export" ).
+ '">';
+
+ $html;
+ },
+);
+
+</%init>
Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_pkg.cgi,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cust_pkg.cgi 25 Dec 2007 23:49:21 -0000 1.13
+++ cust_pkg.cgi 13 Jan 2008 21:35:52 -0000 1.14
@@ -1,35 +1,3 @@
-%
-%
-%my %pkg = ();
-%my %comment = ();
-%my %all_pkg = ();
-%my %all_comment = ();
-%#foreach (qsearch('part_pkg', { 'disabled' => '' })) {
-%# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
-%# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
-%#}
-%foreach (qsearch('part_pkg', {} )) {
-% $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
-% $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
-% next if $_->disabled;
-% $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
-% $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
-%}
-%
-%my($custnum, %remove_pkg);
-%if ( $cgi->param('error') ) {
-% $custnum = $cgi->param('custnum');
-% %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
-%} else {
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $custnum = $1;
-% %remove_pkg = ();
-%}
-%
-%my $p1 = popurl(1);
-%
-%
<% include('/elements/header.html', "Add/Edit Packages", '') %>
<% include('/elements/error.html') %>
@@ -147,3 +115,40 @@
</FORM>
<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages');
+
+my %pkg = ();
+my %comment = ();
+my %all_pkg = ();
+my %all_comment = ();
+#foreach (qsearch('part_pkg', { 'disabled' => '' })) {
+# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+#}
+foreach (qsearch('part_pkg', {} )) {
+ $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+ $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+ next if $_->disabled;
+ $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+ $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+}
+
+my($custnum, %remove_pkg);
+if ( $cgi->param('error') ) {
+ $custnum = $cgi->param('custnum');
+ %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $custnum = $1;
+ %remove_pkg = ();
+}
+
+my $p1 = popurl(1);
+
+</%init>
+
Index: prepay_credit.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/prepay_credit.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- prepay_credit.cgi 4 Jan 2008 02:27:03 -0000 1.6
+++ prepay_credit.cgi 13 Jan 2008 21:35:52 -0000 1.7
@@ -1,38 +1,11 @@
-%
-%my $agent = '';
-%my $agentnum = '';
-%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-% $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } );
-%}
-%
-%tie my %multiplier, 'Tie::IxHash',
-% 1 => 'seconds',
-% 60 => 'minutes',
-% 3600 => 'hours',
-%;
-%
-%tie my %bytemultiplier, 'Tie::IxHash',
-% 1 => 'bytes',
-% 1000 => 'Kbytes',
-% 1000000 => 'Mbytes',
-% 1000000000 => 'Gbytes',
-%;
-%
-%$cgi->param('multiplier', '60') unless $cgi->param('multiplier');
-%$cgi->param('upmultiplier', '1000000') unless $cgi->param('upmultiplier');
-%$cgi->param('downmultiplier', '1000000') unless $cgi->param('downmultiplier');
-%$cgi->param('totalmultiplier','1000000') unless $cgi->param('totalmultiplier');
-
-<% include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : ''),
- menubar( 'Main Menu' => $p, ))
-%>
+<% include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : '') ) %>
<% include('/elements/error.html') %>
<FORM ACTION="<%popurl(1)%>process/prepay_credit.cgi" METHOD="POST" NAME="OneTrueForm" onSubmit="document.OneTrueForm.submit.disabled=true">
Generate
-<INPUT TYPE="text" NAME="num" VALUE="<% $cgi->param('num') || '(quantity)' %>" SIZE=10 MAXLENGTH=10 onFocus="if ( this.value == '(quantity)' ) { this.value = ''; }">
+<INPUT TYPE="text" NAME="num" VALUE="<% $cgi->param('num') || '(quantity)' |h %>" SIZE=10 MAXLENGTH=10 onFocus="if ( this.value == '(quantity)' ) { this.value = ''; }">
<SELECT NAME="type">
% foreach (qw(alpha alphanumeric numeric)) {
@@ -52,10 +25,10 @@
<TABLE>
<TR><TD>Value:
-$<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amount') %>">
+$<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amount') |h %>">
</TD>
<TD>and/or
-<INPUT TYPE="text" NAME="seconds" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('seconds') %>">
+<INPUT TYPE="text" NAME="seconds" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('seconds') |h %>">
<SELECT NAME="multiplier">
% foreach my $multiplier ( keys %multiplier ) {
@@ -66,7 +39,7 @@
</TD></TR>
<TR><TD></TD>
<TD>and/or
-<INPUT TYPE="text" NAME="upbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('upbytes') %>">
+<INPUT TYPE="text" NAME="upbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('upbytes') |h %>">
<SELECT NAME="upmultiplier">
% foreach my $multiplier ( keys %bytemultiplier ) {
@@ -77,7 +50,7 @@
</TD></TR>
<TR><TD></TD>
<TD>and/or
-<INPUT TYPE="text" NAME="downbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('downbytes') %>">
+<INPUT TYPE="text" NAME="downbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('downbytes') |h %>">
<SELECT NAME="downmultiplier">
% foreach my $multiplier ( keys %bytemultiplier ) {
@@ -88,7 +61,7 @@
</TD></TR>
<TR><TD></TD>
<TD>and/or
-<INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') %>">
+<INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') |h %>">
<SELECT NAME="totalmultiplier">
% foreach my $multiplier ( keys %bytemultiplier ) {
@@ -101,5 +74,37 @@
<BR><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Generate" onSubmit="this.disabled = true">
-</FORM></BODY></HTML>
+</FORM>
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my $agent = '';
+my $agentnum = '';
+if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+ $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } );
+}
+
+tie my %multiplier, 'Tie::IxHash',
+ 1 => 'seconds',
+ 60 => 'minutes',
+ 3600 => 'hours',
+;
+
+tie my %bytemultiplier, 'Tie::IxHash',
+ 1 => 'bytes',
+ 1000 => 'Kbytes',
+ 1000000 => 'Mbytes',
+ 1000000000 => 'Gbytes',
+;
+
+$cgi->param('multiplier', '60') unless $cgi->param('multiplier');
+$cgi->param('upmultiplier', '1000000') unless $cgi->param('upmultiplier');
+$cgi->param('downmultiplier', '1000000') unless $cgi->param('downmultiplier');
+$cgi->param('totalmultiplier','1000000') unless $cgi->param('totalmultiplier');
+
+</%init>
Index: bulk-cust_svc.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/bulk-cust_svc.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- bulk-cust_svc.html 23 Aug 2006 22:25:37 -0000 1.3
+++ bulk-cust_svc.html 13 Jan 2008 21:35:52 -0000 1.4
@@ -1,9 +1,4 @@
-<% include("/elements/header.html", 'Bulk customer service change',
- menubar(
- 'Main Menu' => $p,
- ),
- )
-%>
+<% include('/elements/header.html', 'Bulk customer service change') %>
<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
@@ -92,8 +87,11 @@
</FORM>
-</BODY>
-</HTML>
+<% include('/elements/footer.html') %>
+<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+</%init>
Index: reg_code.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/reg_code.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- reg_code.cgi 25 Dec 2007 23:49:22 -0000 1.5
+++ reg_code.cgi 13 Jan 2008 21:35:52 -0000 1.6
@@ -1,16 +1,4 @@
-%
-%my $agentnum = $cgi->param('agentnum');
-%$agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum");
-%$agentnum = $1;
-%my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
-%
-%
-
-
-<% include("/elements/header.html",'Generate registration codes for '. $agent->agent, menubar(
- 'Main Menu' => $p,
- ))
-%>
+<% include('/elements/header.html', 'Generate registration codes for '. $agent->agent) %>
<% include('/elements/error.html') %>
@@ -39,5 +27,18 @@
<BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Generate">
-</FORM></BODY></HTML>
+</FORM>
+
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $agentnum = $cgi->param('agentnum');
+$agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum");
+$agentnum = $1;
+my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
+
+</%init>
- Previous message: [freeside-commits] freeside/httemplate/misc/process batch-cust_pay.cgi, 1.3, 1.3.2.1 cancel_pkg.html, 1.4.2.1, 1.4.2.2 catchall.cgi, 1.5, 1.5.2.1 cdr-import.html, 1.3.2.1, 1.3.2.2 cust_main-import.cgi, 1.5.2.1, 1.5.2.2 cust_main-import_charges.cgi, 1.4.2.1, 1.4.2.2 delete-customer.cgi, 1.5, 1.5.2.1 inventory_item-import.html, 1.3.2.1, 1.3.2.2 link.cgi, 1.15.2.2, 1.15.2.3 meta-import.cgi, 1.7.2.1, 1.7.2.2 payment.cgi, 1.9.2.6, 1.9.2.7 recharge_svc.html, 1.2.2.4, 1.2.2.5
- Next message: [freeside-commits] freeside/httemplate/edit/process REAL_cust_pkg.cgi, 1.9, 1.10 access_user.html, 1.5, 1.6 agent.cgi, 1.5, 1.6 agent_payment_gateway.html, 1.2, 1.3 agent_type.cgi, 1.8, 1.9 bulk-cust_svc.cgi, 1.2, 1.3 cust_bill_pay.cgi, 1.6, 1.7 cust_credit.cgi, 1.11, 1.12 cust_credit_bill.cgi, 1.8, 1.9 cust_main.cgi, 1.35, 1.36 cust_main_county-collapse.cgi, 1.5, 1.6 cust_main_county-expand.cgi, 1.9, 1.10 cust_main_county.html, 1.1, 1.2 cust_main_note.cgi, 1.4, 1.5 cust_pay.cgi, 1.12, 1.13 cust_pkg.cgi, 1.7, 1.8 cust_refund.cgi, 1.7, 1.8 cust_svc.cgi, 1.3, 1.4 domain_record.cgi, 1.4, 1.5 generic.cgi, 1.4, 1.5 inventory_class.html, 1.3, 1.4 msgcat.cgi, 1.3, 1.4 part_bill_event.cgi, 1.10, 1.11 part_export.cgi, 1.8, 1.9 part_pkg.cgi, 1.24, 1.25 part_referral.html, 1.2, 1.3 part_svc.cgi, 1.14, 1.15 payment_gateway.html, 1.4, 1.5 pkg_class.html, 1.2, 1.3 prepay_credit.cgi, 1.6, 1.7 quick-charge.cgi, 1.11, 1.12 quick-cust_pkg.cgi, 1.10, 1.11 rate.cgi, 1.8, 1.9 reason.html, 1.1, 1.2 reason_type.html, 1.1, 1.2 reg_code.cgi, 1.5, 1.6 router.cgi, 1.5, 1.6 svc_Common.html, 1.1, 1.2 svc_acct.cgi, 1.10, 1.11 svc_acct_pop.cgi, 1.5, 1.6 svc_broadband.cgi, 1.6, 1.7 svc_domain.cgi, 1.5, 1.6 svc_external.cgi, 1.2, 1.3 svc_forward.cgi, 1.5, 1.6 svc_phone.html, 1.2, 1.3 svc_www.cgi, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list