From 2c757d7db4cb6a7b9655de13206fcc84fb7ce61f Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 14 May 2006 16:47:31 +0000 Subject: first part of ACL and re-skinning work and some other small stuff --- httemplate/search/cust_bill.cgi | 165 --------------------------- httemplate/search/cust_main-otaker.cgi | 47 ++++---- httemplate/search/cust_main-payinfo.html | 20 ---- httemplate/search/cust_main-quickpay.html | 44 ------- httemplate/search/cust_main.cgi | 50 ++++---- httemplate/search/cust_pay.html | 18 --- httemplate/search/cust_pkg_report.cgi | 39 +++---- httemplate/search/report_cust_bill.html | 54 ++++----- httemplate/search/report_cust_credit.html | 62 +++++----- httemplate/search/report_cust_pay.html | 81 +++++++------ httemplate/search/report_prepaid_income.html | 26 ++--- httemplate/search/report_tax.html | 73 ++++++------ httemplate/search/sqlradius.html | 52 +-------- httemplate/search/svc_acct.html | 19 --- httemplate/search/svc_domain.cgi | 2 +- httemplate/search/svc_domain.html | 19 --- httemplate/search/svc_external.cgi | 21 ++-- 17 files changed, 234 insertions(+), 558 deletions(-) delete mode 100755 httemplate/search/cust_bill.cgi delete mode 100755 httemplate/search/cust_main-payinfo.html delete mode 100755 httemplate/search/cust_main-quickpay.html delete mode 100755 httemplate/search/cust_pay.html delete mode 100755 httemplate/search/svc_acct.html delete mode 100755 httemplate/search/svc_domain.html (limited to 'httemplate/search') diff --git a/httemplate/search/cust_bill.cgi b/httemplate/search/cust_bill.cgi deleted file mode 100755 index 5b0538ca3..000000000 --- a/httemplate/search/cust_bill.cgi +++ /dev/null @@ -1,165 +0,0 @@ -<% - -my $conf = new FS::Conf; -my $maxrecords = $conf->config('maxsearchrecordsperpage'); - -my $orderby = ''; #removeme - -my $limit = ''; -$limit .= "LIMIT $maxrecords" if $maxrecords; - -my $offset = $cgi->param('offset') || 0; -$limit .= " OFFSET $offset" if $offset; - -my($total, $tot_amount, $tot_balance); - -my(@cust_bill); -if ( $cgi->keywords ) { - my($query) = $cgi->keywords; - my $owed = "charged - ( select coalesce(sum(amount),0) from cust_bill_pay - where cust_bill_pay.invnum = cust_bill.invnum ) - - ( select coalesce(sum(amount),0) from cust_credit_bill - where cust_credit_bill.invnum = cust_bill.invnum )"; - my @where; - if ( $query =~ /^(OPEN(\d*)_)?(invnum|date|custnum)$/ ) { - my($open, $days, $field) = ($1, $2, $3); - $field = "_date" if $field eq 'date'; - $orderby = "ORDER BY cust_bill.$field"; - push @where, "0 != $owed" if $open; - push @where, "cust_bill._date < ". (time-86400*$days) if $days; - } else { - die "unknown query string $query"; - } - - my $extra_sql = scalar(@where) ? 'WHERE '. join(' AND ', @where) : ''; - - my $statement = "SELECT COUNT(*), sum(charged), sum($owed) - FROM cust_bill $extra_sql"; - my $sth = dbh->prepare($statement) or die dbh->errstr. " doing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - - ( $total, $tot_amount, $tot_balance ) = @{$sth->fetchrow_arrayref}; - - @cust_bill = qsearch( - 'cust_bill', - {}, - "cust_bill.*, $owed as owed", - "$extra_sql $orderby $limit" - ); -} else { - $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/; - my $invnum = $2; - @cust_bill = qsearchs('cust_bill', { 'invnum' => $invnum } ); - $total = scalar(@cust_bill); -} - -#if ( scalar(@cust_bill) == 1 ) { -if ( $total == 1 ) { - my $invnum = $cust_bill[0]->invnum; - print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect -} elsif ( scalar(@cust_bill) == 0 ) { -%> - -<% - eidiot("Invoice not found."); -} else { -%> - -<% - - #begin pager - my $pager = ''; - if ( $total != scalar(@cust_bill) && $maxrecords ) { - unless ( $offset == 0 ) { - $cgi->param('offset', $offset - $maxrecords); - $pager .= 'Previous '; - } - my $poff; - my $page; - for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { - $page++; - if ( $offset == $poff ) { - $pager .= qq!$page !; - } else { - $cgi->param('offset', $poff); - $pager .= qq!$page !; - } - } - unless ( $offset + $maxrecords > $total ) { - $cgi->param('offset', $offset + $maxrecords); - $pager .= 'Next '; - } - } - #end pager - - print header("Invoice Search Results", menubar( - 'Main Menu', popurl(2) - )). - "$total matching invoices found
". - "\$$tot_balance total balance
". - "\$$tot_amount total amount
". - "
$pager". table(). < - - Balance - Amount - Date - Contact name - Company - -END - - foreach my $cust_bill ( @cust_bill ) { - my($invnum, $owed, $charged, $date ) = ( - $cust_bill->invnum, - sprintf("%.2f", $cust_bill->getfield('owed')), - sprintf("%.2f", $cust_bill->charged), - $cust_bill->_date, - ); - my $pdate = time2str("%b %d %Y", $date); - - my $rowspan = 1; - - my $view = popurl(2). "view/cust_bill.cgi?$invnum"; - print < - $invnum - \$$owed - \$$charged - $pdate -END - my $custnum = $cust_bill->custnum; - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); - if ( $cust_main ) { - my $cview = popurl(2). "view/cust_main.cgi?". $cust_main->custnum; - my ( $name, $company ) = ( - $cust_main->last. ', '. $cust_main->first, - $cust_main->company, - ); - print <$name - $company -END - } else { - print <WARNING: couldn't find cust_main.custnum $custnum (cust_bill.invnum $invnum) -END - } - - print ""; - } - $tot_balance = sprintf("%.2f", $tot_balance); - $tot_amount = sprintf("%.2f", $tot_amount); - print "$pager
". table(). <       Total
BalanceTotal
Amount - \$$tot_balance\$$tot_amount - - - -END - -} - -%> diff --git a/httemplate/search/cust_main-otaker.cgi b/httemplate/search/cust_main-otaker.cgi index 03c2619af..6ac0bde18 100755 --- a/httemplate/search/cust_main-otaker.cgi +++ b/httemplate/search/cust_main-otaker.cgi @@ -1,28 +1,23 @@ - - - Customer Search - - - - Customer Search - -
-
- Search for Order taker: - - <% my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_main") - or die dbh->errstr; - $sth->execute() or die $sth->errstr; -# my @otakers = map { $_->[0] } @{$sth->selectall_arrayref}; - %> - -

