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) »
  • Last Entry Link available through profiles
Pages: [1]

Author Topic: Last Entry Link available through profiles  (Read 1292 times)

yamba

  • Guest
Last Entry Link available through profiles
January 31, 2008, 10:37:08 pm
Hi,

I'm currently using profiles to create new Contacts.  Once the contact is created successfully, there is a confirmation message display.  Is there an easy way to display a link pointing on the Contact summary once the new contact is created through the profile?   either in the confirmation message or elsewhere in the page...  (so far, the once the contact is created, the only way I see to get to the summary page is to perform a contact search)

I've started to look in the tpls and in come code parts, but i wanted to have some advise before modiying anything.

Thanks!

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Last Entry Link available through profiles
January 31, 2008, 11:15:52 pm
By default once you submit profile to goes to view mode.
Eg: http://sandbox.civicrm.org/civicrm/profile/view?reset=1&id=69&gid=1

So may be in view mode you can add a link below for Contact Summary.
http://sandbox.civicrm.org/civicrm/contact/view?reset=1&cid=69

You will have to do some custom coding for this. check CRM/Profile/Page/View.php

HTH

kurund
Found this reply helpful? Support CiviCRM

yamba

  • Guest
Re: Last Entry Link available through profiles
February 01, 2008, 07:23:57 pm
Many thanks for your hints!

Here is how I modified the code.

In CRM/Profile/Page/View.php, in the preProcess function:

        $this->assign('profileGroups', $profileGroups);
        $this->assign('recentlyViewed', false);
      
      //INSERTED CODE
      $last_contact_id_url = "index.php?q=civicrm/contact/view&reset=1&cid=".$id;
      $this->assign('last_contact_id_url', $last_contact_id_url);

        $title = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_UFGroup', $this->_gid, 'title' );
        CRM_Utils_System::setTitle( $title );

And in templates/CRM/Profile/Page/View.tpl, at the end of the file:

<div class="action-link">
<a href="{$last_contact_id_url}">&raquo; Aller au dossier du pr&eacute;sent contact</a>
</div>

Regards,

Yamba

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Last Entry Link available through profiles
February 02, 2008, 04:37:02 pm
You could also accomplish this in a more "upgrade friendly" way by creating a custom version of Profile/Page/View.tpl - as discussed here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

... the contact id is already available to that template as $cid - so you don't need to make any changes to the PHP file in order to do this:

Code: [Select]
<a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$cid`"}">&raquo; Aller au dossier du pr&eacute;sent contact</a>

With this approach - you won't have to keep re-implementing your change in View.php as you upgrade.
Protect your investment in CiviCRM by  becoming a Member!

yamba

  • Guest
Re: Last Entry Link available through profiles
February 02, 2008, 06:11:37 pm
Yes, it's definitely more clean.  Thanks for the notice!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Last Entry Link available through profiles

This forum was archived on 2017-11-26.