[freeside-commits] freeside/httemplate/view/elements
svc_Common.html, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Mon Feb 5 04:51:08 PST 2007
- Previous message: [freeside-commits]
freeside/httemplate/view cust_bill-logo.cgi, 1.6,
1.7 cust_bill-pdf.cgi, 1.8, 1.9 cust_bill-ps.cgi, 1.5,
1.6 cust_bill.cgi, 1.36, 1.37 cust_main.cgi, 1.111,
1.112 cust_pkg.cgi, 1.15, NONE svc_Common.html, 1.1,
1.2 svc_acct.cgi, 1.48, 1.49 svc_broadband.cgi, 1.12,
1.13 svc_domain.cgi, 1.22, 1.23 svc_external.cgi, 1.6,
1.7 svc_forward.cgi, 1.14, 1.15 svc_www.cgi, 1.14, 1.15
- Next message: [freeside-commits] freeside/httemplate/search
report_receivables.cgi, 1.34, 1.35 report_receivables.html, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/view/elements
In directory wavetail:/tmp/cvs-serv9128/httemplate/view/elements
Modified Files:
svc_Common.html
Log Message:
C is for Cookie^WControl
Index: svc_Common.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/elements/svc_Common.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- svc_Common.html 17 Jan 2007 23:27:17 -0000 1.4
+++ svc_Common.html 5 Feb 2007 12:51:05 -0000 1.5
@@ -1,5 +1,3 @@
-%
-%
% # options example...
% #
% # 'table' => 'svc_something'
@@ -16,40 +14,6 @@
% # # defaults to "edit/$table.cgi?", will have svcnum appended
% # 'edit_url' =>
%
-% my(%opt) = @_;
-%
-% my $table = $opt{'table'};
-%
-% my $fields = $opt{'fields'}
-% #|| [ grep { $_ ne 'svcnum' } dbdef->table($table)->columns ];
-% || [ grep { $_ ne 'svcnum' } fields($table) ];
-%
-% my $svcnum;
-% if ( $cgi->param('svcnum') ) {
-% $cgi->param('svcnum') =~ /^(\d+)$/ or die "unparsable svcnum";
-% $svcnum = $1;
-% } else {
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/ or die "no svcnum";
-% $svcnum = $1;
-% }
-% my $svc_x = qsearchs( $opt{'table'}, { 'svcnum' => $svcnum } )
-% or die "Unknown svcnum $svcnum in ". $opt{'table'}. " table\n";
-%
-% my $cust_svc = $svc_x->cust_svc;
-% my($label, $value, $svcdb) = $cust_svc->label;
-%
-% my $pkgnum = $cust_svc->pkgnum;
-%
-% my($cust_pkg, $custnum);
-% if ($pkgnum) {
-% $cust_pkg = $cust_svc->cust_pkg;
-% $custnum = $cust_pkg->custnum;
-% } else {
-% $cust_pkg = '';
-% $custnum = '';
-% }
-%
%
% if ( $custnum ) {
@@ -123,3 +87,51 @@
<% joblisting({'svcnum'=>$svcnum}, 1) %>
<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('View customer services')
+ || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me
+
+my(%opt) = @_;
+
+my $table = $opt{'table'};
+
+my $fields = $opt{'fields'}
+ #|| [ grep { $_ ne 'svcnum' } dbdef->table($table)->columns ];
+ || [ grep { $_ ne 'svcnum' } fields($table) ];
+
+my $svcnum;
+if ( $cgi->param('svcnum') ) {
+ $cgi->param('svcnum') =~ /^(\d+)$/ or die "unparsable svcnum";
+ $svcnum = $1;
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "no svcnum";
+ $svcnum = $1;
+}
+my $svc_x = qsearchs({
+ 'select' => $opt{'table'}.'.*',
+ 'table' => $opt{'table'},
+ 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
+ ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
+ ' LEFT JOIN cust_main USING ( custnum ) ',
+ 'hashref' => { 'svcnum' => $svcnum },
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+}) or die "Unknown svcnum $svcnum in ". $opt{'table'}. " table\n";
+
+my $cust_svc = $svc_x->cust_svc;
+my($label, $value, $svcdb) = $cust_svc->label;
+
+my $pkgnum = $cust_svc->pkgnum;
+
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg = $cust_svc->cust_pkg;
+ $custnum = $cust_pkg->custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+
+</%init>
- Previous message: [freeside-commits]
freeside/httemplate/view cust_bill-logo.cgi, 1.6,
1.7 cust_bill-pdf.cgi, 1.8, 1.9 cust_bill-ps.cgi, 1.5,
1.6 cust_bill.cgi, 1.36, 1.37 cust_main.cgi, 1.111,
1.112 cust_pkg.cgi, 1.15, NONE svc_Common.html, 1.1,
1.2 svc_acct.cgi, 1.48, 1.49 svc_broadband.cgi, 1.12,
1.13 svc_domain.cgi, 1.22, 1.23 svc_external.cgi, 1.6,
1.7 svc_forward.cgi, 1.14, 1.15 svc_www.cgi, 1.14, 1.15
- Next message: [freeside-commits] freeside/httemplate/search
report_receivables.cgi, 1.34, 1.35 report_receivables.html, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list