From: Andrew Hunt Date: Fri, 9 Aug 2013 01:52:06 +0000 (-0400) Subject: allow toggle back to current/future events X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=82a54c66a5474e70fbf3bcc9f76490a395a407e9;p=civicrm-core.git allow toggle back to current/future events --- diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index 34135b1b67..20a6b81c8b 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -216,10 +216,8 @@ {/if} {$form.event_id.label}{$form.event_id.html}  - {if $action eq 1 && $past neq 1 } -
» {ts}Include past event(s) in this select list:{/ts} - {if !$past}{ts}past three months{/ts} |{/if} - {ts}all{/ts}
+ {if $action eq 1} +
» {/if} {if $is_test} {ts}(test){/ts} @@ -295,16 +293,29 @@ for (i = 0; i < response.length; i++) { cj( elementID ).get(0).add(new Option(response[i].name, response[i].value), document.all ? i : null); } - if (listallVal == 1) { - cj('#past-event-section').hide( ); - } - else { - cj('.3-mo-past-event').hide( ); - } + getShowEventInfo(listallVal); cj('input[name="past_event"]').val(listallVal); cj("#feeBlock").html( '' ); }); } + + {/literal} + {if $action eq 1}getShowEventInfo({$past});{/if} + {literal} + + function getShowEventInfo (listallVal) { + switch(listallVal) { + case 1: + cj('#showing-event-info').html({/literal}'{ts}Showing all events: show{/ts}'{literal}+' '+{/literal}'{ts}current and future{/ts}'{literal}+' | '+{/literal}'{ts}past three months{/ts}'{literal}+''); + break; + case 2: + cj('#showing-event-info').html({/literal}'{ts}Showing events since three months ago: show{/ts}'{literal}+' '+{/literal}'{ts}current and future{/ts}'{literal}+' | '+{/literal}'{ts}all{/ts}'{literal}+''); + break; + default: + cj('#showing-event-info').html({/literal}'{ts}Showing current and future events: show{/ts}'{literal}+' '+{/literal}'{ts}past three months{/ts}'{literal}+' | '+{/literal}'{ts}all{/ts}'{literal}+''); + break; + } + } {/literal} {if $preloadJSSnippet}