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) »
  • questions re CRM-14678
Pages: [1]

Author Topic: questions re CRM-14678  (Read 453 times)

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
questions re CRM-14678
February 21, 2015, 11:05:10 pm
Since 4.4 contributions pages have operated like event pages re the ability to submit for someone else by adding cid=0 to the url.   That functionality is "hidden" at the moment as there is no "Welcome JoAnne . (Not JoAnne , or want to do this for a different person?) " on the contribution pages.

https://issues.civicrm.org/jira/browse/CRM-14678 is about adding that text and link to contribution pages.  I can get the required phrase with link to appear on an online contribution form, but I have a couple of questions before I submit a PR.

1. What exactly should I be trying to achieve?
 
Whilst I can see the advantages of making the functionality obviously available on membership pages, I am not sure about donation pages.  At the moment I have got it working for all contribution pages and so have had to use the hand-waving text "do this" as indicated above.  Should I be trying to make it just appear on membership forms  in which case I could use more specific text such as "Welcome JoAnne . (Not JoAnne , or want to sign up/renew for a different person?)?


2. This comes from only vaguely understanding what I am doing.
 
Basically I achieved the desired outcome by copying, pasting and modifying code that does the same thing in civicrm\templates\CRM\Event\Form\Registration\Register.tpl.  The code there is:

Quote
  {if $contact_id}
      <div class="messages status no-popup" id="crm-event-register-different">
        {ts 1=$display_name}Welcome %1{/ts}. (<a
          href="{crmURL p='civicrm/event/register' q="cid=0&reset=1&id=`$event.id`"}"
          title="{ts}Click here to register a different person for this event.{/ts}">{ts 1=$display_name}Not %1, or want to register a different person{/ts}</a>?)
      </div>
    {/if}

I am not sure what id="crm-event-register-different" is there for.  As far as I can tell  class="messages status no-popup" is what determines the style for this message.  That is all I need to get the right formatting for the text on the contribution page and if I delete id="crm-event-register-different" from Event\Form\Registration\Register.tpl on my 4.5 install I can't see any difference when the event registration form is displayed. 

Could it be there to confer some sort of backward compatibility, or am I missing something important?





 

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: questions re CRM-14678
February 22, 2015, 07:28:14 am
Doing a quick search for "crm-event-register-different" shows no results except for the one you are looking at, which means we are not using that id for anything.
Sometimes ids and classes are there just to make styling easier for people customizing the look of their Civi site. In general classes are better for this than ids, and you could make the argument that our markup shouldn't use any ids at all.
Adding extra classes to things doesn't hurt and makes themers happy. My recommendation would be to eliminate the id and add an extra class to all of these messages (events included) so it will be:
Code: [Select]
<div class="messages status no-popup crm-not-you-message">
Try asking your question on the new CiviCRM help site.

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: questions re CRM-14678
February 22, 2015, 02:24:44 pm
Is this where the "backwards compatibility" bit comes in. 

Someone could already be using the existence of id="crm-event-register-different" to give a different style to the event message.

Shouldn't I leave that as is and just use your recommendation for the message on the contribution form?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: questions re CRM-14678
February 22, 2015, 04:45:22 pm
So, the instances where people use 'someone else' are largely

- gift memberships
- wierd & wonderful uses of CiviCRM
- back office data entry

in the case of the 3rd they are generally differentiated by having permissioned access to one or more other people. For #1 the presence of a membership is generally the clue - for #2 - dunno. I would note that I personally do donate to a charity on behalf of my brother 1-2 times a year (Xmas & birthday) & they made a right royal mess of that - not using CiviCRM - and saved my credit card token against his contact in their system & every time he subsequently donated they billed me. We aren't far off having token payments as a payment processor (increasingly little work involved to get that to work - at least for Omnipay processors) so it is a valid scenario
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

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: questions re CRM-14678
February 22, 2015, 05:32:58 pm
Back to Question 2.

The backward compatibility thing worries me, so I will change the register tpl to
<div class="messages status no-popup crm-not-you-message" id="crm-event-register-different">

and perhaps put a comment "This message also appears on contribution forms. The class crm-not-you-message is used in both templates.  id="crm-event-register-different" has been kept here for backwards compatibility.)"

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • questions re CRM-14678

This forum was archived on 2017-11-26.