From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: [PATCH] Will things ever be the same again? It's the final masonize --- Makefile | 44 +- httemplate/browse/access_group.html | 101 +- httemplate/browse/access_user.html | 161 +-- httemplate/browse/addr_block.cgi | 81 +- httemplate/browse/agent.cgi | 326 +++-- httemplate/browse/agent_type.cgi | 69 +- httemplate/browse/cust_main_county.cgi | 213 +-- httemplate/browse/cust_pay_batch.cgi | 110 +- httemplate/browse/elements/browse.html | 2 +- httemplate/browse/inventory_class.html | 49 +- httemplate/browse/msgcat.cgi | 76 +- httemplate/browse/nas.cgi | 157 +-- httemplate/browse/part_bill_event.cgi | 164 ++- httemplate/browse/part_export.cgi | 32 +- httemplate/browse/part_pkg.cgi | 449 +++---- httemplate/browse/part_referral.html | 221 +-- httemplate/browse/part_svc.cgi | 244 ++-- httemplate/browse/part_virtual_field.cgi | 54 +- httemplate/browse/payment_gateway.html | 67 +- httemplate/browse/pkg_class.html | 25 +- httemplate/browse/rate.cgi | 39 +- httemplate/browse/router.cgi | 84 +- httemplate/browse/svc_acct_pop.cgi | 86 +- httemplate/config/config-process.cgi | 101 +- httemplate/config/config-view.cgi | 98 +- httemplate/config/config.cgi | 307 +++-- httemplate/docs/trouble.html | 26 - httemplate/edit/REAL_cust_pkg.cgi | 220 +-- httemplate/edit/access_group.html | 2 +- httemplate/edit/access_user.html | 2 +- httemplate/edit/agent.cgi | 114 +- httemplate/edit/agent_payment_gateway.html | 86 +- httemplate/edit/agent_type.cgi | 58 +- httemplate/edit/bulk-cust_svc.html | 96 +- httemplate/edit/cust_bill_pay.cgi | 109 +- httemplate/edit/cust_credit.cgi | 88 +- httemplate/edit/cust_credit_bill.cgi | 121 +- httemplate/edit/cust_main.cgi | 464 +++---- httemplate/edit/cust_main/billing.html | 631 ++++----- httemplate/edit/cust_main/contact.html | 141 +- httemplate/edit/cust_main/select-country.html | 59 +- httemplate/edit/cust_main/select-county.html | 82 +- httemplate/edit/cust_main/select-state.html | 25 +- httemplate/edit/cust_main_county-expand.cgi | 105 +- httemplate/edit/cust_main_county.cgi | 193 +-- httemplate/edit/cust_pay.cgi | 174 +-- httemplate/edit/cust_pkg.cgi | 210 +-- httemplate/edit/cust_refund.cgi | 185 +-- httemplate/edit/elements/edit.html | 298 +++-- httemplate/edit/elements/svc_Common.html | 33 +- httemplate/edit/inventory_class.html | 2 +- httemplate/edit/msgcat.cgi | 113 +- httemplate/edit/part_bill_event.cgi | 740 +++++----- httemplate/edit/part_export.cgi | 220 +-- httemplate/edit/part_pkg.cgi | 537 ++++---- httemplate/edit/part_referral.html | 2 +- httemplate/edit/part_svc.cgi | 853 ++++++------ httemplate/edit/part_virtual_field.cgi | 115 +- httemplate/edit/payment_gateway.html | 164 +-- httemplate/edit/pkg_class.html | 2 +- httemplate/edit/prepay_credit.cgi | 72 +- httemplate/edit/process/REAL_cust_pkg.cgi | 67 +- httemplate/edit/process/access_group.html | 2 +- httemplate/edit/process/access_user.html | 2 +- httemplate/edit/process/addr_block/add.cgi | 39 +- httemplate/edit/process/addr_block/allocate.cgi | 49 +- httemplate/edit/process/addr_block/deallocate.cgi | 47 +- httemplate/edit/process/addr_block/split.cgi | 37 +- httemplate/edit/process/agent.cgi | 55 +- httemplate/edit/process/agent_payment_gateway.html | 51 +- httemplate/edit/process/agent_type.cgi | 71 +- httemplate/edit/process/bulk-cust_svc.cgi | 7 +- httemplate/edit/process/cust_bill_pay.cgi | 93 +- httemplate/edit/process/cust_credit.cgi | 61 +- httemplate/edit/process/cust_credit_bill.cgi | 95 +- httemplate/edit/process/cust_main.cgi | 305 ++--- .../edit/process/cust_main_county-collapse.cgi | 69 +- .../edit/process/cust_main_county-expand.cgi | 115 +- httemplate/edit/process/cust_main_county.cgi | 59 +- httemplate/edit/process/cust_pay.cgi | 98 +- httemplate/edit/process/cust_pkg.cgi | 85 +- httemplate/edit/process/cust_refund.cgi | 83 +- httemplate/edit/process/cust_svc.cgi | 60 +- httemplate/edit/process/domain_record.cgi | 64 +- httemplate/edit/process/elements/process.html | 181 +-- httemplate/edit/process/elements/svc_Common.html | 17 +- httemplate/edit/process/generic.cgi | 139 +- httemplate/edit/process/inventory_class.html | 2 +- httemplate/edit/process/msgcat.cgi | 39 +- httemplate/edit/process/part_bill_event.cgi | 105 +- httemplate/edit/process/part_export.cgi | 77 +- httemplate/edit/process/part_pkg.cgi | 121 +- httemplate/edit/process/part_referral.html | 2 +- httemplate/edit/process/part_svc.cgi | 7 +- httemplate/edit/process/payment_gateway.html | 65 +- httemplate/edit/process/pkg_class.html | 2 +- httemplate/edit/process/prepay_credit.cgi | 78 +- httemplate/edit/process/quick-charge.cgi | 76 +- httemplate/edit/process/quick-cust_pkg.cgi | 44 +- httemplate/edit/process/rate.cgi | 7 +- httemplate/edit/process/rate_region.cgi | 101 +- httemplate/edit/process/reg_code.cgi | 70 +- httemplate/edit/process/router.cgi | 133 +- httemplate/edit/process/svc_acct.cgi | 97 +- httemplate/edit/process/svc_acct_pop.cgi | 55 +- httemplate/edit/process/svc_broadband.cgi | 71 +- httemplate/edit/process/svc_domain.cgi | 61 +- httemplate/edit/process/svc_external.cgi | 57 +- httemplate/edit/process/svc_forward.cgi | 57 +- httemplate/edit/process/svc_phone.html | 2 +- httemplate/edit/process/svc_www.cgi | 71 +- httemplate/edit/rate.cgi | 139 +- httemplate/edit/rate_region.cgi | 135 +- httemplate/edit/reg_code.cgi | 39 +- httemplate/edit/router.cgi | 113 +- httemplate/edit/svc_acct.cgi | 614 ++++----- httemplate/edit/svc_acct_pop.cgi | 109 +- httemplate/edit/svc_broadband.cgi | 276 ++-- httemplate/edit/svc_domain.cgi | 160 +-- httemplate/edit/svc_external.cgi | 181 +-- httemplate/edit/svc_forward.cgi | 267 ++-- httemplate/edit/svc_phone.cgi | 2 +- httemplate/edit/svc_www.cgi | 427 +++--- httemplate/elements/checkboxes-table-name.html | 162 +-- httemplate/elements/checkboxes-table.html | 235 ++-- httemplate/elements/header-popup.html | 21 +- httemplate/elements/header.html | 85 +- httemplate/elements/jsrsServer.html | 7 +- httemplate/elements/menu.html | 631 ++++----- httemplate/elements/menubar.html | 19 +- httemplate/elements/pager.html | 83 +- httemplate/elements/phonenumber.html | 29 +- httemplate/elements/progress-init.html | 51 +- httemplate/elements/progress-popup.html | 49 +- httemplate/elements/search-cust_main.html | 57 +- httemplate/elements/select-access_group.html | 15 +- httemplate/elements/select-agent.html | 15 +- httemplate/elements/select-cust-fields.html | 25 +- httemplate/elements/select-cust_pkg-status.html | 17 +- httemplate/elements/select-month_year.html | 115 +- httemplate/elements/select-part_referral.html | 15 +- httemplate/elements/select-pkg_class.html | 19 +- httemplate/elements/select-table.html | 122 +- httemplate/elements/select-taxclass.html | 48 +- httemplate/elements/small_custview.html | 5 +- httemplate/elements/table-grid.html | 13 +- httemplate/elements/table.html | 17 +- httemplate/elements/tr-select-access_group.html | 24 +- httemplate/elements/tr-select-agent.html | 42 +- httemplate/elements/tr-select-cust-fields.html | 17 +- httemplate/elements/tr-select-cust_pkg-status.html | 15 +- httemplate/elements/tr-select-from_to.html | 53 +- httemplate/elements/tr-select-part_referral.html | 36 +- httemplate/elements/tr-select-pkg_class.html | 24 +- httemplate/elements/xmlhttp.html | 53 +- httemplate/graph/cust_bill_pkg.cgi | 201 +-- httemplate/graph/elements/monthly.html | 319 ++--- httemplate/graph/money_time.cgi | 131 +- httemplate/graph/report_cust_bill_pkg.html | 10 +- httemplate/graph/report_money_time.html | 8 +- httemplate/index.html | 88 +- httemplate/misc/batch-cust_pay.html | 65 +- httemplate/misc/bill.cgi | 74 +- httemplate/misc/cancel-unaudited.cgi | 64 +- httemplate/misc/cancel_pkg.cgi | 29 +- httemplate/misc/catchall.cgi | 263 ++-- httemplate/misc/cdr-import.html | 4 +- httemplate/misc/change_pkg.cgi | 129 +- httemplate/misc/counties.cgi | 35 +- httemplate/misc/cust_main-cancel.cgi | 43 +- httemplate/misc/cust_main-import.cgi | 20 +- httemplate/misc/cust_main-import_charges.cgi | 2 +- httemplate/misc/delete-cust_credit.cgi | 31 +- httemplate/misc/delete-cust_pay.cgi | 31 +- httemplate/misc/delete-customer.cgi | 117 +- httemplate/misc/delete-domain_record.cgi | 29 +- httemplate/misc/delete-part_export.cgi | 29 +- httemplate/misc/download-batch.cgi | 243 ++-- httemplate/misc/dump.cgi | 37 +- httemplate/misc/email-invoice.cgi | 33 +- httemplate/misc/email_invoice_events.cgi | 7 +- httemplate/misc/email_invoices.cgi | 7 +- httemplate/misc/expire_pkg.cgi | 45 +- httemplate/misc/fax-invoice.cgi | 33 +- httemplate/misc/fax_invoice_events.cgi | 7 +- httemplate/misc/fax_invoices.cgi | 7 +- httemplate/misc/inventory_item-import.html | 23 +- httemplate/misc/link.cgi | 124 +- httemplate/misc/meta-import.cgi | 67 +- httemplate/misc/payment.cgi | 182 +-- httemplate/misc/print-invoice.cgi | 33 +- httemplate/misc/print_invoice_events.cgi | 7 +- httemplate/misc/print_invoices.cgi | 7 +- httemplate/misc/process/batch-cust_pay.cgi | 85 +- httemplate/misc/process/catchall.cgi | 65 +- httemplate/misc/process/cdr-import.html | 48 +- httemplate/misc/process/cust_main-import.cgi | 60 +- .../misc/process/cust_main-import_charges.cgi | 50 +- httemplate/misc/process/delete-customer.cgi | 57 +- httemplate/misc/process/expire_pkg.cgi | 49 +- httemplate/misc/process/inventory_item-import.html | 48 +- httemplate/misc/process/link.cgi | 148 +- httemplate/misc/process/meta-import.cgi | 281 ++-- httemplate/misc/process/payment.cgi | 277 ++-- httemplate/misc/queue.cgi | 93 +- httemplate/misc/states.cgi | 13 +- httemplate/misc/susp_pkg.cgi | 29 +- httemplate/misc/unapply-cust_credit.cgi | 35 +- httemplate/misc/unapply-cust_pay.cgi | 35 +- httemplate/misc/unprovision.cgi | 54 +- httemplate/misc/unsusp_pkg.cgi | 29 +- httemplate/misc/unvoid-cust_pay_void.cgi | 31 +- httemplate/misc/upload-batch.cgi | 56 +- httemplate/misc/void-cust_pay.cgi | 31 +- httemplate/misc/whois.cgi | 30 +- httemplate/misc/xmlhttp-cust_main-search.cgi | 37 +- httemplate/misc/xmlrpc.cgi | 33 +- httemplate/search/cdr.html | 53 +- httemplate/search/cust_bill.html | 327 ++--- httemplate/search/cust_bill_event.cgi | 183 +-- httemplate/search/cust_bill_event.html | 13 +- httemplate/search/cust_bill_pkg.cgi | 255 ++-- httemplate/search/cust_credit.html | 135 +- httemplate/search/cust_main-otaker.cgi | 22 +- httemplate/search/cust_main-zip.html | 173 +-- httemplate/search/cust_main.cgi | 1414 ++++++++++---------- httemplate/search/cust_pay.cgi | 299 ++--- httemplate/search/cust_pkg.cgi | 413 +++--- httemplate/search/cust_tax_exempt_pkg.cgi | 179 +-- httemplate/search/elements/search.html | 945 ++++++------- httemplate/search/inventory_item.html | 99 +- httemplate/search/prepay_credit.html | 25 +- httemplate/search/queue.html | 29 +- httemplate/search/reg_code.html | 21 +- httemplate/search/report_cdr.html | 4 +- httemplate/search/report_cust_bill.html | 8 +- httemplate/search/report_cust_credit.html | 28 +- httemplate/search/report_cust_main-zip.html | 4 +- httemplate/search/report_cust_pay.html | 8 +- httemplate/search/report_cust_pkg.html | 17 +- httemplate/search/report_prepaid_income.cgi | 129 +- httemplate/search/report_prepaid_income.html | 4 +- httemplate/search/report_receivables.cgi | 273 ++-- httemplate/search/report_receivables.html | 4 +- httemplate/search/report_tax.cgi | 933 ++++++------- httemplate/search/report_tax.html | 25 +- httemplate/search/sql.html | 2 +- httemplate/search/sqlradius.cgi | 540 ++++---- httemplate/search/sqlradius.html | 29 +- httemplate/search/svc_Smart.html | 49 +- httemplate/search/svc_acct.cgi | 233 ++-- httemplate/search/svc_broadband.cgi | 187 +-- httemplate/search/svc_domain.cgi | 151 +-- httemplate/search/svc_external.cgi | 191 +-- httemplate/search/svc_forward.cgi | 201 +-- httemplate/search/svc_phone.cgi | 135 +- httemplate/search/svc_www.cgi | 81 +- httemplate/view/cust_bill-logo.cgi | 31 +- httemplate/view/cust_bill-pdf.cgi | 35 +- httemplate/view/cust_bill-ps.cgi | 27 +- httemplate/view/cust_bill.cgi | 214 +-- httemplate/view/cust_main.cgi | 152 ++- httemplate/view/cust_main/billing.html | 168 +-- httemplate/view/cust_main/contacts.html | 114 +- httemplate/view/cust_main/misc.html | 89 +- httemplate/view/cust_main/order_pkg.html | 33 +- httemplate/view/cust_main/packages.html | 864 ++++++------ httemplate/view/cust_main/payment_history.html | 979 +++++++------- httemplate/view/cust_main/quick-charge.html | 13 +- httemplate/view/cust_main/tickets.html | 99 +- httemplate/view/cust_pkg.cgi | 327 ++--- httemplate/view/elements/svc_Common.html | 156 +-- httemplate/view/svc_acct.cgi | 397 +++--- httemplate/view/svc_broadband.cgi | 186 +-- httemplate/view/svc_domain.cgi | 134 +- httemplate/view/svc_external.cgi | 78 +- httemplate/view/svc_forward.cgi | 165 +-- httemplate/view/svc_phone.cgi | 2 +- httemplate/view/svc_www.cgi | 143 +- 279 files changed, 17381 insertions(+), 16738 deletions(-) delete mode 100755 httemplate/docs/trouble.html diff --git a/Makefile b/Makefile index fbc5ea1d9..604b402d5 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,8 @@ DATASOURCE = DBI:Pg:dbname=freeside DB_USER = freeside DB_PASSWORD= -#TEMPLATE = asp TEMPLATE = mason -ASP_GLOBAL = /usr/local/etc/freeside/asp-global MASON_HANDLER = /usr/local/etc/freeside/handler.pl MASONDATA = /usr/local/etc/freeside/masondata @@ -117,27 +115,19 @@ help: @echo @echo " dev dev-docs dev-perl-modules" @echo - @echo " aspdocs masondocs alldocs docs" + @echo " masondocs alldocs docs" @echo " htmlman forcehtmlman" @echo " perl-modules" #@echo #@echo " upload-docs release update-webdemo" -aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/* - rm -rf aspdocs - cp -pr httemplate aspdocs - touch aspdocs - masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/* rm -rf masondocs cp -pr httemplate masondocs - ( cd masondocs; \ - ../bin/masonize; \ - ) touch masondocs -alldocs: aspdocs masondocs +alldocs: masondocs docs: make ${TEMPLATE}docs @@ -162,25 +152,17 @@ forcehtmlman: install-docs: docs [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT} - [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true - [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true - [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true - [ "${TEMPLATE}" = "asp" ] && \ - perl -p -i -e "\ - s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ - " ${ASP_GLOBAL}/global.asa || true - [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true - [ "${TEMPLATE}" = "mason" ] && \ - perl -p -i -e "\ - s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ - s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \ - " ${MASON_HANDLER} || true - [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true - [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true - -dev-docs: docs + cp htetc/handler.pl ${MASON_HANDLER} + perl -p -i -e "\ + s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ + s'%%%RT_ENABLED%%%'${RT_ENABLED}'g; \ + " ${MASON_HANDLER} + [ ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true + chown -R freeside ${MASONDATA} + +dev-docs: [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true - ln -s ${FREESIDE_PATH}/masondocs ${FREESIDE_DOCUMENT_ROOT} + ln -s ${FREESIDE_PATH}/httemplate ${FREESIDE_DOCUMENT_ROOT} cp htetc/handler.pl ${MASON_HANDLER} perl -p -i -e "\ s'%%%FREESIDE_DOCUMENT_ROOT%%%'${FREESIDE_DOCUMENT_ROOT}'g; \ @@ -332,7 +314,7 @@ install-rt: [ ${RT_ENABLED} -eq 1 ] && ( cd rt; make install ) || true clean: - rm -rf aspdocs masondocs + rm -rf masondocs cd FS; \ make clean diff --git a/httemplate/browse/access_group.html b/httemplate/browse/access_group.html index 9ebb2b882..d1c3aea4c 100644 --- a/httemplate/browse/access_group.html +++ b/httemplate/browse/access_group.html @@ -1,53 +1,54 @@ -<% - -my $html_init = - "Internal access groups control access to the back-office interface.

