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) »
  • Looking for a form creation cookbook
Pages: [1]

Author Topic: Looking for a form creation cookbook  (Read 5162 times)

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Looking for a form creation cookbook
November 30, 2009, 04:48:34 pm
Can anyone point me to a pretty basic cookbook for creating a new suite of forms to extend Civicrm?  I've been over the developer segments of the documentation and see the hooks and API's, but I need to start a little further back -- how to use the form engine that CiviCRM uses, etc.

I can't use profiles, because I need to store a multiple value custom field.

The basic use case is:  User searches and find a list of contacts (voters in an area); user enters ratings for the voters that s/he knows and/or reaches.  Each rating is stored as a record in a table with entries user/voter/rating/time.  This creates an audit trail and allows overlap.

I'm an old programmer, and can do basic html, php and mysql, but just getting started developing in the Drupal/Civicrm environment.

Thanks in advance for any assistance.

/w.

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: Looking for a form creation cookbook
November 30, 2009, 05:02:11 pm

check:

http://civicrm.org/taxonomy/term/26

and the svn code repository at:

http://svn.civicrm.org/sfschool/trunk/

i've written custom code in there to store values in a multiple value custom field (check the extended care classes). it uses a fair amount of civicrm hooks and a lot of the civicrm data model :)

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

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
November 30, 2009, 05:27:07 pm
 :) Great. 

And I've also found the notes from your recent talk.  http://devsummit09.aspirationtech.org/index.php/Extending_CiviCRM_%28without_hacking_core%29

I've got enough to get started.

Thank you! :)

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
December 01, 2009, 04:35:24 pm
Just sharing a sidebar that I had with Eileen who said:

Quote from: Eileen on December 01, 2009, 01:51:31 pm
The multiple value custom fields are pretty new & haven't really been developed to the point where they are easy to use.

I haven't looked into the area much so you probably are better posting on the forum. Assuming you are using Drupal a Views / CCK solution might be the way to go. Also, you should probably consider using activities rather than multiple value custom fields.

You can extend activities by adding custom fields to them and you can customise the types. They are exposed to views & you would also be able to see them on both people's activities tab. (You could rename the tab if it's an issue). If the people adding the ratings have access to CiviCRM then no coding would be required to allow them to add activities. I assume the voters would never log on so that there is no risk of them seeing the activities via their contact dashboard.

I replied: I'll continue to consider the activity option, but we don't really want to run people through civicrm main screens.  The idea really is to allow voters who are authenticated users, but not necessarily known to the campaign, to start campaigning on their own. So I need to give them a simple view and assure that they can't do any damage or violate anyone's privacy -- they can just see voter lists, enter their own ratings of other voters based on the conversations that they have.  So, I'm thinking the programming of a couple of custom screens will be roughly the same whether we store data in activity records or in a custom field group.  But maybe I'd like having the civicrm screens that handle activities available -- so that's an argument for using activities.  I guess I'm leaning towards a custom group -- it will be cleaner and less risk of any kind of conflict than using activities.  Once we learn how to do the first screen or two, the rest will be easy.

I looked at Views/CCK, but that doesn't seem to offer the ability to nicely customize an update screen -- vision the campaigner browsing a list of voters and entering ratings next to each (as they walked down the street, in the ultimate case).  In future phases, we might develop functions to allow the campaigner to temporarily claim a small set of voters that they working on so as to avoid double coverage.  There are other possible extensions -- showing them a phone script, etc.  I think we'll have more flexibility to customize down the road if we learn to use the Smarty forms and appropriately extend CiviCRM. 

I appreciate your taking the time to reply and welcome any further wisdom.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Looking for a form creation cookbook
December 01, 2009, 05:15:03 pm
Will - there's lots of other folks in the community who are interested in extending "campaigning" capabilities, so I think it could be useful for you and others if you could post a blog with the big picture of what you're working on. You might find that some of what you need has already been tackled, or hook up with some good collaborators etc.

On a slight tangent, wanted to make sure you were aware that the core team is implementing optional "address parsing" (street address -> street number + street name + apt / unit) in support of a walklist (civi)report - and potentially other use cases that require sorting contacts by street number and separating odd / even addresses on a street.

http://issues.civicrm.org/jira/browse/CRM-5450
Protect your investment in CiviCRM by  becoming a Member!

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: Looking for a form creation cookbook
December 01, 2009, 05:38:10 pm
I agree with Eileen that the UI / web interfaces for multiple value custom fields are fairly simple / non-existent. But i think the data model is awesome, the support from the admin end is acceptable and it can be used in multiple ways. based on what little i've used within the school group, the "rules" for each custom group are different (update vs insert) and specific to its use, so i suspect that it will be some time before it makes it way to the front end :)

I think for long term viability of any software code, you have to fit it with the appropriate model. I would use activities if they are appropriate and meets your needs and not because they are convenient :)

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

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
December 02, 2009, 04:12:37 am
Dave,

Thanks for the link to the address parser.  I should have looked at this earlier.

This is something we've actually built already for ourselves and are happy with -- we run it as a batch process though.  We just reparse all addresses each night (only 30000 records, runs quick); users can control the parse outcome by how they enter addresses, but we don't have much need to do that because most of our address data comes from public records.

We have also done something different with the "household" record type.  We've taken real estate assessment data (from town assessor's offices) and parsed it to store housing unit records (with contact names like "2-family: 17 Holden Road").  We run a nightly batch process to link our parsed addresses (from our voter database derived from town clerk's offices) to the parsed housing units and this allows us to household contacts more reliably using the household member relationship type.

I'm happy to put up a post and would welcome more collaboration.  Where would I want to put it up?

/w.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Looking for a form creation cookbook
December 02, 2009, 11:13:28 am
Will,
Sounds like a lot of cool and useful stuff!

I've given your account blogging permissions on civicrm.org - so you can post here:

>> http://civicrm.org/blog/6885

It would be great if your blog post includes the "big picture" (what your organization "does" and how they're using CiviCRM in their workflows), along with some discussion of gaps / what else is needed in the "toolbox" and any plans you have for building stuff.

If your work is open source (hopefully :-) ), it would also be awesome if you could include a link to your repository or some other method for folks to get their hands / look at / use or learn from the code.
Protect your investment in CiviCRM by  becoming a Member!

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
December 02, 2009, 07:11:10 pm
Thank you.  Over the next few days, I'll get this done, including making the routines available -- I'm not sure if they are of adequate generality, but I'm very glad to contribute.

For the work to be "open source" should I put some kind of license language in there or is it enough to put in an available place?

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: Looking for a form creation cookbook
December 02, 2009, 07:42:30 pm

check:

http://civicrm.org/licensing

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

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
December 04, 2009, 06:52:18 pm
Here is a link to the post you suggested, Dave:  http://civicrm.org/node/672

We'll plan to get the routines up before the end of the month, but if someone needs them sooner, just let us know.

Will Brownsberger

  • I post occasionally
  • **
  • Posts: 44
  • Karma: 2
Re: Looking for a form creation cookbook
December 04, 2009, 07:11:48 pm
P.S.  Any recommendations about where to put up some php routines -- I can put them up as forum posts on my own website and post links, but am happy to put them in some other place if that's better.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Looking for a form creation cookbook
December 06, 2009, 06:08:56 pm
Will - GREAT blog post, thx!
You can create a page under this section of the wiki to describe and attach your scripts:
http://wiki.civicrm.org/confluence/display/CRMDOC/Third+Party+Modules

... and update your blog to point there so folks can find it etc.
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Looking for a form creation cookbook

This forum was archived on 2017-11-26.