CRM-15347 - Fix popup links in event dashboard page
authorColeman Watts <coleman@civicrm.org>
Fri, 26 Sep 2014 13:41:43 +0000 (09:41 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 26 Sep 2014 13:41:43 +0000 (09:41 -0400)
CRM/Event/Form/ManageEvent.php
CRM/Event/Form/ManageEvent/EventInfo.php
CRM/Event/Form/ManageEvent/TabHeader.php
CRM/Event/Page/ManageEvent.php
templates/CRM/Event/Form/ManageEvent/EventInfo.tpl
templates/CRM/Event/Page/DashBoard.tpl
templates/CRM/Event/Page/ManageEvent.tpl

index a4702ebeb298b3812de048ab5b3f481241d41a5c..62b688c2e9af145009abe60f1a961cc62fb4475b 100644 (file)
@@ -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'));
+  }
 }
 
index 11d73b460e831012311817b52100e57a9bd7f817..aa657eb4957ee75f2918603fc94ba346749d673b 100644 (file)
@@ -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
index 3bf3823b77ec1b343d90e06002b473461ce52f60..e488114b651be0e604f9710791b213b76c82b8f7 100644 (file)
@@ -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;
   }
 
index 3183936fedb8261c039c1ab542e7f6d382c61598..9df6e77c816fca42dec102b071b2231ff3a12e56 100644 (file)
@@ -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
index 7649579e6a326f9a85b1461cc994563a7c994ae2..3953f637e0519df1a50fbdff06809b001159dac5 100644 (file)
   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');
     })
index a42358be0afe2ad568b963ca510e40f4c838f4d2..8ed876fb7bc439e960d69fe95b59b404cb12fc67 100644 (file)
                     {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}
-                      <li><a title="{$v.title}" class="action-item crm-hover-button {$status}"
+                      <li><a title="{$v.title}" class="action-item crm-hover-button no-popup {$status}"
                              href="{crmURL p="`$v.url`" q="reset=1&action=update&id=`$id`"}">{$v.title}</a></li>
                     {/foreach}
                   </ul>
index fa1c7c5df46e9d5e230d69571ec784920298ba11..2cc51dea5ee8d92d3463e78ff2db29e4c134df3c 100644 (file)
@@ -49,7 +49,7 @@
 {include file="CRM/Event/Form/SearchEvent.tpl"}
 
 <div class="action-link">
-  <a accesskey="N" href="{$newEventURL}" id="newManageEvent" class="button">
+  <a accesskey="N" href="{$newEventURL}" id="newManageEvent" class="button crm-popup">
     <span><div class="icon add-icon"></div>{ts}Add Event{/ts}</span>
   </a>
   <div class="clear"></div>