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) »
  • links qs parameters
Pages: [1]

Author Topic: links qs parameters  (Read 4045 times)

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
links qs parameters
August 01, 2013, 05:35:34 am
Hi everybody,

I'm using &links() in my extension. I've got a table displaying my datas just as any other list's administration (sex, location type,etc) but it miss me parameters to be able to pre-select my datas when I try to update the line.

I know there's a way but I can't find what I'm searching for...

This is the code I'm talking about :

Code: [Select]
     
self::$_links = array(
        CRM_Core_Action::UPDATE => array(
          'name' => ts('Edit'),
          'url' => 'civicrm/admin/automaticRelationship',
          'qs' => 'action=update&id=%%id%%&reset=1',
          'title' => ts('Edit Location Type'),
        ),

How can I know which variables can be put in the qs parameters ?

If I'm able to know this, I can set default values for my datas

Thanks !!!
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: links qs parameters
August 01, 2013, 06:20:17 am

Check the array of values that are sent to the links function in that file. They give the key/value replacements for the 'qs' string

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: links qs parameters
August 01, 2013, 06:48:16 am
Thanks !

But now I'm trying to set defaults values with this :

Code: [Select]
  function setDefaultValues() {
  if ($this->_action & CRM_Core_Action::UPDATE) {
  $defaults=array();
    $AutoRel = CRM_CiviAutoRel_BAO_AutomaticRelationship::getAutomaticRelationship($this->_id);
    $defaults['relationship_id']= $AutoRel->relationship_id;
    $defaults['membership_type_id']=$AutoRel->membership_type_id;
    $defaults['contact_id']=$AutoRel->contact_id;
    return $defaults;
  }
  }

I call it there :

Code: [Select]
function preProcess() {
  $this->_id = CRM_Utils_Request::retrieve('id', 'Int', $this);
      CRM_Custom_Form_CustomData::buildQuickForm($this);
      CRM_Custom_Form_CustomData::setDefaultValues($this);
}

But it's not working...

Any ideas ?
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: links qs parameters
August 01, 2013, 07:48:16 am
Solved !

I was just giving it wrong keys...

 ;D
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • links qs parameters

This forum was archived on 2017-11-26.