/**
* Get list of Multi Record Fields.
*/
- public static function getMultiRecordFieldList() {
+ public static function getMultiRecordFieldList(): void {
$params = CRM_Core_Page_AJAX::defaultSortAndPagerParams(0, 10);
$params['cid'] = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
$obj->_DTparams['sort'] = $params['sortBy'];
}
- list($fields, $attributes) = $obj->browse();
+ [$fields, $attributes] = $obj->browse();
// format params and add class attributes
$fieldList = [];
$links[CRM_Core_Action::VIEW] = [
'name' => ts('View'),
'title' => ts('View %1', [1 => $this->_customGroupTitle . ' record']),
+ 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::VIEW),
];
$links[CRM_Core_Action::UPDATE] = [
'name' => ts('Edit'),
'title' => ts('Edit %1', [1 => $this->_customGroupTitle . ' record']),
+ 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::UPDATE),
];
$links[CRM_Core_Action::DELETE] = [
'name' => ts('Delete'),
'title' => ts('Delete %1', [1 => $this->_customGroupTitle . ' record']),
+ 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::DELETE),
];
// urls and queryStrings
- if ($this->_pageViewType == 'profileDataView') {
+ if ($this->_pageViewType === 'profileDataView') {
$links[CRM_Core_Action::VIEW]['url'] = 'civicrm/profile/view';
$links[CRM_Core_Action::VIEW]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$view}";
$links[CRM_Core_Action::DELETE]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$delete}";
}
- elseif ($this->_pageViewType == 'customDataView') {
+ elseif ($this->_pageViewType === 'customDataView') {
// custom data specific view links
$links[CRM_Core_Action::VIEW]['url'] = 'civicrm/contact/view/cd';
$links[CRM_Core_Action::VIEW]['qs'] = 'reset=1&gid=%%gid%%&cid=%%cid%%&recId=%%recId%%&cgcount=%%cgcount%%&multiRecordDisplay=single&mode=view';
'title' => ts('Copy %1', [1 => $this->_customGroupTitle . ' record']),
'url' => 'civicrm/contact/view/cd/edit',
'qs' => 'reset=1&type=%%type%%&groupID=%%groupID%%&entityID=%%entityID%%&cgcount=%%newCgCount%%&multiRecordDisplay=single©ValueId=%%cgcount%%&mode=copy',
+ 'weight' => CRM_Core_Action::getWeight(CRM_Core_Action::COPY),
];
}
* Browse the listing.
*
*/
- public function browse() {
+ public function browse(): array {
$dateFields = NULL;
$newCgCount = $cgcount = 0;
$attributes = $result = $headerAttr = [];
$dateFieldsVals = NULL;
- if ($this->_pageViewType == 'profileDataView' && $this->_profileId) {
+ if ($this->_pageViewType === 'profileDataView' && $this->_profileId) {
$fields = CRM_Core_BAO_UFGroup::getFields($this->_profileId, FALSE, NULL,
NULL, NULL,
FALSE, NULL,
unset($result['count']);
unset($result['sortedResult']);
- if ($this->_pageViewType == 'profileDataView') {
+ if ($this->_pageViewType === 'profileDataView') {
if (!empty($fieldIDs)) {
//get the group info of multi rec fields in listing view
$fieldInput = $fieldIDs;
$cgcount = 1;
$newCgCount = (!$reached) ? $resultCount + 1 : NULL;
if (!empty($result) && empty($this->_headersOnly)) {
- $links = self::links();
- if ($this->_pageViewType == 'profileDataView') {
+ $links = $this->links();
+ if ($this->_pageViewType === 'profileDataView') {
$pageCheckSum = $this->get('pageCheckSum');
if ($pageCheckSum) {
foreach ($links as $key => $link) {
$links[CRM_Core_Action::DELETE]['url'] = '#';
$links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="' . htmlspecialchars(json_encode($deleteData)) . '"';
$links[CRM_Core_Action::DELETE]['class'] = 'delete-custom-row';
+ $links[CRM_Core_Action::DELETE]['weight'] = CRM_Core_Action::getWeight(CRM_Core_Action::DELETE);
}
if (!empty($pageCheckSum)) {
$actionParams['cs'] = $pageCheckSum;