Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / templates / webpages / letter / load_drafts.html
index 78c04cd..088defa 100644 (file)
@@ -1,12 +1,11 @@
 [%- USE T8 %]
-[%- USE HTML %]
+[%- USE HTML %][%- USE L -%]
 <h1>[% 'Load letter draft' | $T8 %]</h1>
 
- <form method="post" name="Form" action="letter.pl">
+ <form method="post" name="Form" action="controller.pl" id="form">
+  [% L.hidden_tag('is_sales', SELF.is_sales) %]
+  <p>[% 'The following drafts have been saved and can be loaded.' | $T8 %]</p>
   <table width="100%">
-   <tr>
-    <td>
-     [% 'The following drafts have been saved and can be loaded.' | $T8 %]
     </td>
    </tr>
    <tr>
        <th class="listheading">&nbsp;</th>
        <th class="listheading">[% 'Date' | $T8 %]</th>
        <th class="listheading">[% 'Subject' | $T8 %]</th>
+[%- IF SELF.is_sales %]
        <th class="listheading">[% 'Customer' | $T8 %]</th>
+[%- ELSE %]
+       <th class="listheading">[% 'Vendor' | $T8 %]</th>
+[%- END %]
       </tr>
 
       [% FOREACH row = LETTER_DRAFTS %]
        <tr class="listrow[% loop.count % 2 %]">
-        <td><input type="checkbox" name="checked_[% row.id %]" value="1"></td>
-        <td>[% HTML.escape(row.date) %]</td>
-        <td><a href="letter.pl?action=edit&callback=letter.pl&draft=1&id=[% HTML.url(row.id) %]">[% HTML.escape(row.subject) %]</a></td>
-        <td>[% HTML.escape(row.customer) %]</td>
+        <td>[% L.checkbox_tag("ids[+]", value=row.id) %]</td>
+        <td>[% row.date.to_kivitendo | html %]</td>
+        <td><a href="[% SELF.url_for(action='edit', 'draft.id'=row.id) %]">[% row.subject | html %]</a></td>
+[%- IF SELF.is_sales %]
+        <td>[% row.customer.displayable_name | html %]</td>
+[%- ELSE %]
+        <td>[% row.vendor.displayable_name | html %]</td>
+[%- END %]
        </tr>
       [% END %]
      </table>
     </td>
    </tr>
-   <tr>
-     <input type="hidden" name="action" value="dispatcher">
-     <input type="hidden" name="draft" value="1"><!-- maybe not needed -->
-     <input type="submit" class="submit" name="letter_draft_action" value="[% 'Skip' | $T8 %]">
-     <input type="submit" class="submit" name="letter_draft_action" value="[% 'Delete drafts' | $T8 %]">
-   </td>
-   </tr>
   </table>
  </form>