We have struggled to find a compromise between the needs of larger sites not to crash when deduping & the UI experience of a 'batch' not being a batch - ie. finding duplicates for the first 1000 contacts could result in 67 or 6700. In discussion it was clear that even if we agreed on a UI to make this work the default for a large site (e.g 1000 to prevent crashes) was different to what would work for a small site - so I concluded we would need a setting. Given that it seemed to make sense to focus on adding the setting, which would provide the immediate protection needed for larger sites without compromising UI on small sites, and to put the time into that rather than solving the now less important batchin issue.
Note I did some tidy up on the settings form code too...
)
);
+ $descriptions = array();
foreach ($this->_settings as $setting => $group) {
$settingMetaData = civicrm_api('setting', 'getfields', array('version' => 3, 'name' => $setting));
$props = $settingMetaData['values'][$setting];
else {
$this->$add($setting, ts($props['title']));
}
+ // Migrate to using an array as easier in smart...
+ $descriptions[$setting] = ts($props['description']);
$this->assign("{$setting}_description", ts($props['description']));
if ($setting == 'max_attachments') {
//temp hack @todo fix to get from metadata
}
}
+ $this->assign('setting_descriptions', $descriptions);
}
/**
'wkhtmltopdfPath' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'recentItemsMaxCount' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'recentItemsProviders' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
+ 'dedupe_default_limit' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
);
public $_uploadMaxSize;
* Basic setup.
*/
public function preProcess() {
- $config = CRM_Core_Config::singleton();
$this->_uploadMaxSize = (int) ini_get('upload_max_filesize');
// check for post max size
CRM_Utils_Number::formatUnitSize(ini_get('post_max_size'), TRUE);
+ // This is a temp hack for the fact we really don't need to hard-code each setting in the tpl but
+ // we haven't worked through NOT doing that. These settings have been un-hardcoded.
+ $this->assign('pure_config_settings', array(
+ 'empoweredBy',
+ 'max_attachments',
+ 'maxFileSize',
+ 'secondDegRelPermissions',
+ 'recentItemsMaxCount',
+ 'recentItemsProviders',
+ 'dedupe_default_limit',
+ ));
}
/**
$groupList = array('' => ts('- All Contacts -')) + CRM_Core_PseudoConstant::nestedGroup();
$this->add('select', 'group_id', ts('Select Group'), $groupList, FALSE, array('class' => 'crm-select2 huge'));
- $this->add('text', 'limit', ts('No of contacts to find matches for '));
+ if (Civi::settings()->get('dedupe_default_limit')) {
+ $this->add('text', 'limit', ts('No of contacts to find matches for '));
+ }
$this->addButtons(array(
array(
'type' => 'next',
}
public function setDefaultValues() {
- $this->_defaults['limit'] = 1000;
+ $this->_defaults['limit'] = Civi::settings()->get('dedupe_default_limit');
return $this->_defaults;
}
$url .= "&gid={$values['group_id']}";
}
- if ($values['limit']) {
+ if (!empty($values['limit'])) {
$url .= '&limit=' . $values['limit'];
}
'group' => 'core',
'name' => 'resCacheCode',
'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
'default' => NULL,
'add' => '4.3',
'title' => 'resCacheCode',
'group' => 'core',
'name' => 'site_id',
'type' => 'String',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
'default' => '',
'add' => '4.6',
'title' => 'Unique Site ID',
'group' => 'core',
'name' => 'systemStatusCheckResult',
'type' => 'Integer',
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
'default' => 0,
'add' => '4.7',
'title' => 'systemStatusCheckResult',
'callback' => 'CRM_Utils_Recent::getProviders',
),
),
+ 'dedupe_default_limit' => array(
+ 'group_name' => 'CiviCRM Preferences',
+ 'group' => 'core',
+ 'name' => 'dedupe_default_limit',
+ 'type' => 'Integer',
+ 'default' => 0,
+ 'quick_form_type' => 'Element',
+ 'html_type' => 'text',
+ 'add' => '4.7',
+ 'title' => 'Default limit for dedupe screen',
+ 'is_domain' => 1,
+ 'is_contact' => 0,
+ 'description' => ts('Default to only loading matches against this number of contacts'),
+ 'help_text' => ts('Deduping larger databases can crash the server. By configuring a limit other than 0 here the dedupe query will only search for matches against a limited number of contacts.'),
+ ),
);
<p class="description">{ts 1="http://wkhtmltopdf.org/"}<a href="%1">wkhtmltopdf is an alternative utility for generating PDF's</a> which may provide better performance especially if you are generating a large number of PDF letters or receipts. Your system administrator will need to download and install this utility, and enter the executable path here.{/ts}</p>
</td>
</tr>
- <tr class="crm-miscellaneous-form-block-empoweredBy">
- <td class="label">{$form.empoweredBy.label}</td>
- <td>{$form.empoweredBy.html}<br />
- <p class="description">{ts}When enabled, "empowered by CiviCRM" is displayed at the bottom of public forms.{/ts}</p></td>
- </tr>
- <tr class="crm-miscellaneous-form-block-max_attachments">
- <td class="label">{$form.max_attachments.label}</td>
- <td>{$form.max_attachments.html}<br />
- <span class="description">{ts}Maximum number of files (documents, images, etc.) which can attached to emails or activities.{/ts}</span></td>
- </tr>
- <tr class="crm-miscellaneous-form-block-maxFileSize">
- <td class="label">{$form.maxFileSize.label}</td>
- <td>{$form.maxFileSize.html}<br />
- <span class="description">{$maxFileSize_description}</span></td>
- </tr>
- <tr class="crm-miscellaneous-form-block-secondDegRelPermissions">
- <td class="label">{$form.secondDegRelPermissions.label}</td>
- <td>{$form.secondDegRelPermissions.html}<br />
- <p class="description">{ts}If enabled, contacts with the permission to edit a related contact will inherit that contact's permission to edit other related contacts.{/ts}</p>
+ {foreach from=$pure_config_settings item=setting_name}
+ <tr class="crm-miscellaneous-form-block-{$setting_name}">
+ <td class="label">{$form.$setting_name.label}</td>
+ <td>{$form.$setting_name.html}<br />
+ <span class="description">{$setting_descriptions.$setting_name}</span>
</td>
- </tr>
- <tr class="crm-miscellaneous-form-block-recentItemsMaxCount">
- <td class="label">{$form.recentItemsMaxCount.label}</td>
- <td>{$form.recentItemsMaxCount.html}<br />
- <span class="description">{$recentItemsMaxCount_description}</span></td>
- </tr>
- <tr class="crm-miscellaneous-form-block-recentItemsProviders">
- <td class="label">{$form.recentItemsProviders.label}</td>
- <td>{$form.recentItemsProviders.html}<br />
- <span class="description">{$recentItemsProviders_description}</span></td>
- </tr>
+ </tr>
+ {/foreach}
</table>
<h3>{ts}reCAPTCHA Keys{/ts}</h3>