From 893d2c5ab518d315cbc2cd60f34c7780e65c4d55 Mon Sep 17 00:00:00 2001 From: Hufschmidt Date: Wed, 7 Oct 2015 15:24:50 +0200 Subject: [PATCH] Reworded category <-> calendar confusing a bit --- .../extensions/umr_v1/models/Calendars.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/REST/RESTController/extensions/umr_v1/models/Calendars.php b/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/REST/RESTController/extensions/umr_v1/models/Calendars.php index d53d3dad..ebb405b5 100644 --- a/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/REST/RESTController/extensions/umr_v1/models/Calendars.php +++ b/Customizing/global/plugins/Services/UIComponent/UserInterfaceHook/REST/RESTController/extensions/umr_v1/models/Calendars.php @@ -58,15 +58,15 @@ protected static function getCategories($accessToken) { /** * */ - protected static function getCalendarInfo($categories, $calendarInfo) { + protected static function getCalendarInfo($categories, $categoryInfo) { // Fetch all sub calendars - $calendarId = $calendarInfo['cat_id']; + $calendarId = $categoryInfo['cat_id']; $subCategories = $categories->getSubitemCategories($calendarId); // Build calendar-info $object = array( 'calendar_id' => intval($calendarId), - 'title' => $calendarInfo['title'] + 'title' => $categoryInfo['title'] ); // Add children (if available) @@ -91,9 +91,9 @@ function($value) { return intval($value); }, */ public static function hasCalendar($accessToken, $calendarId) { $categories = Calendars::getCategories($accessToken); - $calendarInfos = $categories->getCategoriesInfo(); + $categoryInfos = $categories->getCategoriesInfo(); - return ($calendarInfos[$calendarId] != null); + return ($categoryInfos[$calendarId] != null); } @@ -104,8 +104,8 @@ public static function getAllCalendars($accessToken) { // Fetch info for each calendar (called category here) $result = array(); $categories = self::getCategories($accessToken); - foreach($categories->getCategoriesInfo() as $calendarInfo) { - $info = self::getCalendarInfo($categories, $calendarInfo); + foreach($categories->getCategoriesInfo() as $categoryInfo) { + $info = self::getCalendarInfo($categories, $categoryInfo); $calendarId = $info['calendar_id']; $result[$calendarId] = $info; } @@ -125,12 +125,12 @@ public static function getCalendars($accessToken, $calendarIds) { // Fetch each contact from list $result = array(); $categories = self::getCategories($accessToken); - $calendarInfos = $categories->getCategoriesInfo(); + $categoryInfos = $categories->getCategoriesInfo(); $noSuccess = true; foreach($calendarIds as $calendarId) // Does calendar with this id exist? - if ($calendarInfos[$calendarId]) { - $result[$calendarId] = self::getCalendarInfo($categories, $calendarInfos[$calendarId]); + if ($categoryInfos[$calendarId]) { + $result[$calendarId] = self::getCalendarInfo($categories, $categoryInfos[$calendarId]); $noSuccess = false; } // Add missing calendarId information to response