Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / edit / msg_template.html
index fa375a0..df72c5b 100644 (file)
@@ -27,6 +27,7 @@
      'no_submit'        => $no_submit,
 &>
 <%init>
+use FS::template_image;
 
 my $curuser = $FS::CurrentUser::CurrentUser;
 
@@ -67,7 +68,8 @@ if ( $curuser->access_right('Edit global templates')
       { field => 'subject',   size=>60, },
       { field => 'body',
         type  => 'htmlarea',
-        width => 763
+        width => 763,
+        config=> { extraPlugins => 'blockprotect' },
       },
   ;
 } else { #readonly
@@ -202,12 +204,13 @@ my %substitutions = (
     '$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',
+    #'$cust_status'    => 'Status (raw internal label)',
+    '$cust_status_label' => 'Status (display label)',
+    '$cust_statuscolor'  => 'Status color code',
     '$company_name'   => 'Our company name',
     '$company_address'=> 'Our company address',
     '$company_phonenum' => 'Our phone number',
+    '$selfservice_server_base_url' => 'Base URL of customer self-service',
   ],
   'contact' => [ # duplicate this for shipping
     '$name'           => 'Company and contact name',
@@ -240,6 +243,9 @@ my %substitutions = (
   ],
   'cust_bill' => [
     '$invnum'         => 'Invoice#',
+    '$_date_pretty'   => 'Invoice date',
+    '$due_date'       => 'Invoice due date (timestamp)',
+    '$due_date2str'   => 'Invoice due date (human readable)',
   ],
   'cust_pkg' => [
     '$pkgnum'         => 'Package#',
@@ -340,10 +346,16 @@ function areyousure(url, message) {
 <TD valign="top"><FORM name="dummy">
 Substitutions: '
 . $widget->html .
-'<BR>Click links to insert.
-<BR>Enclose substitutions and other Perl expressions in braces:
+'<P>Click above links to insert substitution code.</P>
+<P>
+Enclose substitutions and other Perl expressions in braces:
 <BR>{ $name } = ExampleCo (Smith, John)
 <BR>{ time2str("%D", time) } = '.time2str("%D", time).'
+</P>';
+$sidebar .= include('/elements/template_image-dialog.html',
+              'callback' => 'insertHtml'
+            );
+$sidebar .= '<P><A HREF="javascript:insertImageDialog()">Insert Uploaded Image</A></P>
 </FONT></TD>
 ';