Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a25ac490

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID a25ac4907df1aca0db5fd0017b96e5d0bc5eadf1
  • Vorgänger 3d779763
  • Nachfolger f928a1f6

Möglichkeit eingebaut, beim Versenden von Emails den Namen für den Dateianhang selber festzulegen. Er ist mit "Vorgangstyp_Vorgangsnummer.ext" vorbelegt, also z.B. "Rechnung_15.pdf". Attribute in HTML-Tags und Werte gequotet.

Unterschiede anzeigen:

bin/mozilla/io.pl
1280 1280
  }
1281 1281
  if ($myconfig{role} eq 'admin') {
1282 1282
    $bcc = qq|
1283
 	  <th align=right nowrap=true>| . $locale->text('Bcc') . qq|</th>
1284
	  <td><input name=bcc size=30 value="$form->{bcc}"></td>
1283
    <tr>
1284
      <th align="right" nowrap="true">| . $locale->text('Bcc') . qq|</th>
1285
      <td><input name="bcc" size="30" value="| . Q($form->{bcc}) . qq|"></td>
1286
    </tr>
1285 1287
|;
1286 1288
  }
1287 1289

  
......
1301 1303
  $form->{oldmedia} = $form->{media};
1302 1304
  $form->{media}    = "email";
1303 1305

  
1306
  my %formname_translations =
1307
    (
1308
     "bin_list" => $locale->text('Bin List'),
1309
     "credit_note" => $locale->text('Credit Note'),
1310
     "invoice" => $locale->text('Invoice'),
1311
     "packing_list" => $locale->text('Packing List'),
1312
     "pick_list" => $locale->text('Pick List'),
1313
     "proforma" => $locale->text('Proforma Invoice'),
1314
     "purchase_order" => $locale->text('Purchase Order'),
1315
     "request_quotation" => $locale->text('RFQ'),
1316
     "sales_order" => $locale->text('Confirmation'),
1317
     "sales_quotation" => $locale->text('Quotation'),
1318
     "storno_invoice" => $locale->text('Storno Invoice'),
1319
     "storno_packing_list" => $locale->text('Storno Packing List'),
1320
    );
1321

  
1322
  my $attachment_filename = $formname_translations{$form->{"formname"}};
1323
  my $prefix;
1324

  
1325
  if ($form->{"type"} =~ /invoice/) {
1326
    $prefix = "inv";
1327
  } elsif ($form->{"type"} =~ /_quotation$/) {
1328
    $prefix = "quo";
1329
  } else {
1330
    $prefix = "ord";
1331
  }
1332

  
1333
  if ($attachment_filename && $form->{"${prefix}number"}) {
1334
    $attachment_filename .= "_" . $form->{"${prefix}number"} .
1335
      ($form->{"format"} =~ /pdf/i ? ".pdf" :
1336
       $form->{"format"} =~ /postscript/i ? ".ps" :
1337
       $form->{"format"} =~ /opendocument/i ? ".odt" :
1338
       $form->{"format"} =~ /html/i ? ".html" : "");
1339
    $attachment_filename =~ s/ /_/g;
1340
    my %umlaute =
1341
      (
1342
       "?" => "ae", "?" => "oe", "?" => "ue",
1343
       "?" => "Ae", "?" => "Oe", "?" => "Ue",
1344
       "?" => "ss"
1345
      );
1346
    map({ $attachment_filename =~ s/$_/$umlaute{$_}/g; } keys(%umlaute));
1347
  } else {
1348
    $attachment_filename = "";
1349
  }
1350

  
1351
  if ($form->{"email"}) {
1352
    $form->{"fokus"} = "Form.subject";
1353
  } else {
1354
    $form->{"fokus"} = "Form.email";
1355
  }
1304 1356
  $form->header;
1305 1357

  
1306 1358
  print qq|
1307
<body>
1359
<body onload="fokus()">
1308 1360

  
1309
<form method=post action=$form->{script}>
1361
<form name="Form" method="post" action="$form->{script}">
1310 1362

  
1311
<table width=100%>
1312
  <tr class=listtop>
