CiviCRM Forums
News: You can learn more about CiviCRM from our new free book: Understanding CiviCRM. Also Check the CiviCRM Blog for updated information on CiviCRM
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 02, 2010, 09:11:03 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: 'Communication preferrences' not in edit form but remain in contact summary.  (Read 104 times)
Durruti
I post occasionally
**

Karma: 0
Offline Offline

CiviCRM: 3.1.1
CMS: Drupal 6.15
Posts: 37


View Profile WWW
« on: July 29, 2010, 07:21:53 am »

Hello all,
We don't register 'communication preferences' as part of our installation and therefore I've disabled it in the edit page of 'site preferences'. However I still have the 4 unwanted fields on my contact summary page. Looking at the CRM/Contact/Page/View/Summary.php page, the
only reference I see is as follows;

//Show blocks only if they are visible in edit form
        require_once 'CRM/Core/BAO/Preferences.php';
        $this->_editOptions  = CRM_Core_BAO_Preferences::valueOptions( 'contact_edit_options' );
        $configItems = array( 'CommBlock'     => 'Communication Preferences',
                              'Demographics'  => 'Demographics',
                              'TagsAndGroups' => 'Tags and Groups',
                              'Notes'         => 'Notes' );

Which I guess should mean that I don't see them? Could it be because 1 of the fields is populated (Email format: both) that I'm still seeing this? I'm not sure where this setting has come from but I could go through the database and remove it if it would help.
Many thanks for any ideas.
Durruti
« Last Edit: July 29, 2010, 07:24:48 am by Durruti » Logged
Kurund Jalmi
Administrator
I’m (like) Lobo ;)
*****

Karma: 101
Offline Offline

CiviCRM: v3.1, v3.2, trunk
CMS: Drupal 6.x, Joomla 1.5.x
MySQL: 5.1.48
PHP: 5.2.13

Posts: 2771



View Profile WWW
« Reply #1 on: July 29, 2010, 09:37:12 am »

I would recommend customizing Summary.tpl and use custom templates rather than modifying php code.

Kurund
Logged

Do you like CiviCRM? If so, please consider making a donation.
Durruti
I post occasionally
**

Karma: 0
Offline Offline

CiviCRM: 3.1.1
CMS: Drupal 6.15
Posts: 37


View Profile WWW
« Reply #2 on: July 30, 2010, 04:38:48 am »

Hi Kurund,
Thanks for the quick response. It's my first time using custom templates, so following the documentation here's what I've done.
  • Created a 'civicrm_templates' directory in my sites/all folder and made it writable
  • Created the following directory structure within the above folder 'CRM\Contact\Page\View' and copied the Summary.tpl file to it.
  • added the following to civicrm.settings.php "define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/vhosts/<mysite>/httpdocs/sites/all/civicrm_templates/' );"
  • Removed the following from Summary.tpl
Code:
<div class="contact_panel">
                        <div class="contactCardLeft">
                            <table>
                                <tr><td class="label">{ts}Privacy{/ts}</td>
                                    <td><span class="font-red upper">
                                        {foreach from=$privacy item=priv key=index}
                                            {if $priv}{$privacy_values.$index}<br />{/if}
                                        {/foreach}
                                        {if $is_opt_out}{ts}No Bulk Emails (User Opt Out){/ts}{/if}
                                    </span></td>
                                </tr>
                                <tr>
                                    <td class="label">{ts}Preferred Method(s){/ts}</td><td>{$preferred_communication_method_display}</td>
                                </tr>
                                <tr>
                                    <td class="label">{ts}Preferred Language{/ts}</td><td>{$preferred_language}</td>
                                </tr>
                                <tr>
                                    <td class="label">{ts}Email Format{/ts}</td><td>{$preferred_mail_format}</td>
                                </tr>
                            </table>
                        </div>
    [/li]
When I refresh a directory has been created in my custom templates directory alongside CRM called en_US containing lots of sub-directories called %%02 to %%F0, but might changes to the template are not getting picked up.
What am I doing wrong?
Many thanks for any suggestions.
Durruti


Logged
Kurund Jalmi
Administrator
I’m (like) Lobo ;)
*****

Karma: 101
Offline Offline

CiviCRM: v3.1, v3.2, trunk
CMS: Drupal 6.x, Joomla 1.5.x
MySQL: 5.1.48
PHP: 5.2.13

Posts: 2771



View Profile WWW
« Reply #3 on: July 30, 2010, 04:50:56 am »

You don't need to add anything in civicrm.settings.php. You should check this: http://en.flossmanuals.net/CiviCRM/DevelopTemplates

Kurund
Logged

Do you like CiviCRM? If so, please consider making a donation.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM