Archive for the ‘CiviCRM’ Category

civiCASE customization

Friday, December 19th, 2014

Address appearance

Show a line for c/o or other info below the contact.addressee:

  • In civiCRM go to administer/localization/address settings
  • Move {contact.supplemental_address_1} to below {contact.addressee}
  • Do that for both Mailing Label Format and for Display Format

 

 

civiCASE apis and running php from command line

Thursday, December 18th, 2014

Open terminal as super user [su]

php /var/www/drupal/sites/all/modules/contrib/civicrm/bin/cli.php -e /var/www/drupal/sites/all/modules/contrib/civicrm/bin/csv/export.php contact -e contact -a get –output  –contact_id=2

or, if already in the civicrm/bin directory:
cd /var/www/drupal/sites/all/modules/contrib/civicrm/bin/
php cli.php -e ../bin/csv/export.php contact -e contact -a get –output –contact_id=2

===================

following are notes that got me to this

===========

To run php code on a web site like civiCRM use the cURL program on linux.

First, civiCRM needs a site key.

  • Run the following in a command prompt
    php -r ‘echo md5(uniqid(rand(), true)) . “\n”;’
    highlight the result and right-click copy
  • Navigate to, as administrator,
    /var/www/drupal/sites/default
    open civicrm.settings.php
    search for CIVICRM_SITE_KEY
    Paste the result you copied into the appropriate place, as indicated by xxx’s below
    define( ‘CIVICRM_SITE_KEY’, ‘xxxxxxxxxxxxxxxxxxx’ );
    save the file
  • Save that site key somewhere safe for future use
  • Now you have a site key

Get cURL
sudo apt-get install curl

Test cURL by finding the definition of ‘bash’
curl dict://dict.org/d:bash

The key php file I need is for uploading csv text file data transferring from another system to civiCASE.

I found the basic import/export/delete php files in:
/var/www/drupal/sites/all/modules/contrib/civicrm/bin/csv

/**
* Import records from a csv file passed as an argument.
*
* Usage:
* php bin/csv/import.php -e <entity> –file /path/to/csv/file [ -s site.org ]
* e.g.: php bin/csv/import.php -e Contact –file /tmp/import.csv
*
**/

From http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API

The API explorer, which is available at http://[CIVICRM_URL]/civicrm/api/explorer (or http://[CIVICRM_URL]/?q=civicrm/api/explorer if you do not use clean URLs in Drupal). This gives you the possibility to actually try out the API in action.

http://localhost/?q=civicrm/api/explorer

The API parameter list, which shows all available entities which can be manipulated by the API and is available at http://[CIVICRM_URL]/civicrm/api/doc (or http://[CIVICRM_URL]/?q=civicrm/api/doc if you do not use clean URLs in Drupal)

http://localhost/?q=civicrm/api/doc

 

Api examples: https://github.com/civicrm/civicrm-core/tree/master/api/v3/examples
This included an example for creating a case with php.

Some handy examples:
http://www.thegeekstuff.com/2012/04/curl-examples/
An example from civiCRM
http://wiki.civicrm.org/confluence/display/CRMDOC40/Update+Greetings+and+Address+Data+for+Contacts
And the civiCRM command-line reference page
http://wiki.civicrm.org/confluence/display/CRMDOC40/Command-line+Script+Configuration

CiviCRM import and export APIs

Tuesday, December 16th, 2014

To import data into CiviCRM, the easiest way is through APIs.

API calls require both a site key and a user API key.

The site key is at:

To create a user API key it is easier to install a civiCRM extension

  1. Create a directory for civiCRM extensions
    /var/www/drupal/sites/default/files/civicrm/custom_ext
    make sure it is writable by the civicrm system
    In my case it is writable by user civicrm
  2. Import the civiCRM

/var/www/drupal/sites/all/modules/contrib/civicrm/api/v3/Group.php to create groups

http://wiki.civicrm.org/confluence/display/CRMDOC/REST+interface#RESTinterface-CreatingAPIkeysforusers

http://wiki.civicrm.org/confluence/display/CRMDOC/Extensions

http://10.0.0.27/index.php?q=civicrm/api/explorer#/index.php?q=civicrm/ajax/rest&entity=Group&action=create&debug=1&sequential=1&json=1&title=Test&description=test+group&visibility=User+and+User+Admin+Only&is_hidden=0&created_id=2&is_reserved=1

http://10.0.0.27/index.php?q=civicrm/api/explorer#explorer

http://wiki.civicrm.org/confluence/display/CRMDOC/Bootstrap+Reference

http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API

 

Linux notes +

Saturday, November 1st, 2014

Create copy

http://www.copyblogger.com/optimize-online-copy/

 

 

cgroups to control task cpu usage

https://www.google.com/search?q=linux+mint+cgroups&btnG=Search&oe=utf-8&rls=org.mozilla%3Aen-US%3Aofficial&client=firefox-a&channel=rcs

syncthing limit resource usage

https://pulse-forum.ind.ie/t/syncthing-for-multiple-users-how-to-limit-the-resource-usage/1261

 

Access to libre base

http://extensions.libreoffice.org/extension-center/access2base

backups

http://andrioid.net/tech/linux/usb-backup

http://backintime.le-web.org/

http://mondorescue.org/

http://www.bacula.org/7.0.x-manuals/en/main/Disaster_Recovery_Using_Bac.html

http://www.bacula.org/7.0.x-manuals/en/main/Automated_Disk_Backup.html#SECTION002510000000000000000

http://www.bacula.org/7.0.x-manuals/en/main/Contents.html

http://www.techrepublic.com/blog/10-things/10-outstanding-linux-backup-utilities/

http://duncanlock.net/blog/2013/08/27/comprehensive-linux-backups-with-etckeeper-backupninja/

http://www.linuxjournal.com/article/9311

http://basicallytech.com/blog/index.php?/archives/73-Using-a-USB-external-hard-disk-for-backups-with-Linux.html

https://www.google.com/search?q=linux+backup+to+changing+usb+drives&client=firefox-a&rls=org.mozilla:en-US:official&channel=sb&gbv=2&sei=FEhVVI2rNKm8iAL2h4GwAg

 

CiviCRM

http://wiki.civicrm.org/confluence/display/CRMDOC33/Tags+vs.+Groups+vs.+Custom+Fields

http://www.happysnowmantech.com/

http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference

http://devsummit.aspirationtech.org/index.php?title=CiviCRM_Extensions

http://www.cividesk.com/

http://wiki.civicrm.org/confluence/display/CRMDOC/Using+Drupal+Calendar+with+CiviEvent

https://civicrm.org/blogs/totten/customizing-civicase-workflows

http://civiteacher.com/

https://www.drupal.org/project/civicrm_activity_ical

https://civicrm.org/blogs/colemanw/pushing-envelope-civicase

Mail and Cal gateway

http://davmail.sourceforge.net/

http://vimeo.com/40276619 unleashing the power of civicase

http://forum.civicrm.org/index.php?topic=1839.0 delete all contacts

http://www.backofficethinking.com/crm-constituent-relationship-management

http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API

Virtual Box, Linux Mint, Drupal and civiCASE — Part 6

Monday, March 3rd, 2014

Here we add special customizations to CiviCRM and CiviCase module
(more…)