+<%= include('/elements/header.html', 'Customer Search' ) %> -

- - +
+Search for Order taker: + + +<% my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_main") + or die dbh->errstr; + $sth->execute() or die $sth->errstr; + #my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref}; +%> + + +

+ +

+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/cust_main-payinfo.html b/httemplate/search/cust_main-payinfo.html deleted file mode 100755 index b82b610d8..000000000 --- a/httemplate/search/cust_main-payinfo.html +++ /dev/null @@ -1,20 +0,0 @@ - - - Customer Search - - - - Customer Search - -
-
- Search for Credit card #: - - - -

- -

- - - diff --git a/httemplate/search/cust_main-quickpay.html b/httemplate/search/cust_main-quickpay.html deleted file mode 100755 index 154a64199..000000000 --- a/httemplate/search/cust_main-quickpay.html +++ /dev/null @@ -1,44 +0,0 @@ - - - Quick payment entry - - - - Quick payment entry - -

- Main Menu

-
- - Search for last name: - - using search method: - -

Search for company: - - using search method: - -

- -

- -
Explanation of search methods: -
    -
  • All - Try all search methods. -
  • Fuzzy - Searches for matches that are close to your text. -
  • Substring - Searches for matches that contain your text. -
  • Exact - Finds exact matches only, but much faster than the other search methods. -
- - - diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 36ad39da8..8b70ff490 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -220,14 +220,13 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) { eidiot "No matching customers found!\n"; } else { %> - -<% +<%= include('/elements/header.html', "Customer Search Results", '' ) %> - $total ||= scalar(@cust_main); - print header("Customer Search Results",menubar( - 'Main Menu', popurl(2) - )), "$total matching customers found "; + <% $total ||= scalar(@cust_main); %> + <%= $total %> matching customers found + + <% #begin pager my $pager = ''; if ( $total != scalar(@cust_main) && $maxrecords ) { @@ -368,12 +367,14 @@ END my $pcompany = $company ? qq!$company! : ' '; - print < + - $custnum - $last, $first - $pcompany -END + ><%= $custnum %> + ><%= "$last, $first" %> + ><%= $pcompany %> + + <% if ( defined dbdef->table('cust_main')->column('ship_last') ) { my($ship_last,$ship_first,$ship_company)=( $cust_main->ship_last || $cust_main->getfield('last'), @@ -383,15 +384,18 @@ END my $pship_company = $ship_company ? qq!$ship_company! : ' '; - print <$ship_last, $ship_first - $pship_company -END - } + %> - foreach my $addl_col ( @addl_cols ) { - print ""; - if ( $addl_col eq 'tickets' ) { + ><%= "$ship_last, $ship_first" %> + ><%= $pship_company %> + + <% } + + foreach my $addl_col ( @addl_cols ) { %> + + ALIGN=right> + + <% if ( $addl_col eq 'tickets' ) { if ( @custom_priorities ) { print &itable('', 0); foreach my $priority ( @custom_priorities, '' ) { @@ -461,10 +465,14 @@ END } print ""; } + + %> - print "$pager"; + <%= $pager %> -} + <%= include('/elements/footer.html') %> + +<% } #undef $cache; #does this help? diff --git a/httemplate/search/cust_pay.html b/httemplate/search/cust_pay.html deleted file mode 100755 index 6414cf771..000000000 --- a/httemplate/search/cust_pay.html +++ /dev/null @@ -1,18 +0,0 @@ - - - Check # Search - - - - Check # Search - -

-
- Search for check #: - - -

-
- - - diff --git a/httemplate/search/cust_pkg_report.cgi b/httemplate/search/cust_pkg_report.cgi index 412c3f79d..d9aada5f4 100755 --- a/httemplate/search/cust_pkg_report.cgi +++ b/httemplate/search/cust_pkg_report.cgi @@ -1,23 +1,22 @@ - - - Packages - - -

Packages

-
- - Return packages with next bill date:

- - <%= include( '/elements/tr-input-beginning_ending.html' ) %> - <%= include( '/elements/tr-select-agent.html', - $cgi->param('agentnum'), - ) - %> -
-
+<%= include('/elements/header.html', 'Packages' ) %> -
+
+ - - +Return packages with next bill date: +

+ + <%= include( '/elements/tr-input-beginning_ending.html' ) %> + <%= include( '/elements/tr-select-agent.html', + $cgi->param('agentnum'), + ) + %> +
+ +
+ + +
+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/report_cust_bill.html b/httemplate/search/report_cust_bill.html index a7be76689..f1b7bfa14 100644 --- a/httemplate/search/report_cust_bill.html +++ b/httemplate/search/report_cust_bill.html @@ -1,28 +1,28 @@ - - Invoice report criteria - - -

Invoice report criteria

-
- - - <%= include( '/elements/tr-select-agent.html', - $cgi->param('agentnum'), - 'label' => 'Invoices for agent: ', - ) - %> - <%= include( '/elements/tr-input-beginning_ending.html' ) %> - - - - - - - - -
Show only open invoices
Show only the single most recent invoice per-customer
-
-
- - +<%= include('/elements/header.html', 'Invoice report criteria' ) %> +
+ + + + <%= include( '/elements/tr-select-agent.html', + $cgi->param('agentnum'), + 'label' => 'Invoices for agent: ', + ) + %> + <%= include( '/elements/tr-input-beginning_ending.html' ) %> + + + + + + + + +
Show only open invoices
Show only the single most recent invoice per-customer
+ +
+ + +
+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html index 56bbd0ac0..8ca52dc9a 100644 --- a/httemplate/search/report_cust_credit.html +++ b/httemplate/search/report_cust_credit.html @@ -1,36 +1,38 @@ - - - Credit report criteria - - -

Credit report criteria

-
- - - - +<%= include('/elements/header.html', 'Credit report' ) %> + + + + +
Credits by employee:
+ + + <% my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_credit") or die dbh->errstr; $sth->execute or die $sth->errstr; my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref}; %> - - - <%= include( '/elements/tr-select-agent.html', - $cgi->param('agentnum'), - 'label' => 'for agent: ', - ) - %> - <%= include( '/elements/tr-input-beginning_ending.html' ) %> -
Credits by employee: -
-
-
- - + + + + + <%= include( '/elements/tr-select-agent.html', + $cgi->param('agentnum'), + 'label' => 'for agent: ', + ) + %> + <%= include( '/elements/tr-input-beginning_ending.html' ) %> + + +
+ + + + +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html index 5d8b74e77..8adf7dc13 100644 --- a/httemplate/search/report_cust_pay.html +++ b/httemplate/search/report_cust_pay.html @@ -1,38 +1,43 @@ - - - Payment report criteria - - -

Payment report criteria

-
- - - - - - - <%= include( '/elements/tr-select-agent.html', - $cgi->param('agentnum'), - 'label' => 'for agent: ', - ) - %> - <%= include( '/elements/tr-input-beginning_ending.html' ) %> -
Payments of type: -
-
-
- - +<%= include('/elements/header.html', 'Payment report' ) %> + +
+ + + + + + + + + + <%= include( '/elements/tr-select-agent.html', + $cgi->param('agentnum'), + 'label' => 'for agent: ', + ) + %> + + <%= include( '/elements/tr-input-beginning_ending.html' ) %> + +
Payments of type: + +
+ +
+ + +
+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/report_prepaid_income.html b/httemplate/search/report_prepaid_income.html index 57c318eba..4359918f9 100644 --- a/httemplate/search/report_prepaid_income.html +++ b/httemplate/search/report_prepaid_income.html @@ -1,13 +1,13 @@ - - - Prepaid Income (Unearned Revenue) Report - - - - - - -

Prepaid Income (Unearned Revenue) Report

+<%= include('/elements/header.html', 'Prepaid Income (Unearned Revenue) Report', + '', + '', + ' + + + + ' +) %> +
@@ -32,8 +32,6 @@ }); - - - -
+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html index 7a8ecd4f0..bdeb8e237 100755 --- a/httemplate/search/report_tax.html +++ b/httemplate/search/report_tax.html @@ -1,40 +1,35 @@ - - - Tax Report Criteria - - -

