X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fmsg_template.html;h=8e859e6e65672f29f09fc50c6d07176c670a8b29;hb=d6741df87df9e3352d7ae47a02d0e3f46154fef9;hp=986629cd75a7d33072ddb759edc37ee20f39fb3e;hpb=f07729b883f93aab6eaf4dffaa9b725e36c6852a;p=freeside.git diff --git a/httemplate/edit/msg_template.html b/httemplate/edit/msg_template.html index 986629cd7..8e859e6e6 100644 --- a/httemplate/edit/msg_template.html +++ b/httemplate/edit/msg_template.html @@ -1,16 +1,26 @@ <% include( 'elements/edit.html', + 'html_init' => '$sidebar
', 'name_singular' => 'template', 'table' => 'msg_template', 'viewall_dir' => 'browse', + 'agent_virt' => 1, + 'agent_null' => 1, + 'agent_null_right' => ['Edit global templates', 'Configuration'], + 'fields' => [ 'msgname', - 'subject', + { field=>'from_addr', size=>60, }, + { field=>'bcc_addr', size=>60, }, + { field=>'subject', size=>80, }, { field=>'body', type=>'htmlarea', width=>763 }, ], - 'labels' => { 'msgnum' => 'Template', - 'msgname' => 'Template name', - 'subject' => 'Message subject', - 'body' => 'Message template', + 'labels' => { 'msgnum' => 'Template', + 'msgname' => 'Template name', + 'from_addr' => 'From: ', + 'bcc_addr' => 'Bcc: ', + 'subject' => 'Subject: ', + 'body' => 'Message template', }, + 'html_foot' => "
", ) %> <%init> @@ -20,4 +30,158 @@ die "access denied" || $FS::CurrentUser::CurrentUser->access_right('Edit global templates') || $FS::CurrentUser::CurrentUser->access_right('Configuration'); +# Create hints pane + +my %substitutions = ( + 'cust_main' => [ + '$display_custnum'=> 'Customer#', + '$agentnum' => 'Agent#', + '$agent_name' => 'Agent name', + '$payby' => 'Payment method', + '$paymask' => 'Card/account# (masked)', + '$payname' => 'Name on card/bank name', + '$paytype' => 'Account type', + '$payip' => 'IP address used to submit payment info', + '$num_ncancelled_pkgs' => '# of active packages', + '$num_cancelled_pkgs' => '# of cancelled packages', + '$num_pkgs' => '# of packages', + '$classname' => 'Customer class', + '$categoryname' => 'Customer category', + '$balance' => 'Current balance', + '$credit_limit' => 'Credit limit', + '$invoicing_list_emailonly' => 'Billing email address', + '$cust_status' => 'Status', + '$ucfirst_cust_status' => 'Status, capitalized', + '$cust_statuscolor' => 'Status color code', + '$company_name' => 'Our company name', + '$company_address'=> 'Our company address', + ], + 'contact' => [ # duplicate this for shipping + '$name' => 'Company and contact name', + '$name_short' => 'Company or contact name', + '$company' => 'Company name', + '$contact' => 'Contact name (last, first)', + '$contact_firstlast'=> 'Contact name (first last)', + '$first' => 'First name', + '$last' => 'Last name', + '$address1' => 'Address line 1', + '$address2' => 'Address line 2', + '$city' => 'City', + '$county' => 'County', + '$state' => 'State', + '$zip' => 'Zip', + '$country' => 'Country', + '$daytime' => 'Day phone', + '$night' => 'Night phone', + '$fax' => 'Fax', + ], + 'cust_bill' => [ + '$invnum' => 'Invoice#', + ], + 'cust_pkg' => [ + '$pkgnum' => 'Package#', + '$pkg' => 'Package description', + '$pkg_label' => 'Description + comment', + '$status' => 'Status', + '$statuscolor' => 'Status color code', + '$start_ymd' => 'Start date', + '$setup_ymd' => 'Setup date', + '$last_bill_ymd' => 'Last bill date', + '$next_bill_ymd' => 'Next bill date', + '$susp_ymd' => 'Suspended on date', + '$cancel_ymd' => 'Canceled on date', + '$adjourn_ymd' => 'Adjournment date', + '$expire_ymd' => 'Expiration date', + '$labels_short' => 'Service labels', + '$location_label' => 'Service location', + ], + 'svc_acct' => [ + '$svcnum' => 'Service#', + '$username' => 'Login name', + '$password' => 'Password', + '$domain' => 'Domain name', + ], + 'svc_domain' => [ + '$svcnum' => 'Service#', + '$domain' => 'Domain name', + '$registrar' => 'Registrar name', + '$catchall' => 'Catchall email', + ], + 'svc_phone' => [ + '$svcnum' => 'Service#', + '$phonenum' => 'Phone number', + '$countrycode' => 'Country code', + '$domain' => 'Domain name' + ], + 'svc_broadband' => [ + '$svcnum' => 'Service#', + '$ip_addr' => 'IP address', + '$mac_addr' => 'MAC address', + '$speed_up' => 'Upstream speed', + '$speed_down' => 'Downstream speed', + ], + 'cust_pay' => [ + '$paynum' => 'Payment#', + '$paid' => 'Amount', + '$payby' => 'Payment method', + '$date' => 'Payment date', + '$payinfo' => 'Card/account# (masked)', + '$error' => 'Decline reason', + ], +); +my @c = @{ $substitutions{'contact'} }; +for (my $i=0; $i 'Name and contact info (billing)', +'shipping' => 'Name and contact info (shipping)', +'cust_main' => 'Customer status and payment info', +'cust_pkg' => 'Package fields', +'cust_bill' => 'Invoice fields', +'cust_pay' => 'Payment fields', +'svc_acct' => 'Login service fields', +'svc_domain'=> 'Domain service fields', +'svc_phone' => 'Phone service fields', +'svc_broadband' => 'Broadband service fields', +); + +my $widget = new HTML::Widgets::SelectLayers( + 'options' => \%sections, + 'form_name' => 'dummy', + 'html_between'=>'', + 'selected_layer'=>(keys(%sections))[0], + 'layer_callback' => sub { + my $section = shift; + my $html = include('/elements/table-grid.html'); + my @hints = @{ $substitutions{$section} }; + while(@hints) { + my $key = shift @hints; + $html .= qq!\n$key!; + $html .= "\n".shift(@hints).''; + } + $html .= "\n"; + return $html; + }, +); + +my $sidebar = ' + +
+Substitutions: ' +. $widget->html . +'
Click links to insert. +
Enclose substitutions and other Perl expressions in braces: +
{ $name } = ExampleCo (Smith, John) +
{ time2str("%D", time) } = '.time2str("%D", time).' +
+'; +