[hermes] [PATCH] Export client name; add Billable to search criteria

Tom Evans tevans at tachometry.com
Fri Apr 8 19:09:24 PDT 2005


This message is in MIME format.

--=_12pqku0hln4g
Content-Type: text/plain;
	charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 7bit


We have been using Horde with Hermes for a little while now and have made a few
small changes to improve the flow of data between Horde and Quickbooks with the
export feature. We wanted to submit this patch for your consideration.

The attached patch adds a "Billable?" criteria to the timesheet search page and
replaces the internal client id with the client name.

Regards,

Tom Evans
Tachometry
_______________________________
Open Source that Means Business
http://www.tachometry.com/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--=_12pqku0hln4g
Content-Type: text/plain;
	charset=UTF-8;
	name="hermes_patch.txt"
Content-Disposition: attachment;
	filename="hermes_patch.txt"
Content-Transfer-Encoding: 7bit

Index: hermes/lib/Hermes.php
===================================================================
RCS file: /repository/hermes/lib/Hermes.php,v
retrieving revision 1.35
diff -u -r1.35 Hermes.php
--- hermes/lib/Hermes.php       10 Mar 2005 16:59:19 -0000      1.35
+++ hermes/lib/Hermes.php       9 Apr 2005 01:10:57 -0000
@@ -129,10 +129,12 @@
         }
         require_once 'Horde/Identity.php';
 
+       $clients = Hermes::listClients();
         $namecache = array();
         for ($i = 0; $i < count($hours); $i++) {
             $timeentry = &$hours[$i];
             $timeentry['item'] = $timeentry['_type_name'];
+            $timeentry['client'] = $clients[$timeentry['client']];
             $emp = &$timeentry['employee'];
             if (isset($namecache[$emp])) {
                 $emp = $namecache[$emp];


Index: hermes/lib/Search.php
===================================================================
RCS file: /repository/hermes/lib/Search.php,v
retrieving revision 1.15
diff -u -r1.15 Search.php
--- hermes/lib/Search.php       25 Feb 2005 18:53:14 -0000      1.15
+++ hermes/lib/Search.php       9 Apr 2005 01:10:57 -0000
@@ -42,6 +42,9 @@
 
         $this->addVariable(_("Exported?"), 'exported', 'enum', false, false,
                            null, array($states));
+
+        $this->addVariable(_("Billable?"), 'billable', 'enum', false, false,
+                           null, array($states));
     }
 
     function getClientsType()
@@ -118,6 +121,9 @@
         if (isset($info['exported']) && $info['exported'] != '') {
             $criteria['exported'] = $info['exported'];
         }
+        if (isset($info['billable']) && $info['billable'] != '') {
+            $criteria['billable'] = $info['billable'];
+        }
         return $criteria;
     }
 

Index: hermes/lib/Driver/sql.php
===================================================================
RCS file: /repository/hermes/lib/Driver/sql.php,v
retrieving revision 1.33
diff -u -r1.33 sql.php
--- hermes/lib/Driver/sql.php   7 Apr 2005 15:14:17 -0000       1.33
+++ hermes/lib/Driver/sql.php   9 Apr 2005 01:10:57 -0000
@@ -229,6 +229,11 @@
                     $glue = ' AND';
                     break;
 
+                case 'billable':
+                    $sql .= $glue . ' timeslice_isbillable = ' . (int)$filter;
+                    $glue = ' AND';
+                    break;
+
                 case 'start':
                     $sql .= $glue . ' timeslice_date >= ' . (int)$filter;
                     $glue = ' AND';

--=_12pqku0hln4g--



More information about the hermes mailing list