Tax Report Criteria

- - -
- - <%= include( '/elements/tr-select-agent.html' ) %> - - <%= include( '/elements/tr-input-beginning_ending.html' ) %> - - <% my $conf = new FS::Conf; - if ( $conf->exists('enable_taxclasses') ) { - %> - - - - - <% } %> - - <% my @pkg_class = qsearch('pkg_class', {}); - if ( @pkg_class ) { - %> - - - - - <% } %> - -
Show tax classes
Show package classes
- -
-
- - - +<%= include('/elements/header.html', 'Tax Report' ) %> +
+ + + + <%= include( '/elements/tr-select-agent.html' ) %> + + <%= include( '/elements/tr-input-beginning_ending.html' ) %> + + <% my $conf = new FS::Conf; + if ( $conf->exists('enable_taxclasses') ) { + %> + + + + + <% } %> + + <% my @pkg_class = qsearch('pkg_class', {}); + if ( @pkg_class ) { + %> + + + + + <% } %> + +
Show tax classes
Show package classes
+ +
+ +
+ +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/sqlradius.html b/httemplate/search/sqlradius.html index 8f4878dbc..645505101 100644 --- a/httemplate/search/sqlradius.html +++ b/httemplate/search/sqlradius.html @@ -1,9 +1,5 @@ -<%= include( '/elements/header.html', 'Search RADIUS sessions', '', '', ' - - - - -') %> +<%= include( '/elements/header.html', 'Search RADIUS sessions' ) %> +
<% #include( '/elements/table.html' ) %> <%= ntable('#cccccc') %> @@ -47,48 +43,10 @@ <% } %> - - From: - - - - - - - - m/d/y - - - To: - - - - - - - - m/d/y -
(leave one or both dates blank for an open-ended search) - - +<%= include( '/elements/tr-input-beginning_ending.html' ) %> +
- - - +<%= include('/elements/footer.html') %> diff --git a/httemplate/search/svc_acct.html b/httemplate/search/svc_acct.html deleted file mode 100755 index c504c2f34..000000000 --- a/httemplate/search/svc_acct.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Account Search - - - - Account Search - -

