X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FBAO%2FEvent.php;h=2ad3f680b15595568f1718266ef41cf8b3ed8428;hb=05a5b2cf3ff09660a5f97bf36632af69127ec08d;hp=cce8709032b7ae91207d307cdb729d15db04fb61;hpb=25d95f38e877adc852b7fee2e27b59f96ab654a8;p=civicrm-core.git diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index cce8709032..2ad3f680b1 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -380,13 +380,7 @@ WHERE civicrm_event.is_active = 1 AND $optionGroupId = $optionGroupDAO->id; } // Get the event summary display preferences - $show_max_events = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, - 'show_events' - ); - // default to 10 if no option is set - if (is_null($show_max_events)) { - $show_max_events = 10; - } + $show_max_events = Civi::settings()->get('show_events'); // show all events if show_events is set to a negative value if ($show_max_events >= 0) { $event_summary_limit = "LIMIT 0, $show_max_events"; @@ -632,11 +626,15 @@ $event_summary_limit if ($role) { $roleClause = 'IN'; } - $roles = implode(',', array_keys($roleTypes)); - if (empty($roles)) { - $roles = 0; + + if (!empty($roleTypes)) { + $escapedRoles = array(); + foreach (array_keys($roleTypes) as $roleType) { + $escapedRoles[] = CRM_Utils_Type::escape($roleType, 'String'); + } + + $clause[] = "participant.role_id {$roleClause} ( '" . implode("', '", $escapedRoles) . "' ) "; } - $clause[] = "participant.role_id {$roleClause} ( $roles )"; } $sqlClause = ''; @@ -847,9 +845,7 @@ WHERE civicrm_event.is_active = 1 $permissions = CRM_Core_Permission::event(CRM_Core_Permission::VIEW); // check if we're in shopping cart mode for events - $enable_cart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME, - 'enable_cart' - ); + $enable_cart = Civi::settings()->get('enable_cart'); if ($enable_cart) { } while ($dao->fetch()) { @@ -1240,7 +1236,7 @@ WHERE civicrm_event.is_active = 1 // append invoice pdf to email $template = CRM_Core_Smarty::singleton(); $taxAmt = $template->get_template_vars('totalTaxAmount'); - $prefixValue = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); + $prefixValue = Civi::settings()->get('contribution_invoice_settings'); $invoicing = CRM_Utils_Array::value('invoicing', $prefixValue); if (isset($invoicing) && isset($prefixValue['is_email_pdf']) && !empty($values['contributionId'])) { $sendTemplateParams['isEmailPdf'] = TRUE; @@ -1668,9 +1664,8 @@ WHERE id = $cfID //take the custom field options $returnProperties = array($name => 1); $query = new CRM_Contact_BAO_Query($params, $returnProperties, $fields); - $options = &$query->_options; if (!$skip) { - $displayValue = CRM_Core_BAO_CustomField::getDisplayValue($customVal, $cfID, $options); + $displayValue = CRM_Core_BAO_CustomField::displayValue($customVal, $cfID); } //Hack since we dont have function to check empty. //FIXME in 2.3 using crmIsEmptyArray()