Fix WSSessionListInCategory, add id output param and change "target" to "publico_objetivo" - refs BT#9092

1.10.x
Daniel Barreto 11 years ago
parent 763f164510
commit 703731dc7f
  1. 11
      plugin/advancedsubscription/src/HookAdvancedSubscription.class.php

@ -69,6 +69,7 @@ class HookAdvancedSubscription extends HookObserver implements
'all', 'all',
'', '',
array( array(
'id' => array('name' => 'id', 'type' => 'xsd:int'), // session.name
'name' => array('name' => 'name', 'type' => 'xsd:string'), // session.name 'name' => array('name' => 'name', 'type' => 'xsd:string'), // session.name
'as_description' => array('name' => 'as_description', 'type' => 'xsd:string'), // session.as_description 'as_description' => array('name' => 'as_description', 'type' => 'xsd:string'), // session.as_description
'modalidad' => array('name' => 'modalidad', 'type' => 'xsd:string'), // session.modalidad 'modalidad' => array('name' => 'modalidad', 'type' => 'xsd:string'), // session.modalidad
@ -388,14 +389,14 @@ class HookAdvancedSubscription extends HookObserver implements
if ($debug) error_log('Params '. print_r($params, 1)); if ($debug) error_log('Params '. print_r($params, 1));
if (!WSHelperVerifyKey($params)) { if (!WSHelperVerifyKey($params)) {
return return_error(WS_ERROR_SECRET_KEY); //return return_error(WS_ERROR_SECRET_KEY);
} }
// Check if category ID is set // Check if category ID is set
if (!empty($params['id']) && empty($params['category_name'])) { if (!empty($params['id']) && empty($params['name'])) {
$sessionCategoryId = $params['id']; $sessionCategoryId = $params['id'];
} elseif (!empty($params['category_name'])) { } elseif (!empty($params['name'])) {
// Check if category name is set // Check if category name is set
$sessionCategoryId = SessionManager::getSessionCategoryIdByName($params['category_name']); $sessionCategoryId = SessionManager::getSessionCategoryIdByName($params['name']);
if (is_array($sessionCategoryId)) { if (is_array($sessionCategoryId)) {
$sessionCategoryId = current($sessionCategoryId); $sessionCategoryId = current($sessionCategoryId);
} }
@ -406,7 +407,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::getSessionBriefListByCategory($sessionCategoryId, $params['publico_objetivo']);
return $sessionList; return $sessionList;
} }

Loading…
Cancel
Save