doh. ivan is so in the doghouse for this one
[freeside.git] / httemplate / elements / tr-select-reason.html
index 04a5c45..4051e7d 100755 (executable)
@@ -86,7 +86,7 @@
   <TD ALIGN="right">
     <P id="new<% $id %>Label" style="display:<% $display %>">New Reason</P>
   </TD>
-  <TD><INPUT id="new<% $id %>" name="new<% $name %>" type="text" value="<% $init_newreason %>" "<% $disabled %>" style="display:<% $display %>"></TD>
+  <TD><INPUT id="new<% $id %>" name="new<% $name %>" type="text" value="<% $init_newreason |h %>" "<% $disabled %>" style="display:<% $display %>"></TD>
 </TR>
 
 <%init>
@@ -110,7 +110,7 @@ if ($class eq 'C') {
 } elsif ($class eq 'S') {
   $access_right = 'Suspend customer package';
   $add_access_right = 'Add on-the-fly suspend reason';
-} elsif ($class eq 'S') {
+} elsif ($class eq 'R') {
   $access_right = 'Post credit';
   $add_access_right = 'Add on-the-fly credit reason';
 } else {
@@ -141,7 +141,7 @@ my @reasons = qsearch({
   extra_sql => $extra_sql,
   addl_from => 'LEFT JOIN reason_type '.
                ' ON reason_type.typenum = reason.reason_type',
-  order_by  => 'reason_type.type ASC, reason.reason ASC',
+  order_by  => 'ORDER BY reason_type.type ASC, reason.reason ASC',
 });
 
 my $curuser = $FS::CurrentUser::CurrentUser;