From 6c4d9632f4d5cd1164ab9183932fbdf9137945aa Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 24 Jan 2009 21:04:17 +0000 Subject: [PATCH] add domain selection to advanced account report (side effect on RT#4623) --- httemplate/elements/select-domain.html | 13 +++++++++ httemplate/elements/select-table.html | 47 +++++++++++++++++++++++-------- httemplate/elements/tr-select-domain.html | 12 ++++++++ httemplate/search/report_svc_acct.html | 13 +++++++-- httemplate/search/svc_acct.cgi | 3 ++ 5 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 httemplate/elements/select-domain.html create mode 100644 httemplate/elements/tr-select-domain.html diff --git a/httemplate/elements/select-domain.html b/httemplate/elements/select-domain.html new file mode 100644 index 000000000..a9998da06 --- /dev/null +++ b/httemplate/elements/select-domain.html @@ -0,0 +1,13 @@ +<% include( '/elements/select-table.html', + 'table' => 'svc_domain', + 'name_col' => 'domain', + 'empty_label' => 'all', + 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '. + #' LEFT JOIN part_svc USING ( svcpart ) '. + ' LEFT JOIN cust_pkg USING ( pkgnum ) '. + ' LEFT JOIN cust_main USING ( custnum ) ', + 'agent_virt' => 1, + 'agent_null-right' => 'View/link unlinked services', + @_, + ) +%> diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index d24c9abe4..32a61e989 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -4,7 +4,9 @@ Example: include( '/elements/select-table.html', - #required + ## + # required + ## 'table' => 'table_name', 'name_col' => 'name_column', @@ -12,24 +14,42 @@ Example: 'curr_value' => 'current_value', #'value' => #deprecated form of 'curr_value', - #opt - 'empty_label' => '', #better specify it though, the default might change - 'hashref' => {}, - 'extra_sql' => '', - 'records' => \@records, #instead of hashref + ## + # optional + ## + + #search params + 'hashref' => {}, + 'addl_from' => '', + 'extra_sql' => '', + 'agent_virt' => 0, #set true and make sure the result is JOINed to + #something with agentnum (usually cust_main) + 'agent_null_right' => '', #right to see un-agented entries + #or + 'records' => \@records, #instead of search params + + #basic params controlling the resulting 'element_name' => '', #HTML element name, defaults to the name of # the primary key column 'field' => '', #synonym for element_name 'element_etc' => '', #additional attributes (i.e. "DISABLED") for the #