[Kolab-devel] RFC: "gender" field in contacts

Gunnar Wrobel wrobel at pardus.de
Thu Apr 3 09:02:19 CEST 2008


Thomas Jarosch <thomas.jarosch at intra2net.com> writes:

> Hello together,
>
> On Tuesday, 1. April 2008 14:15:37 Thomas Jarosch wrote:
>> I'll create a patch for Horde and push it upstream.
>
> Attached is a patch for Horde in case someone needs a working
> gender field right now. I'll send it upstream (good that Gunnar
> and Jan don't read the list ;-)) when we've agreed on the format.

Thanks!

Should I use the attached patch now? People seem to have agreed on the
format. Though having a bug on horde bug be good for reference anyhow.


Cheers,

Gunnar

>
> That still leaves the question if there is a gender field
> somewhere hidden in Kontact? 
>
> Cheers,
> Thomas
>
> --
> www.cactusamerica.com - The best in Cactus since 1994.
> Email: sales at cactusamerica.com
>
> --- old/Horde/Kolab/XML/contact.php	Tue Mar 18 09:31:47 2008
> +++ new/Horde/Kolab/XML/contact.php	Tue Apr  1 16:32:36 2008
> @@ -334,6 +334,20 @@ class Horde_Kolab_XML_contact extends Ho
>              }
>          }
>  
> +        // Handle gender field
> +        if (isset($object['gender'])) {
> +            $gender = $object['gender'];
> +
> +            if ($gender == "female") {
> +                $object['gender'] = 1;
> +            } else if ($gender == "male") {
> +                $object['gender'] = 0;
> +            } else {
> +                // unspecified gender
> +                unset($object['gender']);
> +            }
> +        }
> +
>          // Compatibility with broken clients
>          $broken_fields = array("website" => "web-page",
>                                 "im-adress" => "im-address");
> @@ -457,6 +471,20 @@ class Horde_Kolab_XML_contact extends Ho
>  
>              if ($all_empty) {
>                  unset($object['address'][$index]);
> +            }
> +        }
> +
> +        // Handle gender field
> +        if (isset($object['gender'])) {
> +            $gender = $object['gender'];
> +
> +            if ($gender == "0") {
> +                $object['gender'] = "male";
> +            } else if ($gender == "1") {
> +                $object['gender'] = "female";
> +            } else {
> +                // unspecified gender
> +                unset($object['gender']);
>              }
>          }
>  
> _______________________________________________
> Kolab-devel mailing list
> Kolab-devel at kolab.org
> https://kolab.org/mailman/listinfo/kolab-devel

-- 
______ http://kdab.com _______________ http://kolab-konsortium.com _

p at rdus Kolab work is funded in part by KDAB and the Kolab Konsortium

____ http://www.pardus.de _________________ http://gunnarwrobel.de _
E-mail : p at rdus.de                                 Dr. Gunnar Wrobel
Tel.   : +49 700 6245 0000                          Bundesstrasse 29
Fax    : +49 721 1513 52322                          D-20146 Hamburg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   >> Mail at ease - Rent a kolab groupware server at p at rdus <<                 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the devel mailing list