Fix from pull request observations - refs BT#9092

1.10.x
Daniel Barreto 11 years ago
parent 1bdc1dd719
commit 6d2c9e5ce1
  1. 14
      main/inc/lib/sessionmanager.lib.php
  2. 2
      main/inc/lib/usermanager.lib.php
  3. 4
      main/webservices/registration.soap.php
  4. 2
      plugin/advancedsubscription/src/HookAdvancedSubscription.php

@ -5429,13 +5429,15 @@ class SessionManager
} }
/** /**
* Returns the list of session (name, short description, start date, end date) from category. * Returns list of a few data from session (name, short description, start date, end date)
* The short description is an extra field value * And the next extra fields
* short_description, mode, duration, vacancies, brochure, target, schedule
* from Session category Id.
* @param int $categoryId * @param int $categoryId
* @param string $target * @param string $target
* @return mixed * @return mixed
*/ */
public static function getSessionBriefListByCategory($categoryId, $target) { public static function getBriefSessionListAndExtraByCategory($categoryId, $target) {
// Init variables // Init variables
$categoryId = (int) $categoryId; $categoryId = (int) $categoryId;
$sessionList = array(); $sessionList = array();
@ -5653,13 +5655,13 @@ class SessionManager
// Not found result, update error message // Not found result, update error message
$errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId; $errorResult['errorMessage'] = 'Not found any session for session category id ' . $sessionCategoryId;
} }
}
return $errorResult; return $errorResult;
} }
}
/** /**
* Return session description from * Return session description from session id
* @param int $sessionId * @param int $sessionId
* @return string * @return string
*/ */
@ -5669,7 +5671,7 @@ class SessionManager
$sessionId = intval($sessionId); $sessionId = intval($sessionId);
$description = ''; $description = '';
// Check if session id is valid // Check if session id is valid
if ($sessionId !== 0) { if ($sessionId > 0) {
// Select query from session id // Select query from session id
$rows = Database::select( $rows = Database::select(
'description', 'description',

@ -5116,7 +5116,7 @@ EOF;
public static function getStudentBoss($userId) public static function getStudentBoss($userId)
{ {
$userId = intval($userId); $userId = intval($userId);
if ($userId !== 0) { if ($userId > 0) {
$userRelTable = Database::get_main_table(TABLE_MAIN_USER_REL_USER); $userRelTable = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
$row = Database::select( $row = Database::select(
'DISTINCT friend_user_id AS boss_id', 'DISTINCT friend_user_id AS boss_id',

@ -22,13 +22,13 @@ function return_error($code) {
$fault = new soap_fault('Server', '', 'Secret key is not correct or params are not correctly set'); $fault = new soap_fault('Server', '', 'Secret key is not correct or params are not correctly set');
break; break;
case WS_ERROR_NOT_FOUND_RESULT: case WS_ERROR_NOT_FOUND_RESULT:
$fault = new soap_fault('Server', '', 'Not found any result from the query'); $fault = new soap_fault('Server', '', 'No result was found for this query');
break; break;
case WS_ERROR_INVALID_INPUT: case WS_ERROR_INVALID_INPUT:
$fault = new soap_fault('Server', '', 'The input variables are invalid o are not correctly set'); $fault = new soap_fault('Server', '', 'The input variables are invalid o are not correctly set');
break; break;
case WS_ERROR_SETTING: case WS_ERROR_SETTING:
$fault = new soap_fault('Server', '', 'Please check the configuration and installation for this webservice'); $fault = new soap_fault('Server', '', 'Please check the configuration for this webservice');
break; break;
} }
return $fault; return $fault;

@ -397,7 +397,7 @@ class HookAdvancedSubscription extends HookObserver implements
} }
// Get the session brief List by category // Get the session brief List by category
$sessionList = SessionManager::getSessionBriefListByCategory($sessionCategoryId, $params['target']); $sessionList = SessionManager::getBriefSessionListAndExtraByCategory($sessionCategoryId, $params['target']);
return $sessionList; return $sessionList;
} }

Loading…
Cancel
Save