Commit 3c3c170c authored by BohdanDmytryshyn's avatar BohdanDmytryshyn
Browse files

Release 5.3.0

parent 035a456d
......@@ -67,8 +67,18 @@ class CRM_CiviMobileAPI_Api_CiviMobileCustomFields_Get extends CRM_CiviMobileAPI
return [];
}
foreach ($customGroups['values'] as $customGroup) {
$result[] = $this->prepareCustomGroup($customGroup);
if (!CRM_Core_Permission::check('administer CiviCRM') && !CRM_Core_Permission::check('access all custom data')) {
$accessibleCustomGroupsToView = CRM_Core_Permission::customGroup(CRM_Core_Permission::VIEW);
foreach ($customGroups['values'] as $customGroup) {
if (in_array($customGroup['id'], $accessibleCustomGroupsToView)) {
$result[] = $this->prepareCustomGroup($customGroup);
}
}
} else {
foreach ($customGroups['values'] as $customGroup) {
$result[] = $this->prepareCustomGroup($customGroup);
}
}
return $result;
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_Api_CiviMobileEventSession_Get extends CRM_CiviMobileAPI_Api_CiviMobileBase {
/**
......@@ -104,7 +106,7 @@ class CRM_CiviMobileAPI_Api_CiviMobileEventSession_Get extends CRM_CiviMobileAPI
if (empty($session["venue_id"])) {
$isDisplay = 0;
$displayStatus = ts('Venue does not exists in session');
$displayStatus = E::ts('Venue does not exists in session');
}
$event = $this->getCachedEventById($session["event_id"]);
......@@ -114,15 +116,15 @@ class CRM_CiviMobileAPI_Api_CiviMobileEventSession_Get extends CRM_CiviMobileAPI
&& empty($session["venue"])
) {
$isDisplay = 0;
$displayStatus = ts('Venue does not exists in session and session is outside of timeframe event');
$displayStatus = E::ts('Venue does not exists in session and session is outside of timeframe event');
} elseif ((strtotime($session["end_time"]) > strtotime($event->end_date) && $event->end_date != NULL)
|| strtotime($session["start_time"]) < strtotime($event->start_date)
) {
$isDisplay = 0;
$displayStatus = ts('Session is outside of timeframe event');
$displayStatus = E::ts('Session is outside of timeframe event');
}
if ($isDisplay == 1) {
$displayStatus = ts('Session is ready to use');
$displayStatus = E::ts('Session is ready to use');
}
return [
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
/**
* Class handles CiviMobileParticipantPaymentCreate api
*/
......@@ -100,24 +102,24 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPayment_Create {
}
if ($this->isContactAlreadyRegistered($this->params['contact_id'], $this->params['event_id'])) {
throw new api_Exception(ts('This contact has already been assigned to this event.'), 'contact_already_registered');
throw new api_Exception(E::ts('This contact has already been assigned to this event.'), 'contact_already_registered');
}
$validParams = $this->getExpectedParams();
$priceSetId = CRM_Price_BAO_PriceSet::getFor(CRM_Event_BAO_Event::getTableName(), $this->event->id);
if (empty($priceSetId)) {
throw new api_Exception(ts('Can not get price set assigned to event.'), 'event_empty_price_set');
throw new api_Exception(E::ts('Can not get price set assigned to event.'), 'event_empty_price_set');
}
$priceSet = $this->getPriceSet($priceSetId);
if (empty($priceSet)) {
throw new api_Exception(ts('Can not get price set assigned to event.'), 'event_empty_price_set');
throw new api_Exception(E::ts('Can not get price set assigned to event.'), 'event_empty_price_set');
}
$priceSetFields = CRM_CiviMobileAPI_Utils_PriceSet::getFields($priceSetId);
if (empty($priceSetFields) && empty($priceSetFields['values'])) {
throw new api_Exception(ts('Can not get price set fields assigned to event.'), 'event_empty_price_set_fields');
throw new api_Exception(E::ts('Can not get price set fields assigned to event.'), 'event_empty_price_set_fields');
}
$validParams['price_set_selected_values'] = $this->validatePriceSetItems($validParams['price_set_selected_values'], $priceSetFields['values']);
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_CiviMobileAPI_Api_CiviMobileBase {
/**
......@@ -19,7 +21,7 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_Civ
$this->validParams['email']
)) {
if (!CRM_CiviMobileAPI_BAO_CivimobileEventPaymentInfo::deleteByHash($tmpData['cmb_hash'])) {
throw new api_Exception(ts('Previous Payment cannot be deleted (hash=%1). Please complete payment', [1 => $tmpData['cmb_hash']]), 'participant_previous_payment_not_completed');
throw new api_Exception(E::ts('Previous Payment cannot be deleted (hash=%1). Please complete payment', [1 => $tmpData['cmb_hash']]), 'participant_previous_payment_not_completed');
}
}
......@@ -59,7 +61,7 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_Civ
protected function getValidParams($params) {
$currentCMS = CRM_CiviMobileAPI_Utils_CmsUser::getInstance()->getSystem();
if ($currentCMS == CRM_CiviMobileAPI_Utils_CmsUser::CMS_JOOMLA) {
throw new api_Exception(ts('Joomla does not support that functionality'), 'joomla_does_not_support_that_functionality');
throw new api_Exception(E::ts('Joomla does not support that functionality'), 'joomla_does_not_support_that_functionality');
}
$eventId = (int) $params['event_id'];
......@@ -69,7 +71,7 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_Civ
try {
civicrm_api3('Event', 'getsingle', ['id' => $eventId]);
} catch (CiviCRM_API3_Exception $e) {
throw new api_Exception(ts('Event(id = %1) User can not be registered because event does not exist.', $eventId), 'event_does_not_exist');
throw new api_Exception(E::ts('Event(id = %1) User can not be registered because event does not exist.', $eventId), 'event_does_not_exist');
}
if ($contactId) {
......@@ -80,41 +82,41 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_Civ
'sequential' => 1,
]);
if (!empty($participants['values'])) {
throw new api_Exception(ts('Contact(id = %1) is already registered on the Event(id = %2).', [1 => $contactId, 2 => $eventId]), 'participant_already_exist');
throw new api_Exception(E::ts('Contact(id = %1) is already registered on the Event(id = %2).', [1 => $contactId, 2 => $eventId]), 'participant_already_exist');
}
try {
civicrm_api3('Contact', 'getsingle', ['id' => $contactId]);
} catch (CiviCRM_API3_Exception $e) {
throw new api_Exception(ts('Contact(id = %1) does not exist.', [1 => $contactId]), 'contact_does_not_exist');
throw new api_Exception(E::ts('Contact(id = %1) does not exist.', [1 => $contactId]), 'contact_does_not_exist');
}
} else {
if (empty($params['first_name'])) {
throw new api_Exception(ts('First name \'%1\' cannot be empty.', [1 => $params['first_name']]), 'contact_has_invalid_first_name');
throw new api_Exception(E::ts('First name \'%1\' cannot be empty.', [1 => $params['first_name']]), 'contact_has_invalid_first_name');
}
if (empty($params['last_name'])) {
throw new api_Exception(ts('Last name \'%1\' cannot be empty.', [1 => $params['last_name']]), 'contact_has_invalid_last_name');
throw new api_Exception(E::ts('Last name \'%1\' cannot be empty.', [1 => $params['last_name']]), 'contact_has_invalid_last_name');
}
if (!filter_var($params['email'], FILTER_VALIDATE_EMAIL)) {
throw new api_Exception(ts('Email \'%1\' have to be valid.', [1 => $params['email']]), 'contact_has_invalid_email');
throw new api_Exception(E::ts('Email \'%1\' have to be valid.', [1 => $params['email']]), 'contact_has_invalid_email');
}
}
$priceSetId = CRM_Price_BAO_PriceSet::getFor(CRM_Event_BAO_Event::getTableName(), $eventId);
if (empty($priceSetId)) {
throw new api_Exception(ts('Can not get price set assigned to event.'), 'event_empty_price_set');
throw new api_Exception(E::ts('Can not get price set assigned to event.'), 'event_empty_price_set');
}
$priceSet = $this->getPriceSet($priceSetId);
if (empty($priceSet)) {
throw new api_Exception(ts('Can not get price set assigned to event.'), 'event_empty_price_set');
throw new api_Exception(E::ts('Can not get price set assigned to event.'), 'event_empty_price_set');
}
$priceSetFields = CRM_CiviMobileAPI_Utils_PriceSet::getFields($priceSetId);
if (empty($priceSetFields) && empty($priceSetFields['values'])) {
throw new api_Exception(ts('Can not get price set fields assigned to event.'), 'event_empty_price_set_fields');
throw new api_Exception(E::ts('Can not get price set fields assigned to event.'), 'event_empty_price_set_fields');
}
$this->validatePriceSetItems($selPriceSet, $priceSetFields['values']);
......@@ -153,41 +155,41 @@ class CRM_CiviMobileAPI_Api_CiviMobileParticipantPaymentLink_Get extends CRM_Civ
*/
private function validatePriceSetItems($selPriceSet, $priceSetFields) {
if (!is_array($selPriceSet)) {
throw new api_Exception(ts('Can not parse selected price set'), 'can_not_parse_selected_price_set');
throw new api_Exception(E::ts('Can not parse selected price set'), 'can_not_parse_selected_price_set');
}
if (!empty($selPriceSet)) {
foreach ($selPriceSet as $psId => $psFieldIds) {
foreach ($psFieldIds[0] as $psFieldId => $psFieldValues) {
if (empty($psFieldValues)) {
throw new api_Exception(ts('Can not parse selected value for field (id = %1) for price set (id = %2)', [1 => $psFieldId, 2 => $psId]), 'field_value_does_not_exist');
throw new api_Exception(E::ts('Can not parse selected value for field (id = %1) for price set (id = %2)', [1 => $psFieldId, 2 => $psId]), 'field_value_does_not_exist');
}
$priceField = $this->findPriceSetFiled($priceSetFields, $psId, $psFieldId);
if (empty($priceField)) {
throw new api_Exception(ts('Price Field (id = %1) does not exist for Event\'s', [1 => $psFieldId]), 'field_id_does_not_exist');
throw new api_Exception(E::ts('Price Field (id = %1) does not exist for Event\'s', [1 => $psFieldId]), 'field_id_does_not_exist');
}
$priceSetFieldValues = $this->getPriceSetFieldValues($priceField['id']);
if (empty($priceSetFieldValues['values'])) {
throw new api_Exception(ts('Empty filed values for price set field (id = %1). Please create it in administer.', [1 => $priceField['id']]), 'empty_price_set_field_values');
throw new api_Exception(E::ts('Empty filed values for price set field (id = %1). Please create it in administer.', [1 => $priceField['id']]), 'empty_price_set_field_values');
}
foreach ($psFieldValues as $item => $psFieldValueId) {
if ($priceField['html_type'] == 'Text' && empty($psFieldValueId[key($psFieldValueId)])) {
throw new api_Exception(ts('"filed_value_count" must be filled for field with "Text" "html_type"'), 'invalid_filed_value_count');
throw new api_Exception(E::ts('"filed_value_count" must be filled for field with "Text" "html_type"'), 'invalid_filed_value_count');
}
$priceSetFieldValue = $this->findPriceSetFiledValue($priceSetFieldValues['values'], key($psFieldValueId));
if (empty($priceSetFieldValue)) {
throw new api_Exception(ts('Not valid value(id = %1) for price set field (id = %2).', [1 => key($psFieldValueId), 2 => $psFieldId]), 'not_valid_value_for_price_set_field');
throw new api_Exception(E::ts('Not valid value(id = %1) for price set field (id = %2).', [1 => key($psFieldValueId), 2 => $psFieldId]), 'not_valid_value_for_price_set_field');
}
}
}
foreach ($priceSetFields as $priceSetField) {
if ($priceSetField['is_required'] == 1 && !in_array($priceSetField['id'], array_keys($psFieldIds[0]))) {
throw new api_Exception(ts('Price field (id = %1) is required field for price set(id = %2)', [1 => $priceSetField['id'], 2 => $priceSetField['price_set_id']]), 'required_filed_for_price_set');
throw new api_Exception(E::ts('Price field (id = %1) is required field for price set(id = %2)', [1 => $priceSetField['id'], 2 => $priceSetField['price_set_id']]), 'required_filed_for_price_set');
}
}
}
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_Api_CiviMobilePublicParticipant_Create extends CRM_CiviMobileAPI_Api_CiviMobileBase {
/**
......@@ -45,7 +47,7 @@ class CRM_CiviMobileAPI_Api_CiviMobilePublicParticipant_Create extends CRM_CiviM
$event->is_public = 1;
$eventExistence = $event->find(TRUE);
if (empty($eventExistence)) {
throw new api_Exception(ts('Event(id=' . $params['event_id'] . ') does not exist or is not public.'), 'public_event_does_not_exist');
throw new api_Exception(E::ts('Event(id=' . $params['event_id'] . ') does not exist or is not public.'), 'public_event_does_not_exist');
}
$contactId = $this->getContactId($params);
......@@ -97,7 +99,7 @@ class CRM_CiviMobileAPI_Api_CiviMobilePublicParticipant_Create extends CRM_CiviM
'last_name' => $params["last_name"],
]);
} catch (CiviCRM_API3_Exception $e) {
throw new api_Exception(ts('Can not create Contact. Error: ') . $e->getMessage(), 'can_not_create_contact');
throw new api_Exception(E::ts('Can not create Contact. Error: ') . $e->getMessage(), 'can_not_create_contact');
}
try {
......@@ -107,7 +109,7 @@ class CRM_CiviMobileAPI_Api_CiviMobilePublicParticipant_Create extends CRM_CiviM
'is_primary' => 1,
]);
} catch (CiviCRM_API3_Exception $e) {
throw new api_Exception(ts('Can not create Email to Contact. Error: ') . $e->getMessage(), 'can_not_create_email_to_contact');
throw new api_Exception(E::ts('Can not create Email to Contact. Error: ') . $e->getMessage(), 'can_not_create_email_to_contact');
}
return (int) $contact["id"];
......@@ -127,7 +129,7 @@ class CRM_CiviMobileAPI_Api_CiviMobilePublicParticipant_Create extends CRM_CiviM
'last_name' => $params["last_name"],
]);
} catch (CiviCRM_API3_Exception $e) {
throw new api_Exception(ts('Can not update Contact. Error: ') . $e->getMessage(), 'can_not_update_contact');
throw new api_Exception(E::ts('Can not update Contact. Error: ') . $e->getMessage(), 'can_not_update_contact');
}
}
......
......@@ -26,6 +26,9 @@ class CRM_CiviMobileAPI_ApiWrapper_Contact implements API_Wrapper {
*/
public function toApiOutput($apiRequest, $result) {
if ($apiRequest['action'] == 'getsingle') {
$result['can_edit'] = CRM_Contact_BAO_Contact_Permission::allow($result['id'], CRM_Core_Permission::EDIT) ? 1 : 0;
if (empty($result['current_employer_id']) && !empty($result['contact_id'])) {
$result['current_employer_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $result['contact_id'], 'employer_id');
}
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
/**
* @deprecated will be deleted in version 7.0.0
*/
......@@ -36,7 +38,7 @@ class CRM_CiviMobileAPI_ApiWrapper_EntityTag_Get implements API_Wrapper {
'id' => $value['tag_id'],
]);
} catch (CiviCRM_API3_Exception $e) {
throw new \API_Exception(ts("Something wrong with getting info for tag: " . $e->getMessage()));
throw new \API_Exception(E::ts("Something wrong with getting info for tag: " . $e->getMessage()));
}
$value['name'] = !empty($tagInfo['name']) ? $tagInfo['name'] : '';
......@@ -52,7 +54,7 @@ class CRM_CiviMobileAPI_ApiWrapper_EntityTag_Get implements API_Wrapper {
'id' => $tagInfo['parent_id'],
]);
} catch (CiviCRM_API3_Exception $e) {
throw new \API_Exception(ts("Something wrong with getting info for parent tag: " . $e->getMessage()));
throw new \API_Exception(E::ts("Something wrong with getting info for parent tag: " . $e->getMessage()));
}
if ($parentTagInfo['is_tagset'] == '1') {
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
/**
* @deprecated will be deleted in version 7.0.0
*/
......@@ -26,7 +28,7 @@ class CRM_CiviMobileAPI_ApiWrapper_GroupContact_Create implements API_Wrapper {
* @throws API_Exception
*/
public function toApiOutput($apiRequest, $result) {
$status = $apiRequest['params']['status'];
$status = !empty($apiRequest['params']['status']) ? $apiRequest['params']['status'] : NULL;
if (!empty($status) && !is_array($status) && ($status == "Added" || $status == "Removed")) {
$groupId = $apiRequest['params']['group_id'];
......@@ -36,7 +38,7 @@ class CRM_CiviMobileAPI_ApiWrapper_GroupContact_Create implements API_Wrapper {
'id' => $groupId,
]);
} catch (CiviCRM_API3_Exception $e) {
throw new \API_Exception(ts("Something wrong with getting info for group: " . $e->getMessage()));
throw new \API_Exception(E::ts("Something wrong with getting info for group: " . $e->getMessage()));
}
$result['title'] = !empty($groupInfo['title']) ? $groupInfo['title'] : '';
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
/**
* @deprecated will be deleted in version 7.0.0
*/
......@@ -25,7 +27,7 @@ class CRM_CiviMobileAPI_ApiWrapper_Participant_Create implements API_Wrapper {
$participantExist = $participant->find(TRUE);
if (!empty($participantExist)) {
throw new api_Exception(ts('This contact has already been assigned to this event.'), 'contact_already_registered');
throw new api_Exception(E::ts('This contact has already been assigned to this event.'), 'contact_already_registered');
}
if (empty($apiRequest['params']['fee_currency'])) {
......@@ -41,7 +43,7 @@ class CRM_CiviMobileAPI_ApiWrapper_Participant_Create implements API_Wrapper {
}
if (empty($apiRequest['params']['status_id'])) {
throw new \API_Exception(ts('Empty participant status field(status_id). Please fill it.'));
throw new \API_Exception(E::ts('Empty participant status field(status_id). Please fill it.'));
}
return $apiRequest;
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
/**
* @deprecated will be deleted in version 7.0.0
*/
......@@ -39,7 +41,7 @@ class CRM_CiviMobileAPI_ApiWrapper_Participant_Get implements API_Wrapper {
'id' => $value['contact_id'],
]);
} catch (CiviCRM_API3_Exception $e) {
throw new \API_Exception(ts("Something wrong with getting img url of contact: " . $e->getMessage()));
throw new \API_Exception(E::ts("Something wrong with getting img url of contact: " . $e->getMessage()));
}
if ($activeParam == 1) {
......
......@@ -2,6 +2,7 @@
use CRM_CiviMobileAPI_Utils_CmsUser as CmsUser;
use CRM_CiviMobileAPI_Utils_JsonResponse as JsonResponse;
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
......@@ -26,7 +27,7 @@ class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
public static function getCiviContact($drupalUserId) {
$contact = static::findContact($drupalUserId);
if (!$contact) {
JsonResponse::sendErrorResponse(ts('There are no such contact in CiviCRM'));
JsonResponse::sendErrorResponse(E::ts('There are no such contact in CiviCRM'));
}
return $contact;
......@@ -87,7 +88,7 @@ class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
return TRUE;
}
else {
JsonResponse::sendErrorResponse(ts('Sorry, but CiviMobile are not supporting your system yet.'));
JsonResponse::sendErrorResponse(E::ts('Sorry, but CiviMobile are not supporting your system yet.'));
return FALSE;
}
}
......@@ -102,7 +103,7 @@ class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
return TRUE;
}
else {
JsonResponse::sendErrorResponse(ts('You are blocked for a %1 min. Please try again later', [1 => self::BLOCK_MINUTES]));
JsonResponse::sendErrorResponse(E::ts('You are blocked for a %1 min. Please try again later', [1 => self::BLOCK_MINUTES]));
return FALSE;
}
}
......@@ -119,9 +120,9 @@ class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
$cmsUserId = CmsUser::getInstance()->validateAccount($email, $password);
if ($cmsUserId === FALSE) {
JsonResponse::sendErrorResponse(ts('Wrong email or password'));
JsonResponse::sendErrorResponse(E::ts('Wrong email or password'));
}
return $cmsUserId;
}
......@@ -134,10 +135,32 @@ class CRM_CiviMobileAPI_Authentication_AuthenticationHelper {
$userAccount = CmsUser::getInstance()->searchAccount($emailOrUsername);
if (!isset($userAccount) && empty($userAccount)) {
JsonResponse::sendErrorResponse(ts('Wrong email/login'), 'email_or_username');
JsonResponse::sendErrorResponse(E::ts('Wrong email/login'), 'email_or_username');
}
return $userAccount->uid;
}
/**
* Returns contact_id by 'api_key' and 'key' GET-parameters
*
* @return bool|int
* @throws CRM_Core_Exception
*/
public static function authenticateContact() {
$store = NULL;
$api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST');
if (!CRM_Utils_System::authenticateKey(FALSE) || empty($api_key)) {
return false;
}
$contactId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key');
if ($contactId) {
return (int) $contactId;
}
return false;
}
}
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
use CRM_CiviMobileAPI_Utils_JsonResponse as JsonResponse;
/**
......@@ -73,7 +74,7 @@ class CRM_CiviMobileAPI_Authentication_DisablePushToken {
$pushNotificationRow = array_shift(CRM_CiviMobileAPI_BAO_PushNotification::getAll($listOfSearchedParameters));
if (!isset($pushNotificationRow['id']) || empty($pushNotificationRow['id'])) {
JsonResponse::sendErrorResponse(ts('No such id'));
JsonResponse::sendErrorResponse(E::ts('No such id'));
}
return $pushNotificationRow;
......
<?php
use CRM_CiviMobileAPI_Utils_JsonResponse as JsonResponse;
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_Authentication_Login {
......@@ -99,7 +100,7 @@ class CRM_CiviMobileAPI_Authentication_Login {
private function getUserApiKey() {
$apiKey = $this->civiContact->api_key ? $this->civiContact->api_key : $this->setApiKey($this->civiContact->id);
if (!$apiKey) {
JsonResponse::sendErrorResponse(ts('Something went wrong, we can not create the API KEY'));
JsonResponse::sendErrorResponse(E::ts('Something went wrong, we can not create the API KEY'));
}
return $apiKey;
......
......@@ -102,8 +102,6 @@ class CRM_CiviMobileAPI_BAO_LocationVenue extends CRM_CiviMobileAPI_DAO_Location
id,
name,
description,
attached_file_url,
attached_file_type,
address_description,
address,
longitude,
......@@ -145,9 +143,6 @@ class CRM_CiviMobileAPI_BAO_LocationVenue extends CRM_CiviMobileAPI_DAO_Location
if (!empty($params['description'])) {
$query->where('description = @description', ['description' => $params['description']]);
}
if (!empty($params['attached_file_url'])) {
$query->where('attached_file_url = @attached_file_url', ['attached_file_url' => $params['attached_file_url']]);
}
if (!empty($params['address_description'])) {
$query->where('address_description = @address_description', ['address_description' => $params['address_description']]);
}
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_DAO_AgendaConfig extends CRM_Core_DAO {
/**
......@@ -74,7 +76,7 @@ class CRM_CiviMobileAPI_DAO_AgendaConfig extends CRM_Core_DAO {
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('id'),
'title' => E::ts('id'),
'description' => 'id',
'required' => TRUE,
'import' => TRUE,
......@@ -89,7 +91,7 @@ class CRM_CiviMobileAPI_DAO_AgendaConfig extends CRM_Core_DAO {
'event_id' => [
'name' => 'event_id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Event id'),
'title' => E::ts('Event id'),
'description' => 'Event id',
'required' => TRUE,
'import' => TRUE,
......@@ -104,7 +106,7 @@ class CRM_CiviMobileAPI_DAO_AgendaConfig extends CRM_Core_DAO {
'is_active' => [
'name' => 'is_active',
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Is active'),
'title' => E::ts('Is active'),
'description' => 'Is active',
'required' => FALSE,
'import' => TRUE,
......
<?php
use CRM_CiviMobileAPI_ExtensionUtil as E;
class CRM_CiviMobileAPI_DAO_CivimobileEventPaymentInfo extends CRM_Core_DAO {
/**
......@@ -116,8 +118,8 @@ class CRM_CiviMobileAPI_DAO_CivimobileEventPaymentInfo extends CRM_Core_DAO {
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Id'),
'description' => ts('Id'),
'title' => E::ts('Id'),
'description' => E::ts('Id'),
'required' => TRUE,
'import' => TRUE,
'where' => self::getTableName() . '.id',
......@@ -131,8 +133,8 @@ class CRM_CiviMobileAPI_DAO_CivimobileEventPaymentInfo extends CRM_Core_DAO {
'event_id' => [
'name' => 'event_id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Event Id'),
'description' => ts('Event Id'),
'title' => E::ts('Event Id'),
'description' => E::ts('Event Id'),
'required' => TRUE,
'import' => TRUE,
'where' => self::getTableName() . '.event_id',
......@@ -146,8 +148,8 @@ class CRM_CiviMobileAPI_DAO_CivimobileEventPaymentInfo extends CRM_Core_DAO {
'cmb_hash' => [
'name' => 'cmb_hash',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('CMB Hash'),
'description' => ts('CMB Hash'),
'title' => E::ts('CMB Hash'),
'description' => E::ts('CMB Hash'),
'required' => TRUE,
'import' => TRUE,
'where' => self::getTableName() . '.hash',
......@@ -161,8 +163,8 @@ class CRM_CiviMobileAPI_DAO_CivimobileEventPaymentInfo extends CRM_Core_DAO {
'price_set' => [
'name' => 'price_set',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('Price Set'),
'description' => ts('Price Set'),