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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Removing items from -more actions- menu
Pages: [1]

Author Topic: Removing items from -more actions- menu  (Read 3287 times)

ericj

  • Guest
Removing items from -more actions- menu
July 16, 2008, 05:25:10 pm
Hello,
This post numero uno for me.  I am a CiviCRM newb but am in love with the software.  A fantastic piece of open source.  My hat's off to the developers.

I have a couple of questions about removing some items from the forms and dropdowns.

1.  Under the -more actions- menu on the Find Contacts screen, is there a way to remove 'delete contact' 'email contact' and 'export contact?'

2.  On the 'new individual' form is there a way to remove Instant Messenger and OpenID from the Primary Location block?

I've search high and low without much luck...I am hoping someone here can help me out.

Regards,
Eric

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Removing items from -more actions- menu
July 16, 2008, 06:36:13 pm
Thanks for the compliments - we're glad it seems useful !

Now for the 'bad' news...
1) Delete Contact should be suppressed from -more actions- for users who do not have "edit contacts" permission (assuming you're using Drupal). You'll need to hack the code to modify the list beyond that.

2) I think you'll need to "customize" (override) the standard template for that form to remove them. However, you can do that pretty easily - creating a separate copy in your custom templates path:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

The base template for this is CRM/Contact/Form/Edit.tpl
Protect your investment in CiviCRM by  becoming a Member!

ericj

  • Guest
Re: Removing items from -more actions- menu
July 17, 2008, 11:26:11 am
Thanks for the quick response Dave.  I think the the edit.tpl should be no problem to edit, however do you know where I can find the -more action- code (I am using Drupal) in CiviCRM?  I took a look around in the html page source, but don't know where to find the tpl or core code to edit that list.

Thanks again!

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Removing items from -more actions- menu
July 18, 2008, 08:57:52 pm
These are "tasks" and are defined in CRM/Contact/Task.php

As you're finding your way around the codebase - I find that "grep" is your friend :-) You might also want to check out the Blog posts tagged "Architecture" on http://civicrm.org/blog
Protect your investment in CiviCRM by  becoming a Member!

ericj

  • Guest
Re: Removing items from -more actions- menu
July 20, 2008, 04:30:05 pm
Thanks Dave, that work beautifully.  I will do some more grep stuff from now on.  I appreciate the help.  Take care.

nicrodgers

  • Guest
Re: Removing items from -more actions- menu
November 26, 2008, 07:33:04 am
Hey ericj.

I'm trying to do exactly the same thing: remove the Open ID and Instant Messenger blocks from the New Individual form.
I looked at Edit.tpl as mentioned above, and that appears to be including Location.tpl and within there are two further includes, which I have removed:

{include file="CRM/Contact/Form/IM.tpl"}
{include file="CRM/Contact/Form/OpenID.tpl"}

that does remove them from the form, but when you visit the page you get a javascript alert (actually, about 8)  along the lines of:

showBlocks array item not in .tpl = id_location_1_im_2_show

i'd love any pointers on how to fix this, I've taken a look through the code and it seems that $showBlocks gets set in the core CiviCRM code and I couldn't see a very tidy way of editing it..

(btw I'm using CiviCRM 2.0.6)

How did you do it?

Cheers,
Nic


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Removing items from -more actions- menu
November 26, 2008, 12:06:29 pm
Not sure how Eric did this, but one approach would be to retain the included tpl files, but modify them to just be empty div's.
Protect your investment in CiviCRM by  becoming a Member!

nicrodgers

  • Guest
Re: Removing items from -more actions- menu
November 26, 2008, 11:38:23 pm
I managed to solve the problem by also editing /sites/all/modules/civicrm/CRM/Contact/Form/Location.php

Comment out lines 105 and 106, which relate to building the openID and instant messenger fields. So the if block should look like this after you've commented it out:

if ( ! $locationCompoments ) {
                CRM_Contact_Form_Phone::buildPhoneBlock   ($form, $location, $locationId, self::BLOCKS);
                CRM_Contact_Form_Email::buildEmailBlock   ($form, $location, $locationId, self::BLOCKS);
                //CRM_Contact_Form_IM::buildIMBlock         ($form, $location, $locationId, self::BLOCKS);
               // CRM_Contact_Form_OpenID::buildOpenIDBlock ($form, $location, $locationId, self::BLOCKS);
}

Hope this helps someone else!
Nic

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Removing items from -more actions- menu

This forum was archived on 2017-11-26.