". - qq!Add an internal access group

!; - -#false laziness w/access_user.html & agent_type.cgi -my $agents_sub = sub { - my $access_group = shift; - - [ map { - my $access_groupagent = $_; - my $agent = $access_groupagent->agent; - [ - { - 'data' => $agent->agent, - 'align' => 'left', - 'link' => $p. 'edit/agent.cgi?'. $agent->agentnum, - }, - ]; - } - grep { $_->agent } #? - $access_group->access_groupagent, - - ]; - -}; - -my $rights_sub = sub { - my $access_group = shift; - - [ map { my $access_right = $_; - [ - { - 'data' => $access_right->rightname, - 'align' => 'left', - }, - ]; - } - $access_group->access_rights, - - ]; - -}; - -my $count_query = 'SELECT COUNT(*) FROM access_group'; - -my $link = [ $p.'edit/access_group.html?', 'groupnum' ]; - -%><%= include( 'elements/browse.html', +% +% +%my $html_init = +% "Internal access groups control access to the back-office interface.

". +% qq!Add an internal access group

!; +% +%#false laziness w/access_user.html & agent_type.cgi +%my $agents_sub = sub { +% my $access_group = shift; +% +% [ map { +% my $access_groupagent = $_; +% my $agent = $access_groupagent->agent; +% [ +% { +% 'data' => $agent->agent, +% 'align' => 'left', +% 'link' => $p. 'edit/agent.cgi?'. $agent->agentnum, +% }, +% ]; +% } +% grep { $_->agent } #? +% $access_group->access_groupagent, +% +% ]; +% +%}; +% +%my $rights_sub = sub { +% my $access_group = shift; +% +% [ map { my $access_right = $_; +% [ +% { +% 'data' => $access_right->rightname, +% 'align' => 'left', +% }, +% ]; +% } +% $access_group->access_rights, +% +% ]; +% +%}; +% +%my $count_query = 'SELECT COUNT(*) FROM access_group'; +% +%my $link = [ $p.'edit/access_group.html?', 'groupnum' ]; +% +% +<% include( 'elements/browse.html', 'title' => 'Internal Access Groups', 'menubar' => [ # 'Main menu' => $p, 'Internal users' => $p.'browse/access_user.html', diff --git a/httemplate/browse/access_user.html b/httemplate/browse/access_user.html index 5b787977d..05384289a 100644 --- a/httemplate/browse/access_user.html +++ b/httemplate/browse/access_user.html @@ -1,83 +1,84 @@ -<% - -my $html_init = - "Internal users have access to the back-office interface. Typically, this is your employees and contractors, but in a VISP setup, you can also add accounts for your reseller's employees. It is highly recommended to add a separate account for each person rather than using role accounts.

". - qq!Add an internal user

!; - -#false laziness w/part_pkg.cgi -my %search = (); -my $search = ''; -unless ( $cgi->param('showdisabled') ) { - %search = ( 'disabled' => '' ); - $search = "( disabled = '' OR disabled IS NULL )"; -} - -#false laziness w/access_group.html & agent_type.cgi -my $groups_sub = sub { - my $access_user = shift; - - [ map { - my $access_usergroup = $_; - my $access_group = $access_usergroup->access_group; - [ - { - 'data' => $access_group->groupname, - 'align' => 'left', - 'link' => - $p. 'edit/access_group.html?'. $access_usergroup->groupnum, - }, - ]; - } - grep { $_->access_group # and ! $_->access_group->disabled - } - $access_user->access_usergroup, - - ]; - -}; - -my $posttotal; -if ( $cgi->param('showdisabled') ) { - $cgi->param('showdisabled', 0); - $posttotal = '( hide disabled users )'; - $cgi->param('showdisabled', 1); -} else { - $cgi->param('showdisabled', 1); - $posttotal = '( show disabled users )'; - $cgi->param('showdisabled', 0); -} - -my $count_query = 'SELECT COUNT(*) FROM access_user'; -$count_query .= " WHERE $search" - if $search; - -my $link = [ $p.'edit/access_user.html?', 'usernum' ]; - -my @header = ( '#', 'Username' ); -my @fields = ( 'usernum', 'username' ); -my $align = 'rl'; -my @links = ( $link, $link ); -my @style = ( '', '' ); - -#false laziness w/part_pkg.cgi -#unless ( $cgi->param('showdisabled') ) { #its been reversed already -if ( $cgi->param('showdisabled') ) { #its been reversed already - push @header, 'Status'; - push @fields, sub { shift->disabled - ? 'DISABLED' - : 'Active' - }; - push @links, ''; - $align .= 'c'; - push @style, 'b'; -} - -push @header, 'Full name', 'Groups'; -push @fields, 'name', $groups_sub; -push @links, $link, ''; -$align .= 'll'; - -%><%= include( 'elements/browse.html', +% +% +%my $html_init = +% "Internal users have access to the back-office interface. Typically, this is your employees and contractors, but in a VISP setup, you can also add accounts for your reseller's employees. It is highly recommended to add a separate account for each person rather than using role accounts.

". +% qq!Add an internal user

!; +% +%#false laziness w/part_pkg.cgi +%my %search = (); +%my $search = ''; +%unless ( $cgi->param('showdisabled') ) { +% %search = ( 'disabled' => '' ); +% $search = "( disabled = '' OR disabled IS NULL )"; +%} +% +%#false laziness w/access_group.html & agent_type.cgi +%my $groups_sub = sub { +% my $access_user = shift; +% +% [ map { +% my $access_usergroup = $_; +% my $access_group = $access_usergroup->access_group; +% [ +% { +% 'data' => $access_group->groupname, +% 'align' => 'left', +% 'link' => +% $p. 'edit/access_group.html?'. $access_usergroup->groupnum, +% }, +% ]; +% } +% grep { $_->access_group # and ! $_->access_group->disabled +% } +% $access_user->access_usergroup, +% +% ]; +% +%}; +% +%my $posttotal; +%if ( $cgi->param('showdisabled') ) { +% $cgi->param('showdisabled', 0); +% $posttotal = '( hide disabled users )'; +% $cgi->param('showdisabled', 1); +%} else { +% $cgi->param('showdisabled', 1); +% $posttotal = '( show disabled users )'; +% $cgi->param('showdisabled', 0); +%} +% +%my $count_query = 'SELECT COUNT(*) FROM access_user'; +%$count_query .= " WHERE $search" +% if $search; +% +%my $link = [ $p.'edit/access_user.html?', 'usernum' ]; +% +%my @header = ( '#', 'Username' ); +%my @fields = ( 'usernum', 'username' ); +%my $align = 'rl'; +%my @links = ( $link, $link ); +%my @style = ( '', '' ); +% +%#false laziness w/part_pkg.cgi +%#unless ( $cgi->param('showdisabled') ) { #its been reversed already +%if ( $cgi->param('showdisabled') ) { #its been reversed already +% push @header, 'Status'; +% push @fields, sub { shift->disabled +% ? 'DISABLED' +% : 'Active' +% }; +% push @links, ''; +% $align .= 'c'; +% push @style, 'b'; +%} +% +%push @header, 'Full name', 'Groups'; +%push @fields, 'name', $groups_sub; +%push @links, $link, ''; +%$align .= 'll'; +% +% +<% include( 'elements/browse.html', 'title' => 'Internal Users', 'menubar' => [ #'Main menu' => $p, 'Internal access groups' => $p.'browse/access_group.html', diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi index d453adf8e..87f46c0e7 100644 --- a/httemplate/browse/addr_block.cgi +++ b/httemplate/browse/addr_block.cgi @@ -1,66 +1,73 @@ -<%= include("/elements/header.html",'Address Blocks', menubar('Main Menu' => $p)) %> -<% +<% include("/elements/header.html",'Address Blocks', menubar('Main Menu' => $p)) %> +% +% +%use NetAddr::IP; +% +%my @addr_block = qsearch('addr_block', {}); +%my @router = qsearch('router', {}); +%my $block; +%my $p2 = popurl(2); +%my $path = $p2 . "edit/process/addr_block"; +% +% +% if ($cgi->param('error')) { -use NetAddr::IP; - -my @addr_block = qsearch('addr_block', {}); -my @router = qsearch('router', {}); -my $block; -my $p2 = popurl(2); -my $path = $p2 . "edit/process/addr_block"; - -%> - -<% if ($cgi->param('error')) { %> - Error: <%=$cgi->param('error')%> + Error: <%$cgi->param('error')%>

