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) »
  • return. vs return
Pages: [1]

Author Topic: return. vs return  (Read 675 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
return. vs return
October 11, 2010, 03:37:45 pm
So,

A very minor tidy up is that contact_get accepts return_ or return. (or return%) whereas some others only accept return.

Code: [Select]
    foreach ( $params as $n => $v ) {
        if ( substr( $n, 0, 6 ) == 'return' ) {
            $returnProperties[ substr( $n, 7 ) ] = $v;
        } elseif ( in_array( $n, $otherVars ) ) {

vs

Quote
    foreach ( $params as $n => $v ) {
        if ( substr( $n, 0, 7 ) == 'return.' ) {
            $returnProperties[] = substr( $n, 7 );

I think they should all be the same & I propose they all be made like the contact (this means changing Contribution, Event, Group & Participant). Does anyone see a reason why the contact version should not be the standard?
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

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: return. vs return
October 12, 2010, 02:52:18 am
What's the benefit of accepting returntoto on the top of return_toto ?

On the returns, something that might be interesting to generalise is using return = ['fieldA','fieldB'] instead of return_fieldA => 1, return_fieldB => 1) ?

and so the rest/ajax interface would instead of
civicrm/contribution/search&return[participant_id]=1&return[contribution_id]=1&contribution_id=28

be
civicrm/contribution/search&return=participant_id,contribution_id&contribution_id=28

More compact and readable, isn't it?

X+
« Last Edit: October 12, 2010, 02:56:17 am by xavier »
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: return. vs return
October 12, 2010, 05:51:41 am
Yep, I second that!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: return. vs return
October 12, 2010, 10:48:20 am
So,

You're saying this syntax return_fieldA=1 is a bit laborious & it would be better to pass in a comma separated list or array? Makes sense... we could add it to the list.

On the minor tidy up... does that standardisation make sense?
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) »
  • return. vs return

This forum was archived on 2017-11-26.