From: Coleman Watts Date: Fri, 26 Sep 2014 13:41:43 +0000 (-0400) Subject: CRM-15347 - Fix popup links in event dashboard page X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bfd83a870df3593a52ddd0e25fed4405d16fce58;p=civicrm-core.git CRM-15347 - Fix popup links in event dashboard page --- diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index a4702ebeb2..62b688c2e9 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -380,5 +380,13 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { return 'CRM/Event/Form/ManageEvent/Tab.tpl'; } } + + /** + * Pre-load libraries required by Online Registration Profile fields + */ + static function addProfileEditScripts() { + CRM_UF_Page_ProfileEditor::registerProfileScripts(); + CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ParticipantModel')); + } } diff --git a/CRM/Event/Form/ManageEvent/EventInfo.php b/CRM/Event/Form/ManageEvent/EventInfo.php index 11d73b460e..aa657eb495 100644 --- a/CRM/Event/Form/ManageEvent/EventInfo.php +++ b/CRM/Event/Form/ManageEvent/EventInfo.php @@ -183,6 +183,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent { if (!CRM_Utils_System::isNull($eventTemplates)) { $this->add('select', 'template_id', ts('From Template'), array('' => ts('- select -')) + $eventTemplates, FALSE, array('class' => 'crm-select2 huge')); } + // Make sure this form redirects properly + $this->preventAjaxSubmit(); } // add event title, make required if this is not a template diff --git a/CRM/Event/Form/ManageEvent/TabHeader.php b/CRM/Event/Form/ManageEvent/TabHeader.php index 3bf3823b77..e488114b65 100644 --- a/CRM/Event/Form/ManageEvent/TabHeader.php +++ b/CRM/Event/Form/ManageEvent/TabHeader.php @@ -55,15 +55,7 @@ class CRM_Event_Form_ManageEvent_TabHeader { ->addSetting(array('tabSettings' => array( 'active' => self::getCurrentTab($tabs), ))); - - // Preload libraries required by Online Registration Include Profiles - $schemas = array('IndividualModel', 'ParticipantModel'); - if (in_array('CiviMember', CRM_Core_Config::singleton()->enableComponents)) { - $schemas[] = 'MembershipModel'; - } - CRM_UF_Page_ProfileEditor::registerProfileScripts(); - CRM_UF_Page_ProfileEditor::registerSchemas($schemas); - + CRM_Event_Form_ManageEvent::addProfileEditScripts(); return $tabs; } diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 3183936fed..9df6e77c81 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -240,6 +240,7 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * @return void */ function browse() { + $this->assign('includeWysiwygEditor', TRUE); $this->_sortByCharacter = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this diff --git a/templates/CRM/Event/Form/ManageEvent/EventInfo.tpl b/templates/CRM/Event/Form/ManageEvent/EventInfo.tpl index 7649579e6a..3953f637e0 100644 --- a/templates/CRM/Event/Form/ManageEvent/EventInfo.tpl +++ b/templates/CRM/Event/Form/ManageEvent/EventInfo.tpl @@ -178,7 +178,7 @@ CRM.$(function($) { var $form = $('form.{/literal}{$form.formClass}{literal}'); $('#template_id', $form).change(function() { - $('#crm-main-content-wrapper') + $(this).closest('.crm-ajax-container, #crm-main-content-wrapper') .crmSnippet({url: CRM.url('civicrm/event/add', {action: 'add', reset: 1, template_id: $(this).val()})}) .crmSnippet('refresh'); }) diff --git a/templates/CRM/Event/Page/DashBoard.tpl b/templates/CRM/Event/Page/DashBoard.tpl index a42358be0a..8ed876fb7b 100644 --- a/templates/CRM/Event/Page/DashBoard.tpl +++ b/templates/CRM/Event/Page/DashBoard.tpl @@ -110,7 +110,7 @@ {foreach from=$eventSummary.tab key=k item=v} {assign var="fld" value=$v.field} {if NOT $values.$fld}{assign var="status" value="disabled"}{else}{assign var="status" value="enabled"}{/if} -
  • {$v.title}
  • {/foreach} diff --git a/templates/CRM/Event/Page/ManageEvent.tpl b/templates/CRM/Event/Page/ManageEvent.tpl index fa1c7c5df4..2cc51dea5e 100644 --- a/templates/CRM/Event/Page/ManageEvent.tpl +++ b/templates/CRM/Event/Page/ManageEvent.tpl @@ -49,7 +49,7 @@ {include file="CRM/Event/Form/SearchEvent.tpl"}