CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Change Listview in Contact Summary Tabs
Pages: [1]

Author Topic: Change Listview in Contact Summary Tabs  (Read 384 times)

jschenck

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: 7
  • MySQL version: 5.5.34
  • PHP version: 5.4.9
Change Listview in Contact Summary Tabs
January 29, 2014, 05:07:29 am
Hey,
i want to change the fields included in the List of memberships of a contact. I want to add custom fields there.
From my opinion its only possible through changing the templates. Is that right?
Is that file the right template? .../templates/CRM/Member/Page/Tab.tpl?

There i find this code which i think is doing the list. How i add custom fields there?

Code: [Select]
<table id="active_membership" class="display">
            <thead>
            <tr>
                <th>{ts}Membership{/ts}</th>
                <th>{ts}Member Since{/ts}</th>
                <th>{ts}Start Date{/ts}</th>
                <th>{ts}End Date{/ts}</th>
                <th>{ts}Status{/ts}</th>
                <th>{ts}Source{/ts}</th>
                <th>{ts}Auto-renew{/ts}</th>
                <th>{ts}Related{/ts}</th>
                <th></th>
            </tr>
            </thead>
            {foreach from=$activeMembers item=activeMember}
            <tr id="crm-membership_{$activeMember.id}" class="{cycle values="odd-row,even-row"} {$activeMember.class} crm-membership"
                <td class="crm-membership-membership_type">
                    {$activeMember.membership_type}
                    {if $activeMember.owner_membership_id}<br />({ts}by relationship{/ts}){/if}
                </td>
                <td class="crm-membership-join_date">{$activeMember.join_date|crmDate}</td>
                <td class="crm-membership-start_date">{$activeMember.start_date|crmDate}</td>
                <td class="crm-membership-end_date">{$activeMember.end_date|crmDate}</td>
                <td class="crm-membership-status">{$activeMember.status}</td>
                <td class="crm-membership-source">{$activeMember.source}</td>
                <td class="crm-membership-auto_renew">{if $activeMember.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt=
                <td class="crm-membership-related_count">{$activeMember.related_count}</td>
    <td>
                    {$activeMember.action|replace:'xx':$activeMember.id}
                    {if $activeMember.owner_membership_id}
                      <a href="{crmURL p='civicrm/membership/view' q="reset=1&id=`$activeMember.owner_membership_id`&action=view&cont
                    {/if}
                </td>
            </tr>
            {/foreach}
        </table>

Thx for Help
Jan

jschenck

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: 7
  • MySQL version: 5.5.34
  • PHP version: 5.4.9
Re: Change Listview in Contact Summary Tabs
January 29, 2014, 06:56:19 am
I somehow fullfilled my task myself.
This is the new code. If someone has some comments i would still like to here them.
Code: [Select]
<table id="active_membership" class="display">
            <thead>
            <tr>
                <th>{ts}Membership{/ts}</th>
                <th>{ts}Member Since{/ts}</th>
                <th>{ts}Start Date{/ts}</th>
                <th>{ts}End Date{/ts}</th>
                <th>{ts}Status{/ts}</th>
                <th>{ts}Zahlungsrythmus{/ts}</th>
                <th>{ts}Zahlungsart{/ts}</th>
                <th>{ts}Related{/ts}</th>
                <th></th>
            </tr>
            </thead>
            {foreach from=$activeMembers item=activeMember}
            <tr id="crm-membership_{$activeMember.id}" class="{cycle values="odd-row,even-row"} {$activeMember.class} crm-membership">
                <td class="crm-membership-membership_type">
                    {$activeMember.membership_type}
                    {if $activeMember.owner_membership_id}<br />({ts}by relationship{/ts}){/if}
                </td>
                <td class="crm-membership-join_date">{$activeMember.join_date|crmDate}</td>
                <td class="crm-membership-start_date">{$activeMember.start_date|crmDate}</td>
                <td class="crm-membership-end_date">{$activeMember.end_date|crmDate}</td>
                <td class="crm-membership-status">{$activeMember.status}</td>
{crmAPI membership_id=$activeMember.id var="result" entity="Membership" action="get" q="civicrm/ajax/rest" sequential=1}
{foreach from=$result.values item=Membership}
                <td class="crm-membership-result">{$Membership.custom_8}</td>
<------><------><td class="crm-membership-result">{$Membership.custom_9}</td>
{/foreach}
............
    <td class="crm-membership-related_count">{$activeMember.related_count}</td>
    <td>
                    {$activeMember.action|replace:'xx':$activeMember.id}
                    {if $activeMember.owner_membership_id}
                      <a href="{crmURL p='civicrm/membership/view' q="reset=1&id=`$activeMember.owner_membership_id`&action=view&context=membership&select
                    {/if}
                </td>
            </tr>
            {/foreach}
        </table>

Thanks a lot to the great CiviAPI Team. ;-)
« Last Edit: January 30, 2014, 03:45:02 am by jschenck »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Change Listview in Contact Summary Tabs

This forum was archived on 2017-11-26.