$mergeParams .= "&gid={$gid}";
}
- $searchRows[$mainId]['actions'] = '<a class="action-item crm-hover-button" href="'. CRM_Utils_System::url('civicrm/contact/merge', $mergeParams) . '">' . ts('merge') . '</a>';
+ $searchRows[$mainId]['actions'] = '<a class="action-item crm-hover-button" href="' . CRM_Utils_System::url('civicrm/contact/merge', $mergeParams) . '">' . ts('merge') . '</a>';
$searchRows[$mainId]['actions'] .= "<a class='action-item crm-hover-button crm-notDuplicate' href='#' onClick=\"processDupes( {$main['srcID']}, {$main['dstID']}, 'dupe-nondupe', 'dupe-listing'); return false;\">" . ts('not a duplicate') . "</a>";
}
else {
// https://civicrm.org/licensing
-var CRM = CRM || {};
+if (!CRM) CRM = {};
var cj = CRM.$ = jQuery;
CRM._ = _;
if (d && CRM[d] && CRM[d][text]) {
text = CRM[d][text];
}
- else if (CRM['strings'][text]) {
- text = CRM['strings'][text];
+ else if (CRM.strings[text]) {
+ text = CRM.strings[text];
}
if (typeof(params) === 'object') {
for (var i in params) {
* @param elementType Value to set display style to for showBlocks (e.g. 'block' or 'table-row' or ...)
*/
function on_load_init_blocks(showBlocks, hideBlocks, elementType) {
- if (elementType == null) {
+ if (!elementType) {
elementType = 'block';
}
for (i = 0; i < showBlocks.length; i++) {
myElement = document.getElementById(showBlocks[i]);
/* getElementById returns null if element id doesn't exist in the document */
- if (myElement != null) {
+ if (myElement) {
myElement.style.display = elementType;
}
else {
for (i = 0; i < hideBlocks.length; i++) {
myElement = document.getElementById(hideBlocks[i]);
/* getElementById returns null if element id doesn't exist in the document */
- if (myElement != null) {
+ if (myElement) {
myElement.style.display = 'none';
}
else {
(function ($, _, undefined) {
"use strict";
+ /* jshint validthis: true */
// Theme classes for unattached elements
$.fn.select2.defaults.dropdownCssClass = $.ui.dialog.prototype.options.dialogClass = 'crm-container';
expires: 0
};
if ($(this).length) {
- if (title == '') {
+ if (title === '') {
var label = $('label[for="' + $(this).attr('name') + '"], label[for="' + $(this).attr('id') + '"]').not('[generated=true]');
if (label.length) {
label.addClass('crm-error');
var $label = label.clone();
- if (text == '' && $('.crm-marker', $label).length > 0) {
+ if (text === '' && $('.crm-marker', $label).length > 0) {
text = $('.crm-marker', $label).attr('title');
}
$('.crm-marker', $label).remove();