-<% } %> +% } -<%=table()%> -<% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) { %> +<%table()%> +% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) { + - <%=$block->NetAddr%> - <% if (my $router = $block->router) { %> - <% if (scalar($block->svc_broadband) == 0) { %> + <%$block->NetAddr%> +% if (my $router = $block->router) { +% if (scalar($block->svc_broadband) == 0) { + - <%=$router->routername%> + <%$router->routername%> -
- + +
- <% } else { %> +% } else { + - <%=$router->routername%> + <%$router->routername%> - <% } %> - <% } else { %> +% } +% } else { + -
- + +
-
- + +
-<% } - } %> +% } +% } +
-
+ Gateway/Netmask / diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi index f5157d9b7..001e6ba50 100755 --- a/httemplate/browse/agent.cgi +++ b/httemplate/browse/agent.cgi @@ -1,283 +1,371 @@ -<% - - my %search; - if ( $cgi->param('showdisabled') - || !dbdef->table('agent')->column('disabled') ) { - %search = (); - } else { - %search = ( 'disabled' => '' ); - } - - my $conf = new FS::Conf; - -%> -<%= include("/elements/header.html",'Agent Listing', menubar( +% +% +% my %search; +% if ( $cgi->param('showdisabled') +% || !dbdef->table('agent')->column('disabled') ) { +% %search = (); +% } else { +% %search = ( 'disabled' => '' ); +% } +% +% my $conf = new FS::Conf; +% +% + +<% include("/elements/header.html",'Agent Listing', menubar( 'Main Menu' => $p, 'Agent Types' => $p. 'browse/agent_type.cgi', # 'Add new agent' => '../edit/agent.cgi' )) %> Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type).

-Add a new agent

+Add a new agent

+% if ( dbdef->table('agent')->column('disabled') ) { -<% if ( dbdef->table('agent')->column('disabled') ) { %> - <%= $cgi->param('showdisabled') + <% $cgi->param('showdisabled') ? do { $cgi->param('showdisabled', 0); '( hide disabled agents )'; } : do { $cgi->param('showdisabled', 1); '( show disabled agents )'; } %> -<% } %> +% } -<%= include('/elements/table-grid.html') %> -<% my $bgcolor1 = '#eeeeee'; - my $bgcolor2 = '#ffffff'; - my $bgcolor = ''; -%> +<% include('/elements/table-grid.html') %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; +% + - param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent + param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent Type Customers Customer
packages
Reports Registration codes Prepaid cards - <% if ( $conf->config('ticket_system') ) { %> +% if ( $conf->config('ticket_system') ) { + Ticketing - <% } %> +% } + Payment Gateway Overrides Freq. Prog. -<% -# Agent # -# Agent +% +%# Agent # +%# Agent +% +%foreach my $agent ( sort { +% #$a->getfield('agentnum') <=> $b->getfield('agentnum') +% $a->getfield('agent') cmp $b->getfield('agent') +%} qsearch('agent', \%search ) ) { +% +% my $cust_main_link = $p. 'search/cust_main.cgi?agentnum_on=1&'. +% 'agentnum='. $agent->agentnum; +% +% my $cust_pkg_link = $p. 'search/cust_pkg.cgi?agentnum='. $agent->agentnum; +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% +% + -foreach my $agent ( sort { - #$a->getfield('agentnum') <=> $b->getfield('agentnum') - $a->getfield('agent') cmp $b->getfield('agent') -} qsearch('agent', \%search ) ) { + + + <% $agent->agentnum %> +% if ( dbdef->table('agent')->column('disabled') +% && !$cgi->param('showdisabled') ) { - my $cust_main_link = $p. 'search/cust_main.cgi?agentnum_on=1&'. - 'agentnum='. $agent->agentnum; + <% $agent->disabled ? 'DISABLED' : '' %> +% } - my $cust_pkg_link = $p. 'search/cust_pkg.cgi?agentnum='. $agent->agentnum; - - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } -%> + + <% $agent->agent %> + <% $agent->agent_type->atype %> - - - <%= $agent->agentnum %> -<% if ( dbdef->table('agent')->column('disabled') - && !$cgi->param('showdisabled') ) { %> - <%= $agent->disabled ? 'DISABLED' : '' %> -<% } %> - - - <%= $agent->agent %> - <%= $agent->agent_type->atype %> - - +
- <%= my $num_prospect = $agent->num_prospect_cust_main %>  + <% my $num_prospect = $agent->num_prospect_cust_main %>  - <% if ( $num_prospect ) { %> - <% } %>prospects<% if ($num_prospect ) { %><% } %> +% if ( $num_prospect ) { + + +% } +prospects +% if ($num_prospect ) { + +% } +
- <%= my $num_inactive = $agent->num_inactive_cust_main %>  + <% my $num_inactive = $agent->num_inactive_cust_main %>  - <% if ( $num_inactive ) { %> - <% } %>inactive<% if ( $num_inactive ) { %><% } %> +% if ( $num_inactive ) { + + +% } +inactive +% if ( $num_inactive ) { + +% } +
- <%= my $num_active = $agent->num_active_cust_main %>  + <% my $num_active = $agent->num_active_cust_main %>  - <% if ( $num_active ) { %> - <% } %>active<% if ( $num_active ) { %><% } %> +% if ( $num_active ) { + + +% } +active +% if ( $num_active ) { + +% } +
- <%= my $num_susp = $agent->num_susp_cust_main %>  + <% my $num_susp = $agent->num_susp_cust_main %>  - <% if ( $num_susp ) { %> - <% } %>suspended<% if ( $num_susp ) { %><% } %> +% if ( $num_susp ) { + + +% } +suspended +% if ( $num_susp ) { + +% } +
- <%= my $num_cancel = $agent->num_cancel_cust_main %>  + <% my $num_cancel = $agent->num_cancel_cust_main %>  - <% if ( $num_cancel ) { %> - <% } %>cancelled<% if ( $num_cancel ) { %><% } %> +% if ( $num_cancel ) { + + +% } +cancelled +% if ( $num_cancel ) { + +% } +
- +
- <%= my $num_inactive_pkg = $agent->num_inactive_cust_pkg %>  + <% my $num_inactive_pkg = $agent->num_inactive_cust_pkg %>  - <% if ( $num_inactive_pkg ) { %> - <% } %>inactive<% if ( $num_inactive_pkg ) { %><% } %> +% if ( $num_inactive_pkg ) { + + +% } +inactive +% if ( $num_inactive_pkg ) { + +% } +
- <%= my $num_active_pkg = $agent->num_active_cust_pkg %>  + <% my $num_active_pkg = $agent->num_active_cust_pkg %>  - <% if ( $num_active_pkg ) { %> - <% } %>active<% if ( $num_active_pkg ) { %><% } %> +% if ( $num_active_pkg ) { + + +% } +active +% if ( $num_active_pkg ) { + +% } +
- <%= my $num_susp_pkg = $agent->num_susp_cust_pkg %>  + <% my $num_susp_pkg = $agent->num_susp_cust_pkg %>  - <% if ( $num_susp_pkg ) { %> - <% } %>suspended<% if ( $num_susp_pkg ) { %><% } %> +% if ( $num_susp_pkg ) { + + +% } +suspended +% if ( $num_susp_pkg ) { + +% } +
- <%= my $num_cancel_pkg = $agent->num_cancel_cust_pkg %>  + <% my $num_cancel_pkg = $agent->num_cancel_cust_pkg %>  - <% if ( $num_cancel_pkg ) { %> - <% } %>cancelled<% if ( $num_cancel_pkg ) { %><% } %> +% if ( $num_cancel_pkg ) { + + +% } +cancelled +% if ( $num_cancel_pkg ) { + +% } +
- - Payments -
Credits -
A/R Aging - + + Payments +
Credits +
A/R Aging + - - <%= my $num_reg_code = $agent->num_reg_code %> - <% if ( $num_reg_code ) { %> - <% } %>Unused<% if ( $num_reg_code ) { %><% } %> -
Generate codes + + <% my $num_reg_code = $agent->num_reg_code %> +% if ( $num_reg_code ) { + + +% } +Unused +% if ( $num_reg_code ) { + +% } + +
Generate codes - - <%= my $num_prepay_credit = $agent->num_prepay_credit %> - <% if ( $num_prepay_credit ) { %> - <% } %>Unused<% if ( $num_prepay_credit ) { %><% } %> -
Generate cards + + <% my $num_prepay_credit = $agent->num_prepay_credit %> +% if ( $num_prepay_credit ) { + + +% } +Unused +% if ( $num_prepay_credit ) { + +% } + +
Generate cards +% if ( $conf->config('ticket_system') ) { - <% if ( $conf->config('ticket_system') ) { %> - - <% if ( $agent->ticketing_queueid ) { %> - Queue: <%= $agent->ticketing_queueid %>: <%= $agent->ticketing_queue %>
- <% } %> + +% if ( $agent->ticketing_queueid ) { + + Queue: <% $agent->ticketing_queueid %>: <% $agent->ticketing_queue %>
+% } + +% } - <% } %> - + - <% foreach my $override ( - # sort { } want taxclass-full stuff first? and default cards (empty cardtype) - qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } ) - ) { - %> +% foreach my $override ( +% # sort { } want taxclass-full stuff first? and default cards (empty cardtype) +% qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } ) +% ) { +% + - <% } %> +% } + - +
- <%= $override->cardtype || 'Default' %> to <%= $override->payment_gateway->gateway_module %> (<%= $override->payment_gateway->gateway_username %>) - <%= $override->taxclass + <% $override->cardtype || 'Default' %> to <% $override->payment_gateway->gateway_module %> (<% $override->payment_gateway->gateway_username %>) + <% $override->taxclass ? ' for '. $override->taxclass. ' only' : '' %> - (delete) + (delete)
(add override)(add override)
+% } -<% } %> diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi index ceffce3d4..318d0b6ea 100755 --- a/httemplate/browse/agent_type.cgi +++ b/httemplate/browse/agent_type.cgi @@ -1,37 +1,38 @@ -<% - -my $html_init = - 'Agent types define groups of packages that you can then assign to'. - ' particular agents.

'. - qq!Add a new agent type

!; - -my $count_query = 'SELECT COUNT(*) FROM agent_type'; - -#false laziness w/access_user.html -my $packages_sub = sub { - my $agent_type = shift; - - [ map { - my $type_pkgs = $_; - #my $part_pkg = $type_pkgs->part_pkg; - [ - { - #'data' => $part_pkg->pkg. ' - '. $part_pkg->comment, - 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment, - 'align' => 'left', - 'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart, - }, - ]; - } - - $agent_type->type_pkgs_enabled - ]; - -}; - -my $link = [ $p.'edit/agent_type.cgi?', 'typenum' ]; - -%><%= include( 'elements/browse.html', +% +% +%my $html_init = +% 'Agent types define groups of packages that you can then assign to'. +% ' particular agents.

'. +% qq!Add a new agent type

!; +% +%my $count_query = 'SELECT COUNT(*) FROM agent_type'; +% +%#false laziness w/access_user.html +%my $packages_sub = sub { +% my $agent_type = shift; +% +% [ map { +% my $type_pkgs = $_; +% #my $part_pkg = $type_pkgs->part_pkg; +% [ +% { +% #'data' => $part_pkg->pkg. ' - '. $part_pkg->comment, +% 'data' => $type_pkgs->pkg. ' - '. $type_pkgs->comment, +% 'align' => 'left', +% 'link' => $p. 'edit/part_pkg.cgi?'. $type_pkgs->pkgpart, +% }, +% ]; +% } +% +% $agent_type->type_pkgs_enabled +% ]; +% +%}; +% +%my $link = [ $p.'edit/agent_type.cgi?', 'typenum' ]; +% +% +<% include( 'elements/browse.html', 'title' => 'Agent Types', 'menubar' => [ #'Main menu' => $p, 'Agents' =>"${p}browse/agent.cgi", diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 9e3feb8f3..69a7eb9a0 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,22 +1,22 @@ -<%= include('/elements/header.html', "Tax Rate Listing", menubar( +<% include('/elements/header.html', "Tax Rate Listing", menubar( 'Edit tax rates' => $p. "edit/cust_main_county.cgi", )) %> Click on expand country to specify a country's tax rates by state.
Click on expand state to specify a state's tax rates by county. +% +%my $conf = new FS::Conf; +%my $enable_taxclasses = $conf->exists('enable_taxclasses'); +% +%if ( $enable_taxclasses ) { -<% -my $conf = new FS::Conf; -my $enable_taxclasses = $conf->exists('enable_taxclasses'); - -if ( $enable_taxclasses ) { %>
Click on expand taxclasses to specify tax classes +% } -<% } %>

-<%= table() %> +<% table() %> Country @@ -27,123 +27,140 @@ if ( $enable_taxclasses ) { %> Tax Exemption +% +%my @regions = sort { $a->country cmp $b->country +% or $a->state cmp $b->state +% or $a->county cmp $b->county +% or $a->taxclass cmp $b->taxclass +% } qsearch('cust_main_county',{}); +% +%my $sup=0; +%#foreach $cust_main_county ( @regions ) { +%for ( my $i=0; $i<@regions; $i++ ) { +% my $cust_main_county = $regions[$i]; +% my $hashref = $cust_main_county->hashref; +% +% -<% -my @regions = sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county - or $a->taxclass cmp $b->taxclass - } qsearch('cust_main_county',{}); - -my $sup=0; -#foreach $cust_main_county ( @regions ) { -for ( my $i=0; $i<@regions; $i++ ) { - my $cust_main_county = $regions[$i]; - my $hashref = $cust_main_county->hashref; - - %> - <%= $hashref->{country} %> - - <% - - my $j; - if ( $sup ) { - $sup--; - } else { - - #lookahead - for ( $j=1; $i+$j<@regions; $j++ ) { - last if $hashref->{country} ne $regions[$i+$j]->country - || $hashref->{state} ne $regions[$i+$j]->state - || $hashref->{tax} != $regions[$i+$j]->tax - || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount - || $hashref->{setuptax} ne $regions[$i+$j]->setuptax - || $hashref->{recurtax} ne $regions[$i+$j]->recurtax; - } - - my $newsup=0; - if ( $j>1 && $i+$j+1 < @regions - && ( $hashref->{state} ne $regions[$i+$j+1]->state - || $hashref->{country} ne $regions[$i+$j+1]->country - ) - && ( ! $i - || $hashref->{state} ne $regions[$i-1]->state - || $hashref->{country} ne $regions[$i-1]->country - ) - ) { - $sup = $j-1; - } else { - $j = 1; - } - - %> - - <%= + <% $hashref->{country} %> +% +% +% my $j; +% if ( $sup ) { +% $sup--; +% } else { +% +% #lookahead +% for ( $j=1; $i+$j<@regions; $j++ ) { +% last if $hashref->{country} ne $regions[$i+$j]->country +% || $hashref->{state} ne $regions[$i+$j]->state +% || $hashref->{tax} != $regions[$i+$j]->tax +% || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount +% || $hashref->{setuptax} ne $regions[$i+$j]->setuptax +% || $hashref->{recurtax} ne $regions[$i+$j]->recurtax; +% } +% +% my $newsup=0; +% if ( $j>1 && $i+$j+1 < @regions +% && ( $hashref->{state} ne $regions[$i+$j+1]->state +% || $hashref->{country} ne $regions[$i+$j+1]->country +% ) +% && ( ! $i +% || $hashref->{state} ne $regions[$i-1]->state +% || $hashref->{country} ne $regions[$i-1]->country +% ) +% ) { +% $sup = $j-1; +% } else { +% $j = 1; +% } +% +% + + + <% $hashref->{state} ? ' BGCOLOR="#ffffff">'. $hashref->{state} : qq! BGCOLOR="#cccccc">(ALL) !. qq!expand country! %> - <% if ( $j>1 ) { %> - collapse state - <% } %> +% if ( $j>1 ) { + + collapse state +% } + - <% } %> - -<% # $sup=$newsup; %> - - {county} ) { - %> BGCOLOR="#ffffff"><%= $hashref->{county} %> - <% } else { - %> BGCOLOR="#cccccc">(ALL) - <% if ( $hashref->{state} ) { %> - expand state - <% } %> - <% } %> +% } +% # $sup=$newsup; + + + {county} ) { +% + BGCOLOR="#ffffff"><% $hashref->{county} %> +% } else { +% + BGCOLOR="#cccccc">(ALL) +% if ( $hashref->{state} ) { + + expand state +% } +% } + - {taxclass} ) { - %> BGCOLOR="#ffffff"><%= $hashref->{taxclass} %> - <% } else { - %> BGCOLOR="#cccccc">(ALL) - <% if ( $enable_taxclasses ) { %> - expand taxclasses - <% } %> - <% } %> + {taxclass} ) { +% + BGCOLOR="#ffffff"><% $hashref->{taxclass} %> +% } else { +% + BGCOLOR="#cccccc">(ALL) +% if ( $enable_taxclasses ) { + + expand taxclasses +% } +% } + - {taxname} ) { - %> BGCOLOR="#ffffff"><%= $hashref->{taxname} %> - <% } else { - %> BGCOLOR="#cccccc">Tax - <% } %> + {taxname} ) { +% + BGCOLOR="#ffffff"><% $hashref->{taxname} %> +% } else { +% + BGCOLOR="#cccccc">Tax +% } + - <%= $hashref->{tax} %>% + <% $hashref->{tax} %>% +% if ( $hashref->{exempt_amount} > 0 ) { - <% if ( $hashref->{exempt_amount} > 0 ) { %> - $<%= sprintf("%.2f", $hashref->{exempt_amount} ) %> per month
- <% } %> + $<% sprintf("%.2f", $hashref->{exempt_amount} ) %> per month
+% } +% if ( $hashref->{setuptax} =~ /^Y$/i ) { - <% if ( $hashref->{setuptax} =~ /^Y$/i ) { %> Setup fee
- <% } %> - - <% if ( $hashref->{recurtax} =~ /^Y$/i ) { %> +% } +% if ( $hashref->{recurtax} =~ /^Y$/i ) { + Recurring fee
- <% } %> +% } + +% } -<% } %> -<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 98ea2f5a2..e40e95870 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,27 +1,27 @@ -<%= include("/elements/header.html","Credit card batch details", menubar( 'Main Menu' => $p,)) %> +<% include("/elements/header.html","Credit card batch details", menubar( 'Main Menu' => $p,)) %> +% +% +%die "No batch specified (bad URL)!" unless $cgi->keywords; +%my($query) = $cgi->keywords; +%$query =~ /^(\d+)$/; +%my $batchnum = $1; +%my $pay_batch = qsearchs('pay_batch',{'batchnum'=>$batchnum}); +%die "Batch not found!" unless $pay_batch; +% +% -<% -die "No batch specified (bad URL)!" unless $cgi->keywords; -my($query) = $cgi->keywords; -$query =~ /^(\d+)$/; -my $batchnum = $1; -my $pay_batch = qsearchs('pay_batch',{'batchnum'=>$batchnum}); -die "Batch not found!" unless $pay_batch; - -%> - - + Download batch in format +

-
+ Upload results
Filename
Format

+% +% my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=". +% $batchnum; +% my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement"; +% $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; +% my $total = $sth->fetchrow_arrayref->[0]; +% +% my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=". +% $batchnum; +% my $c_sth = dbh->prepare($c_statement) +% or die dbh->errstr. "doing $c_statement"; +% $c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr; +% my $cards = $c_sth->fetchrow_arrayref->[0]; +% -<% - my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=". - $batchnum; - my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement"; - $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; - my $total = $sth->fetchrow_arrayref->[0]; - - my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=". - $batchnum; - my $c_sth = dbh->prepare($c_statement) - or die dbh->errstr. "doing $c_statement"; - $c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr; - my $cards = $c_sth->fetchrow_arrayref->[0]; -%> -<%= $cards %> credit card payments batched
-$<%= sprintf("%.2f", $total) %> total in batch
+<% $cards %> credit card payments batched
+$<% sprintf("%.2f", $total) %> total in batch

-<%= &table() %> +<% &table() %> # inv# @@ -62,35 +62,35 @@ $<%= sprintf("%.2f", $total) %> total in batch
Amount Status +% +%foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } +% qsearch('cust_pay_batch', {'batchnum'=>$batchnum} ) +%) { +% my $cardnum = $cust_pay_batch->payinfo; +% #$cardnum =~ s/.{4}$/xxxx/; +% $cardnum = 'x'x(length($cardnum)-4). substr($cardnum,(length($cardnum)-4)); +% +% $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; +% my( $mon, $year ) = ( $2, $1 ); +% $mon = "0$mon" if $mon < 10; +% my $exp = "$mon/$year"; +% +% -<% -foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } - qsearch('cust_pay_batch', {'batchnum'=>$batchnum} ) -) { - my $cardnum = $cust_pay_batch->payinfo; - #$cardnum =~ s/.{4}$/xxxx/; - $cardnum = 'x'x(length($cardnum)-4). substr($cardnum,(length($cardnum)-4)); - - $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; - my( $mon, $year ) = ( $2, $1 ); - $mon = "0$mon" if $mon < 10; - my $exp = "$mon/$year"; - -%> - <%= $cust_pay_batch->paybatchnum %> - <%= $cust_pay_batch->invnum %> - <%= $cust_pay_batch->custnum %> - <%= $cust_pay_batch->get('last'). ', '. $cust_pay_batch->first %> - <%= $cust_pay_batch->payname %> - <%= $cardnum %> - <%= $exp %> - $<%= $cust_pay_batch->amount %> - <%= $cust_pay_batch->status %> + <% $cust_pay_batch->paybatchnum %> + <% $cust_pay_batch->invnum %> + <% $cust_pay_batch->custnum %> + <% $cust_pay_batch->get('last'). ', '. $cust_pay_batch->first %> + <% $cust_pay_batch->payname %> + <% $cardnum %> + <% $exp %> + $<% $cust_pay_batch->amount %> + <% $cust_pay_batch->status %> +% } -<% } %> diff --git a/httemplate/browse/elements/browse.html b/httemplate/browse/elements/browse.html index 6d146d356..2cc5a9660 100644 --- a/httemplate/browse/elements/browse.html +++ b/httemplate/browse/elements/browse.html @@ -1,4 +1,4 @@ -<%= include( '/search/elements/search.html', +<% include( '/search/elements/search.html', @_, 'disable_download' => 1, 'disable_nonefound' => 1, diff --git a/httemplate/browse/inventory_class.html b/httemplate/browse/inventory_class.html index 4a15bf7d4..6d9424e14 100644 --- a/httemplate/browse/inventory_class.html +++ b/httemplate/browse/inventory_class.html @@ -1,27 +1,28 @@ -<% - -tie my %labels, 'Tie::IxHash', - 'num_avail' => 'Available', # (upload batch)', - 'num_used' => 'In use', #'Used', #'Allocated', - 'num_total' => 'Total', -; - -my %link = ( - 'num_avail' => ';avail=1', - 'num_used' => ';used=1', - 'num_total' => '', -); - -my %inv_action_link = ( - 'num_avail' => [ 'upload batch', - $p.'misc/inventory_item-import.html?classnum=', - 'classnum' - ], -); - -my $link = [ "${p}edit/inventory_class.html?", 'classnum' ]; - -%><%= include( 'elements/browse.html', +% +% +%tie my %labels, 'Tie::IxHash', +% 'num_avail' => 'Available', # (upload batch)', +% 'num_used' => 'In use', #'Used', #'Allocated', +% 'num_total' => 'Total', +%; +% +%my %link = ( +% 'num_avail' => ';avail=1', +% 'num_used' => ';used=1', +% 'num_total' => '', +%); +% +%my %inv_action_link = ( +% 'num_avail' => [ 'upload batch', +% $p.'misc/inventory_item-import.html?classnum=', +% 'classnum' +% ], +%); +% +%my $link = [ "${p}edit/inventory_class.html?", 'classnum' ]; +% +% +<% include( 'elements/browse.html', 'title' => 'Inventory Classes', 'name' => 'inventory classes', 'menubar' => [ 'Add a new inventory class' => diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi index 318ebfdff..35ea06957 100755 --- a/httemplate/browse/msgcat.cgi +++ b/httemplate/browse/msgcat.cgi @@ -1,40 +1,42 @@ -<%= include('/elements/header.html', "View Message catalog", menubar( +<% include('/elements/header.html', "View Message catalog", menubar( 'Edit message catalog' => $p. "edit/msgcat.cgi", -)) %><% +)) %> +% +% +%my $widget = new HTML::Widgets::SelectLayers( +% 'selected_layer' => 'en_US', +% 'options' => { 'en_US'=>'en_US' }, +% 'layer_callback' => sub { +% my $layer = shift; +% my $html = "
Messages for locale $layer
". table(). +% "Code". +% "Message"; +% $html .= "en_US Message" unless $layer eq 'en_US'; +% $html .= ''; +% +% #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } +% # qsearch('msgcat', { 'locale' => $layer } ) ) { +% foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { +% $html .= ''. $msgcat->msgnum. ''. +% ''. $msgcat->msgcode. ''. +% ''. $msgcat->msg. ''; +% unless ( $layer eq 'en_US' ) { +% my $en_msgcat = qsearchs('msgcat', { +% 'locale' => 'en_US', +% 'msgcode' => $msgcat->msgcode, +% } ); +% $html .= ''. $en_msgcat->msg. ''; +% } +% $html .= ''; +% } +% +% $html .= ''; +% $html; +% }, +% +%); +% -my $widget = new HTML::Widgets::SelectLayers( - 'selected_layer' => 'en_US', - 'options' => { 'en_US'=>'en_US' }, - 'layer_callback' => sub { - my $layer = shift; - my $html = "
Messages for locale $layer
". table(). - "Code". - "Message"; - $html .= "en_US Message" unless $layer eq 'en_US'; - $html .= ''; - #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } - # qsearch('msgcat', { 'locale' => $layer } ) ) { - foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { - $html .= ''. $msgcat->msgnum. ''. - ''. $msgcat->msgcode. ''. - ''. $msgcat->msg. ''; - unless ( $layer eq 'en_US' ) { - my $en_msgcat = qsearchs('msgcat', { - 'locale' => 'en_US', - 'msgcode' => $msgcat->msgcode, - } ); - $html .= ''. $en_msgcat->msg. ''; - } - $html .= ''; - } - - $html .= ''; - $html; - }, - -); -%> - -<%= $widget->html %> -<%= include('/elements/footer.html') %> +<% $widget->html %> +<% include('/elements/footer.html') %> diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi index 9ccbfe632..022c65ea7 100755 --- a/httemplate/browse/nas.cgi +++ b/httemplate/browse/nas.cgi @@ -1,80 +1,81 @@ -<% +% +% +%print header('NAS ports', menubar( +% 'Main Menu' => $p, +%)); +% +%my $now = time; +% +%foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) { +% print $nas->nasnum. ": ". $nas->nas. " ". +% $nas->nasfqdn. " (". $nas->nasip. ") ". +% "as of ". time2str("%c",$nas->last). +% " (". &pretty_interval($now - $nas->last). " ago)
". +% &table(). "Nas
Port #Global
Port #
". +% "IP addressUserSinceDuration", +% ; +% foreach my $port ( sort { +% $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum +% } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) { +% my $session = $port->session; +% my($user, $since, $pretty_since, $duration); +% if ( ! $session ) { +% $user = "(empty)"; +% $since = 0; +% $pretty_since = "(never)"; +% $duration = ''; +% } elsif ( $session->logout ) { +% $user = "(empty)"; +% $since = $session->logout; +% } else { +% my $svc_acct = $session->svc_acct; +% $user = "svcnum. "\">". +% $svc_acct->username. ""; +% $since = $session->login; +% } +% $pretty_since = time2str("%c", $since) if $since; +% $duration = pretty_interval( $now - $since ). " ago" +% unless defined($duration); +% print "". $port->nasport. "". $port->portnum. "". +% $port->ip. "$user$pretty_since". +% "$duration" +% ; +% } +% print "
"; +%} +% +%#Time::Duration?? +%sub pretty_interval { +% my $interval = shift; +% my %howlong = ( +% '604800' => 'week', +% '86400' => 'day', +% '3600' => 'hour', +% '60' => 'minute', +% '1' => 'second', +% ); +% +% my $pretty = ""; +% foreach my $key ( sort { $b <=> $a } keys %howlong ) { +% my $value = int( $interval / $key ); +% if ( $value ) { +% if ( $value == 1 ) { +% $pretty .= +% ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " " +% } else { +% $pretty .= $value. ' '. $howlong{$key}. 's '; +% } +% } +% $interval -= $value * $key; +% } +% $pretty =~ /^\s*(\S.*\S)\s*$/; +% $1; +%} +% +%#print &table(), < +%# # +%# NAS $p, -)); - -my $now = time; - -foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) { - print $nas->nasnum. ": ". $nas->nas. " ". - $nas->nasfqdn. " (". $nas->nasip. ") ". - "as of ". time2str("%c",$nas->last). - " (". &pretty_interval($now - $nas->last). " ago)
". - &table(). "Nas
Port #Global
Port #
". - "IP addressUserSinceDuration", - ; - foreach my $port ( sort { - $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum - } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) { - my $session = $port->session; - my($user, $since, $pretty_since, $duration); - if ( ! $session ) { - $user = "(empty)"; - $since = 0; - $pretty_since = "(never)"; - $duration = ''; - } elsif ( $session->logout ) { - $user = "(empty)"; - $since = $session->logout; - } else { - my $svc_acct = $session->svc_acct; - $user = "svcnum. "\">". - $svc_acct->username. ""; - $since = $session->login; - } - $pretty_since = time2str("%c", $since) if $since; - $duration = pretty_interval( $now - $since ). " ago" - unless defined($duration); - print "". $port->nasport. "". $port->portnum. "". - $port->ip. "$user$pretty_since". - "$duration" - ; - } - print "
"; -} - -#Time::Duration?? -sub pretty_interval { - my $interval = shift; - my %howlong = ( - '604800' => 'week', - '86400' => 'day', - '3600' => 'hour', - '60' => 'minute', - '1' => 'second', - ); - - my $pretty = ""; - foreach my $key ( sort { $b <=> $a } keys %howlong ) { - my $value = int( $interval / $key ); - if ( $value ) { - if ( $value == 1 ) { - $pretty .= - ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " " - } else { - $pretty .= $value. ' '. $howlong{$key}. 's '; - } - } - $interval -= $value * $key; - } - $pretty =~ /^\s*(\S.*\S)\s*$/; - $1; -} - -#print &table(), < -# # -# NAS diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi index 91e31d832..2486c6669 100755 --- a/httemplate/browse/part_bill_event.cgi +++ b/httemplate/browse/part_bill_event.cgi @@ -1,118 +1,116 @@ -<% -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} +% +%my %search; +%if ( $cgi->param('showdisabled') ) { +% %search = (); +%} else { +% %search = ( 'disabled' => '' ); +%} +% +%my @part_bill_event = qsearch('part_bill_event', \%search ); +%my $total = scalar(@part_bill_event); +% -my @part_bill_event = qsearch('part_bill_event', \%search ); -my $total = scalar(@part_bill_event); -%> -<%= include("/elements/header.html",'Invoice Event Listing', menubar( 'Main Menu' => $p) ) %> +<% include("/elements/header.html",'Invoice Event Listing', menubar( 'Main Menu' => $p) ) %> Invoice events are actions taken on open invoices.

