/** * Browse all Label Format settings. * * @param null $action * * @return void */ public function browse($action = NULL) { // Get list of configured Label Formats $labelFormatList = CRM_Core_BAO_LabelFormat::getList(); $nameFormatList = CRM_Core_BAO_LabelFormat::getList(FALSE, 'name_badge'); // Add action links to each of the Label Formats foreach ($labelFormatList as &$format) { $action = array_sum(array_keys($this->links())); if (!empty($format['is_reserved'])) { $action -= CRM_Core_Action::DELETE; } $format['groupName'] = ts('Mailing Label'); $format['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $format['id'], 'group' => 'label_format'), ts('more'), FALSE, 'labelFormat.manage.action', 'LabelFormat', $format['id']); } // Add action links to each of the Label Formats foreach ($nameFormatList as &$format) { $format['groupName'] = ts('Name Badge'); } $labelFormatList = array_merge($labelFormatList, $nameFormatList); // Order Label Formats by weight $returnURL = CRM_Utils_System::url(self::userContext()); CRM_Core_BAO_LabelFormat::addOrder($labelFormatList, $returnURL); $this->assign('rows', $labelFormatList); }
/** * Browse all Label Format settings. * * @return void * @access public * @static */ function browse($action = NULL) { // Get list of configured Label Formats $labelFormatList = CRM_Core_BAO_LabelFormat::getList(); // Add action links to each of the Label Formats foreach ($labelFormatList as &$format) { $action = array_sum(array_keys($this->links())); if ($format['is_reserved']) { $action -= CRM_Core_Action::DELETE; } $format['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $format['id'])); } // Order Label Formats by weight $returnURL = CRM_Utils_System::url(self::userContext()); CRM_Core_BAO_LabelFormat::addOrder($labelFormatList, $returnURL); $this->assign('rows', $labelFormatList); }