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) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Slight improvement to Profile Titles
Pages: [1]

Author Topic: Slight improvement to Profile Titles  (Read 2204 times)

carlessa

  • Guest
Slight improvement to Profile Titles
August 29, 2007, 12:06:28 pm
My first attempt to hack at CiviCRM, so please excuse the fact that it's only a tiny improvement. I'm running CiviCRM via Joomla 1.0.x so the paths and templates are specific to that version, I can only assume the Drupal code works vaguely the same way.

When a user edits a profile page, the header of the page (and the HTML title) shows the name of the profile they are editing. When they save the changes, the header changes to just say "Contact's Profile". That's a bit nasty, it should keep showing the name of the profile, otherwise the user gets confused over what the site has just done with their details.

The fix is in the file <website>/administrator/components/com_civicrm/CRM/Profile/Page/View.php

At approx line 110, you'll see the line:
CRM_Utils_System::setTitle(ts('Contact\'s Profile'));

Replace that with something like:
$title = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_UFGroup', $this->_gid, 'title' );
CRM_Utils_System::setTitle($title);


Then the view page will have the same header as the edit page for the profile.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Slight improvement to Profile Titles
August 29, 2007, 12:20:59 pm

thanx for the patch. much appreciated :) This will be part for the next 1.8 revision release and has been commited at rev 11101

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

carlessa

  • Guest
Re: Slight improvement to Profile Titles
August 29, 2007, 05:04:27 pm
Oh cool, that's an acceptable patch format? I was thinking about producing a diff file, release note, opening a new Issue, etc. I've spent too long in the commercial world   ::)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Slight improvement to Profile Titles
August 29, 2007, 06:09:28 pm

For something as simple as what you did, which is much better than what we have currently, the forum patch is fine. If it gets more involved, we would want an issue filed along with a patch for the latest version etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • Slight improvement to Profile Titles

This forum was archived on 2017-11-26.