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) »
  • View only Birth date field in profile
Pages: [1]

Author Topic: View only Birth date field in profile  (Read 763 times)

idmacdonald

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
View only Birth date field in profile
July 27, 2010, 10:21:42 am
Hi,

I'm using CiviCRM v28600 from SVN.

I have a Birth Date field that is used in a profile so that a user can fill in his/her details.

In some circumstances, I want this field to display 'read-only' on the profile edit form. If I go into the profile settings and untick 'required' and tick 'View Only', then the field does show up as a non-editable field in the profile. However, the 'clear' JavaScript link still appears next to the text field, and clicking on it and then 'Save' does clear the 'Birth date' field for the user's contact record.

Surely the 'clear' link shouldn't be there if the field is configured to be 'View Only'. Right? Shall I report this as a bug, or is there something else that I am missing?

Many thanks,
-Ian

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: View only Birth date field in profile
July 27, 2010, 10:38:40 am
Quote
Surely the 'clear' link shouldn't be there if the field is configured to be 'View Only'. Right?
Yes

Quote
Shall I report this as a bug
Yes, file an issue at http://issues.civicrm.org/jira/browse/CRM?report=com.atlassian.jira.plugin.system.project:roadmap-panel

Thanks
Kurund
Found this reply helpful? Support CiviCRM

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: View only Birth date field in profile
July 28, 2010, 12:32:34 am
Filed and fixed http://issues.civicrm.org/jira/browse/CRM-6550

Kurund
Found this reply helpful? Support CiviCRM

idmacdonald

  • I post occasionally
  • **
  • Posts: 69
  • Karma: 1
Re: View only Birth date field in profile
July 28, 2010, 03:51:46 am
Hi Kurund,

Thanks for that. I've now patched my 3.1 branch install with that change.

Now, there is something else that I would like to do. We would like users to be able to fill in the 'Birth Date' field as part of their user profile, but we don't want people to be able to go back and change their birth date once it has been filled in. We want it to be filled in once, then become read-only.

I've tried using hook_civicrm_buildForm to set the form element to '_flagFrozen = TRUE' if the birth date field has a value already, which seems to make the birth date field read-only on the form, but the 'clear' link still displays and works.

Obviously, what I am doing is a gross hack, so I'm not surprised that it doesn't work right. Is there another, better way of doing this? Has anyone else done something similar?

Thanks,
-Ian

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: View only Birth date field in profile
July 28, 2010, 05:28:15 am
I have not check on 3.1, but on 3.2 birthdate is already frozen. No element is displayed.

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • View only Birth date field in profile

This forum was archived on 2017-11-26.