Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 30b8dc10

Von Moritz Bunkus vor fast 3 Jahren hinzugefügt

  • ID 30b8dc1025aad59401d2648d0a39776bcb084c85
  • Vorgänger 63f70f53
  • Nachfolger d32410ac

Order-Controller: Unterstützung für Drucken & E-Mailen von HTML-Vorlagen

Unterschiede anzeigen:

js/kivi.Order.js
96 96

  
97 97
    $('#print_options_form table').first().remove().appendTo('#email_form_print_options');
98 98

  
99
    $('select#format').change(kivi.Order.adjust_email_attachment_name_for_template_format);
100
    kivi.Order.adjust_email_attachment_name_for_template_format();
101

  
99 102
    var to_focus = $('#email_form_to').val() === '' ? 'to' : 'subject';
100 103
    $('#email_form_' + to_focus).focus();
101 104
  };
......
155 158
    email_dialog.dialog("close");
156 159
  };
157 160

  
161
  ns.adjust_email_attachment_name_for_template_format = function() {
162
    var $filename_elt = $('#email_form_attachment_filename');
163
    var $format_elt   = $('select#format');
164

  
165
    if (!$filename_elt || !$format_elt)
166
      return;
167

  
168
    var format   = $format_elt.val().toLowerCase();
169
    var new_ext  = format == 'html' ? 'html' : format == 'opendocument' ? 'odt' : 'pdf';
170
    var filename = $filename_elt.val();
171

  
172
    $filename_elt.val(filename.replace(/[^.]+$/, new_ext));
173
  };
174

  
158 175
  ns.set_number_in_title = function(elt) {
159 176
    $('#nr_in_title').html($(elt).val());
160 177
  };

Auch abrufbar als: Unified diff