Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7f683e50

Von Jan Büren vor etwa 14 Jahren hinzugefügt

  • ID 7f683e50d6d550b307a1c97d071e894889039ff0
  • Vorgänger 5316e3c6
  • Nachfolger 7cf894f1

Geschlecht fuer Ansprechpartner bei abweichender Lieferadresse als Auswahlfeld in do.pl anzeigen und als hidden feld entsprechend weitergeben

Unterschiede anzeigen:

SL/Form.pm
2018 2018
  my @values;
2019 2019

  
2020 2020
  foreach my $item (qw(name department_1 department_2 street zipcode city country
2021
                       contact phone fax email)) {
2021
                       contact cp_gender phone fax email)) {
2022 2022
    if ($self->{"shipto$item"}) {
2023 2023
      $shipto = 1 if ($self->{$item} ne $self->{"shipto$item"});
2024 2024
    }
......
2036 2036
                       shiptocity = ?,
2037 2037
                       shiptocountry = ?,
2038 2038
                       shiptocontact = ?,
2039
                       shiptocp_gender = ?,
2039 2040
                       shiptophone = ?,
2040 2041
                       shiptofax = ?,
2041 2042
                       shiptoemail = ?
......
2051 2052
                       shiptocity = ? AND
2052 2053
                       shiptocountry = ? AND
2053 2054
                       shiptocontact = ? AND
2055
                       shiptocp_gender = ? AND
2054 2056
                       shiptophone = ? AND
2055 2057
                       shiptofax = ? AND
2056 2058
                       shiptoemail = ? AND
......
2061 2063
        $query =
2062 2064
          qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2,
2063 2065
                                 shiptostreet, shiptozipcode, shiptocity, shiptocountry,
2064
                                 shiptocontact, shiptophone, shiptofax, shiptoemail, module)
2065
             VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
2066
                                 shiptocontact, shiptocp_gender, shiptophone, shiptofax, shiptoemail, module)
2067
             VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
2066 2068
        do_query($self, $dbh, $query, $id, @values, $module);
2067 2069
      }
2068 2070
    }
bin/mozilla/io.pl
1780 1780

  
1781 1781
  my @shipto_vars =
1782 1782
    qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry
1783
       shiptocontact shiptophone shiptofax shiptoemail
1783
       shiptocontact shiptocp_gender shiptophone shiptofax shiptoemail
1784 1784
       shiptodepartment_1 shiptodepartment_2);
1785 1785

  
1786 1786
  my @addr_vars =
......
1795 1795
    ? $locale->text('Customer Number')
1796 1796
    : $locale->text('Vendor Number');
1797 1797

  
1798
  # sieht nicht nett aus, funktioniert aber
1799
  # das vorausgewählte select-feld wird über shiptocp_gender
1800
  # entsprechend vorbelegt
1801
  my $selected_m='';
1802
  my $selected_f='';
1803
  if ($form->{shiptocp_gender} eq 'm') {
1804
    $selected_m='selected';
1805
    $selected_f='';
1806
  } elsif ($form->{shiptocp_gender} eq 'f') {
1807
    $selected_m='';
1808
    $selected_f='selected';
1809
  }
1810

  
1798 1811
  # get pricegroups for parts
1799 1812
  IS->get_pricegroups_for_parts(\%myconfig, \%$form);
1800 1813

  
......
1867 1880
          <td>$form->{contact}</td>
1868 1881
          <td><input name="shiptocontact" size="35" value="$form->{shiptocontact}"></td>
1869 1882
        </tr>
1883
        <tr>
1884
          <th align="right" nowrap>| . $locale->text('Gender') . qq|</th>
1885
          <td></td>
1886
          <td><select id="shiptocp_gender" name="shiptocp_gender">
1887
              <option value="m"| .  $selected_m . qq|>| . $locale->text('male') . qq|</option>
1888
              <option value="f"| .  $selected_f . qq|>| . $locale->text('female') . qq|</option>
1889
              </select>
1890
          </td>
1891
        </tr>
1870 1892
        <tr>
1871 1893
          <th align="right" nowrap>| . $locale->text('Phone') . qq|</th>
1872 1894
          <td>$form->{phone}</td>
templates/webpages/do/form_header.html
80 80
  <input type="hidden" name="saved_donumber" value="[% HTML.escape(saved_donumber) %]">
81 81
  <input type="hidden" name="shiptocity" value="[% HTML.escape(shiptocity) %]">
82 82
  <input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
83
  <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
83 84
  <input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
84 85
  <input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
85 86
  <input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">

Auch abrufbar als: Unified diff