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
8a1b671fdd
commit
c62673d360
|
@ -10,8 +10,10 @@
|
||||||
* This class manages our app actions
|
* This class manages our app actions
|
||||||
*/
|
*/
|
||||||
OC_Contacts_App::$l10n = new OC_L10N('contacts');
|
OC_Contacts_App::$l10n = new OC_L10N('contacts');
|
||||||
|
OC_Contacts_App::$categories = new OC_VCategories('contacts');
|
||||||
class OC_Contacts_App {
|
class OC_Contacts_App {
|
||||||
public static $l10n;
|
public static $l10n;
|
||||||
|
public static $categories;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render templates/part.details to json output
|
* Render templates/part.details to json output
|
||||||
|
|
|
@ -114,6 +114,8 @@ class OC_Contacts_VCard{
|
||||||
|
|
||||||
$card = OC_VObject::parse($data);
|
$card = OC_VObject::parse($data);
|
||||||
if(!is_null($card)){
|
if(!is_null($card)){
|
||||||
|
OC_Contacts_App::$categories->loadFromVObject($card);
|
||||||
|
|
||||||
$fn = $card->getAsString('FN');
|
$fn = $card->getAsString('FN');
|
||||||
if(!$fn){ // Fix missing 'FN' field.
|
if(!$fn){ // Fix missing 'FN' field.
|
||||||
$n = $card->getAsString('N');
|
$n = $card->getAsString('N');
|
||||||
|
@ -187,6 +189,7 @@ class OC_Contacts_VCard{
|
||||||
$email = null;
|
$email = null;
|
||||||
$card = OC_VObject::parse($data);
|
$card = OC_VObject::parse($data);
|
||||||
if(!is_null($card)){
|
if(!is_null($card)){
|
||||||
|
OC_Contacts_App::$categories->loadFromVObject($card);
|
||||||
foreach($card->children as $property){
|
foreach($card->children as $property){
|
||||||
if($property->name == 'FN'){
|
if($property->name == 'FN'){
|
||||||
$fn = $property->value;
|
$fn = $property->value;
|
||||||
|
@ -245,6 +248,7 @@ class OC_Contacts_VCard{
|
||||||
|
|
||||||
$card = OC_VObject::parse($data);
|
$card = OC_VObject::parse($data);
|
||||||
if(!is_null($card)){
|
if(!is_null($card)){
|
||||||
|
OC_Contacts_App::$categories->loadFromVObject($card);
|
||||||
foreach($card->children as $property){
|
foreach($card->children as $property){
|
||||||
if($property->name == 'FN'){
|
if($property->name == 'FN'){
|
||||||
$fn = $property->value;
|
$fn = $property->value;
|
||||||
|
@ -279,6 +283,7 @@ class OC_Contacts_VCard{
|
||||||
$fn = null;
|
$fn = null;
|
||||||
$card = OC_VObject::parse($data);
|
$card = OC_VObject::parse($data);
|
||||||
if(!is_null($card)){
|
if(!is_null($card)){
|
||||||
|
OC_Contacts_App::$categories->loadFromVObject($card);
|
||||||
foreach($card->children as $property){
|
foreach($card->children as $property){
|
||||||
if($property->name == 'FN'){
|
if($property->name == 'FN'){
|
||||||
$fn = $property->value;
|
$fn = $property->value;
|
||||||
|
|
Loading…
Reference in New Issue