$dao->orderBy('weight, title');
$dao->find();
+ $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
+ $customGroupStyle = CRM_Core_SelectValues::customGroupStyle();
while ($dao->fetch()) {
- $customGroup[$dao->id] = array();
- CRM_Core_DAO::storeValues($dao, $customGroup[$dao->id]);
+ $id = $dao->id;
+ $customGroup[$id] = array();
+ CRM_Core_DAO::storeValues($dao, $customGroup[$id]);
// form all action links
$action = array_sum(array_keys($this->actionLinks()));
else {
$action -= CRM_Core_Action::DISABLE;
}
- $customGroup[$dao->id]['order'] = $customGroup[$dao->id]['weight'];
- $customGroup[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action,
- array('id' => $dao->id),
+ $customGroup[$id]['order'] = $customGroup[$id]['weight'];
+ $customGroup[$id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action,
+ array('id' => $id),
ts('more'),
FALSE,
'customGroup.row.actions',
'CustomGroup',
- $dao->id
+ $id
);
- }
-
- $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
- $customGroupStyle = CRM_Core_SelectValues::customGroupStyle();
- foreach ($customGroup as $key => $array) {
- $customGroup[$key]['style_display'] = $customGroupStyle[$customGroup[$key]['style']];
- $customGroup[$key]['extends_display'] = $customGroupExtends[$customGroup[$key]['extends']];
+ if (!empty($customGroup[$id]['style'])) {
+ $customGroup[$id]['style_display'] = $customGroupStyle[$customGroup[$id]['style']];
+ }
+ $customGroup[$id]['extends_display'] = $customGroupExtends[$customGroup[$id]['extends']];
}
//fix for Displaying subTypes