-<TR>
- <TD ALIGN="right"><% mt('Date') |h %></TD>
- <TD COLSPAN=2>
- <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str($date_format.' %r',$_date) %>">
- <IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="<% mt('Select date') |h %>">
- </TD>
-</TR>
+% my %date_args = (
+% 'name' => '_date',
+% 'label' => emt('Date'),
+% 'value' => $_date,
+% 'format' => $date_format. ' %r',
+% 'colspan' => 2,
+% );
+% if ( $FS::CurrentUser::CurrentUser->access_right('Backdate payment') ) {
+
+ <& /elements/tr-input-date-field.html, \%date_args &>
+
+% } else {