-Add a new invoice event +Add a new invoice event

-<%= $total %> events -<%= $cgi->param('showdisabled') +<% $total %> events +<% $cgi->param('showdisabled') ? do { $cgi->param('showdisabled', 0); '( hide disabled events )'; } : do { $cgi->param('showdisabled', 1); '( show disabled events )'; } %>

+% tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname; +% tie my %freq, 'Tie::IxHash', '1d' => 'daily', '1m' => 'monthly'; +% foreach my $payby ( keys %payby ) { +% my $oldfreq = ''; +% +% my @payby_part_bill_event = +% grep { $payby eq $_->payby } +% sort { ( $a->freq || '1d') cmp ( $b->freq || '1d' ) # for now +% || $a->seconds <=> $b->seconds +% || $a->weight <=> $b->weight +% || $a->eventpart <=> $b->eventpart +% } +% @part_bill_event; +% +% +% if ( @payby_part_bill_event ) { -<% tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname; - tie my %freq, 'Tie::IxHash', '1d' => 'daily', '1m' => 'monthly'; - foreach my $payby ( keys %payby ) { - my $oldfreq = ''; - - my @payby_part_bill_event = - grep { $payby eq $_->payby } - sort { ( $a->freq || '1d') cmp ( $b->freq || '1d' ) # for now - || $a->seconds <=> $b->seconds - || $a->weight <=> $b->weight - || $a->eventpart <=> $b->eventpart - } - @part_bill_event; - -%> - <% if ( @payby_part_bill_event ) { %> + <% include('/elements/table-grid.html') %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor; +% +% +% foreach my $part_bill_event ( @payby_part_bill_event ) { +% my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart; +% my $delay = duration_exact($part_bill_event->seconds); +% ( my $plandata = $part_bill_event->plandata ) =~ s/\n/
/go; +% my $freq = $part_bill_event->freq || '1d'; +% +% if ( $oldfreq ne $freq ) { - <%= include('/elements/table-grid.html') %> - - <% my $bgcolor1 = '#eeeeee'; - my $bgcolor2 = '#ffffff'; - my $bgcolor; - %> - - <% - foreach my $part_bill_event ( @payby_part_bill_event ) { - my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart; - my $delay = duration_exact($part_bill_event->seconds); - ( my $plandata = $part_bill_event->plandata ) =~ s/\n/
/go; - my $freq = $part_bill_event->freq || '1d'; - %> - - <% if ( $oldfreq ne $freq ) { %> - param('showdisabled') ? 7 : 8 %>><%= ucfirst($freq{$freq}) %> event tests for <%= $payby{$payby} %> customers + param('showdisabled') ? 7 : 8 %>><% ucfirst($freq{$freq}) %> event tests for <% $payby{$payby} %> customers - param('showdisabled') ? 2 : 3 %>>Event + param('showdisabled') ? 2 : 3 %>>Event After Action Options Code - - <% - $oldfreq = $freq; - $bgcolor = ''; - %> - - <% } %> - - <% - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } - %> +% +% $oldfreq = $freq; +% $bgcolor = ''; +% +% } +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% + - - <%= $part_bill_event->eventpart %> - <% unless ( $cgi->param('showdisabled') ) { %> - - <%= $part_bill_event->disabled ? 'DISABLED' : '' %> - <% } %> - - <%= $part_bill_event->event %> - - <%= $delay %> - - <%= $part_bill_event->plan %> - - <%= $plandata %> - - <%= $part_bill_event->eventcode %> + + <% $part_bill_event->eventpart %> +% unless ( $cgi->param('showdisabled') ) { + + + <% $part_bill_event->disabled ? 'DISABLED' : '' %> +% } + + + <% $part_bill_event->event %> + + <% $delay %> + + <% $part_bill_event->plan %> + + <% $plandata %> + + <% $part_bill_event->eventcode %> - <% } %> +% } +