1313
    <th class=listtop>$title</th>
1363
<table width="100%">
1364
  <tr class="listtop">
1365
    <th class="listtop">$title</th>
1314 1366
  </tr>
1315 1367
  <tr height="5"></tr>
1316 1368
  <tr>
1317 1369
    <td>
1318
      <table width=100%>
1319
	<tr>
1320
	  <th align=right nowrap>| . $locale->text('To') . qq|</th>
1321
	  <td><input name=email size=30 value="$form->{email}"></td>
1322
	  <th align=right nowrap>| . $locale->text('Cc') . qq|</th>
1323
	  <td><input name=cc size=30 value="$form->{cc}"></td>
1324
	</tr>
1325
	<tr>
1326
	  <th align=right nowrap>| . $locale->text('Subject') . qq|</th>
1327
	  <td><input name=subject size=30 value="$form->{subject}"></td>
1328
	  $bcc
1329
	</tr>
1370
      <table>
1371
        <tr>
1372
          <th align="right" nowrap>| . $locale->text('To') . qq|</th>
1373
          <td><input name="email" size="30" value="| .
1374
          Q($form->{"email"}) . qq|"></td>
1375
        </tr>
1376
        <tr>
1377
          <th align="right" nowrap>| . $locale->text('Cc') . qq|</th>
1378
          <td><input name="cc" size="30" value="| .
1379
          Q($form->{"cc"}) . qq|"></td>
1380
        </tr>
1381
        $bcc
1382
        <tr>
1383
          <th align="right" nowrap>| . $locale->text('Subject') . qq|</th>
1384
          <td><input name="subject" size="30" value="| .
1385
          Q($form->{"subject"}) . qq|"></td>
1386
        </tr>
1387
        <tr>
1388
          <th align="right" nowrap>| . $locale->text('Attachment name') .
1389
          qq|</th>
1390
          <td><input name="attachment_filename" size="30" value="| .
1391
          Q($attachment_filename) . qq|"></td>
1330 1392
      </table>
1331 1393
    </td>
1332 1394
  </tr>
1333 1395
  <tr>
1334 1396
    <td>
1335
      <table width=100%>
1336
	<tr>
1337
	  <th align=left nowrap>| . $locale->text('Message') . qq|</th>
1338
	</tr>
1339
	<tr>
1340
	  <td><textarea name=message rows=15 cols=60 wrap=soft>$form->{message}</textarea></td>
1341
	</tr>
1397
      <table>
1398
        <tr>
1399
          <th align="left" nowrap>| . $locale->text('Message') . qq|</th>
1400
        </tr>
1401
        <tr>
1402
          <td><textarea name="message" rows="15" cols="60" wrap="soft">| .
1403
          H($form->{"message"}) . qq|</textarea></td>
1404
        </tr>
1342 1405
      </table>
1343 1406
    </td>
1344 1407
  </tr>
......
1354 1417
  # save all other variables
1355 1418
  foreach $key (keys %$form) {
1356 1419
    $form->{$key} =~ s/\"/&quot;/g;
1357
    print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
1420
    print qq|<input type="hidden" name="$key" value="| . Q($form->{$key}) . qq|">\n|;
1358 1421
  }
1359 1422

  
1360 1423
  print qq|
1361 1424
    </td>
1362 1425
  </tr>
1363 1426
  <tr>
1364
    <td><hr size=3 noshade></td>
1427
    <td><hr size="3" noshade></td>
1365 1428
  </tr>
1366 1429
</table>
1367 1430

  
1368
<input type=hidden name=nextsub value=send_email>
1431
<input type="hidden" name="nextsub" value="send_email">
1369 1432

  
1370 1433
<br>
1371
<input name=action class=submit type=submit value="|
1434
<input name="action" class="submit" type="submit" value="|
1372 1435
    . $locale->text('Continue') . qq|">
1373 1436
</form>
1374 1437

  

Auch abrufbar als: Unified diff