olympian /media/civicrm/templates_c/en_US/%%18/189/1890E85C%%Membership.tpl.php

Language PHP Lines 975
MD5 Hash d9f9eaace1058b6ef739b4ed1fb365cc
Repository https://github.com/finchiefin/olympian.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
<?php /* Smarty version 2.6.27, created on 2014-06-19 15:07:39
         compiled from CRM/Member/Form/Membership.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'crmScope', 'CRM/Member/Form/Membership.tpl', 1, false),array('block', 'ts', 'CRM/Member/Form/Membership.tpl', 30, false),array('modifier', 'crmDate', 'CRM/Member/Form/Membership.tpl', 30, false),array('modifier', 'crmAddClass', 'CRM/Member/Form/Membership.tpl', 250, false),array('function', 'help', 'CRM/Member/Form/Membership.tpl', 148, false),array('function', 'crmURL', 'CRM/Member/Form/Membership.tpl', 468, false),)), $this); ?>
<?php $this->_tag_stack[] = array('crmScope', array('extensionKey' => "")); $_block_repeat=true;smarty_block_crmScope($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><?php if ($this->_tpl_vars['cancelAutoRenew']): ?>
  <div class="messages status no-popup">
    <div class="icon inform-icon"></div>
    <p><?php $this->_tag_stack[] = array('ts', array('1' => $this->_tpl_vars['cancelAutoRenew'])); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>This membership is set to renew automatically <?php if ($this->_tpl_vars['endDate']): ?>on <?php echo ((is_array($_tmp=$this->_tpl_vars['endDate'])) ? $this->_run_mod_handler('crmDate', true, $_tmp) : smarty_modifier_crmDate($_tmp)); ?>
<?php endif; ?>. You will need to cancel the auto-renew option if you want to modify the Membership Type, End Date or Membership Status. <a href="%1">Click here</a> if you want to cancel the automatic renewal option.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></p>
  </div>
<?php endif; ?>
<div class="spacer"></div>
<?php if ($this->_tpl_vars['cdType']): ?>
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Custom/Form/CustomData.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php elseif ($this->_tpl_vars['priceSetId']): ?>
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Price/Form/PriceSet.tpl", 'smarty_include_vars' => array('context' => 'standalone','extends' => 'Membership')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <?php echo '
  <script type="text/javascript">
  cj( function() {
    var membershipValues = new Array;
    '; ?>
<?php $_from = $this->_tpl_vars['optionsMembershipTypes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['opId'] => $this->_tpl_vars['memType']):
?><?php echo '
      membershipValues['; ?>
<?php echo $this->_tpl_vars['opId']; ?>
<?php echo '] = '; ?>
<?php echo $this->_tpl_vars['memType']; ?>
<?php echo ';
    '; ?>
<?php endforeach; endif; unset($_from); ?><?php echo '
    processMembershipPriceset(membershipValues, '; ?>
<?php echo $this->_tpl_vars['autoRenewOption']; ?>
<?php echo ', 1);
    '; ?>
<?php if (! $this->_tpl_vars['membershipMode']): ?><?php echo '
      enableAmountSection('; ?>
<?php echo $this->_tpl_vars['contributionType']; ?>
<?php echo ');
    '; ?>
<?php endif; ?><?php echo '
  });
  </script>
  '; ?>

<?php else: ?>
  <?php if ($this->_tpl_vars['membershipMode'] == 'test'): ?>
    <?php $this->assign('registerMode', 'TEST'); ?>
    <?php elseif ($this->_tpl_vars['membershipMode'] == 'live'): ?>
    <?php $this->assign('registerMode', 'LIVE'); ?>
  <?php endif; ?>
  <?php if (! $this->_tpl_vars['emailExists'] && $this->_tpl_vars['action'] != 8 && $this->_tpl_vars['context'] != 'standalone'): ?>
  <div class="messages status no-popup">
    <div class="icon inform-icon"></div>
    <p><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>You will not be able to send an automatic email receipt for this Membership because there is no email address recorded for this contact. If you want a receipt to be sent when this Membership is recorded, click Cancel and then click Edit from the Summary tab to add an email address before recording the Membership.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></p>
  </div>
  <?php endif; ?>
  <?php if ($this->_tpl_vars['context'] != 'standalone'): ?>
  <h3><?php if ($this->_tpl_vars['action'] == 1): ?><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>New Membership<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php elseif ($this->_tpl_vars['action'] == 2): ?><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Edit Membership<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php else: ?><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Delete Membership<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php endif; ?></h3>
  <?php endif; ?>
  <?php if ($this->_tpl_vars['membershipMode']): ?>
  <div id="help">
    <?php $this->_tag_stack[] = array('ts', array('1' => $this->_tpl_vars['displayName'],'2' => $this->_tpl_vars['registerMode'])); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Use this form to submit Membership Record on behalf of %1. <strong>A %2 transaction will be submitted</strong> using the selected payment processor.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
  </div>
  <?php endif; ?>
  <div class="crm-block crm-form-block crm-membership-form-block">
    <div class="crm-submit-buttons"><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/formButtons.tpl", 'smarty_include_vars' => array('location' => 'top')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?></div>
    <?php if ($this->_tpl_vars['action'] == 8): ?>
    <div class="messages status no-popup">
      <div class="icon inform-icon"></div>&nbsp;
      <span class="font-red bold"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>WARNING: Deleting this membership will also delete any related payment (contribution) records.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?> <?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>This action cannot be undone.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span>
      <p><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Consider modifying the membership status instead if you want to maintain an audit trail and avoid losing payment data. You can set the status to Cancelled by editing the membership and clicking the Status Override checkbox.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></p>
      <p><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Click 'Delete' if you want to continue.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></p>
    </div>
    <?php else: ?>
      <table class="form-layout-compressed">
        <?php if ($this->_tpl_vars['context'] != 'standalone'): ?>
          <tr>
            <td class="font-size12pt label"><strong><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Member<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></strong></td><td class="font-size12pt"><strong><?php echo $this->_tpl_vars['displayName']; ?>
</strong></td>
          </tr>
          <?php else: ?>
          <?php if (! $this->_tpl_vars['membershipMode'] && ! $this->_tpl_vars['emailExists'] && $this->_tpl_vars['outBound_option'] != 2): ?>
            <?php $this->assign('profileCreateCallback', 1); ?>
          <?php endif; ?>
        <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Contact/Form/NewContact.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['membershipMode']): ?>
          <tr><td class="label"><?php echo $this->_tpl_vars['form']['payment_processor_id']['label']; ?>
</td><td><?php echo $this->_tpl_vars['form']['payment_processor_id']['html']; ?>
</td></tr>
        <?php endif; ?>
        <tr class="crm-membership-form-block-membership_type_id">
          <td class="label"><?php echo $this->_tpl_vars['form']['membership_type_id']['label']; ?>
</td>
          <td><span id='mem_type_id'><?php echo $this->_tpl_vars['form']['membership_type_id']['html']; ?>
</span>
            <?php if ($this->_tpl_vars['hasPriceSets']): ?>
              <span id='totalAmountORPriceSet'> <?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>OR<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span>
              <span id='selectPriceSet'><?php echo $this->_tpl_vars['form']['price_set_id']['html']; ?>
</span>
              <?php if ($this->_tpl_vars['buildPriceSet'] && $this->_tpl_vars['priceSet']): ?>
                <div id="priceset"><br/><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Price/Form/PriceSet.tpl", 'smarty_include_vars' => array('extends' => 'Membership')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?></div>
                <?php else: ?>
                <div id="priceset" class="hiddenElement"></div>
              <?php endif; ?>
            <?php endif; ?>
            <?php if ($this->_tpl_vars['member_is_test']): ?> <?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>(test)<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php endif; ?><br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Select Membership Organization and then Membership Type.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php if ($this->_tpl_vars['hasPriceSets']): ?> <?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Alternatively, you can use a price set.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php endif; ?></span>
          </td>
        </tr>
        <tr id="maxRelated" class="crm-membership-form-block-max_related">
          <td class="label"><?php echo $this->_tpl_vars['form']['max_related']['label']; ?>
</td>
          <td><?php echo $this->_tpl_vars['form']['max_related']['html']; ?>
<br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Maximum number of related memberships (leave blank for unlimited).<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span>
          </td>
        </tr>
        <?php if ($this->_tpl_vars['action'] == 1): ?>
          <tr id="num_terms_row" class="crm-membership-form-block-num_terms">
            <td class="label"><?php echo $this->_tpl_vars['form']['num_terms']['label']; ?>
</td>
            <td>&nbsp;<?php echo $this->_tpl_vars['form']['num_terms']['html']; ?>
<br />
              <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Set the membership end date this many membership periods from now. Make sure the appropriate corresponding fee is entered below.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span>
            </td>
          </tr>
        <?php endif; ?>
        <tr class="crm-membership-form-block-source">
          <td class="label"><?php echo $this->_tpl_vars['form']['source']['label']; ?>
</td>
          <td>&nbsp;<?php echo $this->_tpl_vars['form']['source']['html']; ?>
<br />
          <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Source of this membership. This value is searchable.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
        </tr>

                <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Campaign/Form/addCampaignToComponent.tpl", 'smarty_include_vars' => array('campaignTrClass' => "crm-membership-form-block-campaign_id")));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

        <tr class="crm-membership-form-block-join_date"><td class="label"><?php echo $this->_tpl_vars['form']['join_date']['label']; ?>
</td><td><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/jcalendar.tpl", 'smarty_include_vars' => array('elementName' => 'join_date')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
          <br />
          <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>When did this contact first become a member?<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td></tr>
        <tr class="crm-membership-form-block-start_date"><td class="label"><?php echo $this->_tpl_vars['form']['start_date']['label']; ?>
</td><td><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/jcalendar.tpl", 'smarty_include_vars' => array('elementName' => 'start_date')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
          <br />
          <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>First day of current continuous membership period. Start Date will be automatically set based on Membership Type if you don't select a date.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td></tr>
        <tr class="crm-membership-form-block-end_date"><td class="label"><?php echo $this->_tpl_vars['form']['end_date']['label']; ?>
</td>
          <td><?php if ($this->_tpl_vars['isRecur'] && $this->_tpl_vars['endDate']): ?><?php echo ((is_array($_tmp=$this->_tpl_vars['endDate'])) ? $this->_run_mod_handler('crmDate', true, $_tmp) : smarty_modifier_crmDate($_tmp)); ?>
<?php else: ?><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/jcalendar.tpl", 'smarty_include_vars' => array('elementName' => 'end_date')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?><?php endif; ?>
            <br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Latest membership period expiration date. End Date will be automatically set based on Membership Type if you don't select a date.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td></tr>
        <tr id="autoRenew" class="crm-membership-form-block-auto_renew">
          <td class="label"> <?php echo $this->_tpl_vars['form']['auto_renew']['label']; ?>
 </td>
          <td> <?php echo $this->_tpl_vars['form']['auto_renew']['html']; ?>
 <?php echo smarty_function_help(array('id' => "id-auto_renew",'file' => "CRM/Member/Form/Membership.hlp",'action' => $this->_tpl_vars['action']), $this);?>
 </td>
        </tr>
        <?php if (! $this->_tpl_vars['membershipMode']): ?>
          <tr><td class="label"><?php echo $this->_tpl_vars['form']['is_override']['label']; ?>
</td><td><?php echo $this->_tpl_vars['form']['is_override']['html']; ?>
&nbsp;&nbsp;<?php echo smarty_function_help(array('id' => "id-status-override"), $this);?>
</td></tr>
        <?php endif; ?>

        <?php if (! $this->_tpl_vars['membershipMode']): ?>
                    <tr id="memberStatus_show">
            <?php if ($this->_tpl_vars['action'] == 2): ?>
              <td class="label"><?php echo $this->_tpl_vars['form']['status_id']['label']; ?>
</td><td class="view-value"><?php echo $this->_tpl_vars['membershipStatus']; ?>
</td>
            <?php endif; ?>
          </tr>

                    <tr id="memberStatus"><td class="label"><?php echo $this->_tpl_vars['form']['status_id']['label']; ?>
</td><td><?php echo $this->_tpl_vars['form']['status_id']['html']; ?>
<br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>If <strong>Status Override</strong> is checked, the selected status will remain in force (it will NOT be modified by the automated status update script).<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td></tr>

          <?php elseif ($this->_tpl_vars['membershipMode']): ?>
          <tr class="crm-membership-form-block-financial_type_id-mode">
            <td class="label"><?php echo $this->_tpl_vars['form']['financial_type_id']['label']; ?>
</td>
            <td><?php echo $this->_tpl_vars['form']['financial_type_id']['html']; ?>
<br />
              <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Select the appropriate financial type for this payment.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
          </tr>
          <tr class="crm-membership-form-block-total_amount">
            <td class="label"><?php echo $this->_tpl_vars['form']['total_amount']['label']; ?>
</td>
            <td><?php echo $this->_tpl_vars['form']['total_amount']['html']; ?>
<br />
              <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Membership payment amount.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
          </tr>
          <?php if ($this->_tpl_vars['context'] != 'standalone'): ?>
            <tr class="crm-membership-form-block-contribution-contact">
              <td class="label"><?php echo $this->_tpl_vars['form']['is_different_contribution_contact']['label']; ?>
</td>
              <td><?php echo $this->_tpl_vars['form']['is_different_contribution_contact']['html']; ?>
&nbsp;&nbsp;<?php echo smarty_function_help(array('id' => "id-contribution_contact"), $this);?>
</td>
            </tr>
            <tr id="record-different-contact">
              <td>&nbsp;</td>
              <td>
                <table class="compressed">
                  <tr class="crm-membership-form-block-honor-type">
                    <td class="label"><?php echo $this->_tpl_vars['form']['honor_type_id']['label']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['form']['honor_type_id']['html']; ?>
</td>
                  </tr>
                  <tr id ='contributionContact' class="crm-membership-form-block-contribution-type">
                  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Contact/Form/NewContact.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                  </tr>
                </table>
              </td>
            </tr>
          <?php endif; ?>
          <tr class="crm-membership-form-block-billing">
            <td colspan="2">
            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'CRM/Core/BillingBlock.tpl', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
            </td>
          </tr>
        <?php endif; ?>
        <?php if ($this->_tpl_vars['accessContribution'] && ! $this->_tpl_vars['membershipMode'] && ( $this->_tpl_vars['action'] != 2 || ! $this->_tpl_vars['rows']['0']['contribution_id'] || $this->_tpl_vars['onlinePendingContributionId'] )): ?>
          <tr id="contri">
            <td class="label"><?php if ($this->_tpl_vars['onlinePendingContributionId']): ?><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Update Payment Status<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php else: ?><?php echo $this->_tpl_vars['form']['record_contribution']['label']; ?>
<?php endif; ?></td>
            <td><?php echo $this->_tpl_vars['form']['record_contribution']['html']; ?>
<br />
              <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Check this box to enter or update payment information. You will also be able to generate a customized receipt.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
          </tr>
          <tr class="crm-membership-form-block-record_contribution"><td colspan="2">
            <fieldset id="recordContribution"><legend><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Membership Payment and Receipt<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></legend>
              <table><?php if ($this->_tpl_vars['context'] != 'standalone'): ?>
                <tr class="crm-membership-form-block-contribution-contact">
                  <td class="label"><?php echo $this->_tpl_vars['form']['is_different_contribution_contact']['label']; ?>
</td>
                  <td><?php echo $this->_tpl_vars['form']['is_different_contribution_contact']['html']; ?>
&nbsp;&nbsp;<?php echo smarty_function_help(array('id' => "id-contribution_contact"), $this);?>
</td>
                </tr>
                <tr id="record-different-contact">
                  <td>&nbsp;</td>
                  <td>
                    <table class="compressed">
                      <tr class="crm-membership-form-block-honor-type">
                        <td class="label"><?php echo $this->_tpl_vars['form']['honor_type_id']['label']; ?>
</td>
                        <td><?php echo $this->_tpl_vars['form']['honor_type_id']['html']; ?>
</td>
                      </tr>
                      <tr id ='contributionContact' class="crm-membership-form-block-contribution-type">
                      <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Contact/Form/NewContact.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                      </tr>
                    </table>
                  </td>
                </tr><?php endif; ?>
                  <tr class="crm-membership-form-block-financial_type_id">
                      <td class="label"><?php echo $this->_tpl_vars['form']['financial_type_id']['label']; ?>
</td>
                      <td><?php echo $this->_tpl_vars['form']['financial_type_id']['html']; ?>
<br />
                      <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Select the appropriate financial type for this payment.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
                </tr>
                <tr class="crm-membership-form-block-total_amount">
                  <td class="label"><?php echo $this->_tpl_vars['form']['total_amount']['label']; ?>
</td>
                  <td><?php echo $this->_tpl_vars['form']['total_amount']['html']; ?>
<br />
                    <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Membership payment amount. A contribution record will be created for this amount.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
                </tr>
                <tr class="crm-membership-form-block-receive_date">
                  <td class="label"><?php echo $this->_tpl_vars['form']['receive_date']['label']; ?>
</td>
                  <td><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/jcalendar.tpl", 'smarty_include_vars' => array('elementName' => 'receive_date')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?></td>
                </tr>
                <tr class="crm-membership-form-block-payment_instrument_id">
                  <td class="label"><?php echo $this->_tpl_vars['form']['payment_instrument_id']['label']; ?>
<span class="marker"> *</span></td>
                  <td><?php echo $this->_tpl_vars['form']['payment_instrument_id']['html']; ?>
 <?php echo smarty_function_help(array('id' => 'payment_instrument_id','file' => "CRM/Contribute/Page/Tab.hlp"), $this);?>
</td>
                </tr>
                <tr id="checkNumber" class="crm-membership-form-block-check_number">
                  <td class="label"><?php echo $this->_tpl_vars['form']['check_number']['label']; ?>
</td>
                  <td><?php echo ((is_array($_tmp=$this->_tpl_vars['form']['check_number']['html'])) ? $this->_run_mod_handler('crmAddClass', true, $_tmp, 'six') : smarty_modifier_crmAddClass($_tmp, 'six')); ?>
</td>
                </tr>
                <?php if ($this->_tpl_vars['action'] != 2): ?>
                  <tr class="crm-membership-form-block-trxn_id">
                    <td class="label"><?php echo $this->_tpl_vars['form']['trxn_id']['label']; ?>
</td>
                    <td><?php echo $this->_tpl_vars['form']['trxn_id']['html']; ?>
</td>
                  </tr>
                <?php endif; ?>
                <tr class="crm-membership-form-block-contribution_status_id">
                  <td class="label"><?php echo $this->_tpl_vars['form']['contribution_status_id']['label']; ?>
</td>
                  <td><?php echo $this->_tpl_vars['form']['contribution_status_id']['html']; ?>
</td>
                </tr>
              </table>
            </fieldset>
          </td></tr>
          <?php else: ?>
          <div class="spacer"></div>
        <?php endif; ?>

        <?php if ($this->_tpl_vars['emailExists'] && $this->_tpl_vars['outBound_option'] != 2): ?>
          <tr id="send-receipt" class="crm-membership-form-block-send_receipt">
            <td class="label"><?php echo $this->_tpl_vars['form']['send_receipt']['label']; ?>
</td><td><?php echo $this->_tpl_vars['form']['send_receipt']['html']; ?>
<br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array('1' => $this->_tpl_vars['emailExists'])); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Automatically email a membership confirmation and receipt to %1?<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span></td>
          </tr>
          <?php elseif ($this->_tpl_vars['context'] == 'standalone' && $this->_tpl_vars['outBound_option'] != 2): ?>
          <tr id="email-receipt" style="display:none;">
            <td class="label"><?php echo $this->_tpl_vars['form']['send_receipt']['label']; ?>
</td><td><?php echo $this->_tpl_vars['form']['send_receipt']['html']; ?>
<br />
            <span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Automatically email a membership confirmation and receipt to <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><span id="email-address"></span>?</span></td>
          </tr>
        <?php endif; ?>
        <tr id="fromEmail" style="display:none;">
          <td class="label"><?php echo $this->_tpl_vars['form']['from_email_address']['label']; ?>
</td>
          <td><?php echo $this->_tpl_vars['form']['from_email_address']['html']; ?>
</td>
        </tr>
        <tr id='notice' style="display:none;">
          <td class="label"><?php echo $this->_tpl_vars['form']['receipt_text_signup']['label']; ?>
</td>
          <td class="html-adjust"><span class="description"><?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>If you need to include a special message for this member, enter it here. Otherwise, the confirmation email will include the standard receipt message configured under System Message Templates.<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></span>
            <?php echo ((is_array($_tmp=$this->_tpl_vars['form']['receipt_text_signup']['html'])) ? $this->_run_mod_handler('crmAddClass', true, $_tmp, 'huge') : smarty_modifier_crmAddClass($_tmp, 'huge')); ?>
</td>
        </tr>
      </table>
      <div id="customData"></div>
            <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/customData.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
      <?php echo '
      <script type="text/javascript">
      cj(function() {
      '; ?>

        CRM.buildCustomData( '<?php echo $this->_tpl_vars['customDataType']; ?>
' );
        <?php if ($this->_tpl_vars['customDataSubType']): ?>
          CRM.buildCustomData( '<?php echo $this->_tpl_vars['customDataType']; ?>
', <?php echo $this->_tpl_vars['customDataSubType']; ?>
 );
        <?php endif; ?>
        <?php echo '
      });
      </script>
      '; ?>

      <?php if ($this->_tpl_vars['accessContribution'] && $this->_tpl_vars['action'] == 2 && $this->_tpl_vars['rows']['0']['contribution_id']): ?>
        <fieldset>
        <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/Contribute/Form/Selector.tpl", 'smarty_include_vars' => array('context' => 'Search')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
        </fieldset>
      <?php endif; ?>
    <?php endif; ?>

    <div class="spacer"></div>
    <div class="crm-submit-buttons"><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/formButtons.tpl", 'smarty_include_vars' => array('location' => 'bottom')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?></div>
  </div> <!-- end form-block -->

  <?php if ($this->_tpl_vars['action'] != 8): ?>     <?php if ($this->_tpl_vars['accessContribution'] && ! $this->_tpl_vars['membershipMode'] && ( $this->_tpl_vars['action'] != 2 || ! $this->_tpl_vars['rows']['0']['contribution_id'] || $this->_tpl_vars['onlinePendingContributionId'] )): ?>

    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/showHideByFieldValue.tpl", 'smarty_include_vars' => array('trigger_field_id' => 'record_contribution','trigger_value' => "",'target_element_id' => 'recordContribution','target_element_type' => "table-row",'field_type' => 'radio','invert' => 0)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/showHideByFieldValue.tpl", 'smarty_include_vars' => array('trigger_field_id' => 'payment_instrument_id','trigger_value' => '4','target_element_id' => 'checkNumber','target_element_type' => "table-row",'field_type' => 'select','invert' => 0)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <?php endif; ?>

    <?php echo '
    <script type="text/javascript">
    cj( function( ) {
      var mode   = '; ?>
'<?php echo $this->_tpl_vars['membershipMode']; ?>
'<?php echo ';
      if ( !mode ) {
        // Offline form (mode = false) has the record_contribution checkbox
        cj(\'#record_contribution\').click( function( ) {
          if ( cj(this).attr(\'checked\') ) {
            cj(\'#recordContribution\').show( );
            setPaymentBlock( false, true);
          }
          else {
            cj(\'#recordContribution\').hide( );
          }
        });
      }

      cj(\'#membership_type_id_1\').change( function( ) {
        setPaymentBlock(mode);
      });
      cj(\'#num_terms\').change( function( ) {
        setPaymentBlock(mode);
      });
      setPaymentBlock(mode);

      // show/hide different contact section
      setDifferentContactBlock();
      cj(\'#is_different_contribution_contact\').change( function() {
        setDifferentContactBlock();
      });
    });

    function setDifferentContactBlock( ) {
      // show/hide different contact section
      if ( cj(\'#is_different_contribution_contact\').attr(\'checked\') ) {
        cj(\'#record-different-contact\').show();
      }
      else {
        cj(\'#record-different-contact\').hide();
      }
    }
    </script>
    '; ?>


    <?php if (( $this->_tpl_vars['emailExists'] && $this->_tpl_vars['outBound_option'] != 2 ) || $this->_tpl_vars['context'] == 'standalone'): ?>
    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/showHideByFieldValue.tpl", 'smarty_include_vars' => array('trigger_field_id' => 'send_receipt','trigger_value' => "",'target_element_id' => 'notice','target_element_type' => "table-row",'field_type' => 'radio','invert' => 0)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "CRM/common/showHideByFieldValue.tpl", 'smarty_include_vars' => array('trigger_field_id' => 'send_receipt','trigger_value' => "",'target_element_id' => 'fromEmail','target_element_type' => "table-row",'field_type' => 'radio','invert' => 0)));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <?php endif; ?>
    <?php echo '

    <script type="text/javascript">

    '; ?>
<?php if (! $this->_tpl_vars['membershipMode']): ?><?php echo '
    showHideMemberStatus();
    function showHideMemberStatus() {
      if ( cj( "#is_override" ).attr(\'checked\' ) ) {
        cj(\'#memberStatus\').show( );
        cj(\'#memberStatus_show\').hide( );
      }
      else {
        cj(\'#memberStatus\').hide( );
        cj(\'#memberStatus_show\').show( );
      }
    }
    '; ?>
<?php endif; ?>

    <?php echo '
    function setPaymentBlock(mode, checkboxEvent) {
      var memType = parseInt(cj(\'#membership_type_id_1\').val( ));
      var isPriceSet = 0;

      if ( cj(\'#price_set_id\').length > 0 && cj(\'#price_set_id\').val() ) {
        isPriceSet = 1;
      }

      if ( !memType || isPriceSet ) {
        return;
      }

      var allMemberships = '; ?>
<?php echo $this->_tpl_vars['allMembershipInfo']; ?>
<?php echo ';
      if ( !mode ) {
        //check the record_contribution checkbox if membership is a paid one
        '; ?>
<?php if ($this->_tpl_vars['action'] == 1): ?><?php echo '
          if (!checkboxEvent) {
            if (allMemberships[memType][\'total_amount_numeric\'] > 0) {
              cj(\'#record_contribution\').attr(\'checked\',\'checked\');
              cj(\'#recordContribution\').show();
            }
            else {
              cj(\'#record_contribution\').removeAttr(\'checked\');
              cj(\'#recordContribution\').hide();
            }
          }
        '; ?>
<?php endif; ?><?php echo '
      }

      // skip this for test and live modes because financial type is set automatically
      cj("#financial_type_id").val(allMemberships[memType][\'financial_type_id\']);
      var term = cj(\'#num_terms\').val();
      if ( term ) {
        var feeTotal = allMemberships[memType][\'total_amount_numeric\'] * term;
        cj("#total_amount").val( feeTotal.toFixed(2) );
      }
      else {
        cj("#total_amount").val( allMemberships[memType][\'total_amount\'] );
      }
    }

    '; ?>

    <?php if ($this->_tpl_vars['context'] == 'standalone' && $this->_tpl_vars['outBound_option'] != 2): ?>
    <?php echo '
    cj( function( ) {
      cj("#contact_1").blur( function( ) {
        checkEmail( );
      } );
      checkEmail( );
    });

    function checkEmail( ) {
      var contactID = cj("input[name=\'contact_select_id[1]\']").val();
      if ( contactID ) {
        var postUrl = "'; ?>
<?php echo CRM_Utils_System::crmURL(array('p' => 'civicrm/ajax/checkemail','h' => 0), $this);?>
<?php echo '";
        cj.post( postUrl, {contact_id: contactID},
          function ( response ) {
            if ( response ) {
              cj("#email-receipt").show( );
              if ( cj("#send_receipt").is(\':checked\') ) {
                cj("#notice").show( );
              }
              cj("#email-address").html( response );
            }
            else {
              cj("#email-receipt").hide( );
              cj("#notice").hide( );
            }
          }
        );
  }
  else {
        cj("#email-receipt").hide( );
        cj("#notice").hide( );
      }
    }

    function profileCreateCallback( blockNo ) {
      checkEmail( );
    }
    '; ?>

    <?php endif; ?>

    <?php echo '
    //keep read only always checked.
    cj( function( ) {
      var allowAutoRenew   = '; ?>
'<?php echo $this->_tpl_vars['allowAutoRenew']; ?>
'<?php echo ';
      var alreadyAutoRenew = '; ?>
'<?php echo $this->_tpl_vars['alreadyAutoRenew']; ?>
'<?php echo ';
      if ( allowAutoRenew || alreadyAutoRenew ) {
        cj( "#auto_renew" ).click(function( ) {
          if ( cj(this).attr( \'readonly\' ) ) {
            cj(this).attr( \'checked\', true );
          }
        });
      }
    });
    '; ?>


    <?php if ($this->_tpl_vars['membershipMode'] || $this->_tpl_vars['action'] == 2): ?>
    <?php echo '

    buildAutoRenew( null, null );

    function buildAutoRenew( membershipType, processorId ) {
      var mode   = '; ?>
'<?php echo $this->_tpl_vars['membershipMode']; ?>
'<?php echo ';
      var action = '; ?>
'<?php echo $this->_tpl_vars['action']; ?>
'<?php echo ';

      //for update lets hide it when not already recurring.
      if ( action == 2 ) {
        //user can\'t cancel auto renew by unchecking.
        if ( cj("#auto_renew").attr( \'checked\' ) ) {
          cj("#auto_renew").attr( \'readonly\', true );
        }
        else {
          cj("#autoRenew").hide( );
        }
      }

      //we should do all auto renew for cc memberships.
      if ( !mode ) return;

      //get the required values in case missing.
      if ( !processorId )  processorId = cj( \'#payment_processor_id\' ).val( );
      if ( !membershipType ) membershipType = parseInt( cj(\'#membership_type_id_1\').val( ) );

      //we don\'t have both required values.
      if ( !processorId || !membershipType ) {
        cj("#auto_renew").attr( \'checked\', false );
        cj("#autoRenew").hide( );
        return;
      }

      var recurProcessors  = '; ?>
<?php echo $this->_tpl_vars['recurProcessor']; ?>
<?php echo ';
      var autoRenewOptions = '; ?>
<?php echo $this->_tpl_vars['autoRenewOptions']; ?>
<?php echo ';
      var currentOption    = autoRenewOptions[membershipType];

      if ( !currentOption || !recurProcessors[processorId] ) {
        cj("#auto_renew").attr( \'checked\', false );
        cj("#autoRenew").hide( );
        return;
      }

      if ( currentOption == 1 ) {
        cj("#autoRenew").show( );
        if ( cj("#auto_renew").attr( \'readonly\' ) ) {
          cj("#auto_renew").attr(\'checked\', false );
          cj("#auto_renew").removeAttr( \'readonly\' );
        }
      }
      else if ( currentOption == 2 ) {
        cj("#autoRenew").show( );
        cj("#auto_renew").attr( \'checked\', true );
        cj("#auto_renew").attr( \'readonly\', true );
      }
      else {
        cj("#auto_renew").attr( \'checked\', false );
        cj("#autoRenew").hide( );
      }

      //play w/ receipt option.
      if ( cj("#auto_renew").attr( \'checked\' ) ) {
        cj("#notice").hide( );
        cj("#send_receipt").attr( \'checked\', false );
        cj("#send-receipt").hide( );
      }
      else {
        cj("#send-receipt").show( );
        if ( cj("#send_receipt").attr( \'checked\' ) ) {
          cj("#notice").show( );
        }
      }
    }
    '; ?>

    <?php endif; ?>

    <?php echo '
    function buildReceiptANDNotice( ) {
      if ( cj("#auto_renew").attr( \'checked\' ) ) {
        cj("#notice").hide( );
        cj("#send-receipt").hide( );
      }
      else {
        cj("#send-receipt").show( );
        if ( cj("#send_receipt").attr( \'checked\' ) ) {
          cj("#notice").show( );
        }
      }
    }

    var customDataType = \''; ?>
<?php echo $this->_tpl_vars['customDataType']; ?>
<?php echo '\';

    // load form during form rule.
    '; ?>
<?php if ($this->_tpl_vars['buildPriceSet']): ?><?php echo '
    cj( "#totalAmountORPriceSet" ).hide( );
    cj( "#mem_type_id" ).hide( );
    cj(\'#total_amount\').attr("readonly", true);
    cj( "#num_terms_row" ).hide( );
    cj(".crm-membership-form-block-financial_type_id-mode").hide();
    '; ?>
<?php endif; ?><?php echo '

    function buildAmount( priceSetId ) {
  if ( !priceSetId ) {
    priceSetId = cj("#price_set_id").val( );
  }
        var fname = \'#priceset\';
        if ( !priceSetId ) {
        cj(\'#membership_type_id_1\').val(0);
        CRM.buildCustomData(customDataType, \'null\' );

        // hide price set fields.
        cj( fname ).hide( );

        // show/hide price set amount and total amount.
        cj( "#mem_type_id").show( );
        var choose = "'; ?>
<?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Choose price set<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php echo '";
        cj("#price_set_id option[value=\'\']").html( choose );
        cj( "#totalAmountORPriceSet" ).show( );
        cj(\'#total_amount\').removeAttr("readonly");
        cj( "#num_terms_row").show( );
        cj(".crm-membership-form-block-financial_type_id-mode").show();

        '; ?>
<?php if ($this->_tpl_vars['allowAutoRenew']): ?><?php echo '
        cj(\'#autoRenew\').hide();
        var autoRenew = cj("#auto_renew");
        autoRenew.removeAttr( \'readOnly\' );
        autoRenew.removeAttr( \'checked\' );
        '; ?>
<?php endif; ?><?php echo '
        return;
      }

      cj( "#total_amount" ).val( \'\' );
      cj(\'#total_amount\').attr("readonly", true);

      var dataUrl = '; ?>
"<?php echo CRM_Utils_System::crmURL(array('h' => 0,'q' => 'snippet=4'), $this);?>
"<?php echo ' + \'&priceSetId=\' + priceSetId;

      var response = cj.ajax({
        url: dataUrl,
        async: false
      }).responseText;

      cj( fname ).show( ).html( response );
      // freeze total amount text field.

      cj( "#totalAmountORPriceSet" ).hide( );
      cj( "#mem_type_id" ).hide( );
      var manual = "'; ?>
<?php $this->_tag_stack[] = array('ts', array()); $_block_repeat=true;smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>Manual membership and price<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_ts($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?><?php echo '";
      cj("#price_set_id option[value=\'\']").html( manual );
      cj( "#num_terms_row" ).hide( );
      cj(".crm-membership-form-block-financial_type_id-mode").hide();
    }

    buildMaxRelated(cj(\'#membership_type_id_1\', false).val());

    function buildMaxRelated( memType, setDefault ) {
      var allMemberships = '; ?>
<?php echo $this->_tpl_vars['allMembershipInfo']; ?>
<?php echo ';

      if ((memType > 0) && (allMemberships[memType][\'has_related\'])) {
        if (setDefault) cj(\'#max_related\').val(allMemberships[memType][\'max_related\']);
        cj(\'#maxRelated\').show();
        if(CRM.ids.contact > 0) {
          CRM.api(\'relationship\', \'getcount\', {\'contact_id\' : CRM.ids.contact, \'membership_type_id\' : memType}, {
            success: function(result) {
              var relatable = \' \' + result.result + ts(\' contacts are \');
              if(result.result === 0) {
                relatable = ts(\' No contacts are \');
              }
              if(result.result === 1) {
                relatable = ts(\' One contact is \');
              }

              var others = relatable + ts(\'currently eligible to inherit this relationship.\');
              cj(\'#max_related\').siblings(\'.description\').append(others);
            }
          });
        }
      } else {
        cj(\'#max_related\').val(\'\');
        cj(\'#maxRelated\').hide();
      }
    }

    var lastMembershipTypes = new Array;
    var optionsMembershipTypes = new Array;

    // function to load custom data for selected membership types through priceset
    function processMembershipPriceset( membershipValues, autoRenewOption, reload ) {
      var currentMembershipType = new Array;
      var count = 0;
      var loadCustomData = 0;
      if ( membershipValues ) {
        optionsMembershipTypes = membershipValues;
      }

      if ( reload ) {
        lastMembershipTypes = new Array;
        '; ?>
<?php if ($this->_tpl_vars['allowAutoRenew']): ?><?php echo '
        cj(\'#autoRenew\').hide();
        var autoRenew = cj("#auto_renew");
        autoRenew.removeAttr( \'readOnly\' );
        autoRenew.removeAttr( \'checked\' );
        if ( autoRenewOption == 1 ) {
          cj(\'#autoRenew\').show();
        }
        else if ( autoRenewOption == 2 ) {
          autoRenew.attr( \'readOnly\', true );
          autoRenew.attr( \'checked\',  true );
          cj(\'#autoRenew\').show();
        }
        '; ?>
<?php endif; ?><?php echo '
      }

      cj("input,#priceset select,#priceset").each(function () {
        if ( cj(this).attr(\'price\') ) {
          switch( cj(this).attr(\'type\') ) {
            case \'checkbox\':
              if ( cj(this).attr(\'checked\') ) {
                eval( \'var option = \' + cj(this).attr(\'price\') ) ;
                var ele = option[0];
                var memTypeId = optionsMembershipTypes[ele];
                if ( memTypeId && cj.inArray(optionsMembershipTypes[ele], currentMembershipType) == -1 ) {
                  currentMembershipType[count] = memTypeId;
                  count++;
                }
              }
              if ( reload ) {
                cj(this).click( function( ) {
                  processMembershipPriceset();
                });
              }
              break;

            case \'radio\':
              if ( cj(this).attr(\'checked\') && cj(this).val() ) {
                var memTypeId = optionsMembershipTypes[cj(this).val()];
                if ( memTypeId && cj.inArray(memTypeId, currentMembershipType) == -1 ) {
                  currentMembershipType[count] = memTypeId;
                  count++;
                }
              }
              if ( reload ) {
                cj(this).click( function( ) {
                  processMembershipPriceset();
                });
              }
              break;

            case \'select-one\':
              if ( cj(this).val( ) ) {
                var memTypeId = optionsMembershipTypes[cj(this).val()];
                if ( memTypeId && cj.inArray(memTypeId, currentMembershipType) == -1 ) {
                  currentMembershipType[count] = memTypeId;
                  count++;
                }
              }
              if ( reload ) {
                cj(this).change( function( ) {
                  processMembershipPriceset();
                });
              }
              break;
          }
        }
      });

      for( i in currentMembershipType ) {
        if ( cj.inArray(currentMembershipType[i], lastMembershipTypes) == -1 ) {
          loadCustomData = 1;
          break;
        }
      }

      if ( !loadCustomData ) {
        for( i in lastMembershipTypes) {
          if ( cj.inArray(lastMembershipTypes[i], currentMembershipType) == -1 ) {
            loadCustomData = 1;
            break;
          }
        }
      }

      lastMembershipTypes = currentMembershipType;

      // load custom data only if change in membership type selection
      if ( !loadCustomData ) {
        return;
      }

      subTypeNames = currentMembershipType.join(\',\');
      if ( subTypeNames.length < 1 ) {
        subTypeNames = \'null\';
      }

      CRM.buildCustomData( customDataType, subTypeNames );
    }

  function enableAmountSection( setContributionType ) {
    if ( !cj(\'#record_contribution\').attr(\'checked\') ) {
      cj(\'#record_contribution\').click( );
      cj(\'#recordContribution\').show( );
    }
    if ( setContributionType ) {
    cj(\'#financial_type_id\').val(setContributionType);
    }
  }
  </script>
  '; ?>

  <?php endif; ?> <?php endif; ?><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_crmScope($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
Back to Top