+% } +% } - <% } %> - -<% } %> diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi index 25a49cd20..0f6731739 100755 --- a/httemplate/browse/part_export.cgi +++ b/httemplate/browse/part_export.cgi @@ -1,7 +1,7 @@ -<%= include("/elements/header.html","Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %> +<% include("/elements/header.html","Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %> Provisioning services to external machines, databases and APIs.

-Add a new export

+Add a new export

-<%= table() %> +<% table() %> Export Options +% foreach my $part_export ( sort { +% $a->getfield('exportnum') <=> $b->getfield('exportnum') +% } qsearch('part_export',{}) ) { +% -<% foreach my $part_export ( sort { - $a->getfield('exportnum') <=> $b->getfield('exportnum') - } qsearch('part_export',{}) ) { -%> - <%= $part_export->exportnum %> - <%= $part_export->exporttype %> to <%= $part_export->machine %> (edit | delete) + <% $part_export->exportnum %> + <% $part_export->exporttype %> to <% $part_export->machine %> (edit | delete) - <%= itable() %> - <% my %opt = $part_export->options; - foreach my $opt ( keys %opt ) { %> - <%= $opt %><%= encode_entities($opt{$opt}) %> - <% } %> + <% itable() %> +% my %opt = $part_export->options; +% foreach my $opt ( keys %opt ) { + + <% $opt %><% encode_entities($opt{$opt}) %> +% } + +% } -<% } %> diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi index a5e212d17..f2364b152 100755 --- a/httemplate/browse/part_pkg.cgi +++ b/httemplate/browse/part_pkg.cgi @@ -1,227 +1,228 @@ -<% - -#false laziness w/access_user.html -my %search = (); -my $search = ''; -unless ( $cgi->param('showdisabled') ) { - %search = ( 'disabled' => '' ); - $search = "( disabled = '' OR disabled IS NULL )"; -} - -my $select = '*'; -my $orderby = 'pkgpart'; -if ( $cgi->param('active') ) { - - $orderby = 'num_active DESC'; -} - $select = " - - *, - - ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart - AND ( cancel IS NULL OR cancel = 0 ) - AND ( susp IS NULL OR susp = 0 ) - ) AS num_active, - - ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart - AND ( cancel IS NULL OR cancel = 0 ) - AND susp IS NOT NULL AND susp != 0 - ) AS num_suspended, - - ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart - AND cancel IS NOT NULL AND cancel != 0 - ) AS num_cancelled - - "; - -#} - -my $conf = new FS::Conf; -my $taxclasses = $conf->exists('enable_taxclasses'); - -my $html_init; -#unless ( $cgi->param('active') ) { - $html_init = qq! - One or more service definitions are grouped together into a package - definition and given pricing information. Customers purchase packages - rather than purchase services directly.

- Add a new package definition -

- !; -#} - -my $posttotal; -if ( $cgi->param('showdisabled') ) { - $cgi->param('showdisabled', 0); - $posttotal = '( hide disabled packages )'; - $cgi->param('showdisabled', 1); -} else { - $cgi->param('showdisabled', 1); - $posttotal = '( show disabled packages )'; - $cgi->param('showdisabled', 0); -} - - -# ------ - -my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ]; - -my @header = ( '#', 'Package', 'Comment' ); -my @fields = ( 'pkgpart', 'pkg', 'comment' ); -my $align = 'rll'; -my @links = ( $link, $link, '' ); -my @style = ( '', '', '' ); - -#false laziness w/access_user.html -#unless ( $cgi->param('showdisabled') ) { #its been reversed already -if ( $cgi->param('showdisabled') ) { #its been reversed already - push @header, 'Status'; - push @fields, sub { shift->disabled - ? 'DISABLED' - : 'Active' - }; - push @links, ''; - $align .= 'c'; - push @style, 'b'; -} - -unless ( 0 ) { #already showing only one class or something? - push @header, 'Class'; - push @fields, sub { shift->classname || '(none)'; }; - $align .= 'l'; -} - -#if ( $cgi->param('active') ) { - push @header, 'Customer
packages'; - my %col = ( - 'active' => '00CC00', - 'suspended' => 'FF9900', - 'cancelled' => 'FF0000', - ); - my $cust_pkg_link = $p. 'search/cust_pkg.cgi?pkgpart='; - push @fields, sub { my $part_pkg = shift; - [ - map { - [ - { - 'data' => ''. - $part_pkg->get("num_$_"). - '', - 'align' => 'right', - }, - { - 'data' => $_, - 'align' => 'left', - 'link' => ( $part_pkg->get("num_$_") - ? $cust_pkg_link. - $part_pkg->pkgpart. - ";magic=$_" - : '' - ), - }, - ], - } (qw( active suspended cancelled )) - ]; }; - $align .= 'r'; -#} - -push @header, 'Frequency'; -push @fields, sub { shift->freq_pretty; }; -$align .= 'l'; - -if ( $taxclasses ) { - push @header, 'Taxclass'; - push @fields, sub { shift->taxclass() || ' '; }; - $align .= 'l'; -} - -push @header, 'Plan', - 'Data', - 'Services'; - #'Service', 'Quan', 'Primary'; - -push @fields, sub { shift->plan || '(legacy)' }, - - sub { - my $part_pkg = shift; - if ( $part_pkg->plan ) { - - [ map { - /^(\w+)=(.*)$/; #or something; - [ - { 'data' => $1, - 'align' => 'right', - }, - { 'data' => $2, - 'align' => 'left', - }, - ]; - } - split(/\n/, $part_pkg->plandata) - ]; - - } else { - - [ map { [ - { 'data' => uc($_), - 'align' => 'right', - }, - { - 'data' => $part_pkg->$_(), - 'align' => 'left', - }, - ]; - } - (qw(setup recur)) - ]; - - } - - }, - - sub { - my $part_pkg = shift; - - [ map { - my $pkg_svc = $_; - my $part_svc = $pkg_svc->part_svc; - my $svc = $part_svc->svc; - if ( $pkg_svc->primary_svc =~ /^Y/i ) { - $svc = "$svc (PRIMARY)"; - } - $svc =~ s/ +/ /g; - - [ - { - 'data' => ''. $pkg_svc->quantity. '', - 'align' => 'right' - }, - { - 'data' => $svc, - 'align' => 'left', - 'link' => $p. 'edit/part_svc.cgi?'. - $part_svc->svcpart, - }, - ]; - } - sort { $b->primary_svc =~ /^Y/i - <=> $a->primary_svc =~ /^Y/i - } - $part_pkg->pkg_svc - - ]; - - }; - -$align .= 'lrl'; #rr'; - -# -------- - -my $count_query = 'SELECT COUNT(*) FROM part_pkg'; -$count_query .= " WHERE $search" - if $search; - -%><%= include( 'elements/browse.html', +% +% +%#false laziness w/access_user.html +%my %search = (); +%my $search = ''; +%unless ( $cgi->param('showdisabled') ) { +% %search = ( 'disabled' => '' ); +% $search = "( disabled = '' OR disabled IS NULL )"; +%} +% +%my $select = '*'; +%my $orderby = 'pkgpart'; +%if ( $cgi->param('active') ) { +% +% $orderby = 'num_active DESC'; +%} +% $select = " +% +% *, +% +% ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart +% AND ( cancel IS NULL OR cancel = 0 ) +% AND ( susp IS NULL OR susp = 0 ) +% ) AS num_active, +% +% ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart +% AND ( cancel IS NULL OR cancel = 0 ) +% AND susp IS NOT NULL AND susp != 0 +% ) AS num_suspended, +% +% ( SELECT COUNT(*) FROM cust_pkg WHERE cust_pkg.pkgpart = part_pkg.pkgpart +% AND cancel IS NOT NULL AND cancel != 0 +% ) AS num_cancelled +% +% "; +% +%#} +% +%my $conf = new FS::Conf; +%my $taxclasses = $conf->exists('enable_taxclasses'); +% +%my $html_init; +%#unless ( $cgi->param('active') ) { +% $html_init = qq! +% One or more service definitions are grouped together into a package +% definition and given pricing information. Customers purchase packages +% rather than purchase services directly.

+% Add a new package definition +%

+% !; +%#} +% +%my $posttotal; +%if ( $cgi->param('showdisabled') ) { +% $cgi->param('showdisabled', 0); +% $posttotal = '( hide disabled packages )'; +% $cgi->param('showdisabled', 1); +%} else { +% $cgi->param('showdisabled', 1); +% $posttotal = '( show disabled packages )'; +% $cgi->param('showdisabled', 0); +%} +% +% +%# ------ +% +%my $link = [ $p.'edit/part_pkg.cgi?', 'pkgpart' ]; +% +%my @header = ( '#', 'Package', 'Comment' ); +%my @fields = ( 'pkgpart', 'pkg', 'comment' ); +%my $align = 'rll'; +%my @links = ( $link, $link, '' ); +%my @style = ( '', '', '' ); +% +%#false laziness w/access_user.html +%#unless ( $cgi->param('showdisabled') ) { #its been reversed already +%if ( $cgi->param('showdisabled') ) { #its been reversed already +% push @header, 'Status'; +% push @fields, sub { shift->disabled +% ? 'DISABLED' +% : 'Active' +% }; +% push @links, ''; +% $align .= 'c'; +% push @style, 'b'; +%} +% +%unless ( 0 ) { #already showing only one class or something? +% push @header, 'Class'; +% push @fields, sub { shift->classname || '(none)'; }; +% $align .= 'l'; +%} +% +%#if ( $cgi->param('active') ) { +% push @header, 'Customer
packages'; +% my %col = ( +% 'active' => '00CC00', +% 'suspended' => 'FF9900', +% 'cancelled' => 'FF0000', +% ); +% my $cust_pkg_link = $p. 'search/cust_pkg.cgi?pkgpart='; +% push @fields, sub { my $part_pkg = shift; +% [ +% map { +% [ +% { +% 'data' => ''. +% $part_pkg->get("num_$_"). +% '', +% 'align' => 'right', +% }, +% { +% 'data' => $_, +% 'align' => 'left', +% 'link' => ( $part_pkg->get("num_$_") +% ? $cust_pkg_link. +% $part_pkg->pkgpart. +% ";magic=$_" +% : '' +% ), +% }, +% ], +% } (qw( active suspended cancelled )) +% ]; }; +% $align .= 'r'; +%#} +% +%push @header, 'Frequency'; +%push @fields, sub { shift->freq_pretty; }; +%$align .= 'l'; +% +%if ( $taxclasses ) { +% push @header, 'Taxclass'; +% push @fields, sub { shift->taxclass() || ' '; }; +% $align .= 'l'; +%} +% +%push @header, 'Plan', +% 'Data', +% 'Services'; +% #'Service', 'Quan', 'Primary'; +% +%push @fields, sub { shift->plan || '(legacy)' }, +% +% sub { +% my $part_pkg = shift; +% if ( $part_pkg->plan ) { +% +% [ map { +% /^(\w+)=(.*)$/; #or something; +% [ +% { 'data' => $1, +% 'align' => 'right', +% }, +% { 'data' => $2, +% 'align' => 'left', +% }, +% ]; +% } +% split(/\n/, $part_pkg->plandata) +% ]; +% +% } else { +% +% [ map { [ +% { 'data' => uc($_), +% 'align' => 'right', +% }, +% { +% 'data' => $part_pkg->$_(), +% 'align' => 'left', +% }, +% ]; +% } +% (qw(setup recur)) +% ]; +% +% } +% +% }, +% +% sub { +% my $part_pkg = shift; +% +% [ map { +% my $pkg_svc = $_; +% my $part_svc = $pkg_svc->part_svc; +% my $svc = $part_svc->svc; +% if ( $pkg_svc->primary_svc =~ /^Y/i ) { +% $svc = "$svc (PRIMARY)"; +% } +% $svc =~ s/ +/ /g; +% +% [ +% { +% 'data' => ''. $pkg_svc->quantity. '', +% 'align' => 'right' +% }, +% { +% 'data' => $svc, +% 'align' => 'left', +% 'link' => $p. 'edit/part_svc.cgi?'. +% $part_svc->svcpart, +% }, +% ]; +% } +% sort { $b->primary_svc =~ /^Y/i +% <=> $a->primary_svc =~ /^Y/i +% } +% $part_pkg->pkg_svc +% +% ]; +% +% }; +% +%$align .= 'lrl'; #rr'; +% +%# -------- +% +%my $count_query = 'SELECT COUNT(*) FROM part_pkg'; +%$count_query .= " WHERE $search" +% if $search; +% +% +<% include( 'elements/browse.html', 'title' => 'Package Definitions', 'menubar' => [ 'Main Menu' => $p ], 'html_init' => $html_init, diff --git a/httemplate/browse/part_referral.html b/httemplate/browse/part_referral.html index c50a406ed..0e61a908e 100755 --- a/httemplate/browse/part_referral.html +++ b/httemplate/browse/part_referral.html @@ -1,129 +1,140 @@ -<%= include("/elements/header.html","Advertising source Listing" ) %> +<% include("/elements/header.html","Advertising source Listing" ) %> Where a customer heard about your service. Tracked for informational purposes.

-Add a new advertising source +Add a new advertising source

+% +% my $today = timelocal(0, 0, 0, (localtime(time))[3..5] ); +% my %after; +% tie %after, 'Tie::IxHash', +% 'Today' => 0, +% 'Yesterday' => 86400, # 60sec * 60min * 24hrs +% 'Past week' => 518400, # 60sec * 60min * 24hrs * 6days +% 'Past 30 days' => 2505600, # 60sec * 60min * 24hrs * 29days +% 'Past 60 days' => 5097600, # 60sec * 60min * 24hrs * 59days +% 'Past 90 days' => 7689600, # 60sec * 60min * 24hrs * 89days +% 'Past 6 months' => 15724800, # 60sec * 60min * 24hrs * 182days +% 'Past year' => 31486000, # 60sec * 60min * 24hrs * 364days +% 'Total' => $today, +% ; +% my %before = ( +% 'Today' => 86400, # 60sec * 60min * 24hrs +% 'Yesterday' => 0, +% 'Past week' => 86400, # 60sec * 60min * 24hrs +% 'Past 30 days' => 86400, # 60sec * 60min * 24hrs +% 'Past 60 days' => 86400, # 60sec * 60min * 24hrs +% 'Past 90 days' => 86400, # 60sec * 60min * 24hrs +% 'Past 6 months' => 86400, # 60sec * 60min * 24hrs +% 'Past year' => 86400, # 60sec * 60min * 24hrs +% 'Total' => 86400, # 60sec * 60min * 24hrs +% ); +% +% my $curuser = $FS::CurrentUser::CurrentUser; +% +% my $statement = "SELECT COUNT(*) FROM h_cust_main +% WHERE history_action = 'insert' +% AND refnum = ? +% AND history_date >= ? +% AND history_date < ? +% AND ". $curuser->agentnums_sql; +% my $sth = dbh->prepare($statement) +% or die dbh->errstr; +% +% my $show_agentnums = scalar($curuser->agentnums); +% +% + + +<% include('/elements/table-grid.html') %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; +% -<% - my $today = timelocal(0, 0, 0, (localtime(time))[3..5] ); - my %after; - tie %after, 'Tie::IxHash', - 'Today' => 0, - 'Yesterday' => 86400, # 60sec * 60min * 24hrs - 'Past week' => 518400, # 60sec * 60min * 24hrs * 6days - 'Past 30 days' => 2505600, # 60sec * 60min * 24hrs * 29days - 'Past 60 days' => 5097600, # 60sec * 60min * 24hrs * 59days - 'Past 90 days' => 7689600, # 60sec * 60min * 24hrs * 89days - 'Past 6 months' => 15724800, # 60sec * 60min * 24hrs * 182days - 'Past year' => 31486000, # 60sec * 60min * 24hrs * 364days - 'Total' => $today, - ; - my %before = ( - 'Today' => 86400, # 60sec * 60min * 24hrs - 'Yesterday' => 0, - 'Past week' => 86400, # 60sec * 60min * 24hrs - 'Past 30 days' => 86400, # 60sec * 60min * 24hrs - 'Past 60 days' => 86400, # 60sec * 60min * 24hrs - 'Past 90 days' => 86400, # 60sec * 60min * 24hrs - 'Past 6 months' => 86400, # 60sec * 60min * 24hrs - 'Past year' => 86400, # 60sec * 60min * 24hrs - 'Total' => 86400, # 60sec * 60min * 24hrs - ); - - my $curuser = $FS::CurrentUser::CurrentUser; - - my $statement = "SELECT COUNT(*) FROM h_cust_main - WHERE history_action = 'insert' - AND refnum = ? - AND history_date >= ? - AND history_date < ? - AND ". $curuser->agentnums_sql; - my $sth = dbh->prepare($statement) - or die dbh->errstr; - - my $show_agentnums = scalar($curuser->agentnums); - -%> - -<%= include('/elements/table-grid.html') %> - -<% my $bgcolor1 = '#eeeeee'; - my $bgcolor2 = '#ffffff'; - my $bgcolor = ''; -%> Advertising source - <% if ( $show_agentnums ) { %> +% if ( $show_agentnums ) { + Agent - <% } %> - >Customers +% } + + >Customers -<% for my $period ( keys %after ) { %> - <%= $period %> -<% } %> +% for my $period ( keys %after ) { + + <% $period %> +% } + +% +%foreach my $part_referral ( FS::part_referral->all_part_referral(1) ) { +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% +% $a = 0; +% +% -<% -foreach my $part_referral ( FS::part_referral->all_part_referral(1) ) { + - if ( $bgcolor eq $bgcolor1 ) { - $bgcolor = $bgcolor2; - } else { - $bgcolor = $bgcolor1; - } + +% if ( $part_referral->agentnum || $curuser->access_right('Edit global advertising sources') ) { +% $a++; +% - $a = 0; + +% } -%> - + <% $part_referral->refnum %><% $a ? '' : '' %> + +% if ( $a ) { + + +% } + + <% $part_referral->referral %><% $a ? '' : '' %> +% if ( $show_agentnums ) { + + <% $part_referral->agentnum ? $part_referral->agent->agent : '(global)' %> +% } +% for my $period ( keys %after ) { +% $sth->execute( $part_referral->refnum, +% $today-$after{$period}, +% $today+$before{$period}, +% ) or die $sth->errstr; +% my $number = $sth->fetchrow_arrayref->[0]; +% + + <% $number %> +% } - - <% if ( $part_referral->agentnum || $curuser->access_right('Edit global advertising sources') ) { - $a++; - %> - - <% } %> - <%= $part_referral->refnum %><%= $a ? '' : '' %> - - <% if ( $a ) { %> - - <% } %> - <%= $part_referral->referral %><%= $a ? '' : '' %> - - <% if ( $show_agentnums ) { %> - <%= $part_referral->agentnum ? $part_referral->agent->agent : '(global)' %> - <% } %> - - <% for my $period ( keys %after ) { - $sth->execute( $part_referral->refnum, - $today-$after{$period}, - $today+$before{$period}, - ) or die $sth->errstr; - my $number = $sth->fetchrow_arrayref->[0]; - %> - <%= $number %> - <% } %> -<% } %> +% } +% +% $statement =~ s/AND refnum = \?//; +% $sth = dbh->prepare($statement) +% or die dbh->errstr; +% -<% - $statement =~ s/AND refnum = \?//; - $sth = dbh->prepare($statement) - or die dbh->errstr; -%> Total - <% for my $period ( keys %after ) { - $sth->execute( $today-$after{$period}, - $today+$before{$period}, - ) or die $sth->errstr; - my $number = $sth->fetchrow_arrayref->[0]; - %> - <%= $number %> - <% } %> +% for my $period ( keys %after ) { +% $sth->execute( $today-$after{$period}, +% $today+$before{$period}, +% ) or die $sth->errstr; +% my $number = $sth->fetchrow_arrayref->[0]; +% + + <% $number %> +% } + diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 805bd88b9..0113263fb 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -1,42 +1,43 @@ -<% - -#code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm -my %flag = ( - '' => '', - 'D' => 'Default', - 'F' => 'Fixed (unchangeable)', - #'M' => 'Manual selection from inventory', - 'M' => 'Manual selected from inventory', - #'A' => 'Automatically fill in from inventory', - 'A' => 'Automatically filled in from inventory', - 'X' => 'Excluded', -); - -my %search; -if ( $cgi->param('showdisabled') ) { - %search = (); -} else { - %search = ( 'disabled' => '' ); -} - -my @part_svc = - sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') } - qsearch('part_svc', \%search ); -my $total = scalar(@part_svc); - -my %num_active_cust_svc = map { $_->svcpart => $_->num_cust_svc } @part_svc; - -if ( $cgi->param('orderby') eq 'active' ) { - @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=> - $num_active_cust_svc{$a->svcpart} } @part_svc; -} elsif ( $cgi->param('orderby') eq 'svc' ) { - @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc; -} - -my %inventory_class = (); - -%> -<%= include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %> +% +% +%#code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm +%my %flag = ( +% '' => '', +% 'D' => 'Default', +% 'F' => 'Fixed (unchangeable)', +% #'M' => 'Manual selection from inventory', +% 'M' => 'Manual selected from inventory', +% #'A' => 'Automatically fill in from inventory', +% 'A' => 'Automatically filled in from inventory', +% 'X' => 'Excluded', +%); +% +%my %search; +%if ( $cgi->param('showdisabled') ) { +% %search = (); +%} else { +% %search = ( 'disabled' => '' ); +%} +% +%my @part_svc = +% sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') } +% qsearch('part_svc', \%search ); +%my $total = scalar(@part_svc); +% +%my %num_active_cust_svc = map { $_->svcpart => $_->num_cust_svc } @part_svc; +% +%if ( $cgi->param('orderby') eq 'active' ) { +% @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=> +% $num_active_cust_svc{$a->svcpart} } @part_svc; +%} elsif ( $cgi->param('orderby') eq 'svc' ) { +% @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc; +%} +% +%my %inventory_class = (); +% +% + +<% include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %> '; - -my $count_query = 'SELECT COUNT(*) FROM rate'; - -my $link = [ $p.'edit/rate.cgi?', 'ratenum' ]; - -%><%= include( 'elements/browse.html', +% +% +%my $html_init = +% 'Rate plans, regions and prefixes for VoIP and call billing.

'. +% qq!Add a rate plan!. +% qq! | Add a region!. +% '

+% '; +% +%my $count_query = 'SELECT COUNT(*) FROM rate'; +% +%my $link = [ $p.'edit/rate.cgi?', 'ratenum' ]; +% +% +<% include( 'elements/browse.html', 'title' => 'Rate plans', 'menubar' => [ 'Main menu' => $p, ], 'html_init' => $html_init, diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi index 410037d41..7309388c6 100644 --- a/httemplate/browse/router.cgi +++ b/httemplate/browse/router.cgi @@ -1,56 +1,60 @@ -<%= include("/elements/header.html",'Routers', menubar('Main Menu' => $p)) %> -<% +<% include("/elements/header.html",'Routers', menubar('Main Menu' => $p)) %> +% +% +%my @router = qsearch('router', {}); +%my $p2 = popurl(2); +% +% +% if ($cgi->param('error')) { -my @router = qsearch('router', {}); -my $p2 = popurl(2); + Error: <%$cgi->param('error')%> +

+% } +% +%my $hidecustomerrouters = 0; +%my $hideurl = ''; +%if ($cgi->param('hidecustomerrouters') eq '1') { +% $hidecustomerrouters = 1; +% $cgi->param('hidecustomerrouters', 0); +% $hideurl = 'Show customer routers'; +%} else { +% $hidecustomerrouters = 0; +% $cgi->param('hidecustomerrouters', 1); +% $hideurl = 'Hide customer routers'; +%} +% -%> -<% if ($cgi->param('error')) { %> - Error: <%=$cgi->param('error')%> -

-<% } %> - -<% -my $hidecustomerrouters = 0; -my $hideurl = ''; -if ($cgi->param('hidecustomerrouters') eq '1') { - $hidecustomerrouters = 1; - $cgi->param('hidecustomerrouters', 0); - $hideurl = 'Show customer routers'; -} else { - $hidecustomerrouters = 0; - $cgi->param('hidecustomerrouters', 1); - $hideurl = 'Hide customer routers'; -} -%> - -Add a new router | <%=$hideurl%> - -<%=table()%> +Add a new router | <%$hideurl%> + +<%table()%> Router name Address block(s) -<% foreach my $router (sort {$a->routernum <=> $b->routernum} @router) { - next if $hidecustomerrouters && $router->svcnum; - my @addr_block = $router->addr_block; - if (scalar(@addr_block) == 0) { - push @addr_block, ' '; - } -%> +% foreach my $router (sort {$a->routernum <=> $b->routernum} @router) { +% next if $hidecustomerrouters && $router->svcnum; +% my @addr_block = $router->addr_block; +% if (scalar(@addr_block) == 0) { +% push @addr_block, ' '; +% } +% + - - <%=$router->routername%> + + <%$router->routername%> - <% foreach my $block ( @addr_block ) { %> +% foreach my $block ( @addr_block ) { + - <%=UNIVERSAL::isa($block, 'FS::addr_block') ? $block->NetAddr : ' '%> + <%UNIVERSAL::isa($block, 'FS::addr_block') ? $block->NetAddr : ' '%> - <% } %> +% } + -<% } %> +% } + diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi index 73de6accc..949bfa790 100755 --- a/httemplate/browse/svc_acct_pop.cgi +++ b/httemplate/browse/svc_acct_pop.cgi @@ -1,13 +1,14 @@ -<% - my $accounts_sth = dbh->prepare("SELECT COUNT(*) FROM svc_acct - WHERE popnum = ? ") - or die dbh->errstr; -%> -<%= include("/elements/header.html",'Access Number Listing', menubar( 'Main Menu' => $p )) %> +% +% my $accounts_sth = dbh->prepare("SELECT COUNT(*) FROM svc_acct +% WHERE popnum = ? ") +% or die dbh->errstr; +% + +<% include("/elements/header.html",'Access Number Listing', menubar( 'Main Menu' => $p )) %> Points of Presence

-Add new Access Number

-<%= table() %> +Add new Access Number

+<% table() %> City @@ -17,43 +18,50 @@ Points of Presence

