| 1: | <?php |
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | namespace Aurora\Modules\DavContacts; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | class Manager extends \Aurora\System\Managers\AbstractManagerWithStorage |
| 16: | { |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | public function __construct(\Aurora\System\Module\AbstractModule $oModule = null) |
| 23: | { |
| 24: | parent::__construct($oModule, new Storages\Sabredav\Storage($this)); |
| 25: | } |
| 26: | |
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | public function getContactById($iUserId, $mContactId, $sAddressBookName = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME) |
| 36: | { |
| 37: | $oContact = null; |
| 38: | try { |
| 39: | $oContact = $this->oStorage->getContactById($iUserId, $mContactId, $sAddressBookName); |
| 40: | if ($oContact) { |
| 41: | $mGroupIds = $this->getContactGroupIds($oContact); |
| 42: | if (is_array($mGroupIds)) { |
| 43: | $oContact->GroupIds = $mGroupIds; |
| 44: | } |
| 45: | } |
| 46: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 47: | $oContact = false; |
| 48: | $this->setLastException($oException); |
| 49: | } |
| 50: | |
| 51: | return $oContact; |
| 52: | } |
| 53: | |
| 54: | |
| 55: | |
| 56: | |
| 57: | |
| 58: | |
| 59: | |
| 60: | |
| 61: | |
| 62: | public function GetContactByTypeId($mTypeId, $iContactType) |
| 63: | { |
| 64: | $oContact = null; |
| 65: | try { |
| 66: | $oContact = $this->oStorage->GetContactByTypeId($mTypeId, $iContactType); |
| 67: | if ($oContact) { |
| 68: | $mGroupIds = $this->getContactGroupIds($oContact); |
| 69: | if (is_array($mGroupIds)) { |
| 70: | $oContact->GroupIds = $mGroupIds; |
| 71: | } |
| 72: | } |
| 73: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 74: | $oContact = false; |
| 75: | $this->setLastException($oException); |
| 76: | } |
| 77: | |
| 78: | return $oContact; |
| 79: | } |
| 80: | |
| 81: | |
| 82: | |
| 83: | |
| 84: | |
| 85: | |
| 86: | |
| 87: | |
| 88: | |
| 89: | public function getContactByEmail($iUserId, $sEmail) |
| 90: | { |
| 91: | $oContact = null; |
| 92: | try { |
| 93: | $oContact = $this->oStorage->getContactByEmail($iUserId, $sEmail); |
| 94: | if ($oContact) { |
| 95: | $mGroupIds = $this->getContactGroupIds($oContact); |
| 96: | if (is_array($mGroupIds)) { |
| 97: | $oContact->GroupIds = $mGroupIds; |
| 98: | } |
| 99: | } |
| 100: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 101: | $oContact = false; |
| 102: | $this->setLastException($oException); |
| 103: | } |
| 104: | |
| 105: | return $oContact; |
| 106: | } |
| 107: | |
| 108: | |
| 109: | |
| 110: | |
| 111: | |
| 112: | |
| 113: | |
| 114: | |
| 115: | |
| 116: | |
| 117: | public function getContactByStrId($iUserId, $sContactStrId, $iSharedTenantId = null) |
| 118: | { |
| 119: | $oContact = null; |
| 120: | try { |
| 121: | $oContact = $this->oStorage->getContactByStrId($iUserId, $sContactStrId, $iSharedTenantId); |
| 122: | if ($oContact) { |
| 123: | $mGroupIds = $this->getContactGroupIds($oContact); |
| 124: | if (is_array($mGroupIds)) { |
| 125: | $oContact->GroupIds = $mGroupIds; |
| 126: | } |
| 127: | } |
| 128: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 129: | $oContact = false; |
| 130: | $this->setLastException($oException); |
| 131: | } |
| 132: | |
| 133: | return $oContact; |
| 134: | } |
| 135: | |
| 136: | |
| 137: | |
| 138: | |
| 139: | |
| 140: | |
| 141: | |
| 142: | |
| 143: | |
| 144: | public function getVCardObjectById($iUserId, $mContactId, $sAddressBookName = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME) |
| 145: | { |
| 146: | $mResult = null; |
| 147: | try { |
| 148: | $oVCardObject = $this->oStorage->getVCardObjectById($iUserId, $mContactId, $sAddressBookName); |
| 149: | if ($oVCardObject) { |
| 150: | $mResult = $oVCardObject->get(); |
| 151: | } |
| 152: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 153: | $mResult = false; |
| 154: | $this->setLastException($oException); |
| 155: | } |
| 156: | |
| 157: | return $mResult; |
| 158: | } |
| 159: | |
| 160: | |
| 161: | |
| 162: | |
| 163: | |
| 164: | |
| 165: | |
| 166: | |
| 167: | |
| 168: | public function getSharedContactIds($iUserId, $iSharedTenantId = null) |
| 169: | { |
| 170: | $aContactIds = array(); |
| 171: | try { |
| 172: | $aContactIds = $this->oStorage->getSharedContactIds($iUserId, $iSharedTenantId); |
| 173: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 174: | $aContactIds = false; |
| 175: | $this->setLastException($oException); |
| 176: | } |
| 177: | |
| 178: | return $aContactIds; |
| 179: | } |
| 180: | |
| 181: | |
| 182: | |
| 183: | |
| 184: | |
| 185: | |
| 186: | public function getContactGroupIds($oContact) |
| 187: | { |
| 188: | $aGroupIds = false; |
| 189: | try { |
| 190: | $aGroupIds = $this->oStorage->getContactGroupIds($oContact); |
| 191: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 192: | $aGroupIds = false; |
| 193: | $this->setLastException($oException); |
| 194: | } |
| 195: | |
| 196: | return $aGroupIds; |
| 197: | } |
| 198: | |
| 199: | |
| 200: | |
| 201: | |
| 202: | |
| 203: | |
| 204: | |
| 205: | public function getGroupById($iUserId, $mGroupId) |
| 206: | { |
| 207: | $oGroup = null; |
| 208: | try { |
| 209: | $oGroup = $this->oStorage->getGroupById($iUserId, $mGroupId); |
| 210: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 211: | $oGroup = false; |
| 212: | $this->setLastException($oException); |
| 213: | } |
| 214: | |
| 215: | return $oGroup; |
| 216: | } |
| 217: | |
| 218: | |
| 219: | |
| 220: | |
| 221: | |
| 222: | |
| 223: | |
| 224: | public function getGroupByStrId($iUserId, $sGroupStrId) |
| 225: | { |
| 226: | $oGroup = null; |
| 227: | try { |
| 228: | $oGroup = $this->oStorage->getGroupByStrId($iUserId, $sGroupStrId); |
| 229: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 230: | $oGroup = false; |
| 231: | $this->setLastException($oException); |
| 232: | } |
| 233: | |
| 234: | return $oGroup; |
| 235: | } |
| 236: | |
| 237: | |
| 238: | |
| 239: | |
| 240: | |
| 241: | |
| 242: | |
| 243: | public function getGroupByName($iUserId, $sName) |
| 244: | { |
| 245: | $oGroup = null; |
| 246: | try { |
| 247: | $oGroup = $this->oStorage->getGroupByName($iUserId, $sName); |
| 248: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 249: | $oGroup = false; |
| 250: | $this->setLastException($oException); |
| 251: | } |
| 252: | |
| 253: | return $oGroup; |
| 254: | } |
| 255: | |
| 256: | |
| 257: | |
| 258: | |
| 259: | |
| 260: | |
| 261: | public function updateContact($oContact) |
| 262: | { |
| 263: | $bResult = false; |
| 264: | try { |
| 265: | if ($oContact->validate()) { |
| 266: | $bResult = $this->oStorage->updateContact($oContact); |
| 267: | } |
| 268: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 269: | $bResult = false; |
| 270: | $this->setLastException($oException); |
| 271: | } |
| 272: | |
| 273: | |
| 274: | |
| 275: | |
| 276: | |
| 277: | |
| 278: | |
| 279: | |
| 280: | |
| 281: | |
| 282: | |
| 283: | return $bResult; |
| 284: | } |
| 285: | |
| 286: | |
| 287: | |
| 288: | |
| 289: | |
| 290: | |
| 291: | |
| 292: | public function updateContactUserId($oContact, $iUserId) |
| 293: | { |
| 294: | $bResult = false; |
| 295: | try { |
| 296: | if ($oContact->validate()) { |
| 297: | $bResult = $this->oStorage->updateContactUserId($oContact, $iUserId); |
| 298: | } |
| 299: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 300: | $bResult = false; |
| 301: | $this->setLastException($oException); |
| 302: | } |
| 303: | |
| 304: | return $bResult; |
| 305: | } |
| 306: | |
| 307: | |
| 308: | |
| 309: | |
| 310: | |
| 311: | public function updateGroup($oGroup) |
| 312: | { |
| 313: | $bResult = false; |
| 314: | try { |
| 315: | if ($oGroup->validate()) { |
| 316: | $bResult = $this->oStorage->updateGroup($oGroup); |
| 317: | } |
| 318: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 319: | $bResult = false; |
| 320: | $this->setLastException($oException); |
| 321: | } |
| 322: | |
| 323: | return $bResult; |
| 324: | } |
| 325: | |
| 326: | |
| 327: | |
| 328: | |
| 329: | |
| 330: | |
| 331: | |
| 332: | |
| 333: | |
| 334: | |
| 335: | |
| 336: | public function getContactItemsCount($iUserId, $sSearch = '', $sFirstCharacter = '', $iGroupId = 0, $iTenantId = null, $bAll = false) |
| 337: | { |
| 338: | $iResult = 0; |
| 339: | try { |
| 340: | $iResult = $this->oStorage->getContactItemsCount($iUserId, $sSearch, $sFirstCharacter, $iGroupId, $iTenantId, $bAll); |
| 341: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 342: | $iResult = 0; |
| 343: | $this->setLastException($oException); |
| 344: | } |
| 345: | |
| 346: | return $iResult; |
| 347: | } |
| 348: | |
| 349: | |
| 350: | |
| 351: | |
| 352: | |
| 353: | |
| 354: | |
| 355: | |
| 356: | public function getContactItemsWithoutOrder($iUserId, $iOffset = 0, $iRequestLimit = 20) |
| 357: | { |
| 358: | $mResult = false; |
| 359: | try { |
| 360: | $mResult = $this->oStorage->getContactItemsWithoutOrder($iUserId, $iOffset, $iRequestLimit); |
| 361: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 362: | $mResult = false; |
| 363: | $this->setLastException($oException); |
| 364: | } |
| 365: | |
| 366: | return $mResult; |
| 367: | } |
| 368: | |
| 369: | |
| 370: | |
| 371: | |
| 372: | |
| 373: | |
| 374: | |
| 375: | |
| 376: | |
| 377: | |
| 378: | |
| 379: | public function getContactItems( |
| 380: | $iSortField = \Aurora\Modules\Contacts\Enums\SortField::Email, |
| 381: | $iSortOrder = \Aurora\System\Enums\SortOrder::ASC, |
| 382: | $iOffset = 0, |
| 383: | $iRequestLimit = 20, |
| 384: | $aFilters = array(), |
| 385: | $iIdGroup = 0 |
| 386: | ) |
| 387: | { |
| 388: | $mResult = false; |
| 389: | try { |
| 390: | $mResult = $this->oStorage->getContactItems($iSortField, $iSortOrder, $iOffset, $iRequestLimit, $aFilters, $iIdGroup); |
| 391: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 392: | $mResult = false; |
| 393: | $this->setLastException($oException); |
| 394: | } |
| 395: | |
| 396: | return $mResult; |
| 397: | } |
| 398: | |
| 399: | |
| 400: | |
| 401: | |
| 402: | |
| 403: | |
| 404: | public function GetContactItemObjects($mUserId) |
| 405: | { |
| 406: | $mResult = false; |
| 407: | try { |
| 408: | $mResult = $this->oStorage->GetContactItemObjects($mUserId); |
| 409: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 410: | $mResult = false; |
| 411: | $this->setLastException($oException); |
| 412: | } |
| 413: | |
| 414: | return $mResult; |
| 415: | } |
| 416: | |
| 417: | |
| 418: | |
| 419: | |
| 420: | |
| 421: | |
| 422: | public function GetMyGlobalContact($iUserId) |
| 423: | { |
| 424: | return $this->oStorage->GetMyGlobalContact($iUserId); |
| 425: | } |
| 426: | |
| 427: | |
| 428: | |
| 429: | |
| 430: | |
| 431: | |
| 432: | |
| 433: | |
| 434: | public function getGroupItemsCount($iUserId, $sSearch = '', $sFirstCharacter = '') |
| 435: | { |
| 436: | $iResult = 0; |
| 437: | try { |
| 438: | $iResult = $this->oStorage->getGroupItemsCount($iUserId, $sSearch, $sFirstCharacter); |
| 439: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 440: | $iResult = 0; |
| 441: | $this->setLastException($oException); |
| 442: | } |
| 443: | |
| 444: | return $iResult; |
| 445: | } |
| 446: | |
| 447: | |
| 448: | |
| 449: | |
| 450: | |
| 451: | |
| 452: | |
| 453: | |
| 454: | |
| 455: | |
| 456: | |
| 457: | |
| 458: | |
| 459: | public function getGroupItems( |
| 460: | $iUserId, |
| 461: | $iSortField = \Aurora\Modules\Contacts\Enums\SortField::Name, |
| 462: | $iSortOrder = \Aurora\System\Enums\SortOrder::ASC, |
| 463: | $iOffset = 0, |
| 464: | $iRequestLimit = 20, |
| 465: | $sSearch = '', |
| 466: | $sFirstCharacter = '', |
| 467: | $iContactId = 0 |
| 468: | ) |
| 469: | { |
| 470: | $mResult = false; |
| 471: | try { |
| 472: | $mResult = $this->oStorage->getGroupItems( |
| 473: | $iUserId, |
| 474: | $iSortField, |
| 475: | $iSortOrder, |
| 476: | $iOffset, |
| 477: | $iRequestLimit, |
| 478: | $sSearch, |
| 479: | $sFirstCharacter, |
| 480: | $iContactId |
| 481: | ); |
| 482: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 483: | $mResult = false; |
| 484: | $this->setLastException($oException); |
| 485: | } |
| 486: | |
| 487: | return $mResult; |
| 488: | } |
| 489: | |
| 490: | |
| 491: | |
| 492: | |
| 493: | |
| 494: | |
| 495: | public function GetAllContactsNamesWithPhones($oAccount) |
| 496: | { |
| 497: | $mResult = false; |
| 498: | try { |
| 499: | $mResult = array(); |
| 500: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 501: | $mResult = false; |
| 502: | $this->setLastException($oException); |
| 503: | } |
| 504: | |
| 505: | return $mResult; |
| 506: | } |
| 507: | |
| 508: | |
| 509: | |
| 510: | |
| 511: | |
| 512: | |
| 513: | public function createContact($oContact) |
| 514: | { |
| 515: | $bResult = false; |
| 516: | try { |
| 517: | if ($oContact->validate()) { |
| 518: | $bResult = $this->oStorage->createContact($oContact); |
| 519: | } |
| 520: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 521: | $bResult = false; |
| 522: | $this->setLastException($oException); |
| 523: | } |
| 524: | |
| 525: | if ($bResult) { |
| 526: | |
| 527: | |
| 528: | |
| 529: | |
| 530: | |
| 531: | } |
| 532: | |
| 533: | return $bResult; |
| 534: | } |
| 535: | |
| 536: | public function copyContact($iUserId, $sUID, $sFromAddressbook, $sToAddressbook) |
| 537: | { |
| 538: | $mResult = false; |
| 539: | try { |
| 540: | $mResult = $this->oStorage->copyContact($iUserId, $sUID, $sFromAddressbook, $sToAddressbook); |
| 541: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 542: | $mResult = false; |
| 543: | $this->setLastException($oException); |
| 544: | } |
| 545: | |
| 546: | return $mResult; |
| 547: | } |
| 548: | |
| 549: | |
| 550: | |
| 551: | |
| 552: | |
| 553: | |
| 554: | public function createGroup($oGroup) |
| 555: | { |
| 556: | $bResult = false; |
| 557: | try { |
| 558: | if ($oGroup->validate()) { |
| 559: | $bResult = $this->oStorage->createGroup($oGroup); |
| 560: | } |
| 561: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 562: | $bResult = false; |
| 563: | $this->setLastException($oException); |
| 564: | } |
| 565: | return $bResult; |
| 566: | } |
| 567: | |
| 568: | |
| 569: | |
| 570: | |
| 571: | |
| 572: | |
| 573: | |
| 574: | public function deleteContacts($iUserId, $aContactIds, $sAddressBook = \Afterlogic\DAV\Constants::ADDRESSBOOK_DEFAULT_NAME) |
| 575: | { |
| 576: | $bResult = false; |
| 577: | try { |
| 578: | $bResult = $this->oStorage->deleteContacts($iUserId, $aContactIds, $sAddressBook); |
| 579: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 580: | $bResult = false; |
| 581: | $this->setLastException($oException); |
| 582: | } |
| 583: | |
| 584: | if ($bResult) { |
| 585: | |
| 586: | |
| 587: | |
| 588: | |
| 589: | |
| 590: | } |
| 591: | |
| 592: | return $bResult; |
| 593: | } |
| 594: | |
| 595: | |
| 596: | |
| 597: | |
| 598: | |
| 599: | |
| 600: | |
| 601: | public function deleteSuggestContacts($iUserId, $aContactIds) |
| 602: | { |
| 603: | $bResult = false; |
| 604: | try { |
| 605: | $bResult = $this->oStorage->deleteSuggestContacts($iUserId, $aContactIds); |
| 606: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 607: | $bResult = false; |
| 608: | $this->setLastException($oException); |
| 609: | } |
| 610: | return $bResult; |
| 611: | } |
| 612: | |
| 613: | |
| 614: | |
| 615: | |
| 616: | |
| 617: | |
| 618: | |
| 619: | public function deleteGroups($iUserId, $aGroupIds) |
| 620: | { |
| 621: | $bResult = false; |
| 622: | try { |
| 623: | $bResult = $this->oStorage->deleteGroups($iUserId, $aGroupIds); |
| 624: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 625: | $bResult = false; |
| 626: | $this->setLastException($oException); |
| 627: | } |
| 628: | return $bResult; |
| 629: | } |
| 630: | |
| 631: | |
| 632: | |
| 633: | |
| 634: | |
| 635: | |
| 636: | |
| 637: | public function deleteGroup($iUserId, $mGroupId) |
| 638: | { |
| 639: | $bResult = false; |
| 640: | try { |
| 641: | $bResult = $this->oStorage->deleteGroup($iUserId, $mGroupId); |
| 642: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 643: | $bResult = false; |
| 644: | $this->setLastException($oException); |
| 645: | } |
| 646: | return $bResult; |
| 647: | } |
| 648: | |
| 649: | |
| 650: | |
| 651: | |
| 652: | |
| 653: | |
| 654: | |
| 655: | public function updateSuggestTable($iUserId, $aEmails) |
| 656: | { |
| 657: | $bResult = false; |
| 658: | try { |
| 659: | $bResult = $this->oStorage->updateSuggestTable($iUserId, $aEmails); |
| 660: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 661: | $bResult = false; |
| 662: | $this->setLastException($oException); |
| 663: | } |
| 664: | return $bResult; |
| 665: | } |
| 666: | |
| 667: | |
| 668: | |
| 669: | |
| 670: | |
| 671: | |
| 672: | public function clearAllContactsAndGroups($iUserId) |
| 673: | { |
| 674: | $bResult = $this->oStorage->clearAllContactsAndGroups($iUserId); |
| 675: | |
| 676: | return $bResult; |
| 677: | } |
| 678: | |
| 679: | |
| 680: | |
| 681: | |
| 682: | public function flushContacts() |
| 683: | { |
| 684: | $bResult = false; |
| 685: | try { |
| 686: | $bResult = $this->oStorage->flushContacts(); |
| 687: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 688: | $bResult = false; |
| 689: | $this->setLastException($oException); |
| 690: | } |
| 691: | return $bResult; |
| 692: | } |
| 693: | |
| 694: | |
| 695: | |
| 696: | |
| 697: | |
| 698: | |
| 699: | |
| 700: | public function addContactsToGroup($oGroup, $aContactIds) |
| 701: | { |
| 702: | $bResult = false; |
| 703: | try { |
| 704: | $bResult = $this->oStorage->addContactsToGroup($oGroup, $aContactIds); |
| 705: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 706: | $bResult = false; |
| 707: | $this->setLastException($oException); |
| 708: | } |
| 709: | return $bResult; |
| 710: | } |
| 711: | |
| 712: | |
| 713: | |
| 714: | |
| 715: | |
| 716: | |
| 717: | |
| 718: | public function removeContactsFromGroup($oGroup, $aContactIds) |
| 719: | { |
| 720: | $bResult = false; |
| 721: | try { |
| 722: | $bResult = $this->oStorage->removeContactsFromGroup($oGroup, $aContactIds); |
| 723: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 724: | $bResult = false; |
| 725: | $this->setLastException($oException); |
| 726: | } |
| 727: | return $bResult; |
| 728: | } |
| 729: | |
| 730: | |
| 731: | |
| 732: | |
| 733: | |
| 734: | |
| 735: | |
| 736: | |
| 737: | public function ConvertedContactLocalId($oAccount, $mContactId, $sStorage = 'global') |
| 738: | { |
| 739: | $mResult = null; |
| 740: | try { |
| 741: | $mResult = $this->oStorage->ConvertedContactLocalId($oAccount, $mContactId, $sStorage); |
| 742: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 743: | $this->setLastException($oException); |
| 744: | } |
| 745: | return $mResult; |
| 746: | } |
| 747: | |
| 748: | |
| 749: | |
| 750: | |
| 751: | |
| 752: | |
| 753: | |
| 754: | public function ConvertedContactLocalIdCollection($oAccount, $sStorage = 'global') |
| 755: | { |
| 756: | $aResult = array(); |
| 757: | try { |
| 758: | $aResult = $this->oStorage->ConvertedContactLocalIdCollection($oAccount, $sStorage); |
| 759: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 760: | $this->setLastException($oException); |
| 761: | } |
| 762: | return $aResult; |
| 763: | } |
| 764: | |
| 765: | |
| 766: | |
| 767: | |
| 768: | |
| 769: | |
| 770: | public function ContactIdsLinkedToGroups($aIds) |
| 771: | { |
| 772: | $aResult = array(); |
| 773: | try { |
| 774: | $aResult = $this->oStorage->ContactIdsLinkedToGroups($aIds); |
| 775: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 776: | $this->setLastException($oException); |
| 777: | } |
| 778: | return $aResult; |
| 779: | } |
| 780: | |
| 781: | |
| 782: | |
| 783: | |
| 784: | |
| 785: | |
| 786: | |
| 787: | public function GetGlobalContactById($iUserId, $mContactId) |
| 788: | { |
| 789: | $oContact = null; |
| 790: | try { |
| 791: | $oContact = $this->oStorage->GetGlobalContactById($iUserId, $mContactId); |
| 792: | if ($oContact) { |
| 793: | $mGroupIds = $this->getContactGroupIds($oContact); |
| 794: | if (is_array($mGroupIds)) { |
| 795: | $oContact->GroupIds = $mGroupIds; |
| 796: | } |
| 797: | } |
| 798: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 799: | $oContact = false; |
| 800: | $this->setLastException($oException); |
| 801: | } |
| 802: | |
| 803: | return $oContact; |
| 804: | } |
| 805: | |
| 806: | |
| 807: | |
| 808: | |
| 809: | |
| 810: | |
| 811: | public function getGroupEvents($iGroupId) |
| 812: | { |
| 813: | $bResult = false; |
| 814: | try { |
| 815: | $bResult = $this->oStorage->getGroupEvents($iGroupId); |
| 816: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 817: | $bResult = false; |
| 818: | $this->setLastException($oException); |
| 819: | } |
| 820: | return $bResult; |
| 821: | } |
| 822: | |
| 823: | |
| 824: | |
| 825: | |
| 826: | |
| 827: | |
| 828: | |
| 829: | public function getGroupEvent($sCalendarId, $sEventId) |
| 830: | { |
| 831: | $bResult = false; |
| 832: | try { |
| 833: | $bResult = $this->oStorage->getGroupEvent($sCalendarId, $sEventId); |
| 834: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 835: | $bResult = false; |
| 836: | $this->setLastException($oException); |
| 837: | } |
| 838: | return $bResult; |
| 839: | } |
| 840: | |
| 841: | |
| 842: | |
| 843: | |
| 844: | |
| 845: | |
| 846: | |
| 847: | |
| 848: | public function addEventToGroup($iGroupId, $sCalendarId, $sEventId) |
| 849: | { |
| 850: | $bResult = false; |
| 851: | try { |
| 852: | $bResult = $this->oStorage->addEventToGroup($iGroupId, $sCalendarId, $sEventId); |
| 853: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 854: | $bResult = false; |
| 855: | $this->setLastException($oException); |
| 856: | } |
| 857: | return $bResult; |
| 858: | } |
| 859: | |
| 860: | |
| 861: | |
| 862: | |
| 863: | |
| 864: | |
| 865: | |
| 866: | |
| 867: | public function removeEventFromGroup($iGroupId, $sCalendarId, $sEventId) |
| 868: | { |
| 869: | $bResult = false; |
| 870: | try { |
| 871: | $bResult = $this->oStorage->removeEventFromGroup($iGroupId, $sCalendarId, $sEventId); |
| 872: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 873: | $bResult = false; |
| 874: | $this->setLastException($oException); |
| 875: | } |
| 876: | return $bResult; |
| 877: | } |
| 878: | |
| 879: | |
| 880: | |
| 881: | |
| 882: | |
| 883: | |
| 884: | |
| 885: | public function removeEventFromAllGroups($sCalendarId, $sEventId) |
| 886: | { |
| 887: | $bResult = false; |
| 888: | try { |
| 889: | $bResult = $this->oStorage->removeEventFromAllGroups($sCalendarId, $sEventId); |
| 890: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 891: | $bResult = false; |
| 892: | $this->setLastException($oException); |
| 893: | } |
| 894: | return $bResult; |
| 895: | } |
| 896: | |
| 897: | public function getAddressBook($iUserId, $sUri) |
| 898: | { |
| 899: | $mResult = false; |
| 900: | try { |
| 901: | $mResult = $this->oStorage->getAddressBook($iUserId, $sUri); |
| 902: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 903: | $mResult = false; |
| 904: | $this->setLastException($oException); |
| 905: | } |
| 906: | return $mResult; |
| 907: | } |
| 908: | |
| 909: | public function createAddressBook($iUserId, $sUri, $sName) |
| 910: | { |
| 911: | $bResult = false; |
| 912: | try { |
| 913: | $bResult = $this->oStorage->createAddressBook($iUserId, $sUri, $sName); |
| 914: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 915: | $bResult = false; |
| 916: | $this->setLastException($oException); |
| 917: | } |
| 918: | return $bResult; |
| 919: | } |
| 920: | |
| 921: | public function updateAddressBook($iUserId, $sName, $sNewName) |
| 922: | { |
| 923: | $bResult = false; |
| 924: | try { |
| 925: | $bResult = $this->oStorage->updateAddressBook($iUserId, $sName, $sNewName); |
| 926: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 927: | $bResult = false; |
| 928: | $this->setLastException($oException); |
| 929: | } |
| 930: | return $bResult; |
| 931: | } |
| 932: | |
| 933: | public function deleteAddressBook($iUserId, $sName) |
| 934: | { |
| 935: | $bResult = false; |
| 936: | try { |
| 937: | $bResult = $this->oStorage->deleteAddressBook($iUserId, $sName); |
| 938: | } catch (\Aurora\System\Exceptions\BaseException $oException) { |
| 939: | $bResult = false; |
| 940: | $this->setLastException($oException); |
| 941: | } |
| 942: | return $bResult; |
| 943: | } |
| 944: | } |
| 945: | |