Merge pull request #2965 from generalredneck/CRM-14135
[civicrm-core.git] / templates / CRM / Member / Form / MembershipView.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25 *}
26 {* View existing membership record. *}
27 <div class="crm-block crm-content-block crm-membership-view-form-block">
28 <h3>{ts}View Membership{/ts}</h3>
29 <div class="crm-submit-buttons">
30 {* Check permissions and make sure this is not an inherited membership (edit and delete not allowed for inherited memberships) *}
31 {if ! $owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships') }
32 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"}
33 {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
34 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"}
35 {/if}
36 <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" accesskey="e" id="crm-membership-edit-button-top"><span><div class="icon edit-icon"></div> {ts}Edit{/ts}</span></a>
37 {/if}
38 {if ! $owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')}
39 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"}
40 {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
41 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"}
42 {/if}
43 <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" id="crm-membership-delete-button-top"><span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span></a>
44 {/if}
45 {include file="CRM/common/formButtons.tpl" location="bottom"}
46 </div>
47 <table class="crm-info-panel">
48 <tr><td class="label">{ts}Member{/ts}</td><td class="bold"><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$contact_id&context=$context"}" title="{ts}View contact summary{/ts}">{$displayName}</td></tr>
49 {if $owner_display_name}
50 <tr><td class="label">{ts}By Relationship{/ts}</td><td>{$relationship}&nbsp;&nbsp;<a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$owner_contact_id&context=$context"}" title="{ts}View primary member contact summary{/ts}">{$owner_display_name}</a>&nbsp;</td></tr>
51 {/if}
52 <tr><td class="label">{ts}Membership Type{/ts}</td><td>{$membership_type}</td></tr>
53 {if $has_related}
54 <tr><td class="label">{ts}Max related{/ts}</td><td>{$max_related}</td></tr>
55 {/if}
56 <tr><td class="label">{ts}Status{/ts}</td><td>{$status}</td></tr>
57 <tr><td class="label">{ts}Source{/ts}</td><td>{$source}</td></tr>
58 {if $campaign}<tr><td class="label">{ts}Campaign{/ts}</td><td>{$campaign}</td></tr>{/if}
59 <tr><td class="label">{ts}Member Since{/ts}</td><td>{$join_date|crmDate}</td></tr>
60 <tr><td class="label">{ts}Start date{/ts}</td><td>{$start_date|crmDate}</td></tr>
61 <tr><td class="label">{ts}End date{/ts}</td><td>{$end_date|crmDate}</td></tr>
62 <tr><td class="label">{ts}Auto-renew{/ts}</td><td>{$auto_renew}</td></tr>
63 </table>
64
65 {include file="CRM/Custom/Page/CustomDataView.tpl"}
66
67 {if $accessContribution and $rows.0.contribution_id}
68 {include file="CRM/Contribute/Form/Selector.tpl" context="Search"}
69 {/if}
70
71 {if $has_related}
72 {include file="CRM/Member/Form/MembershipRelated.tpl" context="Search"}
73 {/if}
74
75 <div class="crm-submit-buttons">
76 {* Check permissions and make sure this is not a related membership (edit and delete not allowed for related memberships) *}
77 {if ! $owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'edit memberships') }
78 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context"}
79 {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
80 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=update&context=$context&key=$searchKey"}
81 {/if}
82 <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" accesskey="e" id="crm-membership-edit-button-bottom"><span><div class="icon edit-icon"></div> {ts}Edit{/ts}</span></a>
83 {/if}
84 {if ! $owner_contact_id AND call_user_func(array('CRM_Core_Permission','check'), 'delete in CiviMember')}
85 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context"}
86 {if ( $context eq 'fulltext' || $context eq 'search' ) && $searchKey}
87 {assign var='urlParams' value="reset=1&id=$id&cid=$contact_id&action=delete&context=$context&key=$searchKey"}
88 {/if}
89 <a class="button" href="{crmURL p='civicrm/contact/view/membership' q=$urlParams}" id="crm-membership-delete-button-bottom"><span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span></a>
90 {/if}
91 {include file="CRM/common/formButtons.tpl" location="bottom"}
92 </div>
93 </div>
94