Timesheets: vtigerCRM Time Control Extension

Usage

This extension adds time control to vtigerCRM. The idea is that you will be able to register in the system time slots spent on the majority of the entities in the vtigerCRM system. So a sales person can register time spent on a lead, a technician can register time spent on a trouble ticket or administration can register time spent on an invoice.

Screenshot of Listview:
Timesheet Listview:
Screenshot of Detailview:
Timesheet Detailview:

Besides being able to create a timesheet entry in the normal way you would create any entity in vtigerCRM, you can do it in 3 other ways:

  • vtigerCRM's quick create
  • stopwatch. Accessible via the tool bar, this will pop up a small screen where you will be able to start and stop a counter to easily allocate time spent on an interruption or on a long during activity.

Timesheet Stop Watch

  • simplets. Accessible via the tool bar, this will open a screen where you can easily introduce many time entries. This can be useful for loading a batch of entries at once.

Timesheet Simple Timesheet

Normal vtigerCRM permissions and roles apply so users can see their own entries.

The vtigerCRM reporting module has been modified to be able to create reports based on timesheets for releases below version 5.1.0. For version 5.1.0 reporting does not work (see below).

Installation on vtiger CRM 5.1.0

  1. Install the zip package through the module administrator
  2. Apply patch to code. The patch is modules/Timesheet/Timesheet.diff and must be applied from the root of your vtiger CRM install
    patch -p 0 < modules/Timesheet/Timesheet.diff

The patch is still needed. Although we have advanced VERY MUCH with vtlib there are still things that need to be touched in the base code to get this module working as I want. The patch file is very small compared to the previous versions and is mostly to get the new timesheet buttons on the tool bar. I have also had to modify the code to get the datetime fields working as I want. I could have avoided this but at the cost of making timesheet harder to use and less user friendly. I decided that the cost is low as it is already difficult to get people to create their timesheets and making it harder would only make the extension less useful.

Excluding the toolbar button changes there are ONLY 6 lines of code changed!!!!

Bugs and support on the project's forge in vtiger, please.

Reporting doesn't work with Users

I have released a patch to get timesheet reporting against related modules and permits standard calculations on totaltime field. I have had to modify vtiger base files to achieve this, but I must admit that there are a lot less changes to these files than in previous versions (only 14 lines!)

This patch supports all related modules except user information which did work in previous versions. For some reason it doesn't work in the revamped reporting system. The new reporting system sets up a query that easily exceeds th 61 table mysql limit so you can related with all modules at once.

The patch can be found here:Timesheet Reporting Patch

Upgrading from previous versions

Thanks to vtlib we are now able to import and export automatically on newly created modules. So the obvious way to upgrade would be to “correctly” export the timesheets from your previous version and import them into the new 5.1.0.

I haven't tried this but I do know that a special process must be created to get the correct format in the exported file so it will be recognized in the new system.

I haven't tried upgrading an existing 5.0.4 database with timesheets inside either but even if it did respect the timesheet tables and passed them into the new database (which I doubt) they would be wrong and need to be modified.

Since we have no funding for this project, I thought of selling this upgrade process. Since it is something that should be easy to do, specially once I have done one or two, the price tag would be of 20 euros, the idea is not to get rich but to stimulate users to contribute and support our effort. You can consider it a donation that will get you your data moved over.

Installation on vtiger CRM 5.0.4

As with all our modules:

  1. unzip TSTimesheet files from top of source directory
  2. apply patch file: modules/Timesheet/TSTimesheet.patch
      patch -p 0 < modules/Timesheet/TSTimesheet.patch
  3. execute config_tstimesheet.php script with
      http://yourserver/yourvtigercrm/index.php?module=Timesheet&action=config_tstimesheet
  4. It is very important that the entries in the $module_list array in modules/Reports/Reports.php maps to the correct values. In my installation the timesheet blocks are “84,85” if these numbers change on your installation (they are dynamically generated during the configuration) you must change the values of the mapping. I have added a script to get all the blocks and their ID's to make the previous step easier:
     http://yourserver/yourvtigerinstall/getBlocks.php
  5. patch file only adds new text strings to en_us files, if you are using a localized version you must add new strings to your local language strings. I personally recommend installing Language Pack Wizard (on vtiger forge). The list of modified language files can be obtained from the list at the end of this file or looking at the patch file. Consider sharing your language files changes with others, contact me.

Upgrade from vtigerCRM 5.0.3

These operations are very complicated in the current state of vtigerCRM, and your mileage will vary depending on the state of your code. I will only describe ONE way of doing this which is the way I have tried. There are others and we are more than willing to help anybody get this working on their installation for a fee.

  1. upgrade your vtigerCRM 5.0.3 following vtiger's instructions: overwrite code and apply database changes to your current database through migration wizard in settings
  2. unzip TSTimesheet files from top of source directory overwriting all existing files
  3. apply patch file: modules/Timesheet/TSTimesheet.patch
      patch -p 0 < modules/Timesheet/TSTimesheet.patch 
  4. execute upgrade_tstimesheet.php script with
      http://yourserver/yourvtigercrm/index.php?module=Timesheet&action=upgrade_tstimesheet
  5. It is very important that the entries in the $module_list array in modules/Reports/Reports.php maps to the correct values. In my installation the timesheet blocks are “84,85” if these numbers change on your installation (they are dynamically generated during the configuration) you must change the values of the mapping. I have added a script to get all the blocks and their ID's to make the previous step easier:
     http://yourserver/yourvtigerinstall/getBlocks.php
  6. patch file only adds new text strings to en_us files, if you are using a localized version you must add new strings to your local language strings. I personally recommend installing Language Pack Wizard (on vtiger forge). The list of modified language files can be obtained from the list at the end of this file or looking at the patch file. Consider sharing your language files changes with others, contact me. We haven't added any new text strings so you can copy the ones you had from 5.0.3 to the new 5.0.4 translation.

Changes

5.1.0: 2009-08-20
=======================================
- Adapt to vtigerCRM 5.1.0 based on vtlib

5.0.4: 2008-07-18
=======================================
- Adapt to vtigerCRM 5.0.4
- Small bug fixes caught along the way

5.0.3: 2007-07-13
=======================================
- Adapt to vtigerCRM 5.0.3
- Small bug fixes caught along the way

5.0.1: 2007-01-29
=======================================
- Create extension for vtigerCRM 5.0.1

Acknowledgments

Thanks go to: