+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015 |
+ | Copyright CiviCRM LLC (c) 2004-2016 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
*/
/**
if (!$this->_caseId) {
$caseAttributes = array(
- 'case_type' => CRM_Case_PseudoConstant::caseType(),
- 'case_status' => CRM_Case_PseudoConstant::caseStatus(),
- 'encounter_medium' => CRM_Case_PseudoConstant::encounterMedium(),
+ 'case_type_id' => ts('Case Type'),
+ 'status_id' => ts('Case Status'),
+ 'medium_id' => ts('Activity Medium'),
);
- foreach ($caseAttributes as $key => $values) {
- if (empty($values)) {
- CRM_Core_Error::fatal(ts('You do not have any active %1',
- array(1 => str_replace('_', ' ', $key))
- ));
- break;
+ foreach ($caseAttributes as $key => $label) {
+ if (!CRM_Case_BAO_Case::buildOptions($key, 'create')) {
+ CRM_Core_Error::fatal(ts('You do not have any active %1', array(1 => $label)));
}
}
}
)), TRUE
);
- CRM_Core_BAO_Tag::getTags('civicrm_case', $tags, NULL,
- ' ', TRUE);
+ $tags = CRM_Core_BAO_Tag::getColorTags('civicrm_case');
if (!empty($tags)) {
- $this->add('select', 'tag', ts('Select Tags'), $tags, FALSE,
- array('id' => 'tags', 'multiple' => 'multiple', 'class' => 'crm-select2')
+ $this->add('select2', 'tag', ts('Tags'), $tags, FALSE,
+ array('class' => 'huge', 'multiple' => 'multiple')
);
}
$tagParams = array();
if (!empty($params['tag'])) {
$tagParams = array();
+ if (!is_array($params['tag'])) {
+ $params['tag'] = explode(',', $params['tag']);
+ }
foreach ($params['tag'] as $tag) {
$tagParams[$tag] = 1;
}