-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract selectedChild tabheader functionality and enable for Manage Events #12747
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,18 +31,8 @@ | |
<div class="contact-summary-contribute-tab view-content"> | ||
|
||
<div id="secondaryTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all"> | ||
{* Tab management *} | ||
<script type="text/javascript"> | ||
var selectedTab = 'contributions'; | ||
{include file="CRM/common/TabSelected.tpl" defaultTab="contributions" tabContainer="#secondaryTabContainer"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't figure out how to select the recurring subtab (before or after this change) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eileenmcnaughton No, you can't :-( But maybe once this abstraction is in place we might be able to look at it |
||
|
||
{literal} | ||
CRM.$(function($) { | ||
var tabIndex = $('#tab_' + selectedTab).prevAll().length; | ||
$("#secondaryTabContainer").tabs({active: tabIndex}); | ||
$(".crm-tab-button").addClass("ui-corner-bottom"); | ||
}); | ||
{/literal} | ||
</script> | ||
<ul class="ui-tabs-nav ui-corner-all ui-helper-reset ui-helper-clearfix ui-widget-header"> | ||
<li id="tab_contributions" class="crm-tab-button ui-corner-all ui-tabs-tab ui-corner-top ui-state-default ui-tab ui-tabs-active ui-state-active"> | ||
<a href="#contributions-subtab" title="{ts}Contributions{/ts}"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,3 +107,4 @@ CRM.$(function($) { | |
</script> | ||
{/literal} | ||
{include file="CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl" entityID=$id entityTable="civicrm_event"} | ||
{include file="CRM/common/TabSelected.tpl" defaultTab="settings"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattwire @eileenmcnaughton Currently this line breaks the manage event URLs if selectedChild is not appended to it. Eg https://dmaster.demo.civicrm.org/civicrm/event/manage/fee?reset=1&action=update&id=3 goes to the settings page instead of opening the Maybe, we should just
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattwire @jitendrapurohit maybe we should assign defaultTab from php? @mattwire I think this needs to be fixed in the rc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. So before this PR the selectedChild stuff didn't work for events at all. Events is the only one that specifies the tab as part of the link.
Specifying the "defaultTab" is standard across all usages of the tab selector code and is meant to be a fallback default if selectedChild is not defined.
This is probably the easiest / safest way to resolve this, unless we assign defaultTab from PHP in 1.
This would be more standard and is what we should probably aspire to for consistency, but is also much more likely to cause breakage. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script type='text/javascript'> | ||
var selectedTab = '{$defaultTab}'; | ||
var tabContainer = '#mainTabContainer'; | ||
{if $tabContainer}tabContainer = '{$tabContainer}';{/if} | ||
{if $selectedChild}selectedTab = '{$selectedChild}';{/if} | ||
{literal} | ||
CRM.$(function($) { | ||
var tabIndex = $('#tab_' + selectedTab).prevAll().length; | ||
$(tabContainer).tabs( {active: tabIndex} ); | ||
}); | ||
{/literal} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class addition is lost in this change (intentionally or otherwise) - however, I think the selectedChild doesn't actually work on extensions with or without this patch -it does with this
diff --git a/CRM/Admin/Page/Extensions.php b/CRM/Admin/Page/Extensions.php
index a2d5e9cbad..eb556d4afb 100644
--- a/CRM/Admin/Page/Extensions.php
+++ b/CRM/Admin/Page/Extensions.php
@@ -56,6 +56,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class loss also affects ContributionPage