Changeset 33 for trunk/UContact.pas


Ignore:
Timestamp:
Nov 25, 2021, 12:27:52 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Translated contact fields titles.
  • Added: Full name, Middle name, title after and title before into contact form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UContact.pas

    r32 r33  
    1717  TContactFieldIndex = (cfFirstName, cfMiddleName, cfLastName, cfTitleBefore,
    1818    cfTitleAfter, cfFullName, cfTelCell, cfTelHome, cfTelHome2, cfTelWork, cfTelVoip,
    19     cfTelMain, cfEmail,
     19    cfTelMain, cfEmail, cfTel, cfUid, cfUrl,
    2020    cfEmailHome, cfEmailInternet, cfNickName, cfNote, cfRole, cfTitle,
    21     cfCategories, cfOrganization, cfAdrHome, cfHomeAddressStreet,
    22     cfHomeAddressCity, cfHomeAddressCountry, cfXTimesContacted,
    23     cfXLastTimeContacted, cfPhoto, cfXJabber, cfDayOfBirth, cfRevision,
     21    cfCategories, cfOrganization, cfDepartment,
     22    cfHomeAddress, cfHomeAddressStreet, cfHomeAddressCity, cfHomeAddressCountry,
     23    cfWorkAddress, cfWorkAddressStreet, cfWorkAddressCity, cfWorkAddressCountry,
     24    cfXTimesContacted, cfXLastTimeContacted, cfPhoto, cfXJabber, cfDayOfBirth, cfRevision,
    2425    cfVersion);
    2526
     
    124125  SFoundBlockEndWithoutBlockStart = 'Found block end without block start';
    125126  SFieldIndexNotDefined = 'Field index not defined';
     127  SLastName = 'Last Name';
     128  SFirstName = 'First Name';
     129  SMiddleName = 'Middle Name';
     130  STitleBefore = 'Title Before';
     131  STitleAfter = 'Title After';
     132  SFullName = 'Full Name';
     133  STelephone = 'Telephone';
     134  SCellPhone = 'Cell phone';
     135  SHomePhone = 'Home phone';
     136  SHomePhone2 = 'Home phone 2';
     137  SWorkPhone = 'Work phone';
     138  SVoipPhone = 'VoIP phone';
     139  SMainPhone = 'Main phone';
     140  SEmail = 'E-mail';
     141  SHomeEmail = 'Home Email';
     142  SInternetEmail = 'Internet Email';
     143  SNickName = 'Nick Name';
     144  SNote = 'Note';
     145  SRole = 'Role';
     146  STitle = 'Title';
     147  SCategories = 'Categories';
     148  SOrganization = 'Organization';
     149  SDepartement = 'Departement';
     150  SHomeAddress = 'Home Address';
     151  SHomeAddressStreet = 'Home Address Street';
     152  SHomeAddressCity = 'Home Address City';
     153  SHomeAddressCountry = 'Home Address Country';
     154  SWorkAddress = 'Home Address';
     155  SWorkAddressStreet = 'Work Address Street';
     156  SWorkAddressCity = 'Work Address City';
     157  SWorkAddressCountry = 'Work Address Country';
     158  STimesContacted = 'Times Contacted';
     159  SLastTimeContacted = 'Last Time Contacted';
     160  SPhoto = 'Photo';
     161  SJabber = 'Jabber';
     162  SDayOfBirth = 'Day of birth';
     163  SRevision = 'Revision';
     164  SUniqueIdentifier = 'Unique identifier';
     165  SWebAddress = 'Web address';
    126166
    127167function GetNext(var Text: string; Separator: string): string;
     
    185225
    186226procedure TContactProperty.EvaluateAttributes;
     227var
     228  Index: Integer;
    187229begin
    188230  if Attributes.IndexOf('BASE64') <> -1 then
     
    196238    Charset := Attributes.Values['CHARSET']
    197239    else Charset := '';
     240
     241  // Simplify TYPE attribute from TYPE=VALUE into VALUE
     242  Index := Attributes.IndexOfName('TYPE');
     243  if Index <> -1 then
     244    Attributes.Strings[Index] := Attributes.Values['TYPE'];
    198245end;
    199246
     
    413460begin
    414461  with Fields do begin
    415     AddNew('N', [], 'Last Name', cfLastName, dtString, 0);
    416     AddNew('N', [], 'First Name', cfFirstName, dtString, 1);
    417     AddNew('N', [], 'Middle Name', cfMiddleName, dtString, 2);
    418     AddNew('N', [], 'Title Before', cfTitleBefore, dtString, 3);
    419     AddNew('N', [], 'Title After', cfTitleAfter, dtString, 4);
    420     AddNew('FN', [], 'Full Name', cfFullName, dtString);
    421     AddNew('TEL', ['CELL'], 'Cell phone', cfTelCell, dtString);
    422     AddNew('TEL', ['HOME'], 'Home phone', cfTelHome, dtString);
    423     AddNew('TEL', ['HOME2'], 'Home phone 2', cfTelHome2, dtString);
    424     AddNew('TEL', ['WORK'], 'Home work', cfTelWork, dtString);
    425     AddNew('TEL', ['VOIP'], 'Tel VoIP', cfTelVoip, dtString);
    426     AddNew('TEL', ['MAIN'], 'Tel Main', cfTelMain, dtString);
    427     AddNew('EMAIL', [], 'Email', cfEmail, dtString);
    428     AddNew('EMAIL', ['HOME'], 'Email Home', cfEmailHome, dtString);
    429     AddNew('EMAIL', ['INTERNET'], 'Email Internet', cfEmailInternet, dtString);
    430     AddNew('X-NICKNAME', [], 'Nick Name', cfNickName, dtString);
    431     AddNew('NOTE', [], 'Note', cfNote, dtString);
    432     AddNew('ROLE', [], 'Role', cfRole, dtString);
    433     AddNew('TITLE', [], 'Title', cfTitle, dtString);
    434     AddNew('CATEGORIES', [], 'Categories', cfCategories, dtString);
    435     AddNew('ORG', [], 'Organization', cfOrganization, dtString, 0);
    436     AddNew('ORG', [], 'Division', cfOrganization, dtString, 1);
    437     AddNew('ADR', ['HOME'], 'Home Address', cfAdrHome, dtString);
    438     AddNew('ADR', ['HOME'], 'Home Address Street', cfHomeAddressStreet, dtString, 1);
    439     AddNew('ADR', ['HOME'], 'Home Address City', cfHomeAddressCity, dtString, 2);
    440     AddNew('ADR', ['HOME'], 'Home Address Country', cfHomeAddressCountry, dtString, 3);
    441     AddNew('X-TIMES_CONTACTED', [], 'Times Contacted', cfXTimesContacted, dtString);
    442     AddNew('X-LAST_TIME_CONTACTED', [], 'Last Time Contacted', cfXLastTimeContacted, dtString);
    443     AddNew('PHOTO', [], 'Photo', cfPhoto, dtString);
    444     AddNew('X-JABBER', [], 'Jabber', cfXJabber, dtString);
    445     AddNew('BDAY', [], 'Day of birth', cfDayOfBirth, dtString);
    446     AddNew('REV', [], 'Revision', cfRevision, dtString);
     462    AddNew('N', [], SLastName, cfLastName, dtString, 0);
     463    AddNew('N', [], SFirstName, cfFirstName, dtString, 1);
     464    AddNew('N', [], SMiddleName, cfMiddleName, dtString, 2);
     465    AddNew('N', [], STitleBefore, cfTitleBefore, dtString, 3);
     466    AddNew('N', [], STitleAfter, cfTitleAfter, dtString, 4);
     467    AddNew('FN', [], SFullName, cfFullName, dtString);
     468    AddNew('TEL', [], STelephone, cfTel, dtString);
     469    AddNew('TEL', ['CELL'], SCellPhone, cfTelCell, dtString);
     470    AddNew('TEL', ['HOME'], SHomePhone, cfTelHome, dtString);
     471    AddNew('TEL', ['HOME2'], SHomePhone2, cfTelHome2, dtString);
     472    AddNew('TEL', ['WORK'], SWorkPhone, cfTelWork, dtString);
     473    AddNew('TEL', ['VOIP'], SVoipPhone, cfTelVoip, dtString);
     474    AddNew('TEL', ['MAIN'], SMainPhone, cfTelMain, dtString);
     475    AddNew('EMAIL', [], SEmail, cfEmail, dtString);
     476    AddNew('EMAIL', ['HOME'], SHomeEmail, cfEmailHome, dtString);
     477    AddNew('EMAIL', ['INTERNET'], SInternetEmail, cfEmailInternet, dtString);
     478    AddNew('NICKNAME', [], SNickName, cfNickName, dtString);
     479    AddNew('NOTE', [], SNote, cfNote, dtString);
     480    AddNew('ROLE', [], SRole, cfRole, dtString);
     481    AddNew('TITLE', [], STitle, cfTitle, dtString);
     482    AddNew('CATEGORIES', [], SCategories, cfCategories, dtString);
     483    AddNew('ORG', [], SOrganization, cfOrganization, dtString, 0);
     484    AddNew('ORG', [], SDepartement, cfDepartment, dtString, 1);
     485    AddNew('ADR', ['HOME'], SHomeAddress, cfHomeAddress, dtString);
     486    AddNew('ADR', ['HOME'], SHomeAddressStreet, cfHomeAddressStreet, dtString, 1);
     487    AddNew('ADR', ['HOME'], SHomeAddressCity, cfHomeAddressCity, dtString, 2);
     488    AddNew('ADR', ['HOME'], SHomeAddressCountry, cfHomeAddressCountry, dtString, 3);
     489    AddNew('ADR', ['WORK'], SWorkAddress, cfWorkAddress, dtString);
     490    AddNew('ADR', ['WORK'], SWorkAddressStreet, cfWorkAddressStreet, dtString, 1);
     491    AddNew('ADR', ['WORK'], SWorkAddressCity, cfWorkAddressCity, dtString, 2);
     492    AddNew('ADR', ['WORK'], SWorkAddressCountry, cfWorkAddressCountry, dtString, 3);
     493    AddNew('X-TIMES_CONTACTED', [], STimesContacted, cfXTimesContacted, dtString);
     494    AddNew('X-LAST_TIME_CONTACTED', [], SLastTimeContacted, cfXLastTimeContacted, dtString);
     495    AddNew('PHOTO', [], SPhoto, cfPhoto, dtString);
     496    AddNew('X-JABBER', [], SJabber, cfXJabber, dtString);
     497    AddNew('BDAY', [], SDayOfBirth, cfDayOfBirth, dtString);
     498    AddNew('REV', [], SRevision, cfRevision, dtString);
     499    AddNew('UID', [], SUniqueIdentifier, cfUid, dtString);
     500    AddNew('URL', [], SWebAddress, cfUrl, dtString);
    447501  end;
    448502end;
     
    570624            NewRecord.Properties.Add(NewProperty);
    571625          end;
    572           NewProperty.Attributes.DelimitedText := Names;
     626          NewProperty.Attributes.DelimitedText := UpperCase(Names);
    573627          if NewProperty.Attributes.Count > 0 then begin
    574628            NewProperty.Name := NewProperty.Attributes[0];
Note: See TracChangeset for help on using the changeset viewer.