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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Customizing Fields Quick Add Block in Civicrm
Pages: [1]

Author Topic: Customizing Fields Quick Add Block in Civicrm  (Read 1573 times)

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 01:21:07 am
In default,  Quick Add Block  contains firstname, lastname and email fields.If i want to add phone,city fields in the existing block what should be done ? Code should be customized  or Configuration stuff to be done   ???

Rahul Bile

  • I post occasionally
  • **
  • Posts: 112
  • Karma: 16
  • impossible says, I M Possible
    • I AM POSSIBLE
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 01:42:05 am
sriraman.v,

You can create a profile with the required fields and copy the HTML code of the same , add that in a New Block.
That will do what you want :)


HTH
RB
Consider donating to CiviCRM if you use it. http://civicrm.org/donate

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 02:17:00 am
Just by modifying file 'templates/CRM/Block/Add.tpl'
eg: adding middle name
Code: [Select]
Index: templates/CRM/Block/Add.tpl
===================================================================
--- templates/CRM/Block/Add.tpl (revision 33624)
+++ templates/CRM/Block/Add.tpl (working copy)
@@ -37,6 +37,15 @@
 
 <div class="form-item">
     <div>
+        <label for="qa_middle_name">{ts}Middle Name:{/ts}</label>
+    </div>
+    <div>
+        <input type="text" name="middle_name" id="qa_middle_name" class="form-text" maxlength="64" />
+    </div>
+</div>
+
+<div class="form-item">
+    <div>
         <label for="qa_last_name">{ts}Last Name:{/ts}</label>

Rajan

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 02:45:46 am
Hi ,

@Rajan
i have tried the similar way for the phone and city field , but the contact is created.Phone and city field entry is not saved.

i hope the phone field is in civicrm_phone and city in civicrm_address

<div class="form-item">
     <div>
        <label for="qa_phone">{ts}Phone:{/ts}</label>
    </div>
    <div>
        <input type="text" name="phone" id="qa_phone" class="form-text" maxlength="64" />
    </div>
</div>

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 02:49:14 am
Hi

@RB,
I have tried with ur approach and it is working :) ,But i looking to customize in add.tpl .....

can anyone suggest

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 03:14:35 am
finally i have got it for phone field but for city  i couldn't

<div class="form-item">
     <div>
        <label for="qa_phone">{ts}Phone:{/ts}</label>
    </div>
    <div>
        <input type="text" name="phone[1][phone]" id="qa_phone" class="form-text" maxlength="64" />
        <input type="hidden" name="phone[1][is_primary]" value="1" />
</div>
</div>

<div class="form-item">
     <div>
        <label for="qa_city">{ts}City:{/ts}</label>
    </div>
    <div>
        <input type="text" name="address[1][city ]" id="qa_city" class="form-text" maxlength="64" />
        <input type="hidden" name="address[1][is_primary]" value="1" />
        <input type="hidden" name="address[1][location_type_id]" value="{$primaryLocationType}" />
</div>
</div>

Rajan Mayekar

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 20
    • Rajan's Blogs
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 03:23:33 am
try this
Code: [Select]
<div class="form-item">
    <div>
        <label for="qa_phone_1">{ts}Phone:{/ts}</label>
    </div>
    <div>
        <input type="text" name="phone[1][phone]" id="qa_phone_1" class="form-text" maxlength="64" />
<input type="hidden" name="phone[1][location_type_id]" value='1' />
<input type="hidden" name="phone[1][phone_type_id]" value='1' />
<input type="hidden" name="phone[1][is_primary]" value='1' />
    </div>
</div>

<div class="form-item">
    <div>
        <label for="qa_city_1">{ts}City:{/ts}</label>
    </div>
    <div>
        <input type="text" name="address[1][city]" id="qa_city_1" class="form-text" maxlength="64" />
<input type="hidden" name="address[1][location_type_id]" value='1' />
<input type="hidden" name="address[1][is_primary]" value='1' />
    </div>
</div>

sriraman.v

  • I’m new here
  • *
  • Posts: 19
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.5.8
  • PHP version: 5.2.9
Re: Customizing Fields Quick Add Block in Civicrm
April 13, 2011, 03:34:34 am
YEP ....got it....Thank U ... :)

noah

  • I’m new here
  • *
  • Posts: 18
  • Karma: 4
Re: Customizing Fields Quick Add Block in Civicrm
June 01, 2011, 08:28:31 pm
Any idea how I would add a "Save and Edit" option to this block?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Customizing Fields Quick Add Block in Civicrm

This forum was archived on 2017-11-26.