-
- Search for username: - - -

- -

- - - diff --git a/httemplate/search/svc_domain.cgi b/httemplate/search/svc_domain.cgi index f261ea9f3..b02eea8bd 100755 --- a/httemplate/search/svc_domain.cgi +++ b/httemplate/search/svc_domain.cgi @@ -61,7 +61,7 @@ my $link_cust = sub { $svc_x->custnum ? [ "${p}view/cust_main.cgi?", 'custnum' ] : ''; }; -%><%= include ('elements/search.html', +%><%= include( 'elements/search.html', 'title' => "Domain Search Results", 'name' => 'domains', 'query' => $sql_query, diff --git a/httemplate/search/svc_domain.html b/httemplate/search/svc_domain.html deleted file mode 100755 index b759102f4..000000000 --- a/httemplate/search/svc_domain.html +++ /dev/null @@ -1,19 +0,0 @@ - - - Domain Search - - - - Domain Search - -

-
- Search for domain: - - -

- -

- - - diff --git a/httemplate/search/svc_external.cgi b/httemplate/search/svc_external.cgi index 8dbb949c8..7968f3c43 100755 --- a/httemplate/search/svc_external.cgi +++ b/httemplate/search/svc_external.cgi @@ -38,17 +38,18 @@ if ( $query eq 'svcnum' ) { } if ( scalar(@svc_external) == 1 ) { - print $cgi->redirect(popurl(2). "view/svc_external.cgi?". $svc_external[0]->svcnum); - #exit; + + %><%= $cgi->redirect(popurl(2). "view/svc_external.cgi?". $svc_external[0]->svcnum) %><% + } elsif ( scalar(@svc_external) == 0 ) { -%> - -<% - eidiot "No matching external services found!\n"; -} else { -%> - -<%= include("/elements/header.html","External Search Results",'') %> + + %><%= include('/elements/header.html', 'External Search Results' ) %> + + No matching external services found + +<% } else { + + %><%= include('/elements/header.html', 'External Search Results', '') %> <%= scalar(@svc_external) %> matching external services found -- cgit v1.2.1