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) »
  • New on CiviCRM Development
Pages: [1]

Author Topic: New on CiviCRM Development  (Read 1357 times)

tclf

  • Guest
New on CiviCRM Development
August 04, 2010, 09:30:39 pm
Hi guys.

I am new here as user and developer of CiviCRM. My task is to modify it into a system that is used to record the used toner from customers and calculate corresponding reward points for them to redeem coupon. The system should provide these basic functions:

1. keep customer info
2. keep coupon info
3. keep transaction of receiving returned toner from customer and add corresponding points to their balance
4. keep transaction of redeem coupon to customer and minus corresponding points to their balance

Well I guess these functions are simple enough. However, I am quite confused on how to add my own form (as user interface) and backend logic. The system is highly modulized and I cant find a entrance for me to start with.

Currently I modified the new individual page into my wanted style to keep customer info, by using "custom data" function. But for other functions I cannot find similarity with existing form so I want to add form of my own. I hardly find any tutorials or easy samples to follow so I have to ask for you guys' suggestions (I have studied "hook on CiviCRM" but still cannot find any clew to meet my case).

Thank you all guys in advance, please kindly suggest and help :)

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: New on CiviCRM Development
August 05, 2010, 12:32:41 am
Hi tclf,
have you had a look at the floss manual yet?
http://en.flossmanuals.net/CiviCRM/DevelopIntro

You will need to explain in a little more detail what you want to achieve. Are you going to use custom data in civicrm, or are you going to create separate MySQL tables for the additional data you want to store? If you mention 'keep customer info' do you intend to use the CiviCRM standard data or are you going to create custom data? And the same kind of questions for the others :-)

If I take an example where you might want to add some custom data for customers you could do the following:
* use custom data to create additional fields to the contacts table
* use hooks to validate or process the custom data if required
* create a profile and/or a report showing the data in the format that you want

Erik

Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

tclf

  • Guest
Re: New on CiviCRM Development
August 05, 2010, 09:08:34 pm
Quote from: Erik Hommel on August 05, 2010, 12:32:41 am
Hi tclf,
have you had a look at the floss manual yet?
http://en.flossmanuals.net/CiviCRM/DevelopIntro

You will need to explain in a little more detail what...


Dear Erik,

Thank you so much for your reply. As I have mentioned, what I want to acieve is a system having the 4 functions above. For customer information, I have used custom data to modify the original form (by form I mean the actual page we've seen while we're using the system) of contact. And for other three functions, I dont think there are any existing forms I can use to modify so I guess I may need to code my own form as UI and logic. I have read through the developer manual but it seems there's no instruction on how to insert my own php and tpl file into the system.

I will keep looking for some samples or instructions. And hope you can give me more tips on my situation:)

Joe

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: New on CiviCRM Development
August 05, 2010, 11:34:51 pm
Hi Joe,
you might want to build your own Smarty templates for your forms. Example of templates, hooks and usage of API's can be found here:
http://wiki.civicrm.org/confluence/display/CRMDOC32/Using+CiviCRM+APIs+-+Code+Snippets
http://wiki.civicrm.org/confluence/display/CRM/Creating+CiviCRM+Modules

you might also attend one of the CiviCRM training sessions, where are you located?
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

tclf

  • Guest
Re: New on CiviCRM Development
August 06, 2010, 12:38:20 am
Dear Erik:

Thank you so much for your reply again. I've read the two URLs you've given to me but unfortunately I am using Joomla as basic CMS. I dont know if the hello world example would have conflicts or incompatibility for my case. I will try it out and see if everything goes well.

For Smarty I have worked on Eventum (a MySQL project developed using Smarty & PEAR) so my experience on that is ok. But CiviCRM was not like the simple structure of one page = one php + one tpl, it was highly modulized and it's hard for me to look into the core to modify, that's why I am planning to do my own page and ask for your help.

I am totally willing to attend and tutorial session on CiviCRM but I dont know if my location would have any. I am currently in Hong Kong and this is also the first time my company dealing with system based on CiviCRM so I hardly find any useful resources to help me with my project.

Joe

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: New on CiviCRM Development
August 06, 2010, 12:59:40 am
Hmmm I believe there was a session in Taiwan last year, but watch the CiviCRM core page for sessions . I know there will be a developer training in London in September/October.....

I know nothing about Joomla, do you have any choice in the matter? The security of CiviCRM is much better with Drupal. the ACL part does not work with Joomla. And no, CiviCRM is not simply one page = one php + tpl :-). There is a lot of classes and a lot of backpeddling to do. In my short experience I tend to use the API's and the hooks to make modifications and extensions, which is enough to do all the things I might want to do.

Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: New on CiviCRM Development
August 06, 2010, 01:07:32 am
I think that (IMHO) CiviCRM is not the right software for your project.  CiviCRM is specifically designed for non profit organizations and donations, events and memberships.  Trying to adapt CiviCRM to other uses will likely cost you more time and money in customization process than just writing an application from scratch, particularly if you are new to CiviCRM, which you are.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

tclf

  • Guest
Re: New on CiviCRM Development
August 06, 2010, 01:15:47 am
Thank you for the session information. I will see if I can attend the session.

BTW, have you ever developed your own page instead of cutomize existing page of CiviCRM?

Joe

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: New on CiviCRM Development
August 06, 2010, 01:40:40 am
No, but that will be quite possible. I believe most developers use profiles to show their custom data rather than develop their own. BTW, do you know how to find out which template is used on a CiviCRM page?
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

tclf

  • Guest
Re: New on CiviCRM Development
August 06, 2010, 02:26:03 am
Hi Erik:

I am so confused about the word you have mentioned "profile". Does it mean logic or code or anything ???

For the template yeah, I just try to find them by their naming schemes. Like for contact module, the templates are most likely under ..\templates\CRM\Contact\Form, with Contact.tpl as its main template including many sub templates within (can be discovered by viewing the code of Contact.tpl). I know my way seems silly but I succeed in most cases and would go on using this method ;D

Hopefully you can tell about what "profile" actually refers to :-\

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: New on CiviCRM Development
August 06, 2010, 02:38:32 am
For profile, check this page:
http://en.flossmanuals.net/CiviCRM/CapturingExposing

If you want to find out what template is used on a CiviCRM page, go to the page source and search for ".tpl". In the comment the name of the template used will be mentioned (although others might be included from that template).
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • New on CiviCRM Development

This forum was archived on 2017-11-26.