3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * Page for displaying list of location types.
21 class CRM_Admin_Page_LocationType
extends CRM_Core_Page_Basic
{
23 public $useLivePageJS = TRUE;
26 * The action links that we need to display for the browse screen.
30 public static $_links = NULL;
38 public function getBAOName() {
39 return 'CRM_Core_BAO_LocationType';
46 * (reference) of action links
48 public function &links() {
49 if (!(self
::$_links)) {
51 CRM_Core_Action
::UPDATE
=> [
53 'url' => 'civicrm/admin/locationType',
54 'qs' => 'action=update&id=%%id%%&reset=1',
55 'title' => ts('Edit Location Type'),
57 CRM_Core_Action
::DISABLE
=> [
58 'name' => ts('Disable'),
59 'ref' => 'crm-enable-disable',
60 'title' => ts('Disable Location Type'),
62 CRM_Core_Action
::ENABLE
=> [
63 'name' => ts('Enable'),
64 'ref' => 'crm-enable-disable',
65 'title' => ts('Enable Location Type'),
67 CRM_Core_Action
::DELETE
=> [
68 'name' => ts('Delete'),
69 'url' => 'civicrm/admin/locationType',
70 'qs' => 'action=delete&id=%%id%%',
71 'title' => ts('Delete Location Type'),
79 * Get name of edit form.
82 * Classname of edit form.
84 public function editForm() {
85 return 'CRM_Admin_Form_LocationType';
94 public function editName() {
95 return 'Location Types';
106 public function userContext($mode = NULL) {
107 return 'civicrm/admin/locationType';
113 * @param array $links
117 protected function getRows($sort, $action, array $links): array {
118 $rows = parent
::getRows($sort, $action, $links);
119 foreach ($rows as &$row) {
120 // prevent smarty notices.
121 foreach (['is_default', 'class', 'vcard_name'] as $expectedField) {
122 if (!isset($row['is_default'])) {
123 $row[$expectedField] = NULL;