Browse Source

combine country code and country name because we need both. will be split in promotion.php

tags/contribute2018
Max Mehl 8 months ago
parent
commit
07dfe2a83d
Signed by: max.mehl <max.mehl@fsfe.org> GPG Key ID: 2704E4AB371E2E92
3 changed files with 9 additions and 6 deletions
  1. 7
    3
      cgi-bin/promotion.php
  2. 1
    2
      contribute/spreadtheword.xsl
  3. 1
    1
      tools/xsltsl/countries.xsl

+ 7
- 3
cgi-bin/promotion.php View File

@@ -72,7 +72,7 @@ function send_mail ( $to, $from, $subject, $msg, $bcc = NULL, $att = NULL, $att_
}
$headers .= "X-OTRS-DynamicField-OrderLanguage: " . $_POST["language"] . "\n";
$headers .= "X-OTRS-DynamicField-OrderState: order\n";
$headers .= "X-OTRS-DynamicField-PromoMaterialCountry: " . $_POST["country"] . "\n";
$headers .= "X-OTRS-DynamicField-PromoMaterialCountry: " . $countrycode . "\n";
$headers .= "X-OTRS-DynamicField-PromoMaterialLanguages: " . implode(',', $_POST['languages']) . "\n";

if ( $att ) {
@@ -129,6 +129,10 @@ if (empty($_POST['lastname']) ||
# Without this, escapeshellarg() will eat non-ASCII characters.
setlocale(LC_CTYPE, "en_US.UTF-8");

# $_POST["country"] has values like "DE|Germany", so split this string
$countrycode = explode('|', $_POST["country"])[0];
$countryname = explode('|', $_POST["country"])[1];

if ($_POST['packagetype'] == 'default') {
$subject = "Standard promotion material order";
} else {
@@ -147,7 +151,7 @@ if (!empty($_POST['org'])) {
}
$msg .= "{$_POST['street']}\n".
"{$_POST['zip']} "."{$_POST['city']}\n".
"{$_POST['country']}\n".
"{$countryname}\n".
"\n".
"Specifics of the Order:\n";
# Default or custom package?
@@ -186,7 +190,7 @@ if (!empty($_POST['org'])) {
}
$address .= $_POST['street'] . "\\n" .
$_POST['zip'] . " " . $_POST['city'] . "\\n" .
$_POST['country'];
$countryname;
$name = escapeshellarg($name);
$address = escapeshellarg($address);
shell_exec("$odtfill $template $outfile Name=$name Address=$address Name=$name");

+ 1
- 2
contribute/spreadtheword.xsl View File

@@ -239,8 +239,7 @@
<xsl:template match="add-language">
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="id">lang</xsl:attribute>
<xsl:attribute name="name">lang</xsl:attribute>
<xsl:attribute name="name">language</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="/buildinfo/document/@language" />
</xsl:attribute>

+ 1
- 1
tools/xsltsl/countries.xsl View File

@@ -218,7 +218,7 @@
<!-- will output: <option value="ZZ">Fooland</option> -->
<xsl:element name="option">
<xsl:attribute name="value">
<xsl:value-of select="@id" />
<xsl:value-of select="@id" />|<xsl:value-of select="." />
</xsl:attribute>
<xsl:value-of select="." />
</xsl:element> <!-- /option -->

Loading…
Cancel
Save