PhpReport meets Hamster

Some time ago, we realized that some igalians used Project Hamster to track their daily work, to know exactly when they started working and on what; later, that data was moved to PhpReport manually. So we thought it was a good idea integrating both applications.

We developed a patch to the development version at that time, to add some basic functionality:

  • Send a particular task from Hamster to PhpReport.
  • Send the tasks of an entire day to PhpReport.

Notice that the communication is one-way only; Hamster doesn’t notice changes done later in those tasks in PhpReport. Besides, the data model of Hamster is different, so users have to complete some missing information after sending the tasks to PhpReport. Nevertheless, that’s better than writing down everything manually…

It looks like this:

How the applet looks like login screen

And this is what you get:

Lately I’ve been thinking on how to continue the development. The code base of Hamster has changed a lot in the last months, so my patches are now basically useless… But in any case, the data models are different and I’m not very sure about the approach to take.

It seems I’m not the only one with this problem: the synchronization issue has been around for some time in Hamster bugzilla. There were different proposals, but there isn’t an agreement yet. Maybe should I develop a specific PhpReport client from scratch?

Meanwhile, I leave the code for you to check it out and give it a try:

git clone http://git.igalia.com/hamster-applet-phpreport.git
cd hamster-applet-phpreport/
git checkout origin/phpreport-gnome-2.27.91

And for compilation and installation:

./autogen.sh --prefix=/usr
make
make install

The prefix is necessary because the applet server doesn’t look into /usr/local (the default route) for new applets. And this installation will conflict with any installation of hamster-applet you could have done before.

I compiled it in ubuntu lucid (it should work for karmic too, but I couldn’t make it in jaunty) and I needed the following development packages:

python-dev
python-gtk2-dev
python-gnome2-dev
libgconf2-dev

Finally, you can launch the application in an independent window with debugging purposes, using this command:

/usr/lib/hamster-applet/hamster-applet -w

Material from the talk about JavaScript

Last week I had the pleasure to give a talk about JavaScript from the point of view of a web developer, in the Master on Free Software.

I tried to focus the session on the tools that JavaScript provides to web programmers, but also on the language itself and its special features, to finish with an overview of two popular libraries, jQuery and ExtJS, which boost the power of JavaScript for web development.

I wish I had the chance to show some JavaScript on the desktop too. Next year, maybe? 😉

I leave here the material of the talk:

New version of PhpReport

It was a year ago when I posted I will have news about this project soon… Well, at that time, we started a full rewrite of PhpReport, the time tracking web application. Now we have something we are proud to show 🙂 .

Our main problem was that the existing architecture didn’t allow us to grow and improve the application, and there were quite a lot of things we wanted to do: AJAX in the interface, integration with external applications…

So the decision was rebuilding everything, trying to replicate the existing features while leaving room for improvement. The result is an application that currently can:

  • Store daily tasks for multiple users.
  • Get dedication reports by users, projects and customers.
  • Calculate work hours, extra hours and holiday hours.
  • Features a basic eXtreme Programming tracker integrated with the dedication reports.
  • Features a basic analysis tracker integrated with the XP tracker.

From a more technical point of view, these are, for me, the keys of PhpReport:

  • AJAX-ish interface.
  • Web services to interact with external applications.
  • Modular design to integrate pluggable functionalities.

But there are still a lot of things to do, both in the application and the community around. There are some annoying bugs, missing features, and we need a proper web site, user documentation, bug tracker, mailing lists… I’ll keep you informed here, but as a start point, I’ve prepared a demo website, for you to check PhpReport by yourselves.

  • URL: http://demo.phpreport.igalia.com [EDIT: not available any more]
  • User/password: admin/admin.

And to start hacking, check out the code with:

git clone https://github.com/Igalia/phpreport.git

Finally, I have to credit Jorge López, who worked as an internship student in this project, for his help. Good job!

News about PhpReport

PhpReport is one of those projects that are always there, silent but helpful 😉 . It reflects two features of the way time is managed in Igalia: flexibility and trust. Flexibility because each member fixes his timetable; trust because each igalian is responsible of writing down his hours.

In the next months, we’re going to do an effort to boost the development of PhpReport. An internship student and I will work to improve the application and add new features. More information soon!

Adventures upgrading eZ Publish to 4.0.1

Some weeks ago we upgraded our CMS, eZ Publish, to the latest version in that moment, 4.0.1, with the intention of leaving behind PHP4 and switching to PHP5, the only one supported by the 4.x series. And although there is nice documentation about the process in ez.no, you’ll probably find some little problems which aren’t documented there.

With the aim of helping those who could have similar problems to mine, I’ll list and explain them a bit. 🙂

Switching to UTF-8

There’s a script to convert all the data in the DB to UTF-8, but when I tried it I found some problems; most of the data were corrupted after running it. In that moment, I found a related entry in eZ Publish bug tracker (#13674) where there was a patch which worked for me, but it very likely you won’t have this problem any more; the bug is closed and it says the patch has already been merged to stable (in fact, now the latest version is 4.0.3. These guys work really hard! 😉 ).

Moving templates to the correct place

Once the server was upgraded and running again, we noticed some template files weren’t rendered. I discovered that you have to place new template files in the directory design/plain/templates by imperative in eZ 4, but in previous versions you could place them in design/plain/override/templates although there wasn’t any override. I had a lot of auxiliary files stored in override which were original files, not overrides, so I had to move them.

For example, I have a template file show_comments.tpl which I include from news.tpl and article.tpl. I had it stored in design/plain/override/templates with the latter two files. But show_comments.tpl is, obviously, an original file, not overridden (there isn’t any entry in settings/override.php for it), so I had to move it to design/plain/templates, while news.tpl and article.tpl stay in the override directory.

So, if you made the same mistake as me when writing template files, now it’s the time to amend it 🙂 .

eZ Archive cronjob script not working anymore

We have the archive cronjob script installed in our server, with some customization, to move old content to an archive. After the upgrade it broke due to differences between eZ 3.x and eZ 4.x APIs. This was the error message:

Fatal error: Using $this when not in object context in /var/www/ez/kernel/classes/ezcontentobjecttreenode.php on line 1954

The solution is changing this line in the file extension/archive/cronjobs/archive.php:

39c39
<     $nodes =& eZContentObjectTreeNode::subTree( array( 'ClassFilterType' => 'include',
---
>     $nodes =& eZContentObjectTreeNode::subTreeByNodeIde( array( 'ClassFilterType' => 'include',

Image files don’t appear

Finally, a quite stupid mistake from my part: I just forgot to set the correct permissions to the eZ directory. Because of that, the program couldn’t write the temporary files it uses when resizing images and images in the page didn’t load. So remember your good friends chown and chmod.

Bonus: Online Editor v5

eZ Publish 4.1.0 adds some nice features, but it’s still in a beta state and we prefer a stable release in our server. Anyway, we’ve managed to install the latest Online Editor in the current version of eZ.

To do it, we just took the Online Editor files from the eZ Publish 4.1.0beta release (directory extension/ezoe), copied it to eZ 4.0.1 and activated the new extension modifying the file settings/override/site.ini.append.php:

< ActiveExtensions[]=ezhtml
> ActiveExtensions[]=ezoe

Depending on the rewrite rules you have in your apache server, you could have to make this small change:

< RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
> RewriteRule ^/var/[^/]+/cache/(texttoimage|public)/.* - [L]