Posts Tagged ‘drupal’

Drupal Org Chart – Graph Viz Update

Posted in Programming, Software on February 24th, 2010 by Jamie – Be the first to comment

I have updated the Google Code repository with updates to integrate GraphViz. It expects the PEAR GraphViz package to be installed.  To install it, issue command:

# You must install the beta package.

sudo pear install Image_GraphViz-beta

If you’d rather not mess with PEAR, download the package, extract the class Image_GraphViz, and alter two two lines of code that depend on the PEAR::System package. It should be trivial to change these. They are both basically calls like this:

// create a temporary file with the prefix "graph_"
$file = System::mktemp('graph_');

One possible replacement:

// will use default tmp dir
$file = tempnam('', 'graph_');

Graphiz Problem!

Posted in Libraries on February 20th, 2010 by Jamie – Be the first to comment

I was working on the Drupal OrgChart module tonight, specifically the rendering of the chart image via GraphViz, and I got stuck for at least an hour on a trifle! I planned to use the PEAR library for GraphViz (Image_GraphViz) and I wrote a function using the class it provides. I run the procedure and get weird errors about not being able to find files and such. After debugging for awhile, I find out that there is a property binPath that is not present. I had expected this to point to my install of GraphViz, which I knew to be especially important because it was in a weird macports directory.

It turns out that I had not installed the version I needed! I didn’t realize the version I wanted was beta, and to download a beta package, you need to explicitly state so in the PEAR command.

sudo pear install Image_GraphViz-beta
#instead of
sudo pear install Image_GraphViz

After downloading the most recent package, it turned out my code worked almost perfectly. What a waste of a night!

The past few days, I also worked on a few other modifications. I removed the requirement for a “subordinate_id” field. Also, I made the profile field names options in the administrative settings page.

The project page is here: http://code.google.com/p/drupal-orgchart/.

Drupal Module: Org Chart

Posted in Programming on February 18th, 2010 by Jamie – 1 Comment

I created an org chart module. It interacts with the profile module to display an organizational hierarchy.

From the project description:

An organizational chart that uses the profile.module. Install in your modules directory. Currently, it uses profile fields to build the chart. It assumes that there will be two fields that hold the following data:

* Employee ID – this can be any alphanumeric identifier
* Supervisor ID – this is the alphanumeric identifier pointing to the current user’s supervisor.

In the administrator settings, you may specify the profile field names which correspond to these values.

There are plans to have two other options for loading the data in the future:

1. A custom external table specific to the module
2. Some flat file

Next on the roadmap is graphviz output.

Check it out!


Switch to our mobile site