Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e09347c8

Von Geoffrey Richardson vor mehr als 15 Jahren hinzugefügt

  • ID e09347c89ca119213c4d8ba43083653cda793399
  • Vorgänger 7bc8df16
  • Nachfolger 4dbcf680

Ansprechpartner: cp_greeting durch cp_gender ersetzt

contacts->cp_greeting, was normalerweise fuer Frau/Herr benutzt wird,
wird durch cp_gender (m/f) ersetzt, was den Vorteil hat, dass man je
nach beim Kunden definierter Sprache verschiedene Anreden generieren und
die Anreden zentral verwalten kann.

1. cp_gender wird fuer alle Ansprechpartner auf "m" gesetzt
2. cp_gender wird fuer die Ansprechpartner auf "f" gesetzt, bei denen in
cp_greeting Frau/Mrs/Miss vorkam, bei abweichender weiblicher Deklaration muss
hier also noch nachgepflegt werden
3. alle cp_greeting-Eintraege, die nicht Herr/Frau/Mrs/Miss enthalten
werden nach cp_title verschoben
4. cp_greeting wird geloescht

Unterschiede anzeigen:

SL/CT.pm
my $dbh = $form->dbconnect($myconfig);
$query =
qq|SELECT DISTINCT(cp_greeting) | .
qq|FROM contacts | .
qq|WHERE cp_greeting ~ '[a-zA-Z]' | .
qq|ORDER BY cp_greeting|;
$form->{GREETINGS} = [ selectall_array_query($form, $dbh, $query) ];
$query =
qq|SELECT DISTINCT(greeting) | .
qq|FROM customer | .
qq|WHERE greeting ~ '[a-zA-Z]' | .
qq|UNION | .
qq|SELECT DISTINCT(greeting) | .
qq|FROM vendor | .
qq|WHERE greeting ~ '[a-zA-Z]' | .
qq|ORDER BY greeting|;
my %tmp;
map({ $tmp{$_} = 1; } selectall_array_query($form, $dbh, $query));
$form->{COMPANY_GREETINGS} = [ sort(keys(%tmp)) ];
# edit: cp_greeting wurde entfernt, wird durch cp_gender ersetzt
# $query =
# qq|SELECT DISTINCT(cp_greeting) | .
# qq|FROM contacts | .
# qq|WHERE cp_greeting ~ '[a-zA-Z]' | .
# qq|ORDER BY cp_greeting|;
# $form->{GREETINGS} = [ selectall_array_query($form, $dbh, $query) ];
#
# $query =
# qq|SELECT DISTINCT(greeting) | .
# qq|FROM customer | .
# qq|WHERE greeting ~ '[a-zA-Z]' | .
# qq|UNION | .
# qq|SELECT DISTINCT(greeting) | .
# qq|FROM vendor | .
# qq|WHERE greeting ~ '[a-zA-Z]' | .
# qq|ORDER BY greeting|;
# my %tmp;
# map({ $tmp{$_} = 1; } selectall_array_query($form, $dbh, $query));
# $form->{COMPANY_GREETINGS} = [ sort(keys(%tmp)) ];
$query =
qq|SELECT DISTINCT(cp_title) | .
......
qq|cp_project = ?, | .
qq|cp_privatphone = ?, | .
qq|cp_privatemail = ?, | .
qq|cp_birthday = ? | .
qq|cp_birthday = ?, | .
qq|cp_gender = ? | .
qq|WHERE cp_id = ?|;
@values = (
$form->{cp_greeting},
......
$form->{cp_privatphone},
$form->{cp_privatemail},
$form->{cp_birthday},
$form->{cp_gender} eq 'f' ? 'f' : 'm',
$form->{cp_id}
);
} elsif ( $form->{cp_name} || $form->{cp_givenname} ) {
......
qq|INSERT INTO contacts ( cp_cv_id, cp_greeting, cp_title, cp_givenname, | .
qq| cp_name, cp_email, cp_phone1, cp_phone2, cp_abteilung, cp_fax, cp_mobile1, | .
qq| cp_mobile2, cp_satphone, cp_satfax, cp_project, cp_privatphone, cp_privatemail, | .
qq| cp_birthday) | .
qq|VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
qq| cp_birthday, cp_gender) | .
qq|VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
@values = (
$form->{id},
$form->{cp_greeting},
......
$form->{cp_project},
$form->{cp_privatphone},
$form->{cp_privatemail},
$form->{cp_birthday}
$form->{cp_birthday},
$form->{cp_gender} eq 'f' ? 'f' : 'm',
);
}
do_query( $form, $dbh, $query, @values ) if ($query);
......
qq|cp_privatphone = ?, | .
qq|cp_privatemail = ?, | .
qq|cp_birthday = ? | .
qq|cp_gender = ? | .
qq|WHERE cp_id = ?|;
@values = (
$form->{cp_greeting},
......
$form->{cp_privatphone},
$form->{cp_privatemail},
$form->{cp_birthday},
$form->{cp_gender} eq 'f' ? 'f' : 'm',
$form->{cp_id}
);
} elsif ( $form->{cp_name} || $form->{cp_givenname} ) {
......
qq|INSERT INTO contacts ( cp_cv_id, cp_greeting, cp_title, cp_givenname, | .
qq| cp_name, cp_email, cp_phone1, cp_phone2, cp_abteilung, cp_fax, cp_mobile1, | .
qq| cp_mobile2, cp_satphone, cp_satfax, cp_project, cp_privatphone, cp_privatemail, | .
qq| cp_birthday) | .
qq|VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
qq| cp_birthday, cp_gender) | .
qq|VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
@values = (
$form->{id},
$form->{cp_greeting},
SL/Common.pm
push(@queries, qq|SELECT
c.id, c.name, 0 AS customer_is_vendor,
c.street, c.zipcode, c.city,
ct.cp_greeting, ct.cp_title, ct.cp_givenname, ct.cp_name
ct.cp_gender, ct.cp_title, ct.cp_givenname, ct.cp_name
FROM customer c
LEFT JOIN contacts ct ON (c.id = ct.cp_cv_id)
$c_filter|);
......
push(@queries, qq|SELECT
v.id, v.name, 1 AS customer_is_vendor,
v.street, v.zipcode, v.city,
ct.cp_greeting, ct.cp_title, ct.cp_givenname, ct.cp_name
ct.cp_gender, ct.cp_title, ct.cp_givenname, ct.cp_name
FROM vendor v
LEFT JOIN contacts ct ON (v.id = ct.cp_cv_id)
$v_filter|);
SL/Form.pm
while (<IN>) {
print OUT $_;
open(DUMP_OUT, "> /tmp/lx2.dump" );
print(DUMP_OUT Dumper($self));
close(DUMP_OUT);
}
close(OUT);
SL/IR.pm
use SL::Common;
use SL::DBUtils;
use SL::DO;
use SL::GenericTranslations;
use SL::MoreCommon;
use List::Util qw(min);
......
'trans_id' => $form->{vendor_id});
map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
$form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh,
'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
'allow_fallback' => 1);
$dbh->disconnect();
$main::lxdebug->leave_sub();
SL/IS.pm
use SL::Common;
use SL::DBUtils;
use SL::DO;
use SL::GenericTranslations;
use SL::MoreCommon;
use SL::IC;
use Data::Dumper;
......
# connect to database
my $dbh = $form->dbconnect($myconfig);
my $language_id = $form->{language_id};
# get contact id, set it if nessessary
$form->{cp_id} *= 1;
......
'trans_id' => $form->{customer_id});
map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
$form->{cp_greeting} = GenericTranslations->get('dbh' => $dbh,
'translation_type' => 'greetings::' . ($form->{cp_gender} eq 'f' ? 'female' : 'male'),
'language_id' => $language_id,
'allow_fallback' => 1);
$dbh->disconnect;
$main::lxdebug->leave_sub();
bin/mozilla/common.pl
$cov->{address} =~ s{^,}{}x;
$cov->{address} =~ s{\ +}{\ }gx;
$cov->{contact} = join " ", map { $cov->{$_} } qw(cp_greeting cp_title cp_givenname cp_name);
$cov->{contact} = join " ", map { $cov->{$_} } qw(cp_gender cp_title cp_givenname cp_name);
$cov->{contact} =~ s{\ +}{\ }gx;
}
bin/mozilla/ct.pl
CT->get_contact(\%myconfig, \%$form);
print $form->ajax_response_header(), join '__pjx__', map $form->{"cp_$_"},
qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used);
qw(name greeting title givenname phone1 phone2 email abteilung fax mobile1 mobile2 satphone satfax project privatphone privatemail birthday used gender);
$lxdebug->leave_sub();
}
locale/de/all
'December' => 'Dezember',
'Decimalplaces' => 'Dezimalstellen',
'Decrease' => 'Verringern',
'Default (no language selected)' => 'Standard (keine Sprache ausgew&auml;hlt)',
'Default Accounts' => 'Standardkonten',
'Default output medium' => 'Standardausgabekanal',
'Default printer' => 'Standarddrucker',
......
'Edit and delete a group' => 'Gruppen bearbeiten und l&ouml;schen',
'Edit custom variable' => 'Benutzerdefinierte Variable bearbeiten',
'Edit file' => 'Datei bearbeiten',
'Edit greetings' => 'Anreden bearbeiten',
'Edit group ' => 'Gruppe bearbeiten',
'Edit group membership' => 'Gruppenmitgliedschaften bearbeiten',
'Edit groups' => 'Gruppen bearbeiten',
......
'Full access to all functions' => 'Vollzugriff auf alle Funktionen',
'GL Transaction' => 'Dialogbuchung',
'Gegenkonto' => 'Gegenkonto',
'Gender' => 'Geschlecht',
'General Ledger' => 'Finanzbuchhaltung',
'General Ledger Corrections' => 'Korrekturen im Hauptbuch',
'General Ledger Transaction' => 'Dialogbuchung',
......
'German' => 'Deutsch',
'Given Name' => 'Vorname',
'Greeting' => 'Anrede',
'Greetings' => 'Anreden',
'Group' => 'Warengruppe',
'Group Invoices' => 'Rechnungen zusammenfassen',
'Group Items' => 'Waren gruppieren',
......
'The following users have been migrated into the authentication database:' => 'Die folgenden Benutzer wurden in die Authentifizierungsdatenbank migriert:',
'The following warnings occured during an upgrade to the document templates:' => 'Die folgenden Warnungen traten w&auml;hrend einer Aktualisierung der Dokumentenvorlagen auf:',
'The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>' => 'Die Formeln m&uuml;ssen in der folgenden Syntax eingegeben werden:<br>Bei normalen Artikeln:<br>Variablenname = Variable Einheit;<br>Variablenname2 = Variable2 Einheit2;<br>...<br>###<br>Variable + Variable2 * ( Variable - Variable2 )<br>Variablennamen und Einheiten d?rfen nur aus alphanumerischen Zeichen bestehen.<br>Es muss jeweils die Gesamte Zeile eingegeben werden',
'The greetings have been saved.' => 'Die Anreden wurden gespeichert',
'The group has been added.' => 'Die Gruppe wurde erfasst.',
'The group has been deleted.' => 'Die Gruppe wurde gel&ouml;scht.',
'The group has been saved.' => 'Die Gruppe wurde gespeichert.',
......
'eMail?' => 'eMail?',
'ea' => 'St.',
'emailed to' => 'gemailt an',
'female' => 'weiblich',
'follow_up_list' => 'wiedervorlageliste',
'for' => 'f&uuml;r',
'for Period' => 'f?r den Zeitraum',
......
'list_of_receipts' => 'zahlungseingaenge',
'list_of_transactions' => 'buchungsliste',
'logout' => 'abmelden',
'male' => 'm&auml;nnlich',
'mark as paid' => 'als bezahlt markieren',
'master' => 'de',
'missing' => 'Fehlbestand',
locale/de/menu
'General Ledger' => 'Finanzbuchhaltung',
'General Ledger Corrections' => 'Korrekturen im Hauptbuch',
'General ledger and cash' => 'Finanzbuchhaltung und Zahlungsverkehr',
'Greetings' => 'Anreden',
'Groups' => 'Warengruppen',
'HTML Templates' => 'HTML-Vorlagen',
'History Search Engine' => 'Historien Suchmaschine',
locale/de/menunew
'General Ledger' => 'Finanzbuchhaltung',
'General Ledger Corrections' => 'Korrekturen im Hauptbuch',
'General ledger and cash' => 'Finanzbuchhaltung und Zahlungsverkehr',
'Greetings' => 'Anreden',
'Groups' => 'Warengruppen',
'HTML Templates' => 'HTML-Vorlagen',
'History Search Engine' => 'Historien Suchmaschine',
menu.ini
module=am.pl
action=list_language
[System--Languages--Greetings]
module=generictranslations.pl
action=edit_greetings
[System--Printer]
module=menu.pl
action=acc_menu
sql/Pg-upgrade2/gender.sql
-- @tag: gender
-- @description: Feld "Geschlecht" zu Kontaktdaten hinzufuegen, cp_greeting entferne
-- @depends: release_2_6_0
ALTER TABLE contacts ADD COLUMN cp_gender char(1);
UPDATE contacts SET cp_gender = 'm';
UPDATE contacts SET cp_gender = 'f'
WHERE (cp_greeting ILIKE '%frau%')
OR (cp_greeting ILIKE '%mrs.%')
OR (cp_greeting ILIKE '%miss%');
UPDATE contacts SET cp_title = cp_greeting WHERE NOT (cp_greeting ILIKE '%frau%' OR cp_greeting ILIKE '%herr%' or cp_greeting ILIKE '%mrs.%' or cp_greeting ILIKE '%miss%');
ALtER TABLE contacts DROP COLUMN cp_greeting;
sql/Pg-upgrade2/generic_translations.sql
-- @tag: generic_translations
-- @description: Allgemeine Tabelle fuer Uebersetzungen
-- @depends: release_2_6_0
CREATE TABLE generic_translations (
id SERIAL,
language_id integer,
translation_type varchar(100) NOT NULL,
translation_id integer,
translation text,
PRIMARY KEY (id),
FOREIGN KEY (language_id) REFERENCES language (id)
);
CREATE INDEX generic_translations_type_id_idx ON generic_translations (language_id, translation_type, translation_id);
templates/webpages/ct/form_header_de.html
name = 'shipto_id',
id = 'shipto_id',
DATA = SHIPTO,
onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto])",
onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto,set_gender])",
id_key = 'shipto_id',
label_sub = 'shipto_label',
label_key = 'shipto_label',
......
name = 'cp_id',
id = 'cp_id',
DATA = CONTACTS,
onChange = "get_contact(['cp_id__'+this.value],['cp_name','cp_greeting','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact])",
onChange = "get_contact(['cp_id__'+this.value],['cp_name','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact,set_gender])",
id_key = 'cp_id',
label_sub = 'contacts_label',
-%]
</td>
</tr>
<tr>
<th align="left" nowrap>Anrede</th>
<td>
<input id="cp_greeting" name="cp_greeting" size="40" maxlength="75" value="[% HTML.escape(cp_greeting) %]">&nbsp;
[%- INCLUDE generic/multibox.html
name = 'selected_cp_greeting',
DATA = MB_GREETINGS,
show_empty = 1,
id_key = 'id',
label_key = 'description',
-%]
</td>
</tr>
<tr>
<th align="left" nowrap>Geschlecht</th>
<td>
<select id="cp_gender" name="cp_gender">
<option value="m"[% IF cp_gender == 'm' %] selected[% END %]>m&auml;nnlich</option>
<option value="f"[% IF cp_gender == 'f' %] selected[% END %]>weiblich</option>
</select>
</td>
</tr>
<tr>
<tr>
<th align="left" nowrap>Titel</th>
......
[%- END %]
</div>
<script type="text/javascript">
<!--
function set_gender(gender) {
var s = document.getElementById('cp_gender');
if (s) {
s.selectedIndex = (gender == 'f') ? 1 : 0;
}
}
-->
</script>
templates/webpages/ct/form_header_master.html
name = 'shipto_id',
id = 'shipto_id',
DATA = SHIPTO,
onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto])",
onChange = "get_shipto(['shipto_id__' + this.value], ['shiptoname','shiptodepartment_1', 'shiptodepartment_2','shiptostreet','shiptozipcode','shiptocity','shiptocountry','shiptocontact','shiptophone','shiptofax','shiptoemail',enable_delete_shipto,set_gender])",
id_key = 'shipto_id',
label_sub = 'shipto_label',
label_key = 'shipto_label',
......
name = 'cp_id',
id = 'cp_id',
DATA = CONTACTS,
onChange = "get_contact(['cp_id__'+this.value],['cp_name','cp_greeting','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact])",
onChange = "get_contact(['cp_id__'+this.value],['cp_name','cp_title','cp_givenname','cp_phone1','cp_phone2','cp_email','cp_abteilung','cp_fax','cp_mobile1','cp_mobile2','cp_satphone','cp_satfax','cp_project','cp_privatphone','cp_privatemail','cp_birthday',enable_delete_contact,set_gender])",
id_key = 'cp_id',
label_sub = 'contacts_label',
-%]
</td>
</tr>
<tr>
<th align="left" nowrap><translate>Greeting</translate></th>
<td>
<input id="cp_greeting" name="cp_greeting" size="40" maxlength="75" value="[% HTML.escape(cp_greeting) %]">&nbsp;
[%- INCLUDE generic/multibox.html
name = 'selected_cp_greeting',
DATA = MB_GREETINGS,
show_empty = 1,
id_key = 'id',
label_key = 'description',
-%]
</td>
</tr>
<tr>
<th align="left" nowrap><translate>Gender</translate></th>
<td>
<select id="cp_gender" name="cp_gender">
<option value="m"[% IF cp_gender == 'm' %] selected[% END %]><translate>male</translate></option>
<option value="f"[% IF cp_gender == 'f' %] selected[% END %]><translate>female</translate></option>
</select>
</td>
</tr>
<tr>
<tr>
<th align="left" nowrap><translate>Title</translate></th>
......
[%- END %]
</div>
<script type="text/javascript">
<!--
function set_gender(gender) {
var s = document.getElementById('cp_gender');
if (s) {
s.selectedIndex = (gender == 'f') ? 1 : 0;
}
}
-->
</script>

Auch abrufbar als: Unified diff