Howto

A Page that evolves over time, keeping up to date

SugarCRM to Mozilla LDAP contact slurper

Seeing as SugarCRM is now truly Open Source, I decided to support them buy using SugarCRM as a contact database for a client.

This script extracts contact data from Sugar, and imports it into an LDAP tree, so that Thunderbird clients can use it as an address book.

It’s written for Sugar 5.0, and a suitable LDAP installation with the Mozilla Schema

A suitable VIEW for printing out a contact directory would look like:

51&q=CREATE&lr=lang_en">CREATE 5.1/en/non-typed-operators.html">OR 51&q=REPLACE&lr=lang_en">REPLACE 51&q=VIEW&lr=lang_en">VIEW sugarab 51&q=AS&lr=lang_en">AS
51&q=SELECT&lr=lang_en">SELECT c.id, c.description, salutation, first_name, last_name, title, department,
do_not_call, phone_home, phone_mobile, phone_work, phone_other, c.phone_fax,
primary_address_street, primary_address_city, primary_address_state,
primary_address_postalcode, primary_address_country, alt_address_street,
alt_address_city, alt_address_state, alt_address_postalcode, alt_address_country,
assistant, assistant_phone, lead_source, birthdate,
a.name 51&q=AS&lr=lang_en">AS account_name,
e1.email_address 51&q=AS&lr=lang_en">AS primary_email, e2.email_address 51&q=AS&lr=lang_en">AS secondary_email
51&q=FROM&lr=lang_en">FROM contacts 51&q=AS&lr=lang_en">AS c
5.1/en/string-functions.html">LEFT 51&q=OUTER&lr=lang_en">OUTER 51&q=JOIN&lr=lang_en">JOIN accounts_contacts 51&q=AS&lr=lang_en">AS j 51&q=ON&lr=lang_en">ON (c.id = j.contact_id 5.1/en/non-typed-operators.html">AND j.deleted = 0)
5.1/en/string-functions.html">LEFT 51&q=OUTER&lr=lang_en">OUTER 51&q=JOIN&lr=lang_en">JOIN accounts 51&q=AS&lr=lang_en">AS a 51&q=ON&lr=lang_en">ON (j.account_id = a.id 5.1/en/non-typed-operators.html">AND a.deleted = 0)
5.1/en/string-functions.html">LEFT 51&q=OUTER&lr=lang_en">OUTER 51&q=JOIN&lr=lang_en">JOIN email_addr_bean_rel 51&q=AS&lr=lang_en">as eb 51&q=ON&lr=lang_en">ON (eb.bean_id = c.id 5.1/en/non-typed-operators.html">AND eb.deleted = 0)
5.1/en/string-functions.html">LEFT 51&q=OUTER&lr=lang_en">OUTER 51&q=JOIN&lr=lang_en">JOIN email_addresses 51&q=AS&lr=lang_en">as e1 51&q=ON&lr=lang_en">ON (eb.email_address_id = e1.id 5.1/en/non-typed-operators.html">AND eb.primary_address = 1 5.1/en/non-typed-operators.html">AND e1.deleted = 0)
5.1/en/string-functions.html">LEFT 51&q=OUTER&lr=lang_en">OUTER 51&q=JOIN&lr=lang_en">JOIN email_addresses 51&q=AS&lr=lang_en">as e2 51&q=ON&lr=lang_en">ON (eb.email_address_id = e2.id 5.1/en/non-typed-operators.html">AND e1.id != e2.id 5.1/en/non-typed-operators.html">AND e2.deleted = 0)
51&q=WHERE&lr=lang_en">WHERE c.deleted = 0;

Wordpress -> Drupal

This is my script for migrating from Wordpress to Drupal. I know that there is already a migration script out there, but I still wrote my own for a few reasons:

  • My needs are simple, and I knew what I wanted.
  • I wanted to migrate comments and pingbacks if possible. This turned out to be easy.
  • I wanted to learn more about coding for Drupal.
  • I’d already started writing it when I saw Borek’s migrator.
  • I wanted to migrate straight to Drupal 5, not 4 first.

So here it is.

Limitations and bugs:

  • Attached files are copied by requesting them off the old server. But thumbnails aren’t migrated too.
  • Pages aren’t migrated. But I’m sure this would be a piece of cake to fix
  • I put dumped my wordpress tables into my drupal database (They are all prefixed with wp-). This is messy, but while Drupal’s multi-database system is a cool and would be perfect, it’s unworkable when you are debugging. Errors seem to be hooked in drupal, and if you have a broken SQL query (for example) the error handling code hooks Drupal themes, which aren’t findable in the alternate-db world you are visiting.
  • All blog posts are migrated to a single user on the other side.
  • I’m pretty sure that I didn’t solve the character encoding issues, just sidestepped them…
  • I didn’t look into Drupal 6 compatibility.

Dark Gorge B

Time: 3-4hrs
Last Hiked: Jan 2006

Very steep and rather eroded. Beautiful forest in the ravine most of the way up.

Start at Newlands forestary Station, and take the path up to the base of Newlands Ravine.

Go right along the contour path until you reach the first river up (only about 50m away) This is dark gorge. Follow the cairns up.

The only thing you have to worry about is not going up Dark Gully. When you reach the fork of the valleys, stick left.

Dark Gorge Map

Window Gorge D

This Description comes from Tony Lourens - Table Mountain Classics, with ammendments.

Rope Recommended

Time: 5-6hrs
Last Walked: Dec 2005

This is rather an eroded and seldom used route, but has some magnificent pools and good scrambles. It’s mostly shaded, so a hot day would be a good choice. The scrambles aren’t hard but quite exposed, and have loose grips (because they haven’t seen enough traffic to break all the loose grips off).

This isn’t an easy route if you don’t know it, and dangerous.

Amatomu Drupal Module

I’ve written a simple drupal module for including the Amatomu tracker.

It also supports the “What’s hot in South African blogs” tag-cloud, albeit via ugly javascript. I’m not a fan of all this javascript DHTML nonsense, but maybe they can be talked into providing a better API

Todo list (Things amatomu does that I don’t care for, and thus haven’t coded):

  • I’d like to extend this to include support for the shmaak buttons.
  • The rank ribbon.

Available from Drupal.org. Releases for Drupal 5 and 6 are available.

Syndicate content