summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-02-19 23:32:09 +0100
committerThomas Tanghus <thomas@tanghus.net>2012-02-19 23:32:09 +0100
commitc62673d3601abdefba2ca81ac7d8f8d42fd7f6a5 (patch)
treeea9885b2b9db78a9ff381b06d49faac20a838883
parent8a1b671fdd902b1ec1b6b6e7f23ef8fe732905ce (diff)
downloadnextcloud-server-c62673d3601abdefba2ca81ac7d8f8d42fd7f6a5.tar.gz
nextcloud-server-c62673d3601abdefba2ca81ac7d8f8d42fd7f6a5.zip
Added public static OC_VCategories object to OC_Contacts_App.
Parse cards for new categories in add and edit methods.
-rw-r--r--apps/contacts/lib/app.php2
-rw-r--r--apps/contacts/lib/vcard.php5
2 files changed, 7 insertions, 0 deletions
diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php
index ff348403a9b..48298952c12 100644
--- a/apps/contacts/lib/app.php
+++ b/apps/contacts/lib/app.php
@@ -10,8 +10,10 @@
* This class manages our app actions
*/
OC_Contacts_App::$l10n = new OC_L10N('contacts');
+OC_Contacts_App::$categories = new OC_VCategories('contacts');
class OC_Contacts_App {
public static $l10n;
+ public static $categories;
/**
* Render templates/part.details to json output
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index ece203bd458..de95e732559 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -114,6 +114,8 @@ class OC_Contacts_VCard{
$card = OC_VObject::parse($data);
if(!is_null($card)){
+ OC_Contacts_App::$categories->loadFromVObject($card);
+
$fn = $card->getAsString('FN');
if(!$fn){ // Fix missing 'FN' field.
$n = $card->getAsString('N');
@@ -187,6 +189,7 @@ class OC_Contacts_VCard{
$email = null;
$card = OC_VObject::parse($data);
if(!is_null($card)){
+ OC_Contacts_App::$categories->loadFromVObject($card);
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;
@@ -245,6 +248,7 @@ class OC_Contacts_VCard{
$card = OC_VObject::parse($data);
if(!is_null($card)){
+ OC_Contacts_App::$categories->loadFromVObject($card);
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;
@@ -279,6 +283,7 @@ class OC_Contacts_VCard{
$fn = null;
$card = OC_VObject::parse($data);
if(!is_null($card)){
+ OC_Contacts_App::$categories->loadFromVObject($card);
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;