Local Accounts +% +%foreach my $svc_acct_pop ( sort { +% #$a->getfield('popnum') <=> $b->getfield('popnum') +% $a->state cmp $b->state || $a->city cmp $b->city +% || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc +%} qsearch('svc_acct_pop',{}) ) { +% +% my $svc_acct_pop_link = $p . 'edit/svc_acct_pop.cgi?'. $svc_acct_pop->popnum; +% +% $accounts_sth->execute($svc_acct_pop->popnum) or die $accounts_sth->errstr; +% my $num_accounts = $accounts_sth->fetchrow_arrayref->[0]; +% +% my $svc_acct_link = $p. 'search/svc_acct.cgi?popnum='. $svc_acct_pop->popnum; +% +% -<% -foreach my $svc_acct_pop ( sort { - #$a->getfield('popnum') <=> $b->getfield('popnum') - $a->state cmp $b->state || $a->city cmp $b->city - || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc -} qsearch('svc_acct_pop',{}) ) { - - my $svc_acct_pop_link = $p . 'edit/svc_acct_pop.cgi?'. $svc_acct_pop->popnum; - - $accounts_sth->execute($svc_acct_pop->popnum) or die $accounts_sth->errstr; - my $num_accounts = $accounts_sth->fetchrow_arrayref->[0]; - - my $svc_acct_link = $p. 'search/svc_acct.cgi?popnum='. $svc_acct_pop->popnum; - -%> - - <%= $svc_acct_pop->popnum %> - - <%= $svc_acct_pop->city %> - - <%= $svc_acct_pop->state %> - - <%= $svc_acct_pop->ac %> - - <%= $svc_acct_pop->exch %> - - <%= $svc_acct_pop->loc %> + + <% $svc_acct_pop->popnum %> + + <% $svc_acct_pop->city %> + + <% $svc_acct_pop->state %> + + <% $svc_acct_pop->ac %> + + <% $svc_acct_pop->exch %> + + <% $svc_acct_pop->loc %> - <%= $num_accounts %> - <% if ( $num_accounts ) { %><% } %> + <% $num_accounts %> +% if ( $num_accounts ) { + +% } + active - <% if ( $num_accounts ) { %><% } %> +% if ( $num_accounts ) { + +% } + -<% } %> +% } + diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 259713260..fe04b324c 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -1,51 +1,52 @@ -<% - my $conf = new FS::Conf; - $FS::Conf::DEBUG = 1; - my @config_items = $conf->config_items; +% +% my $conf = new FS::Conf; +% $FS::Conf::DEBUG = 1; +% my @config_items = $conf->config_items; +% +% foreach my $i ( @config_items ) { +% my @touch = (); +% my @delete = (); +% my $n = 0; +% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { +% if ( $type eq '' ) { +% } elsif ( $type eq 'textarea' ) { +% if ( $cgi->param($i->key. $n) ne '' ) { +% my $value = $cgi->param($i->key. $n); +% $value =~ s/\r\n/\n/g; #browsers? +% $conf->set($i->key, $value); +% } else { +% $conf->delete($i->key); +% } +% } elsif ( $type eq 'checkbox' ) { +%# if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) { +% if ( defined $cgi->param($i->key. $n) ) { +% #$conf->touch($i->key); +% push @touch, $i->key; +% } else { +% #$conf->delete($i->key); +% push @delete, $i->key; +% } +% } elsif ( $type eq 'text' || $type eq 'select' ) { +% if ( $cgi->param($i->key. $n) ne '' ) { +% $conf->set($i->key, $cgi->param($i->key. $n)); +% } else { +% $conf->delete($i->key); +% } +% } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) { +% if ( scalar(@{[ $cgi->param($i->key. $n) ]}) ) { +% $conf->set($i->key, join("\n", @{[ $cgi->param($i->key. $n) ]} )); +% } else { +% $conf->delete($i->key); +% } +% } else { +% } +% $n++; +% } +% # warn @touch; +% $conf->touch($_) foreach @touch; +% $conf->delete($_) foreach @delete; +% } +% +% - foreach my $i ( @config_items ) { - my @touch = (); - my @delete = (); - my $n = 0; - foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - if ( $type eq '' ) { - } elsif ( $type eq 'textarea' ) { - if ( $cgi->param($i->key. $n) ne '' ) { - my $value = $cgi->param($i->key. $n); - $value =~ s/\r\n/\n/g; #browsers? - $conf->set($i->key, $value); - } else { - $conf->delete($i->key); - } - } elsif ( $type eq 'checkbox' ) { -# if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) { - if ( defined $cgi->param($i->key. $n) ) { - #$conf->touch($i->key); - push @touch, $i->key; - } else { - #$conf->delete($i->key); - push @delete, $i->key; - } - } elsif ( $type eq 'text' || $type eq 'select' ) { - if ( $cgi->param($i->key. $n) ne '' ) { - $conf->set($i->key, $cgi->param($i->key. $n)); - } else { - $conf->delete($i->key); - } - } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) { - if ( scalar(@{[ $cgi->param($i->key. $n) ]}) ) { - $conf->set($i->key, join("\n", @{[ $cgi->param($i->key. $n) ]} )); - } else { - $conf->delete($i->key); - } - } else { - } - $n++; - } - # warn @touch; - $conf->touch($_) foreach @touch; - $conf->delete($_) foreach @delete; - } - -%> -<%= $cgi->redirect("config-view.cgi") %> +<% $cgi->redirect("config-view.cgi") %> diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index bf51f1509..ff7913d78 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -1,80 +1,92 @@ -<%= include("/elements/header.html",'View Configuration', menubar( 'Main Menu' => $p, +<% include("/elements/header.html",'View Configuration', menubar( 'Main Menu' => $p, 'Edit Configuration' => 'config.cgi' ) ) %> +% my $conf = new FS::Conf; my @config_items = $conf->config_items; +% foreach my $section ( qw(required billing username password UI session +% shell BIND +% ), +% '', 'deprecated') { -<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %> - -<% foreach my $section ( qw(required billing username password UI session - shell BIND - ), - '', 'deprecated') { %> - + - <% foreach my $nav_section ( qw(required billing username password UI session - shell BIND - ), - '', 'deprecated') { %> - <% if ( $section eq $nav_section ) { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } else { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } %> - <% } %> +% foreach my $nav_section ( qw(required billing username password UI session +% shell BIND +% ), +% '', 'deprecated') { +% if ( $section eq $nav_section ) { + + [<% ucfirst($nav_section || 'unclassified') %>] +% } else { + + [<% ucfirst($nav_section || 'unclassified') %>] +% } +% } +
- <%= table("#cccccc", 2) %> + <% table("#cccccc", 2) %> - <%= ucfirst($section || 'unclassified') %> configuration options + <% ucfirst($section || 'unclassified') %> configuration options - <% foreach my $i (grep $_->section eq $section, @config_items) { %> +% foreach my $i (grep $_->section eq $section, @config_items) { + - - <%= $i->key %> - <%= $i->description %> + + <% $i->key %> - <% $i->description %> - <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - my $n = 0; %> - <% if ( $type eq '' ) { %> +% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { +% my $n = 0; +% if ( $type eq '' ) { + - <% } elsif ( $type eq 'textarea' - || $type eq 'editlist' - || $type eq 'selectmultiple' ) { %> +% } elsif ( $type eq 'textarea' +% || $type eq 'editlist' +% || $type eq 'selectmultiple' ) { + - <% } elsif ( $type eq 'checkbox' ) { %> +% } elsif ( $type eq 'checkbox' ) { + - + - <% } elsif ( $type eq 'text' || $type eq 'select' ) { %> +% } elsif ( $type eq 'text' || $type eq 'select' ) { + - <% } elsif ( $type eq 'select-sub' ) { %> +% } elsif ( $type eq 'select-sub' ) { + - <% } else { %> +% } else { + - <% } %> - <% $n++; } %> +% } +% $n++; } +
no type
-<%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
+<% encode_entities(join("\n", $conf->config($i->key) ) ) %>
 
YES' : 'ff0000">NO' %>YES' : 'ff0000">NO' %>
- <%= $conf->exists($i->key) ? $conf->config($i->key) : '' %> + <% $conf->exists($i->key) ? $conf->config($i->key) : '' %>
- <%= $conf->config($i->key) %>: - <%= &{ $i->option_sub }( $conf->config($i->key) ) %> + <% $conf->config($i->key) %>: + <% &{ $i->option_sub }( $conf->config($i->key) ) %>
- unknown type <%= $type %> + unknown type <% $type %>
- <% } %> +% } +

-<% } %> +% } + diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index cf228dba5..369314d98 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -1,5 +1,5 @@ -<%= include("/elements/header.html",'Edit Configuration', menubar( 'Main Menu' => $p ) ) %> +<% include("/elements/header.html",'Edit Configuration', menubar( 'Main Menu' => $p ) ) %> +% my $conf = new FS::Conf; my @config_items = $conf->config_items; -<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
+% foreach my $section ( qw(required billing username password UI session +% shell BIND +% ), +% '', 'deprecated') { -<% foreach my $section ( qw(required billing username password UI session - shell BIND - ), - '', 'deprecated') { %> - + - <% foreach my $nav_section ( qw(required billing username password UI session - shell BIND - ), - '', 'deprecated') { %> - <% if ( $section eq $nav_section ) { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } else { %> - [<%= ucfirst($nav_section || 'unclassified') %>] - <% } %> - <% } %> +% foreach my $nav_section ( qw(required billing username password UI session +% shell BIND +% ), +% '', 'deprecated') { +% if ( $section eq $nav_section ) { + + [<% ucfirst($nav_section || 'unclassified') %>] +% } else { + + [<% ucfirst($nav_section || 'unclassified') %>] +% } +% } +
- <%= table("#cccccc", 2) %> + <% table("#cccccc", 2) %> - <%= ucfirst($section || 'unclassified') %> configuration options + <% ucfirst($section || 'unclassified') %> configuration options - <% foreach my $i (grep $_->section eq $section, @config_items) { %> +% foreach my $i (grep $_->section eq $section, @config_items) { + - <% my $n = 0; - foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { - #warn $i->key unless defined($type); - %> - <% if ( $type eq '' ) { %> +% my $n = 0; +% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { +% #warn $i->key unless defined($type); +% +% if ( $type eq '' ) { + no type +% } elsif ( $type eq 'textarea' ) { - <% } elsif ( $type eq 'textarea' ) { %> - + +% } elsif ( $type eq 'checkbox' ) { - <% } elsif ( $type eq 'checkbox' ) { %> - exists($i->key) ? ' CHECKED' : '' %>> + exists($i->key) ? ' CHECKED' : '' %>> +% } elsif ( $type eq 'text' ) { - <% } elsif ( $type eq 'text' ) { %> - + +% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { - <% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { %> - > +% +% my %hash = (); +% if ( $i->select_enum ) { +% tie %hash, 'Tie::IxHash', +% '' => '', map { $_ => $_ } @{ $i->select_enum }; +% } elsif ( $i->select_hash ) { +% if ( ref($i->select_hash) eq 'ARRAY' ) { +% tie %hash, 'Tie::IxHash', +% '' => '', @{ $i->select_hash }; +% } else { +% tie %hash, 'Tie::IxHash', +% '' => '', %{ $i->select_hash }; +% } +% } else { +% %hash = ( '' => 'WARNING: neither select_enum nor select_hash specified in Conf.pm for configuration option "'. $i->key. '"' ); +% } +% +% my %saw = (); +% foreach my $value ( keys %hash ) { +% local($^W)=0; next if $saw{$value}++; +% my $label = $hash{$value}; +% + + + - <% foreach my $line ( $conf->config($i->key) ) { %> - - <% } %> +% foreach my $line ( $conf->config($i->key) ) { + + +% } +
- - + +
- <%= itable() %> - <% if ( defined $i->editlist_parts ) { %> - <% my $pnum=0; foreach my $part ( @{$i->editlist_parts} ) { %> + <% itable() %> +% if ( defined $i->editlist_parts ) { +% my $pnum=0; foreach my $part ( @{$i->editlist_parts} ) { + - <% if ( $part->{type} eq 'text' ) { %> - "> - <% } elsif ( $part->{type} eq 'immutable' ) { %> - <%= $part->{value} %>" value="<%= $part->{value} %>"> - <% } elsif ( $part->{type} eq 'select' ) { %> - "> +% } elsif ( $part->{type} eq 'immutable' ) { + + <% $part->{value} %>" value="<% $part->{value} %>"> +% } elsif ( $part->{type} eq 'select' ) { + + - <% } else { %> - unknown type <%= $part->type %> - <% } %> +% } else { + + unknown type <% $part->type %> +% } + - <% $pnum++; } %> - <% } else { %> - - <% } %> - - +% $pnum++; } +% } else { - <% } else { %> + +% } + + + +% } else { - unknown type <%= $type %> - <% } %> + unknown type <% $type %> +% } +% $n++; } - <% $n++; } %> - - <%= $i->key %> - <%= $i->description %> + + <% $i->key %> - <% $i->description %> - <% } %> +% } +
You may need to restart Apache and/or freeside-queued for configuration changes to take effect.


+% } -<% } %>
diff --git a/httemplate/docs/trouble.html b/httemplate/docs/trouble.html deleted file mode 100755 index fce743928..000000000 --- a/httemplate/docs/trouble.html +++ /dev/null @@ -1,26 +0,0 @@ - - Troubleshooting - - -

Troubleshooting

-
    -
  • When troubleshooting the web interface, helpful information is often in your web server's error log. -
  • If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL. -
  • If you get tons of errors in your web server's error log like this: -
    -Ambiguous use of value => resolved to "value" =>
    -at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132.
    -
    - This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile. -
  • If you get errors like this: -
    -UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied 
    -at /your/path/site_perl/FS/UID.pm line 26.
    -BEGIN failed--compilation aborted at
    -/your/path/edit/process/part_svc.cgi line 15.
    -
    - Then the scripts are not running as the freeside freeside user. See -the New Installation section of the documentation. -
  • If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the MySQL documentation, DBI manpage and the DBD::mysql manpage for details. -
- diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 1eefcfea0..69bbb9b22 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,177 +1,183 @@ -<% - -my $error =''; -my $pkgnum = ''; -if ( $cgi->param('error') ) { - $error = $cgi->param('error'); - $pkgnum = $cgi->param('pkgnum'); - if ( $error eq '_bill_areyousure' ) { - my $bill = $cgi->param('bill'); - $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? ". - ''; - } -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/ or die "no pkgnum"; - $pkgnum = $1; -} - -#get package record -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -die "No package!" unless $cust_pkg; -my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); - -if ( $error ) { - #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill); - $cust_pkg->setup(str2time($cgi->param('setup'))); - $cust_pkg->bill(str2time($cgi->param('bill'))); - $cust_pkg->last_bill(str2time($cgi->param('last_bill'))); -} - -#my $custnum = $cust_pkg->getfield('custnum'); -%> - -<%= include("/elements/header.html",'Customer package - Edit dates') %> -<% -#, menubar( -# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", -# 'Main Menu' => popurl(2) -#)); -%> +% +% +%my $error =''; +%my $pkgnum = ''; +%if ( $cgi->param('error') ) { +% $error = $cgi->param('error'); +% $pkgnum = $cgi->param('pkgnum'); +% if ( $error eq '_bill_areyousure' ) { +% my $bill = $cgi->param('bill'); +% $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? ". +% ''; +% } +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/ or die "no pkgnum"; +% $pkgnum = $1; +%} +% +%#get package record +%my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +%die "No package!" unless $cust_pkg; +%my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); +% +%if ( $error ) { +% #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill); +% $cust_pkg->setup(str2time($cgi->param('setup'))); +% $cust_pkg->bill(str2time($cgi->param('bill'))); +% $cust_pkg->last_bill(str2time($cgi->param('last_bill'))); +%} +% +%#my $custnum = $cust_pkg->getfield('custnum'); +% + + +<% include("/elements/header.html",'Customer package - Edit dates') %> +% +%#, menubar( +%# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", +%# 'Main Menu' => popurl(2) +%#)); +% + +% +% +%#print info +%my($susp,$cancel,$expire)=( +% $cust_pkg->getfield('susp'), +% $cust_pkg->getfield('cancel'), +% $cust_pkg->getfield('expire'), +%); +%my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); +%my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); +%my $otaker = $cust_pkg->getfield('otaker'); +% +% -<% - -#print info -my($susp,$cancel,$expire)=( - $cust_pkg->getfield('susp'), - $cust_pkg->getfield('cancel'), - $cust_pkg->getfield('expire'), -); -my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -my $otaker = $cust_pkg->getfield('otaker'); - -%>
- - -<% if ( $error ) { %> - Error: <%= $error %> -<% } %> - -<% - -#my $format = "%c %z (%Z)"; -my $format = "%m/%d/%Y %T %z (%Z)"; - -#false laziness w/view/cust_main/packages.html -#my( $billed_or_prepaid, -my( $last_bill_or_renewed, $next_bill_or_prepaid_until ); -unless ( $part_pkg->is_prepaid ) { - #$billed_or_prepaid = 'billed'; - $last_bill_or_renewed = 'Last bill'; - $next_bill_or_prepaid_until = 'Next bill'; -} else { - #$billed_or_prepaid = 'prepaid'; - $last_bill_or_renewed = 'Renewed'; - $next_bill_or_prepaid_until = 'Prepaid until'; -} - -%> - -<%= ntable("#cccccc",2) %> + +% if ( $error ) { + + Error: <% $error %> +% } +% +% +%#my $format = "%c %z (%Z)"; +%my $format = "%m/%d/%Y %T %z (%Z)"; +% +%#false laziness w/view/cust_main/packages.html +%#my( $billed_or_prepaid, +%my( $last_bill_or_renewed, $next_bill_or_prepaid_until ); +%unless ( $part_pkg->is_prepaid ) { +% #$billed_or_prepaid = 'billed'; +% $last_bill_or_renewed = 'Last bill'; +% $next_bill_or_prepaid_until = 'Next bill'; +%} else { +% #$billed_or_prepaid = 'prepaid'; +% $last_bill_or_renewed = 'Renewed'; +% $next_bill_or_prepaid_until = 'Prepaid until'; +%} +% +% + + +<% ntable("#cccccc",2) %> Package number - <%= $pkgnum %> + <% $pkgnum %> Package - <%= $pkg %> + <% $pkg %> Comment - <%= $comment %> + <% $comment %> Order taker - <%= $otaker %> + <% $otaker %> Setup date - "> + "> - <%= $last_bill_or_renewed %> date + <% $last_bill_or_renewed %> date - "> + "> - <%= $next_bill_or_prepaid_until %> date + <% $next_bill_or_prepaid_until %> date - "> + "> +% if ( $susp ) { - <% if ( $susp ) { %> Suspension date - <%= time2str($format, $susp) %> + <% time2str($format, $susp) %> - <% } %> +% } + Expiration date - "> + ">
(will cancel this package when the date is reached) +% if ( $cancel ) { - <% if ( $cancel ) { %> Cancellation date - <%= time2str($format, $cancel) %> + <% time2str($format, $cancel) %> - <% } %> +% } +
diff --git a/httemplate/edit/access_group.html b/httemplate/edit/access_group.html index d7f7667f4..d447512c2 100644 --- a/httemplate/edit/access_group.html +++ b/httemplate/edit/access_group.html @@ -1,4 +1,4 @@ -<%= include( 'elements/edit.html', +<% include( 'elements/edit.html', 'name' => 'Internal Access Group', 'table' => 'access_group', 'labels' => { diff --git a/httemplate/edit/access_user.html b/httemplate/edit/access_user.html index fb2a97196..df580a20d 100644 --- a/httemplate/edit/access_user.html +++ b/httemplate/edit/access_user.html @@ -1,4 +1,4 @@ -<%= include( 'elements/edit.html', +<% include( 'elements/edit.html', 'name' => 'Internal User', 'table' => 'access_user', 'fields' => [ diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index 40115a932..ce514a680 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -1,109 +1,115 @@ -<% - -my $agent; -if ( $cgi->param('error') ) { - $agent = new FS::agent ( { - map { $_, scalar($cgi->param($_)) } fields('agent') - } ); -} elsif ( $cgi->keywords ) { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); -} else { #adding - $agent = new FS::agent {}; -} -my $action = $agent->agentnum ? 'Edit' : 'Add'; -my $hashref = $agent->hashref; - -my $conf = new FS::Conf; - -%> - -<%= include("/elements/header.html","$action Agent", menubar( +% +% +%my $agent; +%if ( $cgi->param('error') ) { +% $agent = new FS::agent ( { +% map { $_, scalar($cgi->param($_)) } fields('agent') +% } ); +%} elsif ( $cgi->keywords ) { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); +%} else { #adding +% $agent = new FS::agent {}; +%} +%my $action = $agent->agentnum ? 'Edit' : 'Add'; +%my $hashref = $agent->hashref; +% +%my $conf = new FS::Conf; +% +% + + +<% include("/elements/header.html","$action Agent", menubar( 'Main Menu' => $p, 'View all agents' => $p. 'browse/agent.cgi', )) %> +% if ( $cgi->param('error') ) { + +Error: <% $cgi->param('error') %> +% } -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> -
- -Agent #<%= $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> + + +Agent #<% $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)" %> -<%= &ntable("#cccccc", 2, '') %> +<% &ntable("#cccccc", 2, '') %> Agent - + Agent type Disable - {disabled} eq 'Y' ? ' CHECKED' : '' %>> + {disabled} eq 'Y' ? ' CHECKED' : '' %>> - + - + +% if ( $conf->config('ticket_system') ) { +% my $default_queueid = $conf->config('ticket_system-default_queueid'); +% my $default_queue = FS::TicketSystem->queue($default_queueid); +% $default_queue = "(default) $default_queueid: $default_queue" +% if $default_queueid; +% my %queues = FS::TicketSystem->queues(); +% my @queueids = sort { $a <=> $b } keys %queues; +% - <% if ( $conf->config('ticket_system') ) { - my $default_queueid = $conf->config('ticket_system-default_queueid'); - my $default_queue = FS::TicketSystem->queue($default_queueid); - $default_queue = "(default) $default_queueid: $default_queue" - if $default_queueid; - my %queues = FS::TicketSystem->queues(); - my @queueids = sort { $a <=> $b } keys %queues; - %> Ticketing queue - <% } %> +% } + Agent interface username - + Agent interface password - + -
"> +
">
diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html index db4331b84..08a2fa6bf 100644 --- a/httemplate/edit/agent_payment_gateway.html +++ b/httemplate/edit/agent_payment_gateway.html @@ -1,57 +1,63 @@ -<% +% +% +%$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'; +% +% -$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( +<% 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', )) %> +% if ( $cgi->param('error') ) { + +Error: <% $cgi->param('error') %> +% } -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> -<% } %> -
- + + Use gateway

for

diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index f5afd3a96..5438e5c3b 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -1,41 +1,43 @@ -<% - -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( +% +% +%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", )) %> +% if ( $cgi->param('error') ) { -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -<% } %> + Error: <% $cgi->param('error') %> +% } - - -Agent Type #<%= $agent_type->typenum || "(NEW)" %> + + + +Agent Type #<% $agent_type->typenum || "(NEW)" %>
Agent Type - +

Select which packages agents of this type may sell to customers
-<%= ntable("#cccccc", 2) %> -<%= include('/elements/checkboxes-table.html', +<% ntable("#cccccc", 2) %> +<% include('/elements/checkboxes-table.html', 'source_obj' => $agent_type, 'link_table' => 'type_pkgs', 'target_table' => 'part_pkg', @@ -48,8 +50,8 @@ Select which packages agents of this type may sell to customers

-"> +">
-<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> diff --git a/httemplate/edit/bulk-cust_svc.html b/httemplate/edit/bulk-cust_svc.html index be247ba4e..f2efc3ff9 100644 --- a/httemplate/edit/bulk-cust_svc.html +++ b/httemplate/edit/bulk-cust_svc.html @@ -1,4 +1,4 @@ -<%= include("/elements/header.html", 'Bulk customer service change', +<% include("/elements/header.html", 'Bulk customer service change', menubar( 'Main Menu' => $p, ), @@ -9,7 +9,7 @@ -<%= include('/elements/progress-init.html', +<% include('/elements/progress-init.html', 'OneTrueForm', [qw( old_svcpart new_svcpart pkgpart )], 'process/bulk-cust_svc.cgi', @@ -18,65 +18,67 @@ %>
+% +% $cgi->param('svcpart') =~ /^(\d+)$/ +% or die "illegal svcpart: ". $cgi->param('svcpart'); +% +% my $old_svcpart = $1; +% my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } ) +% or die "unknown svcpart: $old_svcpart"; +% -<% - $cgi->param('svcpart') =~ /^(\d+)$/ - or die "illegal svcpart: ". $cgi->param('svcpart'); - my $old_svcpart = $1; - my $src_part_svc = qsearchs('part_svc', { 'svcpart' => $old_svcpart } ) - or die "unknown svcpart: $old_svcpart"; -%> - - + Change
to new service definition
diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi index 9d3bdd8cb..2035e4b64 100755 --- a/httemplate/edit/cust_bill_pay.cgi +++ b/httemplate/edit/cust_bill_pay.cgi @@ -1,87 +1,90 @@ -<% - -my($paynum, $amount, $invnum); -if ( $cgi->param('error') ) { - $paynum = $cgi->param('paynum'); - $amount = $cgi->param('amount'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $paynum = $1; - $amount = ''; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= header("Apply Payment", '') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my($paynum, $amount, $invnum); +%if ( $cgi->param('error') ) { +% $paynum = $cgi->param('paynum'); +% $amount = $cgi->param('amount'); +% $invnum = $cgi->param('invnum'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $paynum = $1; +% $amount = ''; +% $invnum = ''; +%} +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% header("Apply Payment", '') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> - - +% } -<% -my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); -die "payment $paynum not found!" unless $cust_pay; -my $unapplied = $cust_pay->unapplied; -%> + +% +%my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } ); +%die "payment $paynum not found!" unless $cust_pay; +% +%my $unapplied = $cust_pay->unapplied; +% -Payment #<%= $paynum %> - -
Date: <%= time2str("%D", $cust_pay->_date) %> +Payment #<% $paynum %> + -
Amount: $<%= $cust_pay->paid %> +
Date: <% time2str("%D", $cust_pay->_date) %> -
Unapplied amount: $<%= $unapplied %> +
Amount: $<% $cust_pay->paid %> -<% -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); +
Unapplied amount: $<% $unapplied %> +% +%my @cust_bill = grep $_->owed != 0, +% qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } ); +% +% -%>
Invoice # -
Amount $ +
Amount $
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi index 8de627d20..c54fb8147 100755 --- a/httemplate/edit/cust_credit.cgi +++ b/httemplate/edit/cust_credit.cgi @@ -1,67 +1,69 @@ -<% - -my $conf = new FS::Conf; -my($custnum, $amount, $reason); -if ( $cgi->param('error') ) { - #$cust_credit = new FS::cust_credit ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit') - #} ); - $custnum = $cgi->param('custnum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $reason = $cgi->param('reason'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $custnum = $1; - $amount = ''; - #$refund = 'yes'; - $reason = ''; -} -my $_date = time; - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= include('/elements/header-popup.html', 'Enter Credit') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my $conf = new FS::Conf; +%my($custnum, $amount, $reason); +%if ( $cgi->param('error') ) { +% #$cust_credit = new FS::cust_credit ( { +% # map { $_, scalar($cgi->param($_)) } fields('cust_credit') +% #} ); +% $custnum = $cgi->param('custnum'); +% $amount = $cgi->param('amount'); +% #$refund = $cgi->param('refund'); +% $reason = $cgi->param('reason'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $custnum = $1; +% $amount = ''; +% #$refund = 'yes'; +% $reason = ''; +%} +%my $_date = time; +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% include('/elements/header-popup.html', 'Enter Credit') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> +% } + - + - + - + - + - + Credit -<%= ntable("#cccccc", 2) %> +<% ntable("#cccccc", 2) %> Date - <%= time2str("%D",$_date) %> + <% time2str("%D",$_date) %> Amount - $ + $ +% +%#print qq! Also post refund!; +% -<% -#print qq! Also post refund!; -%> Reason - + diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 409ea3c25..5fdc0ba18 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,94 +1,97 @@ -<% - -my($crednum, $amount, $invnum); -if ( $cgi->param('error') ) { - #$cust_credit_bill = new FS::cust_credit_bill ( { - # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') - #} ); - $crednum = $cgi->param('crednum'); - $amount = $cgi->param('amount'); - #$refund = $cgi->param('refund'); - $invnum = $cgi->param('invnum'); -} else { - my($query) = $cgi->keywords; - $query =~ /^(\d+)$/; - $crednum = $1; - $amount = ''; - #$refund = 'yes'; - $invnum = ''; -} - -my $otaker = getotaker; - -my $p1 = popurl(1); - -%><%= header("Apply Credit", '') %> - -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> +% +% +%my($crednum, $amount, $invnum); +%if ( $cgi->param('error') ) { +% #$cust_credit_bill = new FS::cust_credit_bill ( { +% # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') +% #} ); +% $crednum = $cgi->param('crednum'); +% $amount = $cgi->param('amount'); +% #$refund = $cgi->param('refund'); +% $invnum = $cgi->param('invnum'); +%} else { +% my($query) = $cgi->keywords; +% $query =~ /^(\d+)$/; +% $crednum = $1; +% $amount = ''; +% #$refund = 'yes'; +% $invnum = ''; +%} +% +%my $otaker = getotaker; +% +%my $p1 = popurl(1); +% +% +<% header("Apply Credit", '') %> +% if ( $cgi->param('error') ) { + + Error: <% $cgi->param('error') %>

-<% } %> - - +% } -<% -my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); -die "credit $crednum not found!" unless $cust_credit; -my $credited = $cust_credit->credited; -%> + +% +%my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +%die "credit $crednum not found!" unless $cust_credit; +% +%my $credited = $cust_credit->credited; +% -Credit #<%= $crednum %> - -
Date: <%= time2str("%D", $cust_credit->_date) %> +Credit #<% $crednum %> + -
Amount: $<%= $cust_credit->amount %> +
Date: <% time2str("%D", $cust_credit->_date) %> -
Unapplied amount: $<%= $credited %> +
Amount: $<% $cust_credit->amount %> -
Reason: <%= $cust_credit->reason %> +
Unapplied amount: $<% $credited %> -<% -my @cust_bill = grep $_->owed != 0, - qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); +
Reason: <% $cust_credit->reason %> +% +%my @cust_bill = grep $_->owed != 0, +% qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); +% +% -%>
Invoice # -
Amount $ +
Amount $
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index c3d1804bc..dfcd0401f 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -1,160 +1,164 @@ -<% - - #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); -my(@invoicing_list); -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_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'); -} 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; - $username = ''; - $password = ''; - $popnum = 0; - @invoicing_list = $cust_main->invoicing_list; -} else { - $custnum=''; - $cust_main = new FS::cust_main ( {} ); - $cust_main->otaker( &getotaker ); - $cust_main->referral_custnum( $cgi->param('referral_custnum') ); - $saved_pkgpart = 0; - $username = ''; - $password = ''; - $popnum = 0; - @invoicing_list = (); -} -$cgi->delete_all(); - -my $action = $custnum ? 'Edit' : 'Add'; -$action .= ": ". $cust_main->name if $custnum; +% +% +% #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); +%my(@invoicing_list); +%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_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'); +%} 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; +% $username = ''; +% $password = ''; +% $popnum = 0; +% @invoicing_list = $cust_main->invoicing_list; +%} else { +% $custnum=''; +% $cust_main = new FS::cust_main ( {} ); +% $cust_main->otaker( &getotaker ); +% $cust_main->referral_custnum( $cgi->param('referral_custnum') ); +% $saved_pkgpart = 0; +% $username = ''; +% $password = ''; +% $popnum = 0; +% @invoicing_list = (); +%} +%$cgi->delete_all(); +% +%my $action = $custnum ? 'Edit' : 'Add'; +%$action .= ": ". $cust_main->name if $custnum; +% +%my $r = qq!* !; +% +% -my $r = qq!* !; - -%> -<%= include('/elements/header.html', +<% include('/elements/header.html', "Customer $action", '', ' onUnload="myclose()"' ) %> +% if ( $error ) { + +Error: <% $error %>

+% } -<% if ( $error ) { %> -Error: <%= $error %>

-<% } %> - -<% if ( $custnum ) { %> - Customer #<%= $custnum %> - - - <%= ucfirst($cust_main->status) %> + +% if ( $custnum ) { + + Customer #<% $custnum %> - + + <% ucfirst($cust_main->status) %>

-<% } %> +% } + -<%= &ntable("#cccccc") %> +<% &ntable("#cccccc") %> -<%= include('/elements/tr-select-agent.html', $cust_main->agentnum, +<% include('/elements/tr-select-agent.html', $cust_main->agentnum, 'label' => "${r}Agent", 'empty_label' => 'Select agent', ) %> +% +%my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; +%if ( $custnum && ! $conf->exists('editreferrals') ) { +% -<% -my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0; -if ( $custnum && ! $conf->exists('editreferrals') ) { -%> - + +% } else { -<% } else { %> - <%= include('/elements/tr-select-part_referral.html') %> + <% include('/elements/tr-select-part_referral.html') %> +% } -<% } %> +% +%my $referring_cust_main = ''; +%if ( $cust_main->referral_custnum +% and $referring_cust_main = +% qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) +%) { +% -<% -my $referring_cust_main = ''; -if ( $cust_main->referral_custnum - and $referring_cust_main = - qsearchs('cust_main', { custnum => $cust_main->referral_custnum } ) -) { -%> Referring customer - <%= $cust_main->referral_custnum %>: <%= $referring_cust_main->name %> + <% $cust_main->referral_custnum %>: <% $referring_cust_main->name %> - + +% } elsif ( ! $conf->exists('disable_customer_referrals') ) { -<% } elsif ( ! $conf->exists('disable_customer_referrals') ) { %> Referring customer - <%= include('/elements/search-cust_main.html', + <% include('/elements/search-cust_main.html', 'field_name' => 'referral_custnum', ) %> +% } else { -<% } else { %> +% } -<% } %> @@ -162,18 +166,20 @@ if ( $cust_main->referral_custnum

Billing address -<%= include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %> +<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %> +% if ( defined $cust_main->dbdef_table->column('ship_last') ) { -<% if ( defined $cust_main->dbdef_table->column('ship_last') ) { %> +% +% my $checked = ''; +% my $disabled = ''; +% my $disabledselect = ''; +% unless ( $cust_main->ship_last && $same ne 'Y' ) { +% $checked = 'CHECKED'; +% $disabled = 'DISABLED style="background-color: #dddddd"'; +% foreach ( +% qw( last first company address1 address2 city county state zip country +% daytime night fax ) +% ) { +% $cust_main->set("ship_$_", $cust_main->get($_) ); +% } +% } +% -<% - my $checked = ''; - my $disabled = ''; - my $disabledselect = ''; - unless ( $cust_main->ship_last && $same ne 'Y' ) { - $checked = 'CHECKED'; - $disabled = 'DISABLED style="background-color: #dddddd"'; - foreach ( - qw( last first company address1 address2 city county state zip country - daytime night fax ) - ) { - $cust_main->set("ship_$_", $cust_main->get($_) ); - } - } -%>
Service address -(>same as billing address) -<%= include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %> +(>same as billing address) +<% include('cust_main/contact.html', $cust_main, 'ship_', '', $disabled ) %> +% } -<% } %> -<%= include( 'cust_main/billing.html', $cust_main, +<% include( 'cust_main/billing.html', $cust_main, 'invoicing_list' => \@invoicing_list, ) %> @@ -317,136 +327,136 @@ function copyelement(from, to) { - - -<% foreach my $hidden ( - 'custnum', 'agentnum', 'refnum', 'referral_custnum', - 'last', 'first', 'ss', 'company', - 'address1', 'address2', 'city', - 'county', 'state', 'zip', 'country', - 'daytime', 'night', 'fax', - - 'same', - - 'ship_last', 'ship_first', 'ship_company', - 'ship_address1', 'ship_address2', 'ship_city', - 'ship_county', 'ship_state', 'ship_zip', 'ship_country', - 'ship_daytime','ship_night', 'ship_fax', - - 'select', #XXX key - - 'payauto', - 'payinfo', 'payinfo1', 'payinfo2', - 'payname', 'exp_month', 'exp_year', 'paycvv', - 'paystart_month', 'paystart_year', 'payissue', - 'payip', - 'paid', - - 'tax', - 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX', - 'spool_cdr' - ) { -%> - -<% } %> + +% foreach my $hidden ( +% 'custnum', 'agentnum', 'refnum', 'referral_custnum', +% 'last', 'first', 'ss', 'company', +% 'address1', 'address2', 'city', +% 'county', 'state', 'zip', 'country', +% 'daytime', 'night', 'fax', +% +% 'same', +% +% 'ship_last', 'ship_first', 'ship_company', +% 'ship_address1', 'ship_address2', 'ship_city', +% 'ship_county', 'ship_state', 'ship_zip', 'ship_country', +% 'ship_daytime','ship_night', 'ship_fax', +% +% 'select', #XXX key +% +% 'payauto', +% 'payinfo', 'payinfo1', 'payinfo2', +% 'payname', 'exp_month', 'exp_year', 'paycvv', +% 'paystart_month', 'paystart_year', 'payissue', +% 'payip', +% 'paid', +% +% 'tax', +% 'invoicing_list', 'invoicing_list_POST', 'invoicing_list_FAX', +% 'spool_cdr' +% ) { +% + + +% } +
Comments -<%= &ntable("#cccccc") %> +<% &ntable("#cccccc") %> - + +% +% +%unless ( $custnum ) { +% # pry the wrong place for this logic. also pretty expensive +% #use FS::part_pkg; +% +% #false laziness, copied from FS::cust_pkg::order +% my $pkgpart; +% my @agents = $FS::CurrentUser::CurrentUser->agents; +% if ( scalar(@agents) == 1 ) { +% # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART +% $pkgpart = $agents[0]->pkgpart_hashref; +% } else { +% #can't know (agent not chosen), so, allow all +% my %typenum; +% foreach my $agent ( @agents ) { +% next if $typenum{$agent->typenum}++; +% #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref } +% foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround +% } +% } +% #eslaf +% +% my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } +% qsearch( 'part_pkg', { 'disabled' => '' } ); +% +% if ( @part_pkg ) { +% +% # print "

First package", &itable("#cccccc", "0 ALIGN=LEFT"), +% #apiabuse & undesirable wrapping +% +% -<% - -unless ( $custnum ) { - # pry the wrong place for this logic. also pretty expensive - #use FS::part_pkg; - - #false laziness, copied from FS::cust_pkg::order - my $pkgpart; - my @agents = $FS::CurrentUser::CurrentUser->agents; - if ( scalar(@agents) == 1 ) { - # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART - $pkgpart = $agents[0]->pkgpart_hashref; - } else { - #can't know (agent not chosen), so, allow all - my %typenum; - foreach my $agent ( @agents ) { - next if $typenum{$agent->typenum}++; - #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref } - foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround - } - } - #eslaf - - my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } } - qsearch( 'part_pkg', { 'disabled' => '' } ); - - if ( @part_pkg ) { - - # print "

First package", &itable("#cccccc", "0 ALIGN=LEFT"), - #apiabuse & undesirable wrapping - - %>
First package - <%= ntable("#cccccc") %> + <% ntable("#cccccc") %> - - <% - #false laziness: (mostly) copied from edit/svc_acct.cgi - #$ulen = $svc_acct->dbdef_table->column('username')->length; - my $ulen = dbdef->table('svc_acct')->column('username')->length; - my $ulen2 = $ulen+2; - my $passwordmax = $conf->config('passwordmax') || 8; - my $pmax2 = $passwordmax + 2; - %> +% +% #false laziness: (mostly) copied from edit/svc_acct.cgi +% #$ulen = $svc_acct->dbdef_table->column('username')->length; +% my $ulen = dbdef->table('svc_acct')->column('username')->length; +% my $ulen2 = $ulen+2; +% my $passwordmax = $conf->config('passwordmax') || 8; +% my $pmax2 = $passwordmax + 2; +% + Username - MAXLENGTH=<%= $ulen %>> + MAXLENGTH=<% $ulen %>> Password - MAXLENGTH=<%= $passwordmax %>> + MAXLENGTH=<% $passwordmax %>> (blank to generate) Access number - <%= FS::svc_acct_pop::popselector($popnum) %> + <% FS::svc_acct_pop::popselector($popnum) %> - - <% } %> +% } +% } -<% } %> - +
-"> +">
-<%= include('/elements/footer.html') %> +<% include('/elements/footer.html') %> diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 790f41f00..78a2002a4 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -1,70 +1,71 @@ -<% - -my( $cust_main, %options ) = @_; -my @invoicing_list = @{ $options{'invoicing_list'} }; -my $conf = new FS::Conf; -my $payby_default = $conf->config('payby-default'); - -my @payby = grep /\w/, $conf->config('payby'); -#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; - -if ( $payby_default eq 'HIDE' ) { - - $cust_main->payby('BILL') unless $cust_main->payby; - -%> - - +% +% +%my( $cust_main, %options ) = @_; +%my @invoicing_list = @{ $options{'invoicing_list'} }; +%my $conf = new FS::Conf; +%my $payby_default = $conf->config('payby-default'); +% +%my @payby = grep /\w/, $conf->config('payby'); +%#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +%@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) +% unless @payby; +% +%if ( $payby_default eq 'HIDE' ) { +% +% $cust_main->payby('BILL') unless $cust_main->payby; +% +% + + + -
<% # XXX key %> - - <% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { %> + +% # XXX key +% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { - - <% } %> + +% } +% +% #false laziness w/elements/select-month_year.html & view/cust_main/billing.html +% my( $mon, $year ); +% my $date = $cust_main->paydate || '12-2037'; +% if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format +% ( $mon, $year ) = ( $2, $1 ); +% } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { +% ( $mon, $year ) = ( $1, $3 ); +% } else { +% die "unrecognized expiration date format: $date"; +% } +% - <% - #false laziness w/elements/select-month_year.html & view/cust_main/billing.html - my( $mon, $year ); - my $date = $cust_main->paydate || '12-2037'; - if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format - ( $mon, $year ) = ( $2, $1 ); - } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { - ( $mon, $year ) = ( $1, $3 ); - } else { - die "unrecognized expiration date format: $date"; - } - %> - - + +
- + - +
+% } else { +% +% my $r = qq!* !; +% +% -<% } else { - - my $r = qq!* !; - -%>
Billing information - <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %> - <%=$r%>Billing type + <%$r%>Billing type - - <% - - my($payby, $payinfo, $payname)=( - $cust_main->payby, - $cust_main->payinfo, - $cust_main->payname, - ); - my( $account, $aba ) = split('@', $payinfo); - - my $disabled = 'DISABLED style="background-color: #dddddd"'; - my $text_disabled = 'style="color: #999999"'; - if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { - $disabled = 'style="background-color: #ffffff"'; - $text_disabled = 'style="color: #000000";' - } - - my %payby = ( - - 'CARD' => - - ''. - - qq!!. - qq!!. - - qq!!. - ''. - - qq!!. - '!. - '!. - - qq!!. - qq!!. - - qq!'. - - '
${r}Card number
${r}Expiration '. - - include('/elements/select-month_year.html', - 'prefix' => 'exp', - 'selected_date' => - ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), - ). - - '
CVV2 !. - - qq!(help)!. - qq!'. - - - qq!
Start date '. - - include('/elements/select-month_year.html', - 'prefix' => 'paystart', - 'disabled' => $disabled, - 'empty_option' => 1, - 'start_year' => 2000, - 'end_year' => (localtime())[5] + 1900, - 'selected_date' => ( - ( $payby =~ /^(CARD|DCRD)$/ - && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) - ? $cust_main->paystart_month. '-'. - $cust_main->paystart_year - : '' - ) - ). - - qq! or Issue number !. - '
${r}Exact name on card
Charge future payments to this card automatically
', - - 'CHEK' => - - ''. - - qq!!. - qq!'. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!'. - - ''. - ''. - ''. - - '
${r}Account number
${r}ABA/Routing number !. - qq!(help)!. - qq!
${r}Bank name
Charge future payments to this electronic check automatically
 
 
 
', - - 'LECB' => - - ''. - - qq!!. - qq!!. - - qq!!. - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Phone number
 
 
 
 
 
 
', - - 'BILL' => - - ''. - - qq!!. - qq!!. - - qq!!. - qq!!. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - - '
P.O.
Attention
 
 
 
 
 
', - - 'COMP' => - - ''. - - qq!!. - qq!!. - - qq!!. - ''. - - ''. - ''. - ''. - ''. - ''. - - '
${r}Approved by
${r}Expiration '. - - include('/elements/select-month_year.html', - 'prefix' => 'exp', - 'selected_date' => - ( $payby eq 'COMP' ? $cust_main->paydate : '' ), - ). - - '
 
 
 
 
 
', - - 'CASH' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'WEST' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'MCRD' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - ); - - #this should use FS::payby - my %allopt = ( - 'CARD' => 'Credit card', - 'CHEK' => 'Electronic check', - 'LECB' => 'Phone bill billing', - 'BILL' => 'Billing', - 'CASH' => 'Cash', # initial payment, then billing', - 'WEST' => 'Western Union', # initial payment, then billing', - 'MCRD' => 'Manual credit card', # initial payment, then billing', - 'COMP' => 'Complimentary', - ); - if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types - # when editing customer - delete $allopt{$_} for qw(CASH WEST MCRD); - } - - tie my %options, 'Tie::IxHash', - map { $_ => $allopt{$_} } - grep { exists $allopt{$_} } - @payby; - - my %payby2option = ( - ( map { $_ => $_ } keys %options ), - 'DCRD' => 'CARD', - 'DCHK' => 'CHEK', - ); - - my $widget = new HTML::Widgets::SelectLayers( - 'options' => \%options, - #'form_name' => 'dummy', - #'form_action' => 'nothingyet', - #chops bottom of page in IE# 'under_position' => 'absolute', - 'html_between' => '', - 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, - 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, - ); - - %> - - <%= $widget->html %> +% +% +% my($payby, $payinfo, $payname)=( +% $cust_main->payby, +% $cust_main->payinfo, +% $cust_main->payname, +% ); +% my( $account, $aba ) = split('@', $payinfo); +% +% my $disabled = 'DISABLED style="background-color: #dddddd"'; +% my $text_disabled = 'style="color: #999999"'; +% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { +% $disabled = 'style="background-color: #ffffff"'; +% $text_disabled = 'style="color: #000000";' +% } +% +% my %payby = ( +% +% 'CARD' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% ''. +% +% qq!!. +% '!. +% '!. +% +% qq!!. +% qq!!. +% +% qq!'. +% +% '
${r}Card number
${r}Expiration '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'exp', +% 'selected_date' => +% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), +% ). +% +% '
CVV2 !. +% +% qq!(help)!. +% qq!'. +% +% +% qq!
Start date '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'paystart', +% 'disabled' => $disabled, +% 'empty_option' => 1, +% 'start_year' => 2000, +% 'end_year' => (localtime())[5] + 1900, +% 'selected_date' => ( +% ( $payby =~ /^(CARD|DCRD)$/ +% && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) +% ? $cust_main->paystart_month. '-'. +% $cust_main->paystart_year +% : '' +% ) +% ). +% +% qq! or Issue number !. +% '
${r}Exact name on card
Charge future payments to this card automatically
', +% +% 'CHEK' => +% +% ''. +% +% qq!!. +% qq!'. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!'. +% +% ''. +% ''. +% ''. +% +% '
${r}Account number
${r}ABA/Routing number !. +% qq!(help)!. +% qq!
${r}Bank name
Charge future payments to this electronic check automatically
 
 
 
', +% +% 'LECB' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Phone number
 
 
 
 
 
 
', +% +% 'BILL' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
P.O.
Attention
 
 
 
 
 
', +% +% 'COMP' => +% +% ''. +% +% qq!!. +% qq!!. +% +% qq!!. +% ''. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Approved by
${r}Expiration '. +% +% include('/elements/select-month_year.html', +% 'prefix' => 'exp', +% 'selected_date' => +% ( $payby eq 'COMP' ? $cust_main->paydate : '' ), +% ). +% +% '
 
 
 
 
 
', +% +% 'CASH' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'WEST' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'MCRD' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% ); +% +% #this should use FS::payby +% my %allopt = ( +% 'CARD' => 'Credit card', +% 'CHEK' => 'Electronic check', +% 'LECB' => 'Phone bill billing', +% 'BILL' => 'Billing', +% 'CASH' => 'Cash', # initial payment, then billing', +% 'WEST' => 'Western Union', # initial payment, then billing', +% 'MCRD' => 'Manual credit card', # initial payment, then billing', +% 'COMP' => 'Complimentary', +% ); +% if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types +% # when editing customer +% delete $allopt{$_} for qw(CASH WEST MCRD); +% } +% +% tie my %options, 'Tie::IxHash', +% map { $_ => $allopt{$_} } +% grep { exists $allopt{$_} } +% @payby; +% +% my %payby2option = ( +% ( map { $_ => $_ } keys %options ), +% 'DCRD' => 'CARD', +% 'DCHK' => 'CHEK', +% ); +% +% my $widget = new HTML::Widgets::SelectLayers( +% 'options' => \%options, +% #'form_name' => 'dummy', +% #'form_action' => 'nothingyet', +% #chops bottom of page in IE# 'under_position' => 'absolute', +% 'html_between' => '', +% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, +% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, +% ); +% +% + + + <% $widget->html %>
- <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %>   - tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt + tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt - exists('disablepostalinvoicedefault') @@ -417,7 +418,7 @@ if ( $payby_default eq 'HIDE' ) { - Email invoice - + +% if ( $conf->exists('voip-cust_cdr_spools') ) { - <% if ( $conf->exists('voip-cust_cdr_spools') ) { %> - spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs + spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs - <% } else { %> - - <% } %> +% } else { + + +% } +
- <%= $r %> required fields + <% $r %> required fields +% } -<% } %> diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index 6e4f08957..a001634a2 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -1,125 +1,128 @@ -<% - -my( $cust_main, $pre, $onchange, $disabled ) = @_; -my $conf = new FS::Conf; - -#false laziness with ship state -my $countrydefault = $conf->config('countrydefault') || 'US'; -$cust_main->set($pre.'country', $countrydefault ) - unless $cust_main->get($pre.'country'); - -my $statedefault = $conf->config('statedefault') - || ($countrydefault eq 'US' ? 'CA' : ''); -$cust_main->set($pre.'state', $statedefault ) - unless $cust_main->get($pre.'state') - || $cust_main->get($pre.'country') ne $countrydefault; - -#my($county_html, $state_html, $country_html) = -# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), -# $cust_main->get($pre.'state'), -# $cust_main->get($pre.'country'), -# $pre, -# $onchange, -# $disabled, -# ); - -my %select_hash = ( - 'county' => $cust_main->get($pre.'county'), - 'state' => $cust_main->get($pre.'state'), - 'country' => $cust_main->get($pre.'country'), - 'prefix' => $pre, - 'onchange' => $onchange, - 'disabled' => $disabled, -); - -my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; -my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; - -my $r = qq!* !; - -%> - -<%= &ntable("#cccccc") %> +% +% +%my( $cust_main, $pre, $onchange, $disabled ) = @_; +%my $conf = new FS::Conf; +% +%#false laziness with ship state +%my $countrydefault = $conf->config('countrydefault') || 'US'; +%$cust_main->set($pre.'country', $countrydefault ) +% unless $cust_main->get($pre.'country'); +% +%my $statedefault = $conf->config('statedefault') +% || ($countrydefault eq 'US' ? 'CA' : ''); +%$cust_main->set($pre.'state', $statedefault ) +% unless $cust_main->get($pre.'state') +% || $cust_main->get($pre.'country') ne $countrydefault; +% +%#my($county_html, $state_html, $country_html) = +%# FS::cust_main_county::regionselector( $cust_main->get($pre.'county'), +%# $cust_main->get($pre.'state'), +%# $cust_main->get($pre.'country'), +%# $pre, +%# $onchange, +%# $disabled, +%# ); +% +%my %select_hash = ( +% 'county' => $cust_main->get($pre.'county'), +% 'state' => $cust_main->get($pre.'state'), +% 'country' => $cust_main->get($pre.'country'), +% 'prefix' => $pre, +% 'onchange' => $onchange, +% 'disabled' => $disabled, +%); +% +%my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone'; +%my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone'; +% +%my $r = qq!* !; +% +% + + +<% &ntable("#cccccc") %> - <%=$r%>Contact name
(last, first) + <%$r%>Contact name
(last, first) - > , - > + > , + > +% if ( $conf->exists('show_ss') && !$pre ) { -<% if ( $conf->exists('show_ss') && !$pre ) { %> SS# - -<% } elsif ( !$pre ) { %> - -<% } %> + +% } elsif ( !$pre ) { + + +% } + Company - > + > - <%=$r%>Address + <%$r%>Address - > + >   - > + > - <%=$r%>City + <%$r%>City - > + > - <%=$r%>State + <%$r%>State - <%= include('select-county.html', %select_hash ) %> - <%= include('select-state.html', %select_hash ) %> + <% include('select-county.html', %select_hash ) %> + <% include('select-state.html', %select_hash ) %> - <%=$r%>Zip + <%$r%>Zip - > + > - <%=$r%>Country - <%= include('select-country.html', %select_hash ) %> + <%$r%>Country + <% include('select-country.html', %select_hash ) %> - <%= $daytime_label %> + <% $daytime_label %> - > + > - <%= $night_label %> + <% $night_label %> - > + > Fax - > + > -<%=$r%>required fields
+<%$r%>required fields
diff --git a/httemplate/edit/cust_main/select-country.html b/httemplate/edit/cust_main/select-country.html index 3941f2f93..5467f26e9 100644 --- a/httemplate/edit/cust_main/select-country.html +++ b/httemplate/edit/cust_main/select-country.html @@ -1,16 +1,17 @@ -<% - - my %opt = @_; - foreach my $opt (qw( county state country prefix onchange disabled )) { - $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); - } - - my $conf = new FS::Conf; - my $countrydefault = $conf->config('countrydefault') || 'US'; - -%> - -<%= include('/elements/xmlhttp.html', +% +% +% my %opt = @_; +% foreach my $opt (qw( county state country prefix onchange disabled )) { +% $opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_}); +% } +% +% my $conf = new FS::Conf; +% my $countrydefault = $conf->config('countrydefault') || 'US'; +% +% + + +<% include('/elements/xmlhttp.html', 'url' => $p.'misc/states.cgi', 'subs' => [ $opt{'prefix'}. 'get_states' ], ) @@ -24,15 +25,15 @@ what.options[length] = optionName; } - function <%= $opt{'prefix'} %>country_changed(what, callback) { + function <% $opt{'prefix'} %>country_changed(what, callback) { country = what.options[what.selectedIndex].value; - function <%= $opt{'prefix'} %>update_states(states) { + function <% $opt{'prefix'} %>update_states(states) { // blank the current state list - for ( var i = what.form.<%= $opt{'prefix'} %>state.length; i >= 0; i-- ) - what.form.<%= $opt{'prefix'} %>state.options[i] = null; + for ( var i = what.form.<% $opt{'prefix'} %>state.length; i >= 0; i-- ) + what.form.<% $opt{'prefix'} %>state.options[i] = null; // add the new states var statesArray = eval('(' + states + ')' ); @@ -40,7 +41,7 @@ var stateLabel = statesArray[s+1]; if ( stateLabel == "" ) stateLabel = '(n/a)'; - opt(what.form.<%= $opt{'prefix'} %>state, statesArray[s], stateLabel); + opt(what.form.<% $opt{'prefix'} %>state, statesArray[s], stateLabel); } //run the callback @@ -49,25 +50,25 @@ } // go get the new states - <%= $opt{'prefix'} %>get_states( country, <%= $opt{'prefix'} %>update_states ); + <% $opt{'prefix'} %>get_states( country, <% $opt{'prefix'} %>update_states ); } -> +% foreach my $country ( +% sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) +% or code2country($a) cmp code2country($b) } +% map { $_->country } +% qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', ) +% ) { +% -<% foreach my $country ( - sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) - or code2country($a) cmp code2country($b) } - map { $_->country } - qsearch( 'cust_main_county',{}, 'DISTINCT ON ( country ) *', ) - ) { -%> -