[PATCH] Enhancements for printed timesheets

Tom Evans <[email protected]> Mon, 01 Aug 2005 22:44:39 -0700
Newsgroups gmane.comp.horde.hermes
Organization Tachometry Corporation
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------090508070605090408070500
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit


We have been tracking our time with Hermes for a while and would like to
submit another small patch for consideration by the project team. When
printing our timesheets via the "Search" page, we wanted to create a
space for an approver's signature. In addition, we wanted to suppress
the search and export forms in the printed version. This patch modifies
the form handler API and adds two simple stylesheets (themes/print.css
and themes/screen.css) to handle the output to these different media types.

As an aside, we considered suppressing the menu as well, but because it
is simple enough for a user to hide it already, we decided to leave well
enough alone. We also considered adding a option/preference setting to
enable the alternate print format, but as it appears there are no other
Hermes user options yet, we determined to forego the additional
complexity for now.

Regards,

Tom Evans
Tachometry Corporation

_______________________________
Open Source that means business.
http://www.tachometry.com/



--------------090508070605090408070500
Content-Type: text/plain;
 name="hermes_patch.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="hermes_patch.txt"

Index: lib/api.php
===================================================================
RCS file: /repository/hermes/lib/api.php,v
retrieving revision 1.28
diff -u -r1.28 api.php
--- lib/api.php 1 Aug 2005 17:19:47 -0000       1.28
+++ lib/api.php 2 Aug 2005 05:04:44 -0000
@@ -101,8 +101,10 @@
             $colspan++;
         }
         $fColumns = array(
-            array('name'    => 'blank1',
-                  'colspan' => $colspan),
+            array('name'    => 'approval',
+                  'colspan' => $colspan,
+                  'type'    => '%html',
+                  'align'   => 'right'),
             array('name'    => 'hours',
                   'type'    => 'number',
                   'align'   => 'right'));
@@ -197,7 +199,10 @@
         $result['footer'][] = array('hours'       => sprintf('%.02f', $total_hours - $total_billable_hours),
                                     'description' => $descr);
         $result['footer'][] = array('hours'       => sprintf('%.02f', $total_hours),
-                                    'description' => _("Total Hours"));
+                                    'description' => _("Total Hours"),
+                                    'approval'    => '<div id="approval">' .
+                                      _("Approved By: ________________________________________ " .
+                                      '&nbsp;</div>'));
         break;
     }
 

Index: templates/common-header.inc
===================================================================
RCS file: /repository/hermes/templates/common-header.inc,v
retrieving revision 1.12
diff -u -r1.12 common-header.inc
--- templates/common-header.inc 27 May 2005 16:46:02 -0000      1.12
+++ templates/common-header.inc 2 Aug 2005 05:04:44 -0000
@@ -24,6 +24,8 @@
 <title><?php echo $page_title ?></title>
 <link href="<?php echo $GLOBALS['registry']->getImageDir()?>/favicon.ico" rel="SHORTCUT ICON" />
 <?php echo Horde::stylesheetLink('horde') ?>
+<link href="<?php echo Horde::applicationUrl('themes/screen.css') ?>" rel="stylesheet" media="screen" type="text/css" />
+<link href="<?php echo Horde::applicationUrl('themes/print.css') ?>" rel="stylesheet" media="print" type="text/css" />
 </head>
 
 <body<?php if (Util::nonInputVar('bodyClass')) echo ' class="' . $bodyClass . '"' ?>>


New File: /repository/hermes/themes/print.css
===================================================================
/**
 * $Horde$
 *
 * Special handling for print media
 */
#menu { display: none; }
#exportform { display: none; }
#searchform { display: none; }


New File: /repository/hermes/themes/screen.css
===================================================================
/**
 * $Horde$
 *
 * Special handling for screen media
 */
#approval { visibility: hidden; }


--------------090508070605090408070500
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-- 
hermes mailing list - Join the hunt: http://horde.org/bounties/#hermes
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]

--------------090508070605090408070500--