mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-30 19:52:17 +01:00
Added public static OC_VCategories object to OC_Contacts_App.
Parse cards for new categories in add and edit methods.
This commit is contained in:
parent
1a42b35bf9
commit
f8e36a6bce
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user