Compare commits
2 Commits
ae7237f49b
...
d80bd71993
Author | SHA1 | Date | |
---|---|---|---|
d80bd71993 | |||
8dd89a41fb |
@ -47,8 +47,27 @@ class CRM_EntityTemplates_Utils {
|
|||||||
$entities = CRM_EntityTemplates_BAO_EntityTemplates::getEntityTemplates($form->_entityTemplateValues['value']);
|
$entities = CRM_EntityTemplates_BAO_EntityTemplates::getEntityTemplates($form->_entityTemplateValues['value']);
|
||||||
if (!empty($entities)) {
|
if (!empty($entities)) {
|
||||||
$form->add('select', 'entity_template_id', ts('Templates'), $entities, FALSE, ['placeholder' => ts('- select -'), 'class' => 'crm-select2']);
|
$form->add('select', 'entity_template_id', ts('Templates'), $entities, FALSE, ['placeholder' => ts('- select -'), 'class' => 'crm-select2']);
|
||||||
|
|
||||||
list($url, $query) = explode('?', $form->_entityTemplateValues['name']);
|
list($url, $query) = explode('?', $form->_entityTemplateValues['name']);
|
||||||
$url = CRM_Utils_System::url($url, $query);
|
$queryString = $form->get('queryString');
|
||||||
|
if (empty($queryString)) {
|
||||||
|
if (!empty($_SERVER['REDIRECT_QUERY_STRING'])) {
|
||||||
|
$queryString = $_SERVER['REDIRECT_QUERY_STRING'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$queryString = $query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parse_str($queryString, $queryString);
|
||||||
|
if (isset($queryString['templateId'])) {
|
||||||
|
unset($queryString['templateId']);
|
||||||
|
}
|
||||||
|
if (isset($queryString['snippet'])) {
|
||||||
|
unset($queryString['snippet']);
|
||||||
|
}
|
||||||
|
$queryString = http_build_query($queryString);
|
||||||
|
$form->set('queryString', $queryString);
|
||||||
|
$url = CRM_Utils_System::url($url, $queryString, FALSE, NULL, FALSE);
|
||||||
$form->assign('redirectUrl', $url);
|
$form->assign('redirectUrl', $url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ function entitytemplates_civicrm_pre($op, $objectName, $id, &$params) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function entitytemplates_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {
|
function entitytemplates_civicrm_validateForm($formName, &$fields, &$files, &$form, &$errors) {
|
||||||
if ($form->_entityTemplate) {
|
if (property_exists($form, '_entityTemplate') && $form->_entityTemplate) {
|
||||||
if (!empty($fields['entity_template_title'])) {
|
if (!empty($fields['entity_template_title'])) {
|
||||||
$params = [
|
$params = [
|
||||||
'title' => $fields['entity_template_title'],
|
'title' => $fields['entity_template_title'],
|
||||||
|
Loading…
Reference in New Issue
Block a user