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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Am struggling
Pages: [1]

Author Topic: Am struggling  (Read 1695 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Am struggling
March 12, 2009, 05:39:37 am
I have found that by creating the 'eileen' module I can change the create employer box to a dojo one but it only works if I get this line

Code: [Select]
[quote]<div class="tundra" dojoType= "dojox.data.QueryReadStore" jsId="organizationStore" url="{$employerDataURL}" doClientPaging="false" ></div>[/quote]
into the tpl file but try as I can I can't find a place in a tpl file that will affect my profile (preferably all my profiles) every time I use it. Kurund suggested dynamic.tpl but I've peppered it all over both of them and it shows up in the preview but not in the edit form on the edit user profile box or when I am registering for an event. (NB I think more than one upsets it too?)

Please help

NB - the function here : seems only to apply to profiles & only when the relevant field exists which surprises me since I thought I'd have to convince it of the joys of that behaviour

Code: [Select]
function eileen_civicrm_buildForm( $formName, &$form ){
  //Eileen Wuz Here
        $employerAttributes    = array( 'dojoType'     => 'civicrm.FilteringSelect',
                                        'mode'         => 'remote',
                                        'store'        => 'organizationStore',
                                        'style'        => 'width:300px; border: 1px solid #cfcfcf;',
                                        'class'        => 'tundra',
                                        'pageSize'     => 10,
                                        'onchange'     => 'showSelectedAddress("current_employer")',
                                       
                                        );
                                       
       
        $employerDataURL =  CRM_Utils_System::url( 'civicrm/ajax/search',
                                                   "org=1",
                                                   false, null, false );
       
        $form->assign('employerDataURL',$employerDataURL );
       
        $form->addElement('text', 'current_employer', ts('Current Employer'), $employerAttributes );
       
 //Eileen Wuz Here
« Last Edit: March 12, 2009, 05:50:44 am by Kurund Jalmi »
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: Am struggling
March 12, 2009, 11:14:19 pm
This worked for me:

Quote
function civicrm_civicrm_buildForm( $formName, $form ) {
    $employerAttributes    = array( 'dojoType'     => 'civicrm.FilteringSelect',
                                            'mode'         => 'remote',
                                            'store'        => 'organizationStore',
                                            'style'        => 'width:300px; border: 1px solid #cfcfcf;',
                                            'class'        => 'tundra',
                                            'pageSize'     => 10
                                            );


    $employerDataURL =  CRM_Utils_System::url( 'civicrm/ajax/search',
                                               "org=1",
                                               true, null, false );

    $form->assign('employerDataURL',$employerDataURL );

    $form->addElement('text', 'current_employer', ts('Current Employer'), $employerAttributes );
}

Quote
Index: templates/CRM/Profile/Form/Dynamic.tpl
===================================================================
--- templates/CRM/Profile/Form/Dynamic.tpl   (revision 20284)
+++ templates/CRM/Profile/Form/Dynamic.tpl   (working copy)
@@ -3,7 +3,7 @@
 {if ! empty( $fields )}
 {* wrap in crm-container div so crm styles are used *}
 <div id="crm-container" lang="{$config->lcMessages|truncate:2:"":true}" xml:lang="{$config->lcMessages|truncate:2:"":true}">
-
+<div class="tundra" dojoType= "dojox.data.QueryReadStore" jsId="organizationStore" url="{$employerDataURL}" doClientPaging="false" ></div>
     {if $mode eq 8 || $mode eq 1}
         {include file="CRM/Form/body.tpl"}
     {/if}

hTH

Kurund
Found this reply helpful? Support CiviCRM

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Am struggling
March 13, 2009, 10:01:49 am
Lobo pointed out I need to put in in block.tpl to get the change in the events / contribution screen and I found preview.tpl helped for the preview screen.

Thanks Kurund.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Am struggling

This forum was archived on